data.finset.finsuppMathlib.Data.Finset.Finsupp

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -117,7 +117,7 @@ theorem mem_pi {f : ι →₀ Finset α} {g : ι →₀ α} : g ∈ f.pi ↔ ∀
 theorem card_pi (f : ι →₀ Finset α) : f.pi.card = f.Prod fun i => (f i).card :=
   by
   rw [pi, card_finsupp]
-  exact Finset.prod_congr rfl fun i _ => by simp only [Pi.nat_apply, Nat.cast_id]
+  exact Finset.prod_congr rfl fun i _ => by simp only [Pi.natCast_apply, Nat.cast_id]
 #align finsupp.card_pi Finsupp.card_pi
 -/
 
Diff
@@ -79,7 +79,7 @@ theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.supp
     · exact h.2 hi
     · rw [not_mem_support_iff.1 (mt h.1 hi), not_mem_support_iff.1 fun H => hi <| ht H]
       exact zero_mem_zero
-  · rwa [H, mem_zero] at h 
+  · rwa [H, mem_zero] at h
 #align finset.mem_finsupp_iff_of_support_subset Finset.mem_finsupp_iff_of_support_subset
 -/
 
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Algebra.BigOperators.Finsupp
-import Mathbin.Data.Finset.Pointwise
-import Mathbin.Data.Finsupp.Indicator
-import Mathbin.Data.Fintype.BigOperators
+import Algebra.BigOperators.Finsupp
+import Data.Finset.Pointwise
+import Data.Finsupp.Indicator
+import Data.Fintype.BigOperators
 
 #align_import data.finset.finsupp from "leanprover-community/mathlib"@"f16e7a22e11fc09c71f25446ac1db23a24e8a0bd"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.finset.finsupp
-! leanprover-community/mathlib commit f16e7a22e11fc09c71f25446ac1db23a24e8a0bd
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.BigOperators.Finsupp
 import Mathbin.Data.Finset.Pointwise
 import Mathbin.Data.Finsupp.Indicator
 import Mathbin.Data.Fintype.BigOperators
 
+#align_import data.finset.finsupp from "leanprover-community/mathlib"@"f16e7a22e11fc09c71f25446ac1db23a24e8a0bd"
+
 /-!
 # Finitely supported product of finsets
 
Diff
@@ -66,6 +66,7 @@ theorem mem_finsupp_iff {t : ι → Finset α} : f ∈ s.Finsupp t ↔ f.support
 #align finset.mem_finsupp_iff Finset.mem_finsupp_iff
 -/
 
+#print Finset.mem_finsupp_iff_of_support_subset /-
 /-- When `t` is supported on `s`, `f ∈ s.finsupp t` precisely means that `f` is pointwise in `t`. -/
 @[simp]
 theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.support ⊆ s) :
@@ -83,12 +84,15 @@ theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.supp
       exact zero_mem_zero
   · rwa [H, mem_zero] at h 
 #align finset.mem_finsupp_iff_of_support_subset Finset.mem_finsupp_iff_of_support_subset
+-/
 
+#print Finset.card_finsupp /-
 @[simp]
 theorem card_finsupp (s : Finset ι) (t : ι → Finset α) :
     (s.Finsupp t).card = ∏ i in s, (t i).card :=
   (card_map _).trans <| card_pi _ _
 #align finset.card_finsupp Finset.card_finsupp
+-/
 
 end Finset
 
@@ -104,17 +108,21 @@ def pi (f : ι →₀ Finset α) : Finset (ι →₀ α) :=
 #align finsupp.pi Finsupp.pi
 -/
 
+#print Finsupp.mem_pi /-
 @[simp]
 theorem mem_pi {f : ι →₀ Finset α} {g : ι →₀ α} : g ∈ f.pi ↔ ∀ i, g i ∈ f i :=
   mem_finsupp_iff_of_support_subset <| Subset.refl _
 #align finsupp.mem_pi Finsupp.mem_pi
+-/
 
+#print Finsupp.card_pi /-
 @[simp]
 theorem card_pi (f : ι →₀ Finset α) : f.pi.card = f.Prod fun i => (f i).card :=
   by
   rw [pi, card_finsupp]
   exact Finset.prod_congr rfl fun i _ => by simp only [Pi.nat_apply, Nat.cast_id]
 #align finsupp.card_pi Finsupp.card_pi
+-/
 
 end Finsupp
 
Diff
@@ -81,7 +81,7 @@ theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.supp
     · exact h.2 hi
     · rw [not_mem_support_iff.1 (mt h.1 hi), not_mem_support_iff.1 fun H => hi <| ht H]
       exact zero_mem_zero
-  · rwa [H, mem_zero] at h
+  · rwa [H, mem_zero] at h 
 #align finset.mem_finsupp_iff_of_support_subset Finset.mem_finsupp_iff_of_support_subset
 
 @[simp]
Diff
@@ -39,7 +39,7 @@ noncomputable section
 
 open Finsupp
 
-open BigOperators Classical Pointwise
+open scoped BigOperators Classical Pointwise
 
 variable {ι α : Type _} [Zero α] {s : Finset ι} {f : ι →₀ α}
 
Diff
@@ -66,12 +66,6 @@ theorem mem_finsupp_iff {t : ι → Finset α} : f ∈ s.Finsupp t ↔ f.support
 #align finset.mem_finsupp_iff Finset.mem_finsupp_iff
 -/
 
-/- warning: finset.mem_finsupp_iff_of_support_subset -> Finset.mem_finsupp_iff_of_support_subset is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] {s : Finset.{u1} ι} {f : Finsupp.{u1, u2} ι α _inst_1} {t : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)}, (HasSubset.Subset.{u1} (Finset.{u1} ι) (Finset.hasSubset.{u1} ι) (Finsupp.support.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1) t) s) -> (Iff (Membership.Mem.{max u1 u2, max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) (Finset.hasMem.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) f (Finset.finsupp.{u1, u2} ι α _inst_1 s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) t))) (forall (i : ι), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι α _inst_1) (fun (_x : Finsupp.{u1, u2} ι α _inst_1) => ι -> α) (Finsupp.coeFun.{u1, u2} ι α _inst_1) f i) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) t i)))
-but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] {s : Finset.{u2} ι} {f : Finsupp.{u2, u1} ι α _inst_1} {t : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)}, (HasSubset.Subset.{u2} (Finset.{u2} ι) (Finset.instHasSubsetFinset.{u2} ι) (Finsupp.support.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1) t) s) -> (Iff (Membership.mem.{max u2 u1, max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u2, u1} ι α _inst_1)) (Finset.instMembershipFinset.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1)) f (Finset.finsupp.{u2, u1} ι α _inst_1 s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) t))) (forall (i : ι), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) i) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) i) (Finset.instMembershipFinset.{u1} α) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι α _inst_1) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) _x) (Finsupp.funLike.{u2, u1} ι α _inst_1) f i) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) t i)))
-Case conversion may be inaccurate. Consider using '#align finset.mem_finsupp_iff_of_support_subset Finset.mem_finsupp_iff_of_support_subsetₓ'. -/
 /-- When `t` is supported on `s`, `f ∈ s.finsupp t` precisely means that `f` is pointwise in `t`. -/
 @[simp]
 theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.support ⊆ s) :
@@ -90,12 +84,6 @@ theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.supp
   · rwa [H, mem_zero] at h
 #align finset.mem_finsupp_iff_of_support_subset Finset.mem_finsupp_iff_of_support_subset
 
-/- warning: finset.card_finsupp -> Finset.card_finsupp is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] (s : Finset.{u1} ι) (t : ι -> (Finset.{u2} α)), Eq.{1} Nat (Finset.card.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.finsupp.{u1, u2} ι α _inst_1 s t)) (Finset.prod.{0, u1} Nat ι Nat.commMonoid s (fun (i : ι) => Finset.card.{u2} α (t i)))
-but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] (s : Finset.{u2} ι) (t : ι -> (Finset.{u1} α)), Eq.{1} Nat (Finset.card.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finset.finsupp.{u2, u1} ι α _inst_1 s t)) (Finset.prod.{0, u2} Nat ι Nat.commMonoid s (fun (i : ι) => Finset.card.{u1} α (t i)))
-Case conversion may be inaccurate. Consider using '#align finset.card_finsupp Finset.card_finsuppₓ'. -/
 @[simp]
 theorem card_finsupp (s : Finset ι) (t : ι → Finset α) :
     (s.Finsupp t).card = ∏ i in s, (t i).card :=
@@ -116,23 +104,11 @@ def pi (f : ι →₀ Finset α) : Finset (ι →₀ α) :=
 #align finsupp.pi Finsupp.pi
 -/
 
-/- warning: finsupp.mem_pi -> Finsupp.mem_pi is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] {f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)} {g : Finsupp.{u1, u2} ι α _inst_1}, Iff (Membership.Mem.{max u1 u2, max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) (Finset.hasMem.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) g (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (forall (i : ι), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι α _inst_1) (fun (_x : Finsupp.{u1, u2} ι α _inst_1) => ι -> α) (Finsupp.coeFun.{u1, u2} ι α _inst_1) g i) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))
-but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] {f : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)} {g : Finsupp.{u2, u1} ι α _inst_1}, Iff (Membership.mem.{max u2 u1, max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u2, u1} ι α _inst_1)) (Finset.instMembershipFinset.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1)) g (Finsupp.pi.{u2, u1} ι α _inst_1 f)) (forall (i : ι), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) i) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) i) (Finset.instMembershipFinset.{u1} α) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι α _inst_1) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) _x) (Finsupp.funLike.{u2, u1} ι α _inst_1) g i) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) f i))
-Case conversion may be inaccurate. Consider using '#align finsupp.mem_pi Finsupp.mem_piₓ'. -/
 @[simp]
 theorem mem_pi {f : ι →₀ Finset α} {g : ι →₀ α} : g ∈ f.pi ↔ ∀ i, g i ∈ f i :=
   mem_finsupp_iff_of_support_subset <| Subset.refl _
 #align finsupp.mem_pi Finsupp.mem_pi
 
-/- warning: finsupp.card_pi -> Finsupp.card_pi is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] (f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)), Eq.{1} Nat (Finset.card.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (Finsupp.prod.{u1, u2, 0} ι (Finset.{u2} α) Nat (Finset.zero.{u2} α _inst_1) Nat.commMonoid f (fun (i : ι) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat ((Finset.{u2} α) -> Nat) (HasLiftT.mk.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (CoeTCₓ.coe.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (Nat.castCoe.{u2} ((Finset.{u2} α) -> Nat) (Pi.hasNatCast.{u2, 0} (Finset.{u2} α) (fun (ᾰ : Finset.{u2} α) => Nat) (fun (a : Finset.{u2} α) => AddMonoidWithOne.toNatCast.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)))))))) (Finset.card.{u2} α (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))))
-but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] (f : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)), Eq.{1} Nat (Finset.card.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finsupp.pi.{u2, u1} ι α _inst_1 f)) (Finsupp.prod.{u2, u1, 0} ι (Finset.{u1} α) Nat (Finset.zero.{u1} α _inst_1) Nat.commMonoid f (fun (i : ι) => Nat.cast.{u1} ((Finset.{u1} α) -> Nat) (Pi.natCast.{u1, 0} (Finset.{u1} α) (fun (a._@.Mathlib.Algebra.BigOperators.Finsupp._hyg.437 : Finset.{u1} α) => Nat) (fun (a : Finset.{u1} α) => instNatCastNat)) (Finset.card.{u1} α (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) f i))))
-Case conversion may be inaccurate. Consider using '#align finsupp.card_pi Finsupp.card_piₓ'. -/
 @[simp]
 theorem card_pi (f : ι →₀ Finset α) : f.pi.card = f.Prod fun i => (f i).card :=
   by
Diff
@@ -131,7 +131,7 @@ theorem mem_pi {f : ι →₀ Finset α} {g : ι →₀ α} : g ∈ f.pi ↔ ∀
 lean 3 declaration is
   forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] (f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)), Eq.{1} Nat (Finset.card.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (Finsupp.prod.{u1, u2, 0} ι (Finset.{u2} α) Nat (Finset.zero.{u2} α _inst_1) Nat.commMonoid f (fun (i : ι) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat ((Finset.{u2} α) -> Nat) (HasLiftT.mk.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (CoeTCₓ.coe.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (Nat.castCoe.{u2} ((Finset.{u2} α) -> Nat) (Pi.hasNatCast.{u2, 0} (Finset.{u2} α) (fun (ᾰ : Finset.{u2} α) => Nat) (fun (a : Finset.{u2} α) => AddMonoidWithOne.toNatCast.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)))))))) (Finset.card.{u2} α (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))))
 but is expected to have type
-  forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] (f : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)), Eq.{1} Nat (Finset.card.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finsupp.pi.{u2, u1} ι α _inst_1 f)) (Finsupp.prod.{u2, u1, 0} ι (Finset.{u1} α) Nat (Finset.zero.{u1} α _inst_1) Nat.commMonoid f (fun (i : ι) => Nat.cast.{u1} ((Finset.{u1} α) -> Nat) (Pi.natCast.{u1, 0} (Finset.{u1} α) (fun (a._@.Mathlib.Algebra.BigOperators.Finsupp._hyg.437 : Finset.{u1} α) => Nat) (fun (a : Finset.{u1} α) => CanonicallyOrderedCommSemiring.toNatCast.{0} Nat Nat.canonicallyOrderedCommSemiring)) (Finset.card.{u1} α (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) f i))))
+  forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] (f : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)), Eq.{1} Nat (Finset.card.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finsupp.pi.{u2, u1} ι α _inst_1 f)) (Finsupp.prod.{u2, u1, 0} ι (Finset.{u1} α) Nat (Finset.zero.{u1} α _inst_1) Nat.commMonoid f (fun (i : ι) => Nat.cast.{u1} ((Finset.{u1} α) -> Nat) (Pi.natCast.{u1, 0} (Finset.{u1} α) (fun (a._@.Mathlib.Algebra.BigOperators.Finsupp._hyg.437 : Finset.{u1} α) => Nat) (fun (a : Finset.{u1} α) => instNatCastNat)) (Finset.card.{u1} α (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) f i))))
 Case conversion may be inaccurate. Consider using '#align finsupp.card_pi Finsupp.card_piₓ'. -/
 @[simp]
 theorem card_pi (f : ι →₀ Finset α) : f.pi.card = f.Prod fun i => (f i).card :=
Diff
@@ -68,7 +68,7 @@ theorem mem_finsupp_iff {t : ι → Finset α} : f ∈ s.Finsupp t ↔ f.support
 
 /- warning: finset.mem_finsupp_iff_of_support_subset -> Finset.mem_finsupp_iff_of_support_subset is a dubious translation:
 lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] {s : Finset.{u1} ι} {f : Finsupp.{u1, u2} ι α _inst_1} {t : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)}, (HasSubset.Subset.{u1} (Finset.{u1} ι) (Finset.hasSubset.{u1} ι) (Finsupp.support.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1) t) s) -> (Iff (Membership.Mem.{max u1 u2, max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) (Finset.hasMem.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) f (Finset.finsupp.{u1, u2} ι α _inst_1 s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.hasCoeToFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) t))) (forall (i : ι), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι α _inst_1) (fun (_x : Finsupp.{u1, u2} ι α _inst_1) => ι -> α) (Finsupp.hasCoeToFun.{u1, u2} ι α _inst_1) f i) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.hasCoeToFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) t i)))
+  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] {s : Finset.{u1} ι} {f : Finsupp.{u1, u2} ι α _inst_1} {t : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)}, (HasSubset.Subset.{u1} (Finset.{u1} ι) (Finset.hasSubset.{u1} ι) (Finsupp.support.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1) t) s) -> (Iff (Membership.Mem.{max u1 u2, max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) (Finset.hasMem.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) f (Finset.finsupp.{u1, u2} ι α _inst_1 s (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) t))) (forall (i : ι), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι α _inst_1) (fun (_x : Finsupp.{u1, u2} ι α _inst_1) => ι -> α) (Finsupp.coeFun.{u1, u2} ι α _inst_1) f i) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) t i)))
 but is expected to have type
   forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] {s : Finset.{u2} ι} {f : Finsupp.{u2, u1} ι α _inst_1} {t : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)}, (HasSubset.Subset.{u2} (Finset.{u2} ι) (Finset.instHasSubsetFinset.{u2} ι) (Finsupp.support.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1) t) s) -> (Iff (Membership.mem.{max u2 u1, max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u2, u1} ι α _inst_1)) (Finset.instMembershipFinset.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1)) f (Finset.finsupp.{u2, u1} ι α _inst_1 s (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) t))) (forall (i : ι), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) i) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) i) (Finset.instMembershipFinset.{u1} α) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι α _inst_1) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) _x) (Finsupp.funLike.{u2, u1} ι α _inst_1) f i) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) t i)))
 Case conversion may be inaccurate. Consider using '#align finset.mem_finsupp_iff_of_support_subset Finset.mem_finsupp_iff_of_support_subsetₓ'. -/
@@ -118,7 +118,7 @@ def pi (f : ι →₀ Finset α) : Finset (ι →₀ α) :=
 
 /- warning: finsupp.mem_pi -> Finsupp.mem_pi is a dubious translation:
 lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] {f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)} {g : Finsupp.{u1, u2} ι α _inst_1}, Iff (Membership.Mem.{max u1 u2, max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) (Finset.hasMem.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) g (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (forall (i : ι), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι α _inst_1) (fun (_x : Finsupp.{u1, u2} ι α _inst_1) => ι -> α) (Finsupp.hasCoeToFun.{u1, u2} ι α _inst_1) g i) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.hasCoeToFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))
+  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] {f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)} {g : Finsupp.{u1, u2} ι α _inst_1}, Iff (Membership.Mem.{max u1 u2, max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) (Finset.hasMem.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1)) g (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (forall (i : ι), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι α _inst_1) (fun (_x : Finsupp.{u1, u2} ι α _inst_1) => ι -> α) (Finsupp.coeFun.{u1, u2} ι α _inst_1) g i) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))
 but is expected to have type
   forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] {f : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)} {g : Finsupp.{u2, u1} ι α _inst_1}, Iff (Membership.mem.{max u2 u1, max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finset.{max u1 u2} (Finsupp.{u2, u1} ι α _inst_1)) (Finset.instMembershipFinset.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1)) g (Finsupp.pi.{u2, u1} ι α _inst_1 f)) (forall (i : ι), Membership.mem.{u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) i) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) i) (Finset.instMembershipFinset.{u1} α) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι α _inst_1) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => α) _x) (Finsupp.funLike.{u2, u1} ι α _inst_1) g i) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) f i))
 Case conversion may be inaccurate. Consider using '#align finsupp.mem_pi Finsupp.mem_piₓ'. -/
@@ -129,7 +129,7 @@ theorem mem_pi {f : ι →₀ Finset α} {g : ι →₀ α} : g ∈ f.pi ↔ ∀
 
 /- warning: finsupp.card_pi -> Finsupp.card_pi is a dubious translation:
 lean 3 declaration is
-  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] (f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)), Eq.{1} Nat (Finset.card.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (Finsupp.prod.{u1, u2, 0} ι (Finset.{u2} α) Nat (Finset.zero.{u2} α _inst_1) Nat.commMonoid f (fun (i : ι) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat ((Finset.{u2} α) -> Nat) (HasLiftT.mk.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (CoeTCₓ.coe.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (Nat.castCoe.{u2} ((Finset.{u2} α) -> Nat) (Pi.hasNatCast.{u2, 0} (Finset.{u2} α) (fun (ᾰ : Finset.{u2} α) => Nat) (fun (a : Finset.{u2} α) => AddMonoidWithOne.toNatCast.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)))))))) (Finset.card.{u2} α (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.hasCoeToFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))))
+  forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : Zero.{u2} α] (f : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)), Eq.{1} Nat (Finset.card.{max u1 u2} (Finsupp.{u1, u2} ι α _inst_1) (Finsupp.pi.{u1, u2} ι α _inst_1 f)) (Finsupp.prod.{u1, u2, 0} ι (Finset.{u2} α) Nat (Finset.zero.{u2} α _inst_1) Nat.commMonoid f (fun (i : ι) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat ((Finset.{u2} α) -> Nat) (HasLiftT.mk.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (CoeTCₓ.coe.{1, succ u2} Nat ((Finset.{u2} α) -> Nat) (Nat.castCoe.{u2} ((Finset.{u2} α) -> Nat) (Pi.hasNatCast.{u2, 0} (Finset.{u2} α) (fun (ᾰ : Finset.{u2} α) => Nat) (fun (a : Finset.{u2} α) => AddMonoidWithOne.toNatCast.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)))))))) (Finset.card.{u2} α (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) (fun (_x : Finsupp.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) => ι -> (Finset.{u2} α)) (Finsupp.coeFun.{u1, u2} ι (Finset.{u2} α) (Finset.zero.{u2} α _inst_1)) f i))))
 but is expected to have type
   forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : Zero.{u1} α] (f : Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)), Eq.{1} Nat (Finset.card.{max u2 u1} (Finsupp.{u2, u1} ι α _inst_1) (Finsupp.pi.{u2, u1} ι α _inst_1 f)) (Finsupp.prod.{u2, u1, 0} ι (Finset.{u1} α) Nat (Finset.zero.{u1} α _inst_1) Nat.commMonoid f (fun (i : ι) => Nat.cast.{u1} ((Finset.{u1} α) -> Nat) (Pi.natCast.{u1, 0} (Finset.{u1} α) (fun (a._@.Mathlib.Algebra.BigOperators.Finsupp._hyg.437 : Finset.{u1} α) => Nat) (fun (a : Finset.{u1} α) => CanonicallyOrderedCommSemiring.toNatCast.{0} Nat Nat.canonicallyOrderedCommSemiring)) (Finset.card.{u1} α (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) ι (fun (_x : ι) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : ι) => Finset.{u1} α) _x) (Finsupp.funLike.{u2, u1} ι (Finset.{u1} α) (Finset.zero.{u1} α _inst_1)) f i))))
 Case conversion may be inaccurate. Consider using '#align finsupp.card_pi Finsupp.card_piₓ'. -/

Changes in mathlib4

mathlib3
mathlib4
chore: Rename coe_nat/coe_int/coe_rat to natCast/intCast/ratCast (#11499)

This is less exhaustive than its sibling #11486 because edge cases are harder to classify. No fundamental difficulty, just me being a bit fast and lazy.

Reduce the diff of #11203

Diff
@@ -100,7 +100,7 @@ theorem mem_pi {f : ι →₀ Finset α} {g : ι →₀ α} : g ∈ f.pi ↔ ∀
 @[simp]
 theorem card_pi (f : ι →₀ Finset α) : f.pi.card = f.prod fun i => (f i).card := by
   rw [pi, card_finsupp]
-  exact Finset.prod_congr rfl fun i _ => by simp only [Pi.nat_apply, Nat.cast_id]
+  exact Finset.prod_congr rfl fun i _ => by simp only [Pi.natCast_apply, Nat.cast_id]
 #align finsupp.card_pi Finsupp.card_pi
 
 end Finsupp
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -33,7 +33,8 @@ noncomputable section
 
 open Finsupp
 
-open BigOperators Classical Pointwise
+open scoped Classical
+open BigOperators Pointwise
 
 variable {ι α : Type*} [Zero α] {s : Finset ι} {f : ι →₀ α}
 
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
@@ -35,7 +35,7 @@ open Finsupp
 
 open BigOperators Classical Pointwise
 
-variable {ι α : Type _} [Zero α] {s : Finset ι} {f : ι →₀ α}
+variable {ι α : Type*} [Zero α] {s : Finset ι} {f : ι →₀ α}
 
 namespace Finset
 
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,17 +2,14 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.finset.finsupp
-! leanprover-community/mathlib commit 59694bd07f0a39c5beccba34bd9f413a160782bf
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.BigOperators.Finsupp
 import Mathlib.Data.Finset.Pointwise
 import Mathlib.Data.Finsupp.Indicator
 import Mathlib.Data.Fintype.BigOperators
 
+#align_import data.finset.finsupp from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf"
+
 /-!
 # Finitely supported product of finsets
 
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
@@ -47,8 +47,8 @@ protected def finsupp (s : Finset ι) (t : ι → Finset α) : Finset (ι →₀
   (s.pi t).map ⟨indicator s, indicator_injective s⟩
 #align finset.finsupp Finset.finsupp
 
-theorem mem_finsupp_iff {t : ι → Finset α} : f ∈ s.finsupp t ↔ f.support ⊆ s ∧ ∀ i ∈ s, f i ∈ t i :=
-  by
+theorem mem_finsupp_iff {t : ι → Finset α} :
+    f ∈ s.finsupp t ↔ f.support ⊆ s ∧ ∀ i ∈ s, f i ∈ t i := by
   refine' mem_map.trans ⟨_, _⟩
   · rintro ⟨f, hf, rfl⟩
     refine' ⟨support_indicator_subset _ _, fun i hi => _⟩
feat: Port/Data.Finset.Finsupp (#1990)

port of data.finset.finsupp

only fixes to poor mathport capitalization and missing aligns + docu fixes

Dependencies 8 + 271

272 files ported (97.1%)
116517 lines ported (97.4%)
Show graph

The unported dependencies are