Skip to content

refactor: turn Set into a 1-field structure - #39211

Draft
urkud wants to merge 68 commits into
leanprover-community:masterfrom
urkud:set-structure
Draft

urkud wants to merge 68 commits into
leanprover-community:masterfrom
urkud:set-structure

Conversation

@urkud

@urkud urkud commented May 11, 2026

Copy link
Copy Markdown
Member

Open in Gitpod

@github-actions

Copy link
Copy Markdown

PR summary a766415431

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Countable.exists_injOn_of_encard_le
+ EventuallyEqSet
+ EventuallyEqSet.biInter
+ EventuallyEqSet.biUnion
+ EventuallyEqSet.cardinal_bInter
+ EventuallyEqSet.cardinal_bUnion
+ EventuallyEqSet.cardinal_iInter
+ EventuallyEqSet.cardinal_iUnion
+ EventuallyEqSet.compl
+ EventuallyEqSet.congr_left
+ EventuallyEqSet.congr_right
+ EventuallyEqSet.countable_bInter
+ EventuallyEqSet.countable_bUnion
+ EventuallyEqSet.countable_iInter
+ EventuallyEqSet.countable_iUnion
+ EventuallyEqSet.diff
+ EventuallyEqSet.iUnion
+ EventuallyEqSet.inter
+ EventuallyEqSet.mem_iff
+ EventuallyEqSet.refl
+ EventuallyEqSet.rfl
+ EventuallyEqSet.subset
+ EventuallyEqSet.superset
+ EventuallyEqSet.symm
+ EventuallyEqSet.symmDiff
+ EventuallyEqSet.trans
+ EventuallyEqSet.union
+ EventuallySubset
+ EventuallySubset.antisymm
+ EventuallySubset.biInter
+ EventuallySubset.biUnion
+ EventuallySubset.cardinal_bInter
+ EventuallySubset.cardinal_bUnion
+ EventuallySubset.cardinal_iInter
+ EventuallySubset.cardinal_iUnion
+ EventuallySubset.compl
+ EventuallySubset.countable_bInter
+ EventuallySubset.countable_bUnion
+ EventuallySubset.countable_iInter
+ EventuallySubset.countable_iUnion
+ EventuallySubset.diff
+ EventuallySubset.iInter
+ EventuallySubset.iUnion
+ EventuallySubset.inter
+ EventuallySubset.union
+ Filter.EventuallyEqSet.mem_interior
+ Filter.EventuallyEqSet.mem_interior_iff
+ Filter.EventuallyEqSet.of_mulIndicator
+ Filter.EventuallyEqSet.of_mulIndicator_const
+ Filter.Frequently.prop_of_isClosed
+ Finite.iUnion_pred
+ HasSubset.Subset.eventually
+ Ioi_ssubset_Ici_self
+ IsCompact.nonempty_biInter_of_directedOn_nonempty_isCompact_isClosed
+ ManyOneReducible.exists_computable_eq
+ MemFiniteInterClosure
+ MemGeneratePiSystem
+ MemGenerateSetAlgebra
+ MemSpanCarrier
+ Set.measurableSpace_eq_comap
+ _root_.Finset.eventuallyEqSet_iInter
+ _root_.Finset.eventuallyEqSet_iUnion
+ _root_.Finset.eventuallySubset_iInter
+ _root_.Finset.eventuallySubset_iUnion
+ _root_.Set.Finite.eventuallyEqSet_iInter
+ _root_.Set.Finite.eventuallyEqSet_iUnion
+ _root_.Set.Finite.eventuallySubset_iInter
+ _root_.Set.Finite.eventuallySubset_iUnion
+ ae_le_image_of_ae_le_comap
+ card_le_card_iff
+ coe_setOf
+ encard_eq_natCast_iff_fin
+ eventuallyEqSet_comm
+ eventuallyEqSet_empty
+ eventuallyEqSet_iff
+ eventuallyEqSet_insert
+ eventuallyEqSet_univ
+ eventuallySubset_antisymm_iff
+ eventuallySubset_iff_inf_principal_le
+ eventuallySubset_iff_mem_inf_principal
+ exists_injective_range_subset_of_le_encard
+ injOn_circleMap_Ico_zero_two_pi
+ instance : Bot (Set α) := ⟨∅⟩
+ instance : CoeFun Class (fun _ ↦ ZFSet → Prop) := ⟨toFun⟩
+ instance : CommRing (D.subalgebra R)
+ instance : LT (Set α) := ⟨fun s t ↦ s ≤ t ∧ ¬t ≤ s⟩
+ instance : Max (Set α) := ⟨Union.union⟩
+ instance : Min (Set α) := ⟨Inter.inter⟩
+ instance : Top (Set α) := ⟨univ⟩
+ instance {l : Filter α} : IsTrans (Set α) (· =ᶠˢ[l] ·)
+ instance {l : Filter α} : IsTrans (α → β) (· =ᶠ[l] ·)
+ inter_eventuallyEqSet_left
+ inter_eventuallyEqSet_right
+ mem_nhdsWithin_iff_eventuallyEqSet
+ mk_eq_setOf
+ mulIndicator_comp_apply_of_one
+ nhdsWithin_eq_iff_eventuallyEqSet
+ nonempty_setOf
+ preimage_eventuallyEqSet_target_inter_preimage_inter
+ sep_mem
+ subset_finiteInterClosure
+ toFun
++-- card_le_card_of_injective
- EventuallyEq.biInter
- EventuallyEq.biUnion
- EventuallyEq.cardinal_bInter
- EventuallyEq.cardinal_bUnion
- EventuallyEq.cardinal_iInter
- EventuallyEq.cardinal_iUnion
- EventuallyEq.compl
- EventuallyEq.countable_bInter
- EventuallyEq.countable_bUnion
- EventuallyEq.countable_iInter
- EventuallyEq.countable_iUnion
- EventuallyEq.diff
- EventuallyEq.iUnion
- EventuallyEq.inter
- EventuallyEq.mem_iff
- EventuallyEq.symmDiff
- EventuallyEq.union
- EventuallyLE.biInter
- EventuallyLE.biUnion
- EventuallyLE.cardinal_bInter
- EventuallyLE.cardinal_bUnion
- EventuallyLE.cardinal_iInter
- EventuallyLE.cardinal_iUnion
- EventuallyLE.compl
- EventuallyLE.countable_bInter
- EventuallyLE.countable_bUnion
- EventuallyLE.countable_iInter
- EventuallyLE.countable_iUnion
- EventuallyLE.diff
- EventuallyLE.iInter
- EventuallyLE.iUnion
- EventuallyLE.inter
- EventuallyLE.union
- Filter.EventuallyEq.mem_interior
- Filter.EventuallyEq.mem_interior_iff
- Filter.EventuallyEq.of_mulIndicator
- Filter.EventuallyEq.of_mulIndicator_const
- HasSubset.Subset.eventuallyLE
- Mem
- _root_.Finset.eventuallyEq_iInter
- _root_.Finset.eventuallyEq_iUnion
- _root_.Finset.eventuallyLE_iInter
- _root_.Finset.eventuallyLE_iUnion
- _root_.Set.Finite.eventuallyEq_iInter
- _root_.Set.Finite.eventuallyEq_iUnion
- _root_.Set.Finite.eventuallyLE_iInter
- _root_.Set.Finite.eventuallyLE_iUnion
- eventuallyEq_empty
- eventuallyEq_insert
- eventuallyEq_set
- eventuallyEq_univ
- instance : CommRing (D.subalgebra R) := inferInstanceAs <| CommRing (Algebra.adjoin _ _)
- instance {l : Filter α} :
- inter_eventuallyEq_left
- inter_eventuallyEq_right
- mem_nhdsWithin_iff_eventuallyEq
- nhdsWithin_eq_iff_eventuallyEq
- preimage_eventuallyEq_target_inter_preimage_inter
- set_eventuallyLE_iff_inf_principal_le
- set_eventuallyLE_iff_mem_inf_principal
- spanCarrier
-+-+ Ioo_ae_eq_Icc
-+-+ congr

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


Increase in strong tech debt: (relative, absolute) = (3.83, 0.07)
Current number Change Type
113 9 adaptation notes
528 -1 erw
5814 -8 backward.isDefEq.respectTransparency
140 -1 simp +instances

Current commit 649fa6ff57
Reference commit a766415431

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
    • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
Increase in weak tech debt: (relative, absolute) = (3.83, 0.07)
Current number Change Type
113 9 adaptation notes
528 -1 erw
5814 -8 backward.isDefEq.respectTransparency
140 -1 simp +instances

Current commit 649fa6ff57
Reference commit a766415431

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 23, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels May 27, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant