Elm Exactly

TheoremenvKeys_addQ

StandardElmMech/Stat/RefuseScope.lean:1127, The context of a provider map binds only what the map provides · term proof

Statement

theorem envKeys_addQ {E : Env} {K : List SmLongId} (q : ModId) (f : IEnv → IEnv) (h : EnvKeys E K)
    (hf : ∀ I x b, FMap.find? (f I).VE x = some b → FMap.find? I.VE x = some b ∨ (⟨some q, .val x⟩ : SmLongId) ∈ K) :
    EnvKeys { E with QE

Proof

addQ q f E.QE } K := by
  refine ⟨h.1, fun q' I hq x b hx => ?_⟩
  simp only at hq
  rw [find?_addQ] at hq
  split at hq
  · rename_i e
    subst e
    cases hq
    rcases hf _ x b hx with h1 | h1
    · cases hI : FMap.find? E.QE q with
      | none => rw [hI] at h1; cases h1
      | some I0 =>
        rw [hI] at h1
        exact h.2 q I0 hI x b h1
    · exact h1
  · exact h.2 q' I hq x b hx

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

Theorems it uses

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.