Elm Exactly

TheoremtaskRed_silent_same

StandardElmMech/Eff/Task.lean:234, The redex of a task · tactic proof

Silent reductions of a task have the same right-hand side, up to the choice of a member of APPLY in the application of the redex.

Statement

theorem taskRed_silent_same {tk t1 t2 : Val} (h1 : TaskRed tk none t1) (h2 : TaskRed tk none t2) :
    t1 = t2 ∨ ∃ fs f v w1 w2, AppVal f v w1 ∧ AppVal f v w2 ∧ t1 = plug fs w1 ∧ t2 = plug fs w2

Proof

by
  obtain ⟨fs, r, r1, r2, hr1, hr2, rfl, rfl⟩ := taskRed_same_redex h1 h2
  cases hr1 with
  | andThenSucceed f v w1 a1 =>
    cases hr2 with
    | andThenSucceed _ _ w2 a2 => exact Or.inr ⟨fs, f, v, r1, r2, a1, a2, rfl, rfl⟩
  | andThenFail => cases hr2; exact Or.inl rfl
  | onErrorFail f v w1 a1 =>
    cases hr2 with
    | onErrorFail _ _ w2 a2 => exact Or.inr ⟨fs, f, v, r1, r2, a1, a2, rfl, rfl⟩
  | onErrorSucceed => cases hr2; exact Or.inl rfl

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

Theorems it uses

In StandardElmMech/Eff/Task.lean: Task reduction (TaskRed, 7 rules, r_e_task_*) and its logged twin, focus and plug, the property of task reduction (taskRed_iff, taskRed_outcome, taskRed_kind, taskRed_silent_same, taskRed_none), and the executable step stepTaskL, sound, complete and unique.

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.