Repository navigation
[Merged by Bors] - refactor(SetTheory/ZFC): make Class an abbrev for Set ZFSet - #43467
YaelDillies wants to merge 6 commits into
Conversation
PR summary 0f1aa04e25Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (strong) |
|---|---|---|
| 2316 | -1 | backward.isDefEq.respectTransparency.types |
| 419 | -1 | porting notes |
Current commit 0f1aa04e25
Reference commit 5e0c4e5239
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.py pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
Class an abbrev for Set ZFCClass an abbrev for Set ZFSet
61ed9d4 to
74bf582
Compare
There was a problem hiding this comment.
It seems a bit silly that we sometimes spell Set ZFSet as ZFClass, and other times as Set ZFSet. Do we really need the separate ZFClass abbrev? Can we just deprecate this material and restate the few lemmas with content (i.e. Burali-Forti) as lemmas about Set ZFSet?
| @[simp, deprecated ZFClass.not_cmem_empty (since := "2026-09-05")] | ||
| theorem notMem_empty (x : Class.{u}) : x ∉ (∅ : Class.{u}) := fun ⟨_, _, h⟩ => h | ||
|
|
||
| @[simp] | ||
| @[simp, deprecated Set.notMem_empty (since := "2026-09-05")] | ||
| theorem not_empty_hom (x : ZFSet.{u}) : ¬(∅ : Class.{u}) x := | ||
| id | ||
|
|
||
| @[simp] | ||
| @[simp, deprecated ZFClass.cmem_univ (since := "2026-09-05")] | ||
| theorem mem_univ {A : Class.{u}} : A ∈ univ.{u} ↔ ∃ x : ZFSet.{u}, ↑x = A := | ||
| exists_congr fun _ => iff_of_eq (and_true _) | ||
|
|
||
| @[simp] | ||
| @[simp, deprecated Set.mem_univ (since := "2026-09-05")] |
There was a problem hiding this comment.
These, and the other deprecated lemmas should not be simp. They trip up the SimpNF linter.
There was a problem hiding this comment.
I don't know where you got this from
There was a problem hiding this comment.
Well, if we make these lemmas simp, doesn't it make it so simp? starts suggesting them? That seems bad.
There was a problem hiding this comment.
Yes, but
- That has nothing to do with the simp nf linter. Are you sure you didn't misread the CI output?
- They are about deprecated declarations, so what's the issue? I am keeping them simp so that I don't need to change the deprecated proofs in this file.
There was a problem hiding this comment.
Then why not make them local simp?
There was a problem hiding this comment.
Although this would work here, it has the wrong semantics: What if the lemmas I was deprecating were spread across two files?
There was a problem hiding this comment.
Well, marking any deprecated lemma as simp definitely has wrong semantics.
There was a problem hiding this comment.
No, I don't see how: if the LHS of the simp lemma contains a deprecated declaration, it is guaranteed not to fire in code relying only on non-deprecated declarations and not using set_option linter.deprecated false.
|
This pull request has conflicts, please merge |
I have thought about this and I find myself in an uncomfortable position:
Could the solution be that you refactor |
|
I can't really do things very rapidly at this moment, sorry. If we do decide to go in the direction I'm suggesting, I think this refactor would still be good intermediate work. |
74bf582 to
c1e003d
Compare
|
Okay, let's worry about removing the |
JovanGerb
left a comment
There was a problem hiding this comment.
Should there be a recommended_spelling entry for the new ∈ᶜ notation? You use cmem, but wouldn't that fit with ᶜ∈, while ∈ᶜ reads as memc? Additionally, since we spell ∉ as notmem, I think ∉ᶜ should be one word, so notmemc or notcmem or cnotmem.
The docstring of ZFClass and CMem both explain the need for the ∉ᶜ notation (in different words). One of these can be dropped I think.
All of the theorem commands were changed to lemma. Is this intentional?
| @[inherit_doc] | ||
| scoped prefix:110 "⋂₀ " => ZFClass.sInter | ||
|
|
||
| lemma coe_subset : (x : ZFClass.{u}) ⊆ y ↔ x ⊆ y := .rfl |
There was a problem hiding this comment.
A bunch of these lemmas have lost their simp/norm_cast attribute. Is this intentional?
There was a problem hiding this comment.
Yes. As pointed out by Violeta in #43467 (comment), these lemmas are duplicates of lemmas about Set ZFSet in .Basic. As was decided above, I am not touching this further for the purpose of moving forward with the Set refactor.
I don't see the point of a
I chose
No, we spell it
Here sure it looks out of place in the docstring of
Whoops, fixed. |
553da44 to
5256a2d
Compare
|
There is still the lemma called Also, it looks like there are still quite some lemmas that used to be theorems. (I don't necessarily mind, but it's good to be aware at least) |
Also take the opportunity to perform a few more changes: * Rename `Class` to `ZFClass` * Rename the coercion from `ZFSet` to `ZFClass` to `ofSet` in lemma names, following the naming convention. Generated by Claude Sonnet/reviewed by myself in several prompts. Assisted-by: Claude Sonnet 5
5256a2d to
7b42de2
Compare
|
It's quite annoying with these force pushes that it's impossible to see what is actually being changed. There are still a bunch of |
|
The force pushes have nothing to do with it. Nothing changes when I rebase except for eventual merge conflicts (which are usually trivial to resolve). I have now looked at the diff for a third time for this issue only and I can see no trace of |
|
I was looking at the diff that appears when removing all the |
|
Cool. You are free to diff as you want, but the diff that ultimately matters is the one we see here on github (/the one |
|
maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by JovanGerb. |
|
bors d+ |
|
✌️ YaelDillies can now approve this pull request until 2026-10-14 17:51 UTC (in 2 weeks). To approve and merge, reply with
|
|
bors merge |
…3467) Also take the opportunity to perform a few more changes: * Rename `Class` to `ZFClass` * Rename the coercion from `ZFSet` to `ZFClass` to `ofSet` in lemma names, following the naming convention. Some `simp`/`norm_cast` lemmas are becoming duplicates of lemmas about `Set ZFSet` in `ZFC.Basic`. We might want to drop the `abbrev` or move it earlier so as to deduplicate these lemmas, but this is out of scope for this PR. Generated by Claude Sonnet/reviewed by myself in several prompts, then subsequently heavily rewritten by hand. Assisted-by: Claude Sonnet 5
|
Pull request successfully merged into master. Build succeeded: |
Class an abbrev for Set ZFSetClass an abbrev for Set ZFSet
|
Just noting here that the duplicate declaration linter found some duplicates introduced by this PR: I'm not sure which is the "correct" version here. |
|
I think the correct versions are the |
Also take the opportunity to perform a few more changes:
ClasstoZFClassZFSettoZFClasstoofSetin lemma names, following the naming convention.Some
simp/norm_castlemmas are becoming duplicates of lemmas aboutSet ZFSetinZFC.Basic. We might want to drop theabbrevor move it earlier so as to deduplicate these lemmas, but this is out of scope for this PR.Generated by Claude Sonnet/reviewed by myself in several prompts, then subsequently heavily rewritten by hand.
Assisted-by: Claude Sonnet 5