data.fintype.card_embedding
⟷
Mathlib.Data.Fintype.CardEmbedding
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -39,7 +39,17 @@ theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [F
-- Establishes the cardinality of the type of all injections between two finite types.
@[simp]
theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)] :
- ‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by classical
+ ‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by
+ classical
+ induction' ‹Fintype α› using Fintype.induction_empty_option with α₁ α₂ h₂ e ih α h ih
+ · letI := Fintype.ofEquiv _ e.symm
+ rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e]
+ · rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff]
+ exact ⟨embedding.of_is_empty, fun x => DFunLike.ext _ _ isEmptyElim⟩
+ · rw [card_option, Nat.descFactorial_succ, card_congr (embedding.option_embedding_equiv α β),
+ card_sigma, ← ih]
+ simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
+ smul_eq_mul, mul_comm]
#align fintype.card_embedding_eq Fintype.card_embedding_eq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -39,17 +39,7 @@ theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [F
-- Establishes the cardinality of the type of all injections between two finite types.
@[simp]
theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)] :
- ‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by
- classical
- induction' ‹Fintype α› using Fintype.induction_empty_option with α₁ α₂ h₂ e ih α h ih
- · letI := Fintype.ofEquiv _ e.symm
- rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e]
- · rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff]
- exact ⟨embedding.of_is_empty, fun x => DFunLike.ext _ _ isEmptyElim⟩
- · rw [card_option, Nat.descFactorial_succ, card_congr (embedding.option_embedding_equiv α β),
- card_sigma, ← ih]
- simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
- smul_eq_mul, mul_comm]
+ ‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by classical
#align fintype.card_embedding_eq Fintype.card_embedding_eq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -45,7 +45,7 @@ theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)
· letI := Fintype.ofEquiv _ e.symm
rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e]
· rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff]
- exact ⟨embedding.of_is_empty, fun x => FunLike.ext _ _ isEmptyElim⟩
+ exact ⟨embedding.of_is_empty, fun x => DFunLike.ext _ _ isEmptyElim⟩
· rw [card_option, Nat.descFactorial_succ, card_congr (embedding.option_embedding_equiv α β),
card_sigma, ← ih]
simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2021 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-/
-import Mathbin.Data.Fintype.BigOperators
-import Mathbin.Logic.Equiv.Embedding
+import Data.Fintype.BigOperators
+import Logic.Equiv.Embedding
#align_import data.fintype.card_embedding from "leanprover-community/mathlib"@"e97cf15cd1aec9bd5c193b2ffac5a6dc9118912b"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2021 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module data.fintype.card_embedding
-! leanprover-community/mathlib commit e97cf15cd1aec9bd5c193b2ffac5a6dc9118912b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Fintype.BigOperators
import Mathbin.Logic.Equiv.Embedding
+#align_import data.fintype.card_embedding from "leanprover-community/mathlib"@"e97cf15cd1aec9bd5c193b2ffac5a6dc9118912b"
+
/-!
# Number of embeddings
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -21,10 +21,8 @@ This file establishes the cardinality of `α ↪ β` in full generality.
-/
--- mathport name: finset.card
local notation "|" x "|" => Finset.card x
--- mathport name: fintype.card
local notation "‖" x "‖" => Fintype.card x
open Function
@@ -33,11 +31,14 @@ open scoped Nat BigOperators
namespace Fintype
+#print Fintype.card_embedding_eq_of_unique /-
theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = ‖β‖ :=
card_congr Equiv.uniqueEmbeddingEquivResult
#align fintype.card_embedding_eq_of_unique Fintype.card_embedding_eq_of_unique
+-/
+#print Fintype.card_embedding_eq /-
-- Establishes the cardinality of the type of all injections between two finite types.
@[simp]
theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)] :
@@ -53,7 +54,9 @@ theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)
simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
smul_eq_mul, mul_comm]
#align fintype.card_embedding_eq Fintype.card_embedding_eq
+-/
+#print Fintype.card_embedding_eq_of_infinite /-
/- The cardinality of embeddings from an infinite type to a finite type is zero.
This is a re-statement of the pigeonhole principle. -/
@[simp]
@@ -61,6 +64,7 @@ theorem card_embedding_eq_of_infinite {α β : Type _} [Infinite α] [Fintype β
‖α ↪ β‖ = 0 :=
card_eq_zero
#align fintype.card_embedding_eq_of_infinite Fintype.card_embedding_eq_of_infinite
+-/
end Fintype
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -43,15 +43,15 @@ theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [F
theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by
classical
- induction' ‹Fintype α› using Fintype.induction_empty_option with α₁ α₂ h₂ e ih α h ih
- · letI := Fintype.ofEquiv _ e.symm
- rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e]
- · rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff]
- exact ⟨embedding.of_is_empty, fun x => FunLike.ext _ _ isEmptyElim⟩
- · rw [card_option, Nat.descFactorial_succ, card_congr (embedding.option_embedding_equiv α β),
- card_sigma, ← ih]
- simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
- smul_eq_mul, mul_comm]
+ induction' ‹Fintype α› using Fintype.induction_empty_option with α₁ α₂ h₂ e ih α h ih
+ · letI := Fintype.ofEquiv _ e.symm
+ rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e]
+ · rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff]
+ exact ⟨embedding.of_is_empty, fun x => FunLike.ext _ _ isEmptyElim⟩
+ · rw [card_option, Nat.descFactorial_succ, card_congr (embedding.option_embedding_equiv α β),
+ card_sigma, ← ih]
+ simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
+ smul_eq_mul, mul_comm]
#align fintype.card_embedding_eq Fintype.card_embedding_eq
/- The cardinality of embeddings from an infinite type to a finite type is zero.
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -29,7 +29,7 @@ local notation "‖" x "‖" => Fintype.card x
open Function
-open Nat BigOperators
+open scoped Nat BigOperators
namespace Fintype
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -33,23 +33,11 @@ open Nat BigOperators
namespace Fintype
-/- warning: fintype.card_embedding_eq_of_unique -> Fintype.card_embedding_eq_of_unique is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Unique.{succ u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : Fintype.{max u1 u2} (Function.Embedding.{succ u1, succ u2} α β)], Eq.{1} Nat (Fintype.card.{max u1 u2} (Function.Embedding.{succ u1, succ u2} α β) _inst_3) (Fintype.card.{u2} β _inst_2)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Unique.{succ u2} α] [_inst_2 : Fintype.{u1} β] [_inst_3 : Fintype.{max u2 u1} (Function.Embedding.{succ u2, succ u1} α β)], Eq.{1} Nat (Fintype.card.{max u2 u1} (Function.Embedding.{succ u2, succ u1} α β) _inst_3) (Fintype.card.{u1} β _inst_2)
-Case conversion may be inaccurate. Consider using '#align fintype.card_embedding_eq_of_unique Fintype.card_embedding_eq_of_uniqueₓ'. -/
theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = ‖β‖ :=
card_congr Equiv.uniqueEmbeddingEquivResult
#align fintype.card_embedding_eq_of_unique Fintype.card_embedding_eq_of_unique
-/- warning: fintype.card_embedding_eq -> Fintype.card_embedding_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Fintype.{u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : Fintype.{max u1 u2} (Function.Embedding.{succ u1, succ u2} α β)], Eq.{1} Nat (Fintype.card.{max u1 u2} (Function.Embedding.{succ u1, succ u2} α β) _inst_3) (Nat.descFactorial (Fintype.card.{u2} β _inst_2) (Fintype.card.{u1} α _inst_1))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Fintype.{u2} α] [_inst_2 : Fintype.{u1} β] [_inst_3 : Fintype.{max u2 u1} (Function.Embedding.{succ u2, succ u1} α β)], Eq.{1} Nat (Fintype.card.{max u2 u1} (Function.Embedding.{succ u2, succ u1} α β) _inst_3) (Nat.descFactorial (Fintype.card.{u1} β _inst_2) (Fintype.card.{u2} α _inst_1))
-Case conversion may be inaccurate. Consider using '#align fintype.card_embedding_eq Fintype.card_embedding_eqₓ'. -/
-- Establishes the cardinality of the type of all injections between two finite types.
@[simp]
theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)] :
@@ -66,12 +54,6 @@ theorem card_embedding_eq {α β} [Fintype α] [Fintype β] [Fintype (α ↪ β)
smul_eq_mul, mul_comm]
#align fintype.card_embedding_eq Fintype.card_embedding_eq
-/- warning: fintype.card_embedding_eq_of_infinite -> Fintype.card_embedding_eq_of_infinite is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Infinite.{succ u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : Fintype.{max u1 u2} (Function.Embedding.{succ u1, succ u2} α β)], Eq.{1} Nat (Fintype.card.{max u1 u2} (Function.Embedding.{succ u1, succ u2} α β) _inst_3) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Infinite.{succ u2} α] [_inst_2 : Fintype.{u1} β] [_inst_3 : Fintype.{max u2 u1} (Function.Embedding.{succ u2, succ u1} α β)], Eq.{1} Nat (Fintype.card.{max u2 u1} (Function.Embedding.{succ u2, succ u1} α β) _inst_3) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))
-Case conversion may be inaccurate. Consider using '#align fintype.card_embedding_eq_of_infinite Fintype.card_embedding_eq_of_infiniteₓ'. -/
/- The cardinality of embeddings from an infinite type to a finite type is zero.
This is a re-statement of the pigeonhole principle. -/
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
All of these changes appear to be oversights to me.
@@ -51,7 +51,7 @@ theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Finty
smul_eq_mul, mul_comm]
#align fintype.card_embedding_eq Fintype.card_embedding_eq
-/- The cardinality of embeddings from an infinite type to a finite type is zero.
+/-- The cardinality of embeddings from an infinite type to a finite type is zero.
This is a re-statement of the pigeonhole principle. -/
theorem card_embedding_eq_of_infinite {α β : Type*} [Infinite α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = 0 :=
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -32,7 +32,7 @@ theorem card_embedding_eq_of_unique {α β : Type*} [Unique α] [Fintype β] [Fi
#align fintype.card_embedding_eq_of_unique Fintype.card_embedding_eq_of_unique
-- Establishes the cardinality of the type of all injections between two finite types.
--- porting note: `induction'` is broken so instead we make an ugly refine and `dsimp` a lot.
+-- Porting note: `induction'` is broken so instead we make an ugly refine and `dsimp` a lot.
@[simp]
theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Fintype (α ↪ β)] :
‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by
FunLike
to DFunLike
(#9785)
This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.
This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:
sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@@ -42,7 +42,7 @@ theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Finty
· letI := Fintype.ofEquiv _ e.symm
rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e]
· rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff]
- exact ⟨Embedding.ofIsEmpty, fun x ↦ FunLike.ext _ _ isEmptyElim⟩
+ exact ⟨Embedding.ofIsEmpty, fun x ↦ DFunLike.ext _ _ isEmptyElim⟩
· classical
dsimp only at ih
rw [card_option, Nat.descFactorial_succ, card_congr (Embedding.optionEmbeddingEquiv γ β),
Rationale: this instance creates (empty) data out of nothing, which may conflict with other data. If you have in the context [Fintype i]
and case on whether i
is empty or not, then this gave two non-defeq instances of [Fintype i]
around.
@@ -53,7 +53,6 @@ theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Finty
/- The cardinality of embeddings from an infinite type to a finite type is zero.
This is a re-statement of the pigeonhole principle. -/
-@[simp]
theorem card_embedding_eq_of_infinite {α β : Type*} [Infinite α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = 0 :=
card_eq_zero
@@ -46,7 +46,7 @@ theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Finty
· classical
dsimp only at ih
rw [card_option, Nat.descFactorial_succ, card_congr (Embedding.optionEmbeddingEquiv γ β),
- card_sigma, ←ih]
+ card_sigma, ← ih]
simp only [Fintype.card_compl_set, Fintype.card_range, Finset.sum_const, Finset.card_univ,
smul_eq_mul, mul_comm]
#align fintype.card_embedding_eq Fintype.card_embedding_eq
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -26,7 +26,7 @@ open Nat BigOperators
namespace Fintype
-theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [Fintype (α ↪ β)] :
+theorem card_embedding_eq_of_unique {α β : Type*} [Unique α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = ‖β‖ :=
card_congr Equiv.uniqueEmbeddingEquivResult
#align fintype.card_embedding_eq_of_unique Fintype.card_embedding_eq_of_unique
@@ -34,7 +34,7 @@ theorem card_embedding_eq_of_unique {α β : Type _} [Unique α] [Fintype β] [F
-- Establishes the cardinality of the type of all injections between two finite types.
-- porting note: `induction'` is broken so instead we make an ugly refine and `dsimp` a lot.
@[simp]
-theorem card_embedding_eq {α β : Type _} [Fintype α] [Fintype β] [emb : Fintype (α ↪ β)] :
+theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Fintype (α ↪ β)] :
‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖ := by
rw [Subsingleton.elim emb Embedding.fintype]
refine' Fintype.induction_empty_option (P := fun t ↦ ‖t ↪ β‖ = ‖β‖.descFactorial ‖t‖)
@@ -54,7 +54,7 @@ theorem card_embedding_eq {α β : Type _} [Fintype α] [Fintype β] [emb : Fint
/- The cardinality of embeddings from an infinite type to a finite type is zero.
This is a re-statement of the pigeonhole principle. -/
@[simp]
-theorem card_embedding_eq_of_infinite {α β : Type _} [Infinite α] [Fintype β] [Fintype (α ↪ β)] :
+theorem card_embedding_eq_of_infinite {α β : Type*} [Infinite α] [Fintype β] [Fintype (α ↪ β)] :
‖α ↪ β‖ = 0 :=
card_eq_zero
#align fintype.card_embedding_eq_of_infinite Fintype.card_embedding_eq_of_infinite
@@ -2,16 +2,13 @@
Copyright (c) 2021 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module data.fintype.card_embedding
-! leanprover-community/mathlib commit 98e83c3d541c77cdb7da20d79611a780ff8e7d90
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Logic.Equiv.Embedding
import Mathlib.Logic.Embedding.Set
+#align_import data.fintype.card_embedding from "leanprover-community/mathlib"@"98e83c3d541c77cdb7da20d79611a780ff8e7d90"
+
/-!
# Number of embeddings
Co-authored-by: Alex Kassil <alexkassil@sbcglobal.net> Co-authored-by: Eric Rodriguez <ericrboidi@gmail.com>
The unported dependencies are