Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: four small lemmas about successors of finite cardinals #11544

Closed
wants to merge 5 commits into from

Conversation

grunweg
Copy link
Collaborator

@grunweg grunweg commented Mar 20, 2024

Co-authored-by: @fpvandoorn

Open in Gitpod

@grunweg grunweg added the awaiting-review The author would like community review of the PR label Mar 20, 2024
@grunweg
Copy link
Collaborator Author

grunweg commented Mar 20, 2024

Actually, I wonder if the right decision is "remove the first two lemmas" instead...

@fpvandoorn
Copy link
Member

I added comments in the Zulip thread

@fpvandoorn fpvandoorn added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Mar 20, 2024
@fpvandoorn
Copy link
Member

A lemma Cardinal.succ_eq_of_lt_omega would probably also useful (I think you can guess the statement from the name)

@grunweg
Copy link
Collaborator Author

grunweg commented Mar 22, 2024

A lemma Cardinal.succ_eq_of_lt_omega would probably also useful (I think you can guess the statement from the name)

I agree, but I don't find that easy to prove. (It's also the first time I'm seriously looking at the library for cardinals and ordinals.) There is a proof using more advanced tools:

import Mathlib.SetTheory.Cardinal.Ordinal
set_option autoImplicit false
open scoped Cardinal
lemma Cardinal.succ_eq_of_lt_aleph0 {c : Cardinal} (hc : ℵ₀ ≤ c): c + 1 = c := by
  rw [Cardinal.add_eq_max hc]
  exact max_eq_left (aleph0_le.mp hc 1)  

aleph0_le is in Cardinal.Basic, but inlining add_eq_max and related lemmas is tedious. For instance, here is the proof of add_eq_max inlined - and that's not even close to it.

lemma Cardinal.succ_eq_of_lt_aleph0 {c : Cardinal} (hc : ℵ₀ ≤ c): c + 1 = c := by
  apply le_antisymm _ (self_le_add_right c 1)
  have h1 : 1 ≤ c := aleph0_le.mp hc 1
  -- this requires inlining lots of `mul` lemmas, or a new proof
  have b : c + c = c := sorry
  nth_rw 2 [← b]
  exact add_le_add (le_refl c) h1

I could add the lemma to Ordinal, but that feels way too specialised compared to the lemmas there. What do you think?
(My current preference is to add a comment in Basic - unless there is better proof which could go in Basic.)

@grunweg
Copy link
Collaborator Author

grunweg commented Mar 22, 2024

I have used your proofs and golfed the special case (n=1).
awaiting-review

@github-actions github-actions bot added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Mar 22, 2024
@grunweg grunweg marked this pull request as ready for review March 22, 2024 22:52
@fpvandoorn
Copy link
Member

fpvandoorn commented Mar 23, 2024

Note that in Cardinal, we distinguish between add_one and succ, because they're not the same for infinite cardinals.
Cardinal.add_one_eq already exists, as do many other similar lemmas. The proof uses ordinals, and so was probably in a file you didn't import...

For the lemma Cardinal.succ_eq_of_lt_aleph0 (sorry, I forgot that Cardinal.omega was renamed to Cardinal.aleph0 a while back), I want (h : c < \aleph\_0) : Order.succ c = c + 1, which is a combination of the lemma in this PR and
Cardinal.lt_aleph0.

Can you add that?

Other than that, LGTM
bors d+

@mathlib-bors
Copy link

mathlib-bors bot commented Mar 23, 2024

✌️ grunweg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated and removed awaiting-review The author would like community review of the PR labels Mar 23, 2024
@fpvandoorn
Copy link
Member

(please update PR title)

@grunweg grunweg changed the title feat: Cardinal.leq_iff_le_succ feat: four small lemmas about successors of finite cardinals Mar 23, 2024
@grunweg
Copy link
Collaborator Author

grunweg commented Mar 23, 2024

Don't worry, figured out the renaming. (omega still exists, but as ordinal number...)
That lemma you mentioned seems easy to prove, added. Thanks for all the input!
bors r+

mathlib-bors bot pushed a commit that referenced this pull request Mar 23, 2024
@mathlib-bors
Copy link

mathlib-bors bot commented Mar 23, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Mar 23, 2024
@mathlib-bors
Copy link

mathlib-bors bot commented Mar 23, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: four small lemmas about successors of finite cardinals [Merged by Bors] - feat: four small lemmas about successors of finite cardinals Mar 23, 2024
@mathlib-bors mathlib-bors bot closed this Mar 23, 2024
@mathlib-bors mathlib-bors bot deleted the MR-cardinal-two branch March 23, 2024 17:33
utensil pushed a commit that referenced this pull request Mar 26, 2024
Louddy pushed a commit that referenced this pull request Apr 15, 2024
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants