Repository navigation
[Merged by Bors] - feat(Data/Finset): insert a (s.erase a) = insert a s - #40775
felixpernegger wants to merge 6 commits into
Conversation
felixpernegger
commented
Jun 18, 2026
PR summary 371753f809Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
insert a (s.erase a) = insert a sinsert a (s.erase a) = insert a s
| @[simp] theorem insert_erase_eq_insert : insert a (s.erase a) = insert a s := by grind | ||
|
|
||
| theorem insert_erase (h : a ∈ s) : insert a (s.erase a) = s := by grind |
There was a problem hiding this comment.
Do we have sometihng similar for Multiset?
There was a problem hiding this comment.
Not in that form since insert always adds an element for Multiset. Only thing would be
example (s : Multiset Nat) (n : Nat) : n ::ₘ (s.erase n) = if n ∈ s then s else n ::ₘ s := by
by_cases hn : n ∈ s <;> simp [hn]
Co-authored-by: Monica Omar <[email protected]>
Co-authored-by: Monica Omar <[email protected]>
themathqueen
left a comment
There was a problem hiding this comment.
looks fine to me
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by themathqueen. |
|
thanks bors r+ |
Co-authored-by: Batixx <[email protected]>
|
Pull request successfully merged into master. Build succeeded: |
insert a (s.erase a) = insert a sinsert a (s.erase a) = insert a s
* origin/master: (417 commits) feat(CategoryTheory/Presentable): more basic API for κ-filtered categories (leanprover-community#41184) feat(Tactic/Linter/UnusedTactic): mark `isIgnoreTacticKind` and `addIgnoreTacticKind` as public (leanprover-community#41993) doc: sync area READMEs with the directory tree (leanprover-community#42224) feat(CategoryTheory/Presentable): new constructor for `IsCardinalFilteredGenerator` (leanprover-community#41183) feat(Data/Finset): `insert a (s.erase a) = insert a s` (leanprover-community#40775) feat(CategoryTheory/Limits): morphisms between filtered limits are initially level-wise (leanprover-community#41009) chore: fix more linter warnings encountered by `scripts/rm_set_option.py` (leanprover-community#42659) chore(Algebra/Module/Submodule/Pointwise): remove `@[simp]` (leanprover-community#42643) feat(Algebra/QuadraticAlgebra): change of generator (leanprover-community#42209) chore(Condensed): reduce imports (leanprover-community#42022) chore: remove @[expose] from def-free public sections (leanprover-community#39388) feat: make `TFAE.out` 1-indexed (leanprover-community#42663) feat(Topology/Order): convergence of suprema and infima (leanprover-community#40578) feat: composition of Fredholm operators (leanprover-community#41601) chore: remove unused open declarations (leanprover-community#42235) chore(Algebra/Order/GroupWithZero/Canonical): remove unnecessary typeclass assumptions (leanprover-community#42539) chore(Algebra/Homology): make `HomologicalComplex.eval` `implicit_reducible` (leanprover-community#42648) chore: update Mathlib dependencies 2026-08-11 (leanprover-community#42651) chore: improve `Set` / `Finset` congruence API (leanprover-community#42640) feat(Geometry/Convex): a topology on StdSimplex (leanprover-community#42131) ... # Conflicts: # Mathlib/Tactic/Linter/DirectoryDependency.lean
The merge 51ba7e8 resolved a conflict in `Mathlib/Data/Finset/Basic.lean` by taking the branch side wholesale, which silently dropped the `insert_erase_eq_insert` added upstream in leanprover-community#40775 and put `@[simp]` back on `insert_erase`. Restore the lemma with a choice-free proof in the style of the surrounding declarations (`propext` and `Quot.sound` only), move `@[simp]` back off `insert_erase`, and reinstate the `-insert_erase_eq_insert` simp exclusions in `Finset.Fold` and `RingTheory.Lasker`. Co-Authored-By: Claude Opus 5 <[email protected]>
…mmunity#40775) Co-authored-by: Batixx <[email protected]>