Elm Exactly

TheoremkeysIncreasing_of_labels

StandardElmMech/Eff/Properties.lean:331, Every value of a payload type has an encoding (sec:effects-ports, the property) · term proof

Statement

theorem keysIncreasing_of_labels : ∀ (fs : PFields) (kvs : BObj), kvs.keys = fs.labels →
    fs.labelsIncreasing = true → kvs.keysIncreasing = true
  | .nil, .nil, _, _ => rfl
  | .cons _ _ .nil, .cons _ _ .nil, _, _ => rfl
  | .cons l _ (.cons l' τ' rest), .cons k j (.cons k' j' kvs), hk, hl => by
    simp only [BObj.keys, PFields.labels, List.cons.injEq] at hk
    obtain ⟨rfl, rfl, hk⟩

Proof

hk
    simp only [PFields.labelsIncreasing, Bool.and_eq_true, decide_eq_true_eq] at hl
    simp only [BObj.keysIncreasing, Bool.and_eq_true, decide_eq_true_eq]
    exact ⟨hl.1, keysIncreasing_of_labels (.cons k' τ' rest) (.cons k' j' kvs)
      (by simp [BObj.keys, PFields.labels, hk]) hl.2⟩
  | .nil, .cons _ _ _, hk, _ | .cons _ _ _, .nil, hk, _ => by simp [BObj.keys, PFields.labels] at hk
  | .cons _ _ .nil, .cons _ _ (.cons _ _ _), hk, _ => by simp [BObj.keys, PFields.labels] at hk
  | .cons _ _ (.cons _ _ _), .cons _ _ .nil, hk, _ => by simp [BObj.keys, PFields.labels] at hk

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

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.