Elm Exactly

TheoremnextAt

StandardElmMech/Complete.lean:48, The index only grows · tactic proof

Statement

theorem nextAt (o : Oracle) : ∀ n, NextAt o n

Proof

by
  intro n
  induction n with
  | zero =>
    refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ <;>
      (intros; subst_vars; simp [evAtExp, evExpOpt, evExpRow, evExpRowOpt, evExp, appVal, evMatch,
        evMRule, evDec, evValBind, evValBindOpt, matchAtPat, matchPatOpt, matchPatRow,
        matchPatRowOpt, matchPat, matchAtPats])
  | succ n ih =>
    obtain ⟨i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17⟩ := ih
    refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩
    · intro E a k r h; subst h; cases a <;> simp only [evAtExp] <;> next_fin
    · intro E x k r h; subst h; cases x <;> simp only [evExpOpt] <;> next_fin
    · intro E row k r h; subst h; cases row <;> simp only [evExpRow] <;> next_fin
    · intro E x k r h; subst h; cases x <;> simp only [evExpRowOpt] <;> next_fin
    · intro E e k r h; subst h; cases e <;> simp only [evExp] <;> next_fin
    · intro f v k r h; subst h; cases f <;> simp only [appVal] <;> next_fin
    · intro E v m k r h; subst h; cases m <;> simp only [evMatch] <;> next_fin
    · intro E v mr k r h; subst h; cases mr <;> simp only [evMRule] <;> next_fin
    · intro E d k r h; subst h; cases d <;> simp only [evDec] <;> next_fin
    · intro E vb k r h; subst h; cases vb <;> simp only [evValBind] <;> next_fin
    · intro E x k r h; subst h; cases x <;> simp only [evValBindOpt] <;> next_fin
    · intro E v a k r h; subst h; cases a <;> simp only [matchAtPat] <;> next_fin
    · intro E v p k r h; subst h; cases v <;> cases p <;> simp only [matchPatOpt] <;> next_fin
    · intro E rc row k r h; subst h; cases row <;> simp only [matchPatRow] <;> next_fin
    · intro E rc x k r h; subst h; cases x <;> simp only [matchPatRowOpt] <;> next_fin
    · intro E v p k r h; subst h; cases p <;> simp only [matchPat] <;> next_fin
    · intro E vs as k r h; subst h; cases vs <;> cases as <;> simp only [matchAtPats] <;> next_fin

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

Tactics it calls

next_fin (StandardElmMech/Complete.lean:40):

macro "next_fin" : tactic => `(tactic| (
  (repeat' split)
  all_goals (apply_to_eqs [i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17])
  all_goals (try dsimp only at *)
  all_goals (try split at *)
  all_goals (try dsimp only at *)
  all_goals (first | omega | exact i1 rfl | exact i2 rfl | exact i3 rfl | exact i4 rfl | exact i5 rfl | exact i6 rfl | exact i7 rfl | exact i8 rfl | exact i9 rfl | exact i10 rfl | exact i11 rfl | exact i12 rfl | exact i13 rfl | exact i14 rfl | exact i15 rfl | exact i16 rfl | exact i17 rfl)))

Used by

In StandardElmMech/Complete.lean: The index of the next choice only grows (evExp_next and the others); Agrees; lemmas for the side conditions.

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.