Elm Exactly

Theorema80_kill_ended

StandardElmMech/Prog/Rulings.lean:207, A80: killing an ended process changes nothing but the killer's own entry · tactic proof

Statement

theorem a80_kill_ended {PE : PortEnv} {r : List (String × Val)} {K K' : Config} {n' : Nat} {t : Val}
    (h : Step PE r K (some (.act ⟨.kill, [.pid n'], t⟩)) K') (hk : K.procs.get n' = some .ended) :
    ∃ n, ∀ q, q ≠ n → K'.procs.get q = K.procs.get q

Proof

by
  generalize hl : some (Event.act ⟨.kill, [.pid n'], t⟩) = lbl at h
  cases h with
  | r_p_proc_step _ _ _ _ _ _ _ _ _ _ _ a _ _ _ h3 =>
    cases a with
    | none => simp at hl
    | some x => exact absurd (h3 x rfl) (by simp [platPrims])
  | r_p_proc_kill _ _ _ P _ _ _ n _ _ _ _ n'' _ _ _ =>
    simp only [Option.some.injEq, Event.act.injEq, Action.mk.injEq, List.cons.injEq, Val.pid.injEq] at hl
    obtain ⟨-, ⟨rfl, -⟩, -⟩ := hl
    refine ⟨n, fun q hq => ?_⟩
    simp only [Procs.get, Procs.set] at hk ⊢
    rw [natLookup_natSet_other _ _ _ _ hq]
    by_cases hq' : q = n'
    · subst hq'; rw [natLookup_natSet_self]; exact hk.symm
    · exact natLookup_natSet_other _ _ _ _ hq'
  | r_p_platform _ _ _ hp => cases hp
  | _ => simp at hl

Proved with tactics, which Lean expands into a proof term that its kernel checks.

Rules of the book it uses

Theorems it uses

In StandardElmMech/Prog/Rulings.lean: The rulings A62, A72, A77, A79, A80 and A81 as theorems, and a66_batch_order_open: a program whose batch is delivered in either order.

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.