Elm Exactly

Theoremimport_before

StandardElmMech/Src/SynSet.lean:44, Refusals whatever the order · term proof

In a sequence meeting res:program-import-order and res:program-modules-distinct, a module that imports a module of the program comes after it.

Statement

theorem import_before {q : SProgram} (hio : ImportOrder q) {i : Nat}
    (hi : i < q.modules.length) {mod : ModId} (hm : mod ∈ q.modules[i].imports.map (·.mod))
    (hnb : mod ∉ basisModuleIds) : ∃ j < i, (q.modules[j]?.map (·.header.name)) = some mod

Proof

((hio i hi q.modules[i] (by simp [List.getElem?_eq_getElem hi]) mod
  (List.mem_append_right _ hm)).resolve_left hnb)

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

Used by

In StandardElmMech/Src/SynSet.lean: The restrictions of the set of a program's modules (SynOKSet) and the refusals of every order.

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.