Elm Exactly

Theoremapply_effect_singleton

StandardElmMech/Eff/Properties.lean:23, APPLY of the effect values · tactic proof

APPLY of an effect value has at most one member ("each set has exactly one member", sec:effects-apply, where it is defined).

Statement

theorem apply_effect_singleton {b : BasVal} {vs : List Val} (h : b.isEffect = true) :
    ∀ w w', Apply b vs w → Apply b vs w' → w = w'

Proof

by
  intro w w' h1 h2
  cases h1 <;> simp [BasVal.isEffect] at h <;> cases h2 <;> first | rfl | simp_all

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

In StandardElmMech/Eff/Properties.lean: APPLY of the effect values has one member; the rulings A74, A76, A88 and A92; canonical payload types, the decimality of a float's exact value, and that every value of a payload type has a canonical encoding (enc_total).

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.