feat: port gmultiset big-operators (big_opMS/big_sepMS)#495
Open
lihaokun wants to merge 1 commit into
Open
Conversation
Abstract `FiniteMultiSet` typeclass interface + `bigOpMS`/`bigSepMS` defined generically over it (mirroring `FiniteSet`/`bigOpS`/`bigSepS`), addressing the Multisets subtask of leanprover-community#260, plus the `embed_big_sepMS` follow-up in embedding.v.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port of Coq Iris's gmultiset big-operators —
big_opMS(algebra/big_op.v) andbig_sepMS(bi/big_op.v) — addressing the Multisets subtask of #260. iris-lean abstracts its finite collections rather than porting stdpp's concrete types 1:1 (cf.FiniteSet/GenSets↔ stdppfin_sets, withbig_opSgeneric overFiniteSet), so this introduces an abstractFiniteMultiSettypeclass and definesbigOpMS/bigSepMSgenerically over it, mirroring theFiniteSet/bigOpS/bigSepSstructure. All proved, 0sorry.Iris/Iris/Std/GenMultiSets.lean— the interfaceMultiSet/LawfulMultiSet/FiniteMultiSet/LawfulFiniteMultiSet: aNat-valuedmultiplicity(the multiset analog of∈),⊎(multiset sum) alongside∪/∩/∖,toList, the multiplicity/toListlaws,ext, andind(Coqgmultiset_ind). It isFiniteSetminusnodup, plus⊎andmultiplicity— exposing exactly what the big-operators need.Iris/Iris/Algebra/BigOp.lean—bigOpMS(16@[rocq_alias]+ 11#rocq_ignore)bigOpMS o f X := bigOpL o (fun _ x => f x) (toList X)+[^ o mset]notation; the empty/singleton/disj_union/insert/delete/unit/op/ne/proper/gen_proper/ext/elements/closed lemmas and thehom/hom_weakmonoid homomorphisms. The#rocq_ignores matchbig_opS's exactly: thene'/proper'Properinstances, the cross-big-opopL/opM/opS/opMS(proven at BI level asbigSepMS_comm_*), the Leibniz_Lvariants, and the unseal machinery.Iris/Iris/BI/BigOp/{BigOp,BigSepMSet}.lean—bigSepMS(44@[rocq_alias])bigSepMS := bigOpMS sep+[∗mset]notation, and the fullbig_sepMS_*suite: mono/proper/ne, empty/singleton/disj_union/insert/delete, the persistent/affine/timeless instances, sep/and/wand, elem_of(_acc)(_acc_impl), pure(_1)/affinely_pure_2, intro/impl/forall, persistently, later(_2)/laterN(_2), subseteq, sepL/sepM/sepS/sepMS, and dup. Hooked intoIris/BI/BigOp.lean.Iris/Iris/BI/Embedding.lean— follow-upembed_big_sepMS/embed_big_sepMS_2, previously#rocq_ignored pending this port, become one-liners viaBigOpMS.hom(mirroringembed_big_sepS).Scope
Every Coq
big_opMS_*/big_sepMS_*inalgebra/big_op.vandbi/big_op.vis aliased or justifiably ignored (checked againstROCQ_REVISIONb9b6cf04). Thebig_sepMS_{bupd,fupd,plain,plainly,objective}andbig_opMS_{own,auth_frag,view_frag,None,singletons}that live inbi/updates.v,bi/plainly.v,bi/monpred.v,algebra/{auth,view,gmultiset}.v, andbase_logic/lib/own.vare out of scope — they belong to those modules' ports and are unblocked as follow-ups by this PR.Checklist
authorssection of any appropriate filesAddresses the Multisets subtask of #260.