Extensional maps#488
Conversation
| get?_merge : | ||
| get? (merge op m₁ m₂) k = Option.merge (op k) (get? m₁ k) (get? m₂ k) | ||
| /-- Pointwise-equivalent maps are equal (extensionality). -/ | ||
| equiv_iff_eq {m₁ m₂ : M V} : PartialMap.equiv m₁ m₂ ↔ m₁ = m₂ |
There was a problem hiding this comment.
Is it still necessary to have PartialMap.equiv or can it just be replaced by equality?
There was a problem hiding this comment.
Do you mean changing the rules to be stated without get? I think it can be done as well, I did it this way to reuse most of the file + allow users to use extensionality while staying in the interface, in case they define some additional operations on top of maps. I can change it, if you think that it's better to avoid PartialMap.equiv completely.
|
Rebased it on top of the agreement PR, so now all OFEs implemented in the project are Leibniz. I tried to stay as close as possible to the old interfaces, but if you think that we should use equalities instead of equiv, I can make a pass and change it now. As a side note, we probably should discuss at some point having version tags and a changelog for interface changes. |
Description
Beyond what quotient PR did, this PR is mostly the extensional maps preps before moving to equality for OFEs:
ExtensionalPartialMapclass intoLawfulPartialMap(it now carriesequiv_iff_eq), so pointwise-equivalent maps are just equal. As a result ~40 map lemmas (insert_delete,union_*,map_*,zip_*, etc) now conclude=instead of≡ₘ, and a lot of downstream proofs collapse torw/subst.≡ₘcase from map induction. Induction_on no longer needs thehequivobligation, which deleted that case everywhere maps are inducted (BigOp, BigSepMap, Plainly, GenHeap, HeapView).AssocListtype (can restore withPartialMapinstance) and the plainTreeMapinstances are gone, the only instances ofLawfulPartialMapare functions andExtTreeMap.Added
Leibnizinstances for dependent functions,GenMap,ReservationMap, andHeapView. With that, all constructions in the project should be Leibniz/Leibniz-preserving.There is some simplification (~230 lines), but the
≡that is introduced on BI level cuts short the gain from it.Builds on top of #485