Skip to content

[Merged by Bors] - chore(Data/Set/Card): make s.ncard the simpNF of Fintype.card s#39414

Closed
SnirBroshi wants to merge 2 commits into
leanprover-community:masterfrom
SnirBroshi:chore/unsimp-fintype-card-set
Closed

[Merged by Bors] - chore(Data/Set/Card): make s.ncard the simpNF of Fintype.card s#39414
SnirBroshi wants to merge 2 commits into
leanprover-community:masterfrom
SnirBroshi:chore/unsimp-fintype-card-set

Conversation

@SnirBroshi

@SnirBroshi SnirBroshi commented May 15, 2026

Copy link
Copy Markdown
Collaborator

Untags coe_fintypeCard : ↑(Fintype.card s) = s.encard as @[simp], and instead tags

  • fintypeCard_eq_ncard : Fintype.card s = s.ncard
  • coe_ncard_eq_encard : ↑(s.ncard) = s.encard

Then untags simp lemmas which are no longer simpNF because of this change;
simpNF versions of some of them will be introduced in future PRs.


Open in Gitpod

@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

PR summary a5c1b3289a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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.


No changes to strong technical debt.
No changes to weak technical debt.

@SnirBroshi SnirBroshi added the t-data Data (lists, quotients, numbers, etc) label May 15, 2026
@SnirBroshi
SnirBroshi requested review from Vierkantor and b-mehta May 15, 2026 14:17
@Vierkantor Vierkantor self-assigned this May 15, 2026
Comment on lines +333 to 335
@[to_dual self]
theorem _root_.Fintype.card_Icc (a b : α) [Fintype (Set.Icc a b)] :
Fintype.card (Set.Icc a b) = #(Icc a b) :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can simp now prove these lemmas (in a different way)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, it just simplifies the LHS to Set.ncard (after Mathlib/Data/Set/Card.lean, not here) so simpNF is angry.

I also think these are pretty strange as simp lemmas, but maybe I haven't used LocallyFiniteOrder enough to see its value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These lemmas should be stated in terms of Set.ncard. They were written before the definition existed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you make a follow-up PR to make this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread Mathlib/Data/Fintype/Card.lean

@b-mehta b-mehta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request May 24, 2026
…39414)

Untags `coe_fintypeCard : ↑(Fintype.card s) = s.encard` as `@[simp]`, and instead tags
- `fintypeCard_eq_ncard : Fintype.card s = s.ncard`
- `coe_ncard_eq_encard : ↑(s.ncard) = s.encard`

Then untags `simp` lemmas which are no longer simpNF because of this change;
simpNF versions of some of them will be introduced in future PRs.
@mathlib-triage mathlib-triage Bot added the ready-to-merge This PR has been sent to bors. label May 24, 2026
@mathlib-bors

mathlib-bors Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore(Data/Set/Card): make s.ncard the simpNF of Fintype.card s [Merged by Bors] - chore(Data/Set/Card): make s.ncard the simpNF of Fintype.card s May 24, 2026
@mathlib-bors mathlib-bors Bot closed this May 24, 2026
b-mehta pushed a commit to b-mehta/mathlib4 that referenced this pull request Jun 2, 2026
…eanprover-community#39414)

Untags `coe_fintypeCard : ↑(Fintype.card s) = s.encard` as `@[simp]`, and instead tags
- `fintypeCard_eq_ncard : Fintype.card s = s.ncard`
- `coe_ncard_eq_encard : ↑(s.ncard) = s.encard`

Then untags `simp` lemmas which are no longer simpNF because of this change;
simpNF versions of some of them will be introduced in future PRs.
Bergschaf pushed a commit to Bergschaf/mathlib4 that referenced this pull request Jun 3, 2026
…eanprover-community#39414)

Untags `coe_fintypeCard : ↑(Fintype.card s) = s.encard` as `@[simp]`, and instead tags
- `fintypeCard_eq_ncard : Fintype.card s = s.ncard`
- `coe_ncard_eq_encard : ↑(s.ncard) = s.encard`

Then untags `simp` lemmas which are no longer simpNF because of this change;
simpNF versions of some of them will be introduced in future PRs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants