Elm Exactly

TheoremisSome_of_lookup

StandardElmMech/Stat/RefuseScope.lean:642, The bare checker is sound · tactic proof

Statement

theorem isSome_of_lookup {C : Ctx} {Γ : Shape} (hA : Abs C Γ) {lv : LongId} {inst : List Ty} {τ : Ty}
    (h : (match C.lookupVal lv with
      | some (σ, _) => genAt σ inst τ
      | none => false) = true) : (Γ lv).isSome = true

Proof

by
  split at h
  · rename_i σ st hl
    obtain ⟨a, ha, _⟩ := hA lv _ hl
    rw [ha]; rfl
  · cases h

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

Used by

In StandardElmMech/Stat/RefuseScope.lean: Refusals by scope, constructor arity and imports, for one module and for a module after a helper (scopeFailB).

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.