." /> <!-- PLACEHOLDER_TITLE --> ." /> <!-- PLACEHOLDER_TITLE --> ." />
Elm Exactly

Theoremappend_dollar_inj

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

The part before the first $.

Statement

theorem append_dollar_inj : ∀ (l1 l2 r1 r2 : List Char), '#039; ∉ l1 → '#039; ∉ l2 →
    l1 ++ '#039; :: r1 = l2 ++ '#039; :: r2 → l1 = l2 ∧ r1 = r2
  | [], [], _, _, _, _, h => by simpa using h
  | [], c :: l2, _, _, _, h2, h => by
    simp only [List.nil_append, List.cons_append, List.cons.injEq] at h
    exact absurd (h.1 ▸ List.mem_cons_self) h2
  | c :: l1, [], _, _, h1, _, h => by
    simp only [List.nil_append, List.cons_append, List.cons.injEq] at h
    exact absurd (h.1 ▸ List.mem_cons_self) h1
  | c :: l1, d :: l2, r1, r2, h1, h2, h => by
    simp only [List.cons_append, List.cons.injEq] at h
    obtain ⟨rfl, h⟩

Proof

h
    have := append_dollar_inj l1 l2 r1 r2 (fun hm => h1 (List.mem_cons_of_mem _ hm))
      (fun hm => h2 (List.mem_cons_of_mem _ hm)) h
    exact ⟨by rw [this.1], this.2⟩

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.