Theoreminhabited
A97: every type has an inhabitant, in both modes.
Statement
theorem inhabited (tbl : ConTable) (mode : Mode) : ∀ (τ : Ty), IsInh tbl mode τ (canonInh tbl τ)Proof
by
intro τ n
induction n generalizing τ with
| zero => trivial
| succ n ih =>
obtain ⟨hc, har, has⟩ := canonNode_clause tbl mode τ
refine ⟨(canonNode tbl τ).1, rfl, hc, ?_, ?_⟩
· intro i p hi
simp only [canonInh, canonAt]
rw [har] at hi
rw [List.getElem?_eq_none_iff.mpr hi]
· intro k as he has' i hi
have e := has k as he has'
subst e
rw [canonInh_sub tbl τ i hi]
exact ih _Proved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
Used by
About ruling A97 of the book, where the implementations disagreed or were silent and the definition decides.
In StandardElmMech/Stat/PatternsProof.lean: The pattern decider is correct: every type is inhabited (inhabited), useful_spec, exhDec_sound, irrDec_sound.
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.