data.fintype.powersetMathlib.Data.Fintype.Powerset

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -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
 -/
 
Diff
@@ -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
 -/
 
Diff
@@ -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
 -/
 
Diff
@@ -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 /-
Diff
@@ -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"
 
Diff
@@ -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
 
Diff
@@ -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 α) :=
Diff
@@ -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
 -/
 
Diff
@@ -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
Diff
@@ -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'
 -/
 

Changes in mathlib4

mathlib3
mathlib4
chore(*Set): golf (#12117)
  • Golf Directed.exists_mem_subset_of_finset_subset_biUnion using induction tactic.
  • Golf Set.fintype.
  • Reduce abuse of Set α = α → Prop defeq.
Diff
@@ -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
feat: Basic finset lemmas (#9530)

From LeanAPAP

Diff
@@ -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
 
chore: rename Finset.powersetLen to powersetCard (#7667)

I don't understand why this was ever named powersetLen, there isn't even the notion of the length of a Finset/Multiset.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -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
feat: Order isomorphism between 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).

Diff
@@ -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
feat(RingTheory/MvPolynomial/NewtonIdentities): Add proof of Newton's identities (#6139)

Co-authored-by: michaellee94 <michael.a.rodrigues.lee@gmail.com> Co-authored-by: Oliver Nash <github@olivernash.org>

Diff
@@ -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 _
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -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]
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -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
 -/
chore: bye-bye, solo bys! (#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 bys".

Diff
@@ -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
chore: tidy various files (#1693)
Diff
@@ -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
feat: port Data.Fintype.Powerset (#1678)

Dependencies 2 + 182

183 files ported (98.9%)
83272 lines ported (99.8%)
Show graph

The unported dependencies are