Elm Exactly

Theoremapply_arrows

StandardElmMech/Stat/RefuseScope.lean:170, Arities · term proof

Statement

theorem apply_arrows (S : Subst) : (ks : List Ty) → (args : List Ty) → (t : TyName) → (τ : Ty) →
    S.apply (arrows ks (.con args t)) = some τ →
    ∃ ks' args', τ = arrows ks' (.con args' t) ∧ ks'.length = ks.length
  | [], args, t, τ, h => by
    simp only [arrows, Subst.apply] at h
    split at h
    · cases h; exact ⟨[], _, rfl, rfl⟩
    · cases h
  | k :: ks, args, t, τ, h => by
    simp only [arrows, Subst.apply] at h
    split at h
    · rename_i a' b' _ hb
      cases h
      obtain ⟨ks', args', rfl, hl⟩

Proof

apply_arrows S ks args t b' hb
      exact ⟨a' :: ks', args', rfl, by simp [hl]⟩
    · cases h

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

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.