Theorema76_enc_record_perm
A76: objects are unordered: the encoding of a record value does not depend on the order in which its fields are held (its labels distinct, as evaluation makes them).
Statement
theorem a76_enc_record_perm {r r' : List (String × Val)} (hp : r.Perm r')
(hnd : (r.map (·.1)).Nodup) (fs : PFields) :
enc (.record fs) (.record r) = enc (.record fs) (.record r')Proof
by
simp only [enc, labelsMatch_perm hp fs, encFields_perm hp hnd fs]Proved with tactics, which Lean expands into a proof term that its kernel checks.
Theorems it uses
About ruling A76 of the book, where the implementations disagreed or were silent and the definition decides.
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.