Elm Exactly

TheoremkeyChars_inj

StandardElmMech/Stat/Pipeline.lean:78, Copy names · term proof

Statement

theorem keyChars_inj : ∀ (a b : Assignment), a.length = b.length → keyChars a = keyChars b → a = b
  | [], [], _, _ => rfl
  | [n], [m], _, h => by
    simp only [keyChars, num_key_toList] at h
    cases n <;> cases m <;> simp at h <;> rfl
  | n :: n' :: as, m :: m' :: bs, hl, h => by
    simp only [keyChars, num_key_toList] at h
    have ih

Proof

keyChars_inj (n' :: as) (m' :: bs) (by simpa using hl)
    cases n <;> cases m <;> simp at h <;> simp [ih h]
  | [], _ :: _, hl, _ => by simp at hl
  | _ :: _, [], hl, _ => by simp at hl
  | [_], _ :: _ :: _, hl, _ => by simp at hl
  | _ :: _ :: _, [_], hl, _ => by simp at hl

Proved by a term, which Lean's kernel checks directly.

Used by

In StandardElmMech/Stat/Pipeline.lean: SpecOf, DynOf (in Lib.Btest for a view, Mod.Btest [] for a worker: dynBasis), ProgramSem (r:p-program), D11For; copy names, payload types and main (copyName_inj, toPTy_isSome_iff, mainKind_worker_iff, mainKind_view_iff); the pipeline theorems (specOf_of_endToEnd, programSem_of_legal).

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.