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] - chore(SetTheory/Cardinal/Basic): inline mul_comm into instance #16851

Closed
wants to merge 3 commits into from

Conversation

vihdzp
Copy link
Collaborator

@vihdzp vihdzp commented Sep 16, 2024

We also make the arguments of power_zero, power_one, and power_add explicit.


Open in Gitpod

Copy link

PR summary dd08cb466a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

- cast_succ

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors d+

Thanks!

inductionOn₃ a b c fun α β γ => mk_congr <| Equiv.sumArrowEquivProdArrow β γ α

private theorem cast_succ (n : ℕ) : ((n + 1 : ℕ) : Cardinal.{u}) = n + 1 := by
change #(ULift.{u} _) = #(ULift.{u} _) + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope if you want it to be, but it would be nice to have a natCast_def lemma that avoids the need for this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't be very useful, as it'd be essentially subsumed by Cardinal.mk_fintype.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same could be said for add_def vs mk_sum though, right?

Copy link
Collaborator Author

@vihdzp vihdzp Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite, since one is universe polymorphic, while the other is more convenient in the case the universes are equal.

#(Ulift (Fin n)) = n is just rw [Cardinal.mk_ulift, Cardinal.mk_fintype, Fintype.card_fin], and it's not like it adds a lot of convenience (under what other context are you going to be using Ulift (Fin n)?).

Copy link
Collaborator Author

@vihdzp vihdzp Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, we should probably redefine ↑n as the def-eq lift #(Fin n). Then I think it would make more sense to have natCast_def.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theorem Cardinal.natCast_def (n : ℕ) : (n : Cardinal.{u}) = #(ULift.{u} (Fin n)) := by
  rw [mk_uLift, mk_fin, lift_natCast]

is probably the steps you're thinking of; but I think I'd still argue that the lemma is worth having since it's rfl and avoids a change. No need to pull this PR back from bors though.

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Sep 17, 2024

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

@vihdzp
Copy link
Collaborator Author

vihdzp commented Sep 17, 2024

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Sep 17, 2024
)

We also make the arguments of `power_zero`, `power_one`, and `power_add` explicit.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Sep 17, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(SetTheory/Cardinal/Basic): inline mul_comm into instance [Merged by Bors] - chore(SetTheory/Cardinal/Basic): inline mul_comm into instance Sep 17, 2024
@mathlib-bors mathlib-bors bot closed this Sep 17, 2024
@mathlib-bors mathlib-bors bot deleted the vi.card_improve branch September 17, 2024 23:44
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.

3 participants