Repository navigation
[Merged by Bors] - chore(Data/Set/Card): make s.ncard the simpNF of Fintype.card s - #39414
SnirBroshi wants to merge 2 commits into
Conversation
PR summary a5c1b3289aImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
| @[to_dual self] | ||
| theorem _root_.Fintype.card_Icc (a b : α) [Fintype (Set.Icc a b)] : | ||
| Fintype.card (Set.Icc a b) = #(Icc a b) := |
There was a problem hiding this comment.
Can simp now prove these lemmas (in a different way)?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
These lemmas should be stated in terms of Set.ncard. They were written before the definition existed
There was a problem hiding this comment.
Can you make a follow-up PR to make this change?
…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.
|
Pull request successfully merged into master. Build succeeded: |
s.ncard the simpNF of Fintype.card ss.ncard the simpNF of Fintype.card s
…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.
…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.
…40624) Since #39414 the simpNF of the cardinality of `neighborSet` uses `Set.ncard` rather than `Fintype.card`, therefore we import `Set.ncard` into `SimpleGraph/Finite.lean` and show `(G.neighborSet v).ncard = G.degree v`. Also includes some other results that benefit from the import/lemma: - `(commonNeighbors ⊤ u v).encard = ENat.card V - 2` - `(G.map f).degree (f v) = G.degree v` for an injective `f` - `G'.degree (f v) = G.degree v` for `f : G ↪g G'`, given `G'.neighborSet (f v) ⊆ Set.range f`
…leanprover-community#39783) Followup to leanprover-community#39414 which untagged `Fintype.card_I??` as `@[simp]`. Adds `Cardinal.mk`/`Set.encard`/`Set.ncard` lemmas for the 8 interval sets `Set.I??` (= 24 lemmas), that convert them to `Finset.card` over the corresponding `Finset.I??` from a `LocallyFiniteOrder` instance.
…eanprover-community#40624) Since leanprover-community#39414 the simpNF of the cardinality of `neighborSet` uses `Set.ncard` rather than `Fintype.card`, therefore we import `Set.ncard` into `SimpleGraph/Finite.lean` and show `(G.neighborSet v).ncard = G.degree v`. Also includes some other results that benefit from the import/lemma: - `(commonNeighbors ⊤ u v).encard = ENat.card V - 2` - `(G.map f).degree (f v) = G.degree v` for an injective `f` - `G'.degree (f v) = G.degree v` for `f : G ↪g G'`, given `G'.neighborSet (f v) ⊆ Set.range f`
Untags
coe_fintypeCard : ↑(Fintype.card s) = s.encardas@[simp], and instead tagsfintypeCard_eq_ncard : Fintype.card s = s.ncardcoe_ncard_eq_encard : ↑(s.ncard) = s.encardThen untags
simplemmas which are no longer simpNF because of this change;simpNF versions of some of them will be introduced in future PRs.