data.fintype.powerset
⟷
Mathlib.Data.Fintype.Powerset
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)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(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
@@ -72,7 +72,12 @@ theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
#print Set.fintype /-
instance Set.fintype [Fintype α] : Fintype (Set α) :=
- ⟨(@Finset.univ α _).powerset.map ⟨coe, coe_injective⟩, fun s => by classical⟩
+ ⟨(@Finset.univ α _).powerset.map ⟨coe, coe_injective⟩, fun s => by
+ classical
+ refine' mem_map.2 ⟨finset.univ.filter s, mem_powerset.2 (subset_univ _), _⟩
+ apply (coe_filter _ _).trans
+ rw [coe_univ, Set.sep_univ]
+ rfl⟩
#align set.fintype Set.fintype
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -72,12 +72,7 @@ theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
#print Set.fintype /-
instance Set.fintype [Fintype α] : Fintype (Set α) :=
- ⟨(@Finset.univ α _).powerset.map ⟨coe, coe_injective⟩, fun s => by
- classical
- refine' mem_map.2 ⟨finset.univ.filter s, mem_powerset.2 (subset_univ _), _⟩
- apply (coe_filter _ _).trans
- rw [coe_univ, Set.sep_univ]
- rfl⟩
+ ⟨(@Finset.univ α _).powerset.map ⟨coe, coe_injective⟩, fun s => by classical⟩
#align set.fintype Set.fintype
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/b1abe23ae96fef89ad30d9f4362c307f72a55010
@@ -47,18 +47,18 @@ theorem Finset.powerset_eq_univ [Fintype α] {s : Finset α} : s.powerset = univ
#align finset.powerset_eq_univ Finset.powerset_eq_univ
-/
-#print Finset.mem_powersetLen_univ /-
-theorem Finset.mem_powersetLen_univ [Fintype α] {s : Finset α} {k : ℕ} :
- s ∈ powersetLen k (univ : Finset α) ↔ card s = k :=
- mem_powersetLen.trans <| and_iff_right <| subset_univ _
-#align finset.mem_powerset_len_univ_iff Finset.mem_powersetLen_univ
+#print Finset.mem_powersetCard_univ /-
+theorem Finset.mem_powersetCard_univ [Fintype α] {s : Finset α} {k : ℕ} :
+ s ∈ powersetCard k (univ : Finset α) ↔ card s = k :=
+ mem_powersetCard.trans <| and_iff_right <| subset_univ _
+#align finset.mem_powerset_len_univ_iff Finset.mem_powersetCard_univ
-/
#print Finset.univ_filter_card_eq /-
@[simp]
theorem Finset.univ_filter_card_eq (α : Type _) [Fintype α] (k : ℕ) :
- ((Finset.univ : Finset (Finset α)).filterₓ fun s => s.card = k) = Finset.univ.powersetLen k :=
- by ext; simp [Finset.mem_powersetLen]
+ ((Finset.univ : Finset (Finset α)).filterₓ fun s => s.card = k) = Finset.univ.powersetCard k :=
+ by ext; simp [Finset.mem_powersetCard]
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -47,11 +47,11 @@ theorem Finset.powerset_eq_univ [Fintype α] {s : Finset α} : s.powerset = univ
#align finset.powerset_eq_univ Finset.powerset_eq_univ
-/
-#print Finset.mem_powerset_len_univ_iff /-
-theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ} :
+#print Finset.mem_powersetLen_univ /-
+theorem Finset.mem_powersetLen_univ [Fintype α] {s : Finset α} {k : ℕ} :
s ∈ powersetLen k (univ : Finset α) ↔ card s = k :=
mem_powersetLen.trans <| and_iff_right <| subset_univ _
-#align finset.mem_powerset_len_univ_iff Finset.mem_powerset_len_univ_iff
+#align finset.mem_powerset_len_univ_iff Finset.mem_powersetLen_univ
-/
#print Finset.univ_filter_card_eq /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
-import Mathbin.Data.Fintype.Card
-import Mathbin.Data.Finset.Powerset
+import Data.Fintype.Card
+import Data.Finset.Powerset
#align_import data.fintype.powerset from "leanprover-community/mathlib"@"327c3c0d9232d80e250dc8f65e7835b82b266ea5"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module data.fintype.powerset
-! leanprover-community/mathlib commit 327c3c0d9232d80e250dc8f65e7835b82b266ea5
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Fintype.Card
import Mathbin.Data.Finset.Powerset
+#align_import data.fintype.powerset from "leanprover-community/mathlib"@"327c3c0d9232d80e250dc8f65e7835b82b266ea5"
+
/-!
# fintype instance for `set α`, when `α` is a fintype
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -57,17 +57,21 @@ theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ}
#align finset.mem_powerset_len_univ_iff Finset.mem_powerset_len_univ_iff
-/
+#print Finset.univ_filter_card_eq /-
@[simp]
theorem Finset.univ_filter_card_eq (α : Type _) [Fintype α] (k : ℕ) :
((Finset.univ : Finset (Finset α)).filterₓ fun s => s.card = k) = Finset.univ.powersetLen k :=
by ext; simp [Finset.mem_powersetLen]
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
+-/
+#print Fintype.card_finset_len /-
@[simp]
theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
Fintype.card { s : Finset α // s.card = k } = Nat.choose (Fintype.card α) k := by
simp [Fintype.subtype_card, Finset.card_univ]
#align fintype.card_finset_len Fintype.card_finset_len
+-/
#print Set.fintype /-
instance Set.fintype [Fintype α] : Fintype (Set α) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -73,10 +73,10 @@ theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
instance Set.fintype [Fintype α] : Fintype (Set α) :=
⟨(@Finset.univ α _).powerset.map ⟨coe, coe_injective⟩, fun s => by
classical
- refine' mem_map.2 ⟨finset.univ.filter s, mem_powerset.2 (subset_univ _), _⟩
- apply (coe_filter _ _).trans
- rw [coe_univ, Set.sep_univ]
- rfl⟩
+ refine' mem_map.2 ⟨finset.univ.filter s, mem_powerset.2 (subset_univ _), _⟩
+ apply (coe_filter _ _).trans
+ rw [coe_univ, Set.sep_univ]
+ rfl⟩
#align set.fintype Set.fintype
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -57,24 +57,12 @@ theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ}
#align finset.mem_powerset_len_univ_iff Finset.mem_powerset_len_univ_iff
-/
-/- warning: finset.univ_filter_card_eq -> Finset.univ_filter_card_eq is a dubious translation:
-lean 3 declaration is
- forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] (k : Nat), Eq.{succ u1} (Finset.{u1} (Finset.{u1} α)) (Finset.filter.{u1} (Finset.{u1} α) (fun (s : Finset.{u1} α) => Eq.{1} Nat (Finset.card.{u1} α s) k) (fun (a : Finset.{u1} α) => Nat.decidableEq (Finset.card.{u1} α a) k) (Finset.univ.{u1} (Finset.{u1} α) (Finset.fintype.{u1} α _inst_1))) (Finset.powersetLen.{u1} α k (Finset.univ.{u1} α _inst_1))
-but is expected to have type
- forall (α : Type.{u1}) [_inst_1 : Fintype.{u1} α] (k : Nat), Eq.{succ u1} (Finset.{u1} (Finset.{u1} α)) (Finset.filter.{u1} (Finset.{u1} α) (fun (s : Finset.{u1} α) => Eq.{1} Nat (Finset.card.{u1} α s) k) (fun (a : Finset.{u1} α) => instDecidableEqNat (Finset.card.{u1} α a) k) (Finset.univ.{u1} (Finset.{u1} α) (Finset.fintype.{u1} α _inst_1))) (Finset.powersetLen.{u1} α k (Finset.univ.{u1} α _inst_1))
-Case conversion may be inaccurate. Consider using '#align finset.univ_filter_card_eq Finset.univ_filter_card_eqₓ'. -/
@[simp]
theorem Finset.univ_filter_card_eq (α : Type _) [Fintype α] (k : ℕ) :
((Finset.univ : Finset (Finset α)).filterₓ fun s => s.card = k) = Finset.univ.powersetLen k :=
by ext; simp [Finset.mem_powersetLen]
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
-/- warning: fintype.card_finset_len -> Fintype.card_finset_len is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Fintype.{u1} α] (k : Nat), Eq.{1} Nat (Fintype.card.{u1} (Subtype.{succ u1} (Finset.{u1} α) (fun (s : Finset.{u1} α) => Eq.{1} Nat (Finset.card.{u1} α s) k)) (Subtype.fintype.{u1} (Finset.{u1} α) (fun (s : Finset.{u1} α) => Eq.{1} Nat (Finset.card.{u1} α s) k) (fun (a : Finset.{u1} α) => Nat.decidableEq (Finset.card.{u1} α a) k) (Finset.fintype.{u1} α _inst_1))) (Nat.choose (Fintype.card.{u1} α _inst_1) k)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Fintype.{u1} α] (k : Nat), Eq.{1} Nat (Fintype.card.{u1} (Subtype.{succ u1} (Finset.{u1} α) (fun (s : Finset.{u1} α) => Eq.{1} Nat (Finset.card.{u1} α s) k)) (Subtype.fintype.{u1} (Finset.{u1} α) (fun (s : Finset.{u1} α) => Eq.{1} Nat (Finset.card.{u1} α s) k) (fun (a : Finset.{u1} α) => instDecidableEqNat (Finset.card.{u1} α a) k) (Finset.fintype.{u1} α _inst_1))) (Nat.choose (Fintype.card.{u1} α _inst_1) k)
-Case conversion may be inaccurate. Consider using '#align fintype.card_finset_len Fintype.card_finset_lenₓ'. -/
@[simp]
theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
Fintype.card { s : Finset α // s.card = k } = Nat.choose (Fintype.card α) k := by
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -66,9 +66,7 @@ Case conversion may be inaccurate. Consider using '#align finset.univ_filter_car
@[simp]
theorem Finset.univ_filter_card_eq (α : Type _) [Fintype α] (k : ℕ) :
((Finset.univ : Finset (Finset α)).filterₓ fun s => s.card = k) = Finset.univ.powersetLen k :=
- by
- ext
- simp [Finset.mem_powersetLen]
+ by ext; simp [Finset.mem_powersetLen]
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
/- warning: fintype.card_finset_len -> Fintype.card_finset_len is a dubious translation:
@@ -96,10 +94,7 @@ instance Set.fintype [Fintype α] : Fintype (Set α) :=
#print Set.finite' /-
-- Not to be confused with `set.finite`, the predicate
-instance Set.finite' [Finite α] : Finite (Set α) :=
- by
- cases nonempty_fintype α
- infer_instance
+instance Set.finite' [Finite α] : Finite (Set α) := by cases nonempty_fintype α; infer_instance
#align set.finite' Set.finite'
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Directed.exists_mem_subset_of_finset_subset_biUnion
using induction
tactic.Set.fintype
.Set α = α → Prop
defeq.@@ -59,12 +59,10 @@ theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
#align fintype.card_finset_len Fintype.card_finset_len
instance Set.fintype [Fintype α] : Fintype (Set α) :=
- ⟨(@Finset.univ α _).powerset.map ⟨(↑), coe_injective⟩, fun s => by
+ ⟨(@Finset.univ (Finset α) _).map coeEmb.1, fun s => by
classical
- refine' mem_map.2 ⟨Finset.univ.filter s, Finset.mem_powerset.2 (Finset.subset_univ _), _⟩
- apply (coe_filter _ _).trans
- simp
- rfl⟩
+ refine mem_map.2 ⟨Finset.univ.filter (· ∈ s), Finset.mem_univ _, (coe_filter _ _).trans ?_⟩
+ simp⟩
#align set.fintype Set.fintype
-- Not to be confused with `Set.Finite`, the predicate
@@ -40,7 +40,7 @@ lemma filter_subset_univ [DecidableEq α] (s : Finset α) :
rw [← Finset.powerset_univ, powerset_inj]
#align finset.powerset_eq_univ Finset.powerset_eq_univ
-@[simp] lemma mem_powersetCard_univ : s ∈ powersetCard k (univ : Finset α) ↔ card s = k :=
+lemma mem_powersetCard_univ : s ∈ powersetCard k (univ : Finset α) ↔ card s = k :=
mem_powersetCard.trans <| and_iff_right <| subset_univ _
#align finset.mem_powerset_len_univ_iff Finset.mem_powersetCard_univ
@@ -40,14 +40,14 @@ lemma filter_subset_univ [DecidableEq α] (s : Finset α) :
rw [← Finset.powerset_univ, powerset_inj]
#align finset.powerset_eq_univ Finset.powerset_eq_univ
-@[simp] lemma mem_powersetLen_univ : s ∈ powersetLen k (univ : Finset α) ↔ card s = k :=
- mem_powersetLen.trans <| and_iff_right <| subset_univ _
-#align finset.mem_powerset_len_univ_iff Finset.mem_powersetLen_univ
+@[simp] lemma mem_powersetCard_univ : s ∈ powersetCard k (univ : Finset α) ↔ card s = k :=
+ mem_powersetCard.trans <| and_iff_right <| subset_univ _
+#align finset.mem_powerset_len_univ_iff Finset.mem_powersetCard_univ
variable (α)
@[simp] lemma univ_filter_card_eq (k : ℕ) :
- (univ : Finset (Finset α)).filter (fun s ↦ s.card = k) = univ.powersetLen k := by ext; simp
+ (univ : Finset (Finset α)).filter (fun s ↦ s.card = k) = univ.powersetCard k := by ext; simp
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
end Finset
Finset α
and Set α
(#7375)
over a fintype.
Also fix the name of Finset.mem_powerset_len_univ_iff
(it should be powersetLen
, not powerset_len
).
@@ -26,29 +26,32 @@ theorem Fintype.card_finset [Fintype α] : Fintype.card (Finset α) = 2 ^ Fintyp
Finset.card_powerset Finset.univ
#align fintype.card_finset Fintype.card_finset
-@[simp]
-theorem Finset.powerset_univ [Fintype α] : (univ : Finset α).powerset = univ :=
+namespace Finset
+variable [Fintype α] {s : Finset α} {k : ℕ}
+
+@[simp] lemma powerset_univ : (univ : Finset α).powerset = univ :=
coe_injective <| by simp [-coe_eq_univ]
#align finset.powerset_univ Finset.powerset_univ
-@[simp]
-theorem Finset.powerset_eq_univ [Fintype α] {s : Finset α} : s.powerset = univ ↔ s = univ := by
+lemma filter_subset_univ [DecidableEq α] (s : Finset α) :
+ filter (fun t ↦ t ⊆ s) univ = powerset s := by ext; simp
+
+@[simp] lemma powerset_eq_univ : s.powerset = univ ↔ s = univ := by
rw [← Finset.powerset_univ, powerset_inj]
#align finset.powerset_eq_univ Finset.powerset_eq_univ
-@[simp]
-theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ} :
- s ∈ powersetLen k (univ : Finset α) ↔ card s = k :=
+@[simp] lemma mem_powersetLen_univ : s ∈ powersetLen k (univ : Finset α) ↔ card s = k :=
mem_powersetLen.trans <| and_iff_right <| subset_univ _
-#align finset.mem_powerset_len_univ_iff Finset.mem_powerset_len_univ_iff
+#align finset.mem_powerset_len_univ_iff Finset.mem_powersetLen_univ
-@[simp]
-theorem Finset.univ_filter_card_eq (α : Type*) [Fintype α] (k : ℕ) :
- ((Finset.univ : Finset (Finset α)).filter fun s => s.card = k) = Finset.univ.powersetLen k := by
- ext
- simp [Finset.mem_powersetLen]
+variable (α)
+
+@[simp] lemma univ_filter_card_eq (k : ℕ) :
+ (univ : Finset (Finset α)).filter (fun s ↦ s.card = k) = univ.powersetLen k := by ext; simp
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
+end Finset
+
@[simp]
theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
Fintype.card { s : Finset α // s.card = k } = Nat.choose (Fintype.card α) k := by
Co-authored-by: michaellee94 <michael.a.rodrigues.lee@gmail.com> Co-authored-by: Oliver Nash <github@olivernash.org>
@@ -36,6 +36,7 @@ theorem Finset.powerset_eq_univ [Fintype α] {s : Finset α} : s.powerset = univ
rw [← Finset.powerset_univ, powerset_inj]
#align finset.powerset_eq_univ Finset.powerset_eq_univ
+@[simp]
theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ} :
s ∈ powersetLen k (univ : Finset α) ↔ card s = k :=
mem_powersetLen.trans <| and_iff_right <| subset_univ _
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -13,7 +13,7 @@ import Mathlib.Data.Finset.Powerset
-/
-variable {α : Type _}
+variable {α : Type*}
open Finset
@@ -42,7 +42,7 @@ theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ}
#align finset.mem_powerset_len_univ_iff Finset.mem_powerset_len_univ_iff
@[simp]
-theorem Finset.univ_filter_card_eq (α : Type _) [Fintype α] (k : ℕ) :
+theorem Finset.univ_filter_card_eq (α : Type*) [Fintype α] (k : ℕ) :
((Finset.univ : Finset (Finset α)).filter fun s => s.card = k) = Finset.univ.powersetLen k := by
ext
simp [Finset.mem_powersetLen]
@@ -2,15 +2,12 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module data.fintype.powerset
-! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Finset.Powerset
+#align_import data.fintype.powerset from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
+
/-!
# fintype instance for `Set α`, when `α` is a fintype
-/
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -46,8 +46,7 @@ theorem Finset.mem_powerset_len_univ_iff [Fintype α] {s : Finset α} {k : ℕ}
@[simp]
theorem Finset.univ_filter_card_eq (α : Type _) [Fintype α] (k : ℕ) :
- ((Finset.univ : Finset (Finset α)).filter fun s => s.card = k) = Finset.univ.powersetLen k :=
- by
+ ((Finset.univ : Finset (Finset α)).filter fun s => s.card = k) = Finset.univ.powersetLen k := by
ext
simp [Finset.mem_powersetLen]
#align finset.univ_filter_card_eq Finset.univ_filter_card_eq
@@ -67,7 +67,7 @@ instance Set.fintype [Fintype α] : Fintype (Set α) :=
rfl⟩
#align set.fintype Set.fintype
--- Not to be confused with `Set.finite`, the predicate
+-- Not to be confused with `Set.Finite`, the predicate
instance Set.finite' [Finite α] : Finite (Set α) := by
cases nonempty_fintype α
infer_instance
The unported dependencies are