data.multiset.powerset
⟷
Mathlib.Data.Multiset.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)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(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
@@ -147,7 +147,7 @@ theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset
Quotient.inductionOn s fun l =>
by
simp only [powerset_coe, quot_mk_to_coe, coe_le, coe_map]
- show l.map (coe ∘ List.ret) <+~ (sublists l).map coe
+ show l.map (coe ∘ List.pure) <+~ (sublists l).map coe
rw [← List.map_map]
exact ((map_ret_sublist_sublists _).map _).Subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -163,8 +163,8 @@ theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
#print Multiset.revzip_powersetAux /-
theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l :=
by
- rw [revzip, powerset_aux_eq_map_coe, ← map_reverse, zip_map, ← revzip] at h
- simp at h ; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
+ rw [revzip, powerset_aux_eq_map_coe, ← map_reverse, zip_map, ← revzip] at h
+ simp at h; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists _ _ _ h)
#align multiset.revzip_powerset_aux Multiset.revzip_powersetAux
-/
@@ -172,8 +172,8 @@ theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux
#print Multiset.revzip_powersetAux' /-
theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) : x.1 + x.2 = ↑l :=
by
- rw [revzip, powerset_aux', ← map_reverse, zip_map, ← revzip] at h
- simp at h ; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
+ rw [revzip, powerset_aux', ← map_reverse, zip_map, ← revzip] at h
+ simp at h; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists' _ _ _ h)
#align multiset.revzip_powerset_aux' Multiset.revzip_powersetAux'
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -355,19 +355,19 @@ theorem powersetCard_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
#align multiset.powerset_len_mono Multiset.powersetCard_mono
-/
-#print Multiset.powersetCard_empty /-
+#print Multiset.powersetCard_eq_empty /-
@[simp]
-theorem powersetCard_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
+theorem powersetCard_eq_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
powersetCard n s = 0 :=
card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetCard _ _)
-#align multiset.powerset_len_empty Multiset.powersetCard_empty
+#align multiset.powerset_len_empty Multiset.powersetCard_eq_empty
-/
#print Multiset.powersetCard_card_add /-
@[simp]
theorem powersetCard_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
s.powersetCard (s.card + i) = 0 :=
- powersetCard_empty _ (lt_add_of_pos_right (card s) hi)
+ powersetCard_eq_empty _ (lt_add_of_pos_right (card s) hi)
#align multiset.powerset_len_card_add Multiset.powersetCard_card_add
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/b1abe23ae96fef89ad30d9f4362c307f72a55010
@@ -217,58 +217,58 @@ theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) :
/-! ### powerset_len -/
-#print Multiset.powersetLenAux /-
+#print Multiset.powersetCardAux /-
/-- Helper function for `powerset_len`. Given a list `l`, `powerset_len_aux n l` is the list
of sublists of length `n`, as multisets. -/
-def powersetLenAux (n : ℕ) (l : List α) : List (Multiset α) :=
+def powersetCardAux (n : ℕ) (l : List α) : List (Multiset α) :=
sublistsLenAux n l coe []
-#align multiset.powerset_len_aux Multiset.powersetLenAux
+#align multiset.powerset_len_aux Multiset.powersetCardAux
-/
-#print Multiset.powersetLenAux_eq_map_coe /-
-theorem powersetLenAux_eq_map_coe {n} {l : List α} :
- powersetLenAux n l = (sublistsLen n l).map coe := by
+#print Multiset.powersetCardAux_eq_map_coe /-
+theorem powersetCardAux_eq_map_coe {n} {l : List α} :
+ powersetCardAux n l = (sublistsLen n l).map coe := by
rw [powerset_len_aux, sublists_len_aux_eq, append_nil]
-#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetLenAux_eq_map_coe
+#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetCardAux_eq_map_coe
-/
-#print Multiset.mem_powersetLenAux /-
+#print Multiset.mem_powersetCardAux /-
@[simp]
-theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔ s ≤ ↑l ∧ card s = n :=
+theorem mem_powersetCardAux {n} {l : List α} {s} : s ∈ powersetCardAux n l ↔ s ≤ ↑l ∧ card s = n :=
Quotient.inductionOn s <| by
simp [powerset_len_aux_eq_map_coe, subperm] <;>
exact fun l₁ =>
⟨fun ⟨l₂, ⟨s, e⟩, p⟩ => ⟨⟨_, p, s⟩, p.symm.length_eq.trans e⟩, fun ⟨⟨l₂, p, s⟩, e⟩ =>
⟨_, ⟨s, p.length_eq.trans e⟩, p⟩⟩
-#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAux
+#align multiset.mem_powerset_len_aux Multiset.mem_powersetCardAux
-/
-#print Multiset.powersetLenAux_zero /-
+#print Multiset.powersetCardAux_zero /-
@[simp]
-theorem powersetLenAux_zero (l : List α) : powersetLenAux 0 l = [0] := by
+theorem powersetCardAux_zero (l : List α) : powersetCardAux 0 l = [0] := by
simp [powerset_len_aux_eq_map_coe]
-#align multiset.powerset_len_aux_zero Multiset.powersetLenAux_zero
+#align multiset.powerset_len_aux_zero Multiset.powersetCardAux_zero
-/
-#print Multiset.powersetLenAux_nil /-
+#print Multiset.powersetCardAux_nil /-
@[simp]
-theorem powersetLenAux_nil (n : ℕ) : powersetLenAux (n + 1) (@nil α) = [] :=
+theorem powersetCardAux_nil (n : ℕ) : powersetCardAux (n + 1) (@nil α) = [] :=
rfl
-#align multiset.powerset_len_aux_nil Multiset.powersetLenAux_nil
+#align multiset.powerset_len_aux_nil Multiset.powersetCardAux_nil
-/
-#print Multiset.powersetLenAux_cons /-
+#print Multiset.powersetCardAux_cons /-
@[simp]
-theorem powersetLenAux_cons (n : ℕ) (a : α) (l : List α) :
- powersetLenAux (n + 1) (a :: l) =
- powersetLenAux (n + 1) l ++ List.map (cons a) (powersetLenAux n l) :=
+theorem powersetCardAux_cons (n : ℕ) (a : α) (l : List α) :
+ powersetCardAux (n + 1) (a :: l) =
+ powersetCardAux (n + 1) l ++ List.map (cons a) (powersetCardAux n l) :=
by simp [powerset_len_aux_eq_map_coe] <;> rfl
-#align multiset.powerset_len_aux_cons Multiset.powersetLenAux_cons
+#align multiset.powerset_len_aux_cons Multiset.powersetCardAux_cons
-/
-#print Multiset.powersetLenAux_perm /-
-theorem powersetLenAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
- powersetLenAux n l₁ ~ powersetLenAux n l₂ :=
+#print Multiset.powersetCardAux_perm /-
+theorem powersetCardAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
+ powersetCardAux n l₁ ~ powersetCardAux n l₂ :=
by
induction' n with n IHn generalizing l₁ l₂; · simp
induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ p₁ p₂ IH₁ IH₂; · rfl
@@ -280,118 +280,118 @@ theorem powersetLenAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
(by funext s <;> simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
exact perm_append_comm.append_right _
· exact IH₁.trans IH₂
-#align multiset.powerset_len_aux_perm Multiset.powersetLenAux_perm
+#align multiset.powerset_len_aux_perm Multiset.powersetCardAux_perm
-/
-#print Multiset.powersetLen /-
+#print Multiset.powersetCard /-
/-- `powerset_len n s` is the multiset of all submultisets of `s` of length `n`. -/
-def powersetLen (n : ℕ) (s : Multiset α) : Multiset (Multiset α) :=
- Quot.liftOn s (fun l => (powersetLenAux n l : Multiset (Multiset α))) fun l₁ l₂ h =>
- Quot.sound (powersetLenAux_perm h)
-#align multiset.powerset_len Multiset.powersetLen
+def powersetCard (n : ℕ) (s : Multiset α) : Multiset (Multiset α) :=
+ Quot.liftOn s (fun l => (powersetCardAux n l : Multiset (Multiset α))) fun l₁ l₂ h =>
+ Quot.sound (powersetCardAux_perm h)
+#align multiset.powerset_len Multiset.powersetCard
-/
-#print Multiset.powersetLen_coe' /-
-theorem powersetLen_coe' (n) (l : List α) : @powersetLen α n l = powersetLenAux n l :=
+#print Multiset.powersetCard_coe' /-
+theorem powersetCard_coe' (n) (l : List α) : @powersetCard α n l = powersetCardAux n l :=
rfl
-#align multiset.powerset_len_coe' Multiset.powersetLen_coe'
+#align multiset.powerset_len_coe' Multiset.powersetCard_coe'
-/
-#print Multiset.powersetLen_coe /-
-theorem powersetLen_coe (n) (l : List α) :
- @powersetLen α n l = ((sublistsLen n l).map coe : List (Multiset α)) :=
- congr_arg coe powersetLenAux_eq_map_coe
-#align multiset.powerset_len_coe Multiset.powersetLen_coe
+#print Multiset.powersetCard_coe /-
+theorem powersetCard_coe (n) (l : List α) :
+ @powersetCard α n l = ((sublistsLen n l).map coe : List (Multiset α)) :=
+ congr_arg coe powersetCardAux_eq_map_coe
+#align multiset.powerset_len_coe Multiset.powersetCard_coe
-/
-#print Multiset.powersetLen_zero_left /-
+#print Multiset.powersetCard_zero_left /-
@[simp]
-theorem powersetLen_zero_left (s : Multiset α) : powersetLen 0 s = {0} :=
+theorem powersetCard_zero_left (s : Multiset α) : powersetCard 0 s = {0} :=
Quotient.inductionOn s fun l => by simp [powerset_len_coe'] <;> rfl
-#align multiset.powerset_len_zero_left Multiset.powersetLen_zero_left
+#align multiset.powerset_len_zero_left Multiset.powersetCard_zero_left
-/
-#print Multiset.powersetLen_zero_right /-
-theorem powersetLen_zero_right (n : ℕ) : @powersetLen α (n + 1) 0 = 0 :=
+#print Multiset.powersetCard_zero_right /-
+theorem powersetCard_zero_right (n : ℕ) : @powersetCard α (n + 1) 0 = 0 :=
rfl
-#align multiset.powerset_len_zero_right Multiset.powersetLen_zero_right
+#align multiset.powerset_len_zero_right Multiset.powersetCard_zero_right
-/
-#print Multiset.powersetLen_cons /-
+#print Multiset.powersetCard_cons /-
@[simp]
-theorem powersetLen_cons (n : ℕ) (a : α) (s) :
- powersetLen (n + 1) (a ::ₘ s) = powersetLen (n + 1) s + map (cons a) (powersetLen n s) :=
+theorem powersetCard_cons (n : ℕ) (a : α) (s) :
+ powersetCard (n + 1) (a ::ₘ s) = powersetCard (n + 1) s + map (cons a) (powersetCard n s) :=
Quotient.inductionOn s fun l => by simp [powerset_len_coe'] <;> rfl
-#align multiset.powerset_len_cons Multiset.powersetLen_cons
+#align multiset.powerset_len_cons Multiset.powersetCard_cons
-/
-#print Multiset.mem_powersetLen /-
+#print Multiset.mem_powersetCard /-
@[simp]
-theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t ↔ s ≤ t ∧ card s = n :=
+theorem mem_powersetCard {n : ℕ} {s t : Multiset α} : s ∈ powersetCard n t ↔ s ≤ t ∧ card s = n :=
Quotient.inductionOn t fun l => by simp [powerset_len_coe']
-#align multiset.mem_powerset_len Multiset.mem_powersetLen
+#align multiset.mem_powerset_len Multiset.mem_powersetCard
-/
-#print Multiset.card_powersetLen /-
+#print Multiset.card_powersetCard /-
@[simp]
-theorem card_powersetLen (n : ℕ) (s : Multiset α) :
- card (powersetLen n s) = Nat.choose (card s) n :=
+theorem card_powersetCard (n : ℕ) (s : Multiset α) :
+ card (powersetCard n s) = Nat.choose (card s) n :=
Quotient.inductionOn s <| by simp [powerset_len_coe]
-#align multiset.card_powerset_len Multiset.card_powersetLen
+#align multiset.card_powerset_len Multiset.card_powersetCard
-/
-#print Multiset.powersetLen_le_powerset /-
-theorem powersetLen_le_powerset (n : ℕ) (s : Multiset α) : powersetLen n s ≤ powerset s :=
+#print Multiset.powersetCard_le_powerset /-
+theorem powersetCard_le_powerset (n : ℕ) (s : Multiset α) : powersetCard n s ≤ powerset s :=
Quotient.inductionOn s fun l => by
simp [powerset_len_coe] <;> exact ((sublists_len_sublist_sublists' _ _).map _).Subperm
-#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powerset
+#align multiset.powerset_len_le_powerset Multiset.powersetCard_le_powerset
-/
-#print Multiset.powersetLen_mono /-
-theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
- powersetLen n s ≤ powersetLen n t :=
+#print Multiset.powersetCard_mono /-
+theorem powersetCard_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
+ powersetCard n s ≤ powersetCard n t :=
leInductionOn h fun l₁ l₂ h => by
simp [powerset_len_coe] <;> exact ((sublists_len_sublist_of_sublist _ h).map _).Subperm
-#align multiset.powerset_len_mono Multiset.powersetLen_mono
+#align multiset.powerset_len_mono Multiset.powersetCard_mono
-/
-#print Multiset.powersetLen_empty /-
+#print Multiset.powersetCard_empty /-
@[simp]
-theorem powersetLen_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
- powersetLen n s = 0 :=
- card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetLen _ _)
-#align multiset.powerset_len_empty Multiset.powersetLen_empty
+theorem powersetCard_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
+ powersetCard n s = 0 :=
+ card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetCard _ _)
+#align multiset.powerset_len_empty Multiset.powersetCard_empty
-/
-#print Multiset.powersetLen_card_add /-
+#print Multiset.powersetCard_card_add /-
@[simp]
-theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
- s.powersetLen (s.card + i) = 0 :=
- powersetLen_empty _ (lt_add_of_pos_right (card s) hi)
-#align multiset.powerset_len_card_add Multiset.powersetLen_card_add
+theorem powersetCard_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
+ s.powersetCard (s.card + i) = 0 :=
+ powersetCard_empty _ (lt_add_of_pos_right (card s) hi)
+#align multiset.powerset_len_card_add Multiset.powersetCard_card_add
-/
-#print Multiset.powersetLen_map /-
-theorem powersetLen_map {β : Type _} (f : α → β) (n : ℕ) (s : Multiset α) :
- powersetLen n (s.map f) = (powersetLen n s).map (map f) :=
+#print Multiset.powersetCard_map /-
+theorem powersetCard_map {β : Type _} (f : α → β) (n : ℕ) (s : Multiset α) :
+ powersetCard n (s.map f) = (powersetCard n s).map (map f) :=
by
induction' s using Multiset.induction with t s ih generalizing n
· cases n <;> simp [powerset_len_zero_left, powerset_len_zero_right]
· cases n <;> simp [ih, map_comp_cons]
-#align multiset.powerset_len_map Multiset.powersetLen_map
+#align multiset.powerset_len_map Multiset.powersetCard_map
-/
-#print Multiset.pairwise_disjoint_powersetLen /-
-theorem pairwise_disjoint_powersetLen (s : Multiset α) :
- Pairwise fun i j => Multiset.Disjoint (s.powersetLen i) (s.powersetLen j) :=
+#print Multiset.pairwise_disjoint_powersetCard /-
+theorem pairwise_disjoint_powersetCard (s : Multiset α) :
+ Pairwise fun i j => Multiset.Disjoint (s.powersetCard i) (s.powersetCard j) :=
fun i j h x hi hj =>
- h (Eq.trans (Multiset.mem_powersetLen.mp hi).right.symm (Multiset.mem_powersetLen.mp hj).right)
-#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetLen
+ h (Eq.trans (Multiset.mem_powersetCard.mp hi).right.symm (Multiset.mem_powersetCard.mp hj).right)
+#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetCard
-/
#print Multiset.bind_powerset_len /-
theorem bind_powerset_len {α : Type _} (S : Multiset α) :
- (bind (Multiset.range (S.card + 1)) fun k => S.powersetLen k) = S.powerset :=
+ (bind (Multiset.range (S.card + 1)) fun k => S.powersetCard k) = S.powerset :=
by
induction S using Quotient.inductionOn
simp_rw [quot_mk_to_coe, powerset_coe', powerset_len_coe, ← coe_range, coe_bind, ← List.bind_map,
@@ -415,11 +415,11 @@ alias ⟨nodup.of_powerset, nodup.powerset⟩ := nodup_powerset
#align multiset.nodup.of_powerset Multiset.Nodup.ofPowerset
#align multiset.nodup.powerset Multiset.Nodup.powerset
-#print Multiset.Nodup.powersetLen /-
-protected theorem Nodup.powersetLen {n : ℕ} {s : Multiset α} (h : Nodup s) :
- Nodup (powersetLen n s) :=
- nodup_of_le (powersetLen_le_powerset _ _) (nodup_powerset.2 h)
-#align multiset.nodup.powerset_len Multiset.Nodup.powersetLen
+#print Multiset.Nodup.powersetCard /-
+protected theorem Nodup.powersetCard {n : ℕ} {s : Multiset α} (h : Nodup s) :
+ Nodup (powersetCard n s) :=
+ nodup_of_le (powersetCard_le_powerset _ _) (nodup_powerset.2 h)
+#align multiset.nodup.powerset_len Multiset.Nodup.powersetCard
-/
end Multiset
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
-import Mathbin.Data.List.Sublists
-import Mathbin.Data.Multiset.Nodup
+import Data.List.Sublists
+import Data.Multiset.Nodup
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"f2f413b9d4be3a02840d0663dace76e8fe3da053"
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -411,7 +411,7 @@ theorem nodup_powerset {s : Multiset α} : Nodup (powerset s) ↔ Nodup s :=
#align multiset.nodup_powerset Multiset.nodup_powerset
-/
-alias nodup_powerset ↔ nodup.of_powerset nodup.powerset
+alias ⟨nodup.of_powerset, nodup.powerset⟩ := nodup_powerset
#align multiset.nodup.of_powerset Multiset.Nodup.ofPowerset
#align multiset.nodup.powerset Multiset.Nodup.powerset
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2018 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.multiset.powerset
-! leanprover-community/mathlib commit f2f413b9d4be3a02840d0663dace76e8fe3da053
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.List.Sublists
import Mathbin.Data.Multiset.Nodup
+#align_import data.multiset.powerset from "leanprover-community/mathlib"@"f2f413b9d4be3a02840d0663dace76e8fe3da053"
+
/-!
# The powerset of a multiset
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -47,10 +47,12 @@ theorem powersetAux_eq_map_coe {l : List α} : powersetAux l = (sublists l).map
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
-/
+#print Multiset.mem_powersetAux /-
@[simp]
theorem mem_powersetAux {l : List α} {s} : s ∈ powersetAux l ↔ s ≤ ↑l :=
Quotient.inductionOn s <| by simp [powerset_aux_eq_map_coe, subperm, and_comm]
#align multiset.mem_powerset_aux Multiset.mem_powersetAux
+-/
#print Multiset.powersetAux' /-
/-- Helper function for the powerset of a multiset. Given a list `l`, returns a list
@@ -136,11 +138,14 @@ theorem powerset_cons (a : α) (s) : powerset (a ::ₘ s) = powerset s + map (co
#align multiset.powerset_cons Multiset.powerset_cons
-/
+#print Multiset.mem_powerset /-
@[simp]
theorem mem_powerset {s t : Multiset α} : s ∈ powerset t ↔ s ≤ t :=
Quotient.induction_on₂ s t <| by simp [subperm, and_comm]
#align multiset.mem_powerset Multiset.mem_powerset
+-/
+#print Multiset.map_single_le_powerset /-
theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset s :=
Quotient.inductionOn s fun l =>
by
@@ -149,11 +154,14 @@ theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset
rw [← List.map_map]
exact ((map_ret_sublist_sublists _).map _).Subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
+-/
+#print Multiset.card_powerset /-
@[simp]
theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
Quotient.inductionOn s <| by simp
#align multiset.card_powerset Multiset.card_powerset
+-/
#print Multiset.revzip_powersetAux /-
theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l :=
@@ -227,6 +235,7 @@ theorem powersetLenAux_eq_map_coe {n} {l : List α} :
#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetLenAux_eq_map_coe
-/
+#print Multiset.mem_powersetLenAux /-
@[simp]
theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔ s ≤ ↑l ∧ card s = n :=
Quotient.inductionOn s <| by
@@ -235,6 +244,7 @@ theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔
⟨fun ⟨l₂, ⟨s, e⟩, p⟩ => ⟨⟨_, p, s⟩, p.symm.length_eq.trans e⟩, fun ⟨⟨l₂, p, s⟩, e⟩ =>
⟨_, ⟨s, p.length_eq.trans e⟩, p⟩⟩
#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAux
+-/
#print Multiset.powersetLenAux_zero /-
@[simp]
@@ -318,39 +328,51 @@ theorem powersetLen_cons (n : ℕ) (a : α) (s) :
#align multiset.powerset_len_cons Multiset.powersetLen_cons
-/
+#print Multiset.mem_powersetLen /-
@[simp]
theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t ↔ s ≤ t ∧ card s = n :=
Quotient.inductionOn t fun l => by simp [powerset_len_coe']
#align multiset.mem_powerset_len Multiset.mem_powersetLen
+-/
+#print Multiset.card_powersetLen /-
@[simp]
theorem card_powersetLen (n : ℕ) (s : Multiset α) :
card (powersetLen n s) = Nat.choose (card s) n :=
Quotient.inductionOn s <| by simp [powerset_len_coe]
#align multiset.card_powerset_len Multiset.card_powersetLen
+-/
+#print Multiset.powersetLen_le_powerset /-
theorem powersetLen_le_powerset (n : ℕ) (s : Multiset α) : powersetLen n s ≤ powerset s :=
Quotient.inductionOn s fun l => by
simp [powerset_len_coe] <;> exact ((sublists_len_sublist_sublists' _ _).map _).Subperm
#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powerset
+-/
+#print Multiset.powersetLen_mono /-
theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
powersetLen n s ≤ powersetLen n t :=
leInductionOn h fun l₁ l₂ h => by
simp [powerset_len_coe] <;> exact ((sublists_len_sublist_of_sublist _ h).map _).Subperm
#align multiset.powerset_len_mono Multiset.powersetLen_mono
+-/
+#print Multiset.powersetLen_empty /-
@[simp]
theorem powersetLen_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
powersetLen n s = 0 :=
card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetLen _ _)
#align multiset.powerset_len_empty Multiset.powersetLen_empty
+-/
+#print Multiset.powersetLen_card_add /-
@[simp]
theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
s.powersetLen (s.card + i) = 0 :=
powersetLen_empty _ (lt_add_of_pos_right (card s) hi)
#align multiset.powerset_len_card_add Multiset.powersetLen_card_add
+-/
#print Multiset.powersetLen_map /-
theorem powersetLen_map {β : Type _} (f : α → β) (n : ℕ) (s : Multiset α) :
@@ -370,6 +392,7 @@ theorem pairwise_disjoint_powersetLen (s : Multiset α) :
#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetLen
-/
+#print Multiset.bind_powerset_len /-
theorem bind_powerset_len {α : Type _} (S : Multiset α) :
(bind (Multiset.range (S.card + 1)) fun k => S.powersetLen k) = S.powerset :=
by
@@ -378,6 +401,7 @@ theorem bind_powerset_len {α : Type _} (S : Multiset α) :
coe_card]
exact coe_eq_coe.mpr ((List.range_bind_sublistsLen_perm S).map _)
#align multiset.bind_powerset_len Multiset.bind_powerset_len
+-/
#print Multiset.nodup_powerset /-
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -158,8 +158,8 @@ theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
#print Multiset.revzip_powersetAux /-
theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l :=
by
- rw [revzip, powerset_aux_eq_map_coe, ← map_reverse, zip_map, ← revzip] at h
- simp at h; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
+ rw [revzip, powerset_aux_eq_map_coe, ← map_reverse, zip_map, ← revzip] at h
+ simp at h ; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists _ _ _ h)
#align multiset.revzip_powerset_aux Multiset.revzip_powersetAux
-/
@@ -167,8 +167,8 @@ theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux
#print Multiset.revzip_powersetAux' /-
theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) : x.1 + x.2 = ↑l :=
by
- rw [revzip, powerset_aux', ← map_reverse, zip_map, ← revzip] at h
- simp at h; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
+ rw [revzip, powerset_aux', ← map_reverse, zip_map, ← revzip] at h
+ simp at h ; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists' _ _ _ h)
#align multiset.revzip_powerset_aux' Multiset.revzip_powersetAux'
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -47,12 +47,6 @@ theorem powersetAux_eq_map_coe {l : List α} : powersetAux l = (sublists l).map
#align multiset.powerset_aux_eq_map_coe Multiset.powersetAux_eq_map_coe
-/
-/- warning: multiset.mem_powerset_aux -> Multiset.mem_powersetAux is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetAux.{u1} α l)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l))
-but is expected to have type
- forall {α : Type.{u1}} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.instMembershipList.{u1} (Multiset.{u1} α)) s (Multiset.powersetAux.{u1} α l)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s (Multiset.ofList.{u1} α l))
-Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_aux Multiset.mem_powersetAuxₓ'. -/
@[simp]
theorem mem_powersetAux {l : List α} {s} : s ∈ powersetAux l ↔ s ≤ ↑l :=
Quotient.inductionOn s <| by simp [powerset_aux_eq_map_coe, subperm, and_comm]
@@ -142,23 +136,11 @@ theorem powerset_cons (a : α) (s) : powerset (a ::ₘ s) = powerset s + map (co
#align multiset.powerset_cons Multiset.powerset_cons
-/
-/- warning: multiset.mem_powerset -> Multiset.mem_powerset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powerset.{u1} α t)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t)
-but is expected to have type
- forall {α : Type.{u1}} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) s (Multiset.powerset.{u1} α t)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t)
-Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset Multiset.mem_powersetₓ'. -/
@[simp]
theorem mem_powerset {s t : Multiset α} : s ∈ powerset t ↔ s ≤ t :=
Quotient.induction_on₂ s t <| by simp [subperm, and_comm]
#align multiset.mem_powerset Multiset.mem_powerset
-/- warning: multiset.map_single_le_powerset -> Multiset.map_single_le_powerset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toHasLe.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.map.{u1, u1} α (Multiset.{u1} α) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.hasSingleton.{u1} α)) s) (Multiset.powerset.{u1} α s)
-but is expected to have type
- forall {α : Type.{u1}} (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instPartialOrderMultiset.{u1} (Multiset.{u1} α)))) (Multiset.map.{u1, u1} α (Multiset.{u1} α) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.instSingletonMultiset.{u1} α)) s) (Multiset.powerset.{u1} α s)
-Case conversion may be inaccurate. Consider using '#align multiset.map_single_le_powerset Multiset.map_single_le_powersetₓ'. -/
theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset s :=
Quotient.inductionOn s fun l =>
by
@@ -168,9 +150,6 @@ theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset
exact ((map_ret_sublist_sublists _).map _).Subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
-/- warning: multiset.card_powerset -> Multiset.card_powerset is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align multiset.card_powerset Multiset.card_powersetₓ'. -/
@[simp]
theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
Quotient.inductionOn s <| by simp
@@ -248,12 +227,6 @@ theorem powersetLenAux_eq_map_coe {n} {l : List α} :
#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetLenAux_eq_map_coe
-/
-/- warning: multiset.mem_powerset_len_aux -> Multiset.mem_powersetLenAux is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l)) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.instMembershipList.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s (Multiset.ofList.{u1} α l)) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
-Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAuxₓ'. -/
@[simp]
theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔ s ≤ ↑l ∧ card s = n :=
Quotient.inductionOn s <| by
@@ -345,67 +318,34 @@ theorem powersetLen_cons (n : ℕ) (a : α) (s) :
#align multiset.powerset_len_cons Multiset.powersetLen_cons
-/
-/- warning: multiset.mem_powerset_len -> Multiset.mem_powersetLen is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
-Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_len Multiset.mem_powersetLenₓ'. -/
@[simp]
theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t ↔ s ≤ t ∧ card s = n :=
Quotient.inductionOn t fun l => by simp [powerset_len_coe']
#align multiset.mem_powerset_len Multiset.mem_powersetLen
-/- warning: multiset.card_powerset_len -> Multiset.card_powersetLen is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align multiset.card_powerset_len Multiset.card_powersetLenₓ'. -/
@[simp]
theorem card_powersetLen (n : ℕ) (s : Multiset α) :
card (powersetLen n s) = Nat.choose (card s) n :=
Quotient.inductionOn s <| by simp [powerset_len_coe]
#align multiset.card_powerset_len Multiset.card_powersetLen
-/- warning: multiset.powerset_len_le_powerset -> Multiset.powersetLen_le_powerset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toHasLe.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powerset.{u1} α s)
-but is expected to have type
- forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instPartialOrderMultiset.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powerset.{u1} α s)
-Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powersetₓ'. -/
theorem powersetLen_le_powerset (n : ℕ) (s : Multiset α) : powersetLen n s ≤ powerset s :=
Quotient.inductionOn s fun l => by
simp [powerset_len_coe] <;> exact ((sublists_len_sublist_sublists' _ _).map _).Subperm
#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powerset
-/- warning: multiset.powerset_len_mono -> Multiset.powersetLen_mono is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α} {t : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) -> (LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toHasLe.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powersetLen.{u1} α n t))
-but is expected to have type
- forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α} {t : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t) -> (LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instPartialOrderMultiset.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powersetLen.{u1} α n t))
-Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_mono Multiset.powersetLen_monoₓ'. -/
theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
powersetLen n s ≤ powersetLen n t :=
leInductionOn h fun l₁ l₂ h => by
simp [powerset_len_coe] <;> exact ((sublists_len_sublist_of_sublist _ h).map _).Subperm
#align multiset.powerset_len_mono Multiset.powersetLen_mono
-/- warning: multiset.powerset_len_empty -> Multiset.powersetLen_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α}, (LT.lt.{0} Nat Nat.hasLt (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (OfNat.mk.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.zero.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasZero.{u1} (Multiset.{u1} α))))))
-but is expected to have type
- forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α}, (LT.lt.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) instLTNat (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.toOfNat0.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instZeroMultiset.{u1} (Multiset.{u1} α)))))
-Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_empty Multiset.powersetLen_emptyₓ'. -/
@[simp]
theorem powersetLen_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
powersetLen n s = 0 :=
card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetLen _ _)
#align multiset.powerset_len_empty Multiset.powersetLen_empty
-/- warning: multiset.powerset_len_card_add -> Multiset.powersetLen_card_add is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (s : Multiset.{u1} α) {i : Nat}, (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) i) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) i) s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (OfNat.mk.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.zero.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasZero.{u1} (Multiset.{u1} α))))))
-but is expected to have type
- forall {α : Type.{u1}} (s : Multiset.{u1} α) {i : Nat}, (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) i) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) i) s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.toOfNat0.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instZeroMultiset.{u1} (Multiset.{u1} α)))))
-Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_card_add Multiset.powersetLen_card_addₓ'. -/
@[simp]
theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
s.powersetLen (s.card + i) = 0 :=
@@ -430,12 +370,6 @@ theorem pairwise_disjoint_powersetLen (s : Multiset α) :
#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetLen
-/
-/- warning: multiset.bind_powerset_len -> Multiset.bind_powerset_len is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (S : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.bind.{0, u1} Nat (Multiset.{u1} α) (Multiset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) S) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k S)) (Multiset.powerset.{u1} α S)
-but is expected to have type
- forall {α : Type.{u1}} (S : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.bind.{0, u1} Nat (Multiset.{u1} α) (Multiset.range (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) S) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) S) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) S) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) S) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k S)) (Multiset.powerset.{u1} α S)
-Case conversion may be inaccurate. Consider using '#align multiset.bind_powerset_len Multiset.bind_powerset_lenₓ'. -/
theorem bind_powerset_len {α : Type _} (S : Multiset α) :
(bind (Multiset.range (S.card + 1)) fun k => S.powersetLen k) = S.powerset :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -91,10 +91,8 @@ theorem powersetAux'_cons (a : α) (l : List α) :
theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂ :=
by
induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ p₁ p₂ IH₁ IH₂; · simp
- · simp
- exact IH.append (IH.map _)
- · simp
- apply perm.append_left
+ · simp; exact IH.append (IH.map _)
+ · simp; apply perm.append_left
rw [← append_assoc, ← append_assoc,
(by funext s <;> simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
exact perm_append_comm.append_right _
@@ -206,10 +204,8 @@ theorem revzip_powersetAux_lemma [DecidableEq α] (l : List α) {l' : List (Mult
by
rw [forall₂_map_right_iff, forall₂_same]
rintro ⟨s, t⟩ h
- dsimp
- rw [← H h, add_tsub_cancel_left]
- rw [← forall₂_eq_eq_eq, forall₂_map_right_iff]
- simpa
+ dsimp; rw [← H h, add_tsub_cancel_left]
+ rw [← forall₂_eq_eq_eq, forall₂_map_right_iff]; simpa
#align multiset.revzip_powerset_aux_lemma Multiset.revzip_powersetAux_lemma
-/
@@ -296,13 +292,9 @@ theorem powersetLenAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
by
induction' n with n IHn generalizing l₁ l₂; · simp
induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ p₁ p₂ IH₁ IH₂; · rfl
- · simp
- exact IH.append ((IHn p).map _)
- · simp
- apply perm.append_left
- cases n
- · simp
- apply perm.swap
+ · simp; exact IH.append ((IHn p).map _)
+ · simp; apply perm.append_left
+ cases n; · simp; apply perm.swap
simp
rw [← append_assoc, ← append_assoc,
(by funext s <;> simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -171,10 +171,7 @@ theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
/- warning: multiset.card_powerset -> Multiset.card_powerset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (s : Multiset.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} (Multiset.{u1} α)) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powerset.{u1} α s)) (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s))
-but is expected to have type
- forall {α : Type.{u1}} (s : Multiset.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) (fun (_x : Multiset.{u1} (Multiset.{u1} α)) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α)))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powerset.{u1} α s)) (HPow.hPow.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) (instHPow.{0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) instPowNat) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) 2 (instOfNatNat 2)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s))
+<too large>
Case conversion may be inaccurate. Consider using '#align multiset.card_powerset Multiset.card_powersetₓ'. -/
@[simp]
theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
@@ -368,10 +365,7 @@ theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t
#align multiset.mem_powerset_len Multiset.mem_powersetLen
/- warning: multiset.card_powerset_len -> Multiset.card_powersetLen is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} (Multiset.{u1} α)) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s)) (Nat.choose (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n)
-but is expected to have type
- forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powersetLen.{u1} α n s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) (fun (_x : Multiset.{u1} (Multiset.{u1} α)) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α)))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s)) (Nat.choose (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n)
+<too large>
Case conversion may be inaccurate. Consider using '#align multiset.card_powerset_len Multiset.card_powersetLenₓ'. -/
@[simp]
theorem card_powersetLen (n : ℕ) (s : Multiset α) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -49,7 +49,7 @@ theorem powersetAux_eq_map_coe {l : List α} : powersetAux l = (sublists l).map
/- warning: multiset.mem_powerset_aux -> Multiset.mem_powersetAux is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetAux.{u1} α l)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l))
+ forall {α : Type.{u1}} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetAux.{u1} α l)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l))
but is expected to have type
forall {α : Type.{u1}} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.instMembershipList.{u1} (Multiset.{u1} α)) s (Multiset.powersetAux.{u1} α l)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s (Multiset.ofList.{u1} α l))
Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_aux Multiset.mem_powersetAuxₓ'. -/
@@ -146,7 +146,7 @@ theorem powerset_cons (a : α) (s) : powerset (a ::ₘ s) = powerset s + map (co
/- warning: multiset.mem_powerset -> Multiset.mem_powerset is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powerset.{u1} α t)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t)
+ forall {α : Type.{u1}} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powerset.{u1} α t)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t)
but is expected to have type
forall {α : Type.{u1}} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) s (Multiset.powerset.{u1} α t)) (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t)
Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset Multiset.mem_powersetₓ'. -/
@@ -157,7 +157,7 @@ theorem mem_powerset {s t : Multiset α} : s ∈ powerset t ↔ s ≤ t :=
/- warning: multiset.map_single_le_powerset -> Multiset.map_single_le_powerset is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.map.{u1, u1} α (Multiset.{u1} α) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.hasSingleton.{u1} α)) s) (Multiset.powerset.{u1} α s)
+ forall {α : Type.{u1}} (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toHasLe.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.map.{u1, u1} α (Multiset.{u1} α) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.hasSingleton.{u1} α)) s) (Multiset.powerset.{u1} α s)
but is expected to have type
forall {α : Type.{u1}} (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instPartialOrderMultiset.{u1} (Multiset.{u1} α)))) (Multiset.map.{u1, u1} α (Multiset.{u1} α) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.instSingletonMultiset.{u1} α)) s) (Multiset.powerset.{u1} α s)
Case conversion may be inaccurate. Consider using '#align multiset.map_single_le_powerset Multiset.map_single_le_powersetₓ'. -/
@@ -257,7 +257,7 @@ theorem powersetLenAux_eq_map_coe {n} {l : List α} :
/- warning: multiset.mem_powerset_len_aux -> Multiset.mem_powersetLenAux is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l)) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
+ forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l)) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
but is expected to have type
forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.instMembershipList.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s (Multiset.ofList.{u1} α l)) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAuxₓ'. -/
@@ -358,7 +358,7 @@ theorem powersetLen_cons (n : ℕ) (a : α) (s) :
/- warning: multiset.mem_powerset_len -> Multiset.mem_powersetLen is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
+ forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
but is expected to have type
forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_len Multiset.mem_powersetLenₓ'. -/
@@ -381,7 +381,7 @@ theorem card_powersetLen (n : ℕ) (s : Multiset α) :
/- warning: multiset.powerset_len_le_powerset -> Multiset.powersetLen_le_powerset is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powerset.{u1} α s)
+ forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toHasLe.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powerset.{u1} α s)
but is expected to have type
forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instPartialOrderMultiset.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powerset.{u1} α s)
Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powersetₓ'. -/
@@ -392,7 +392,7 @@ theorem powersetLen_le_powerset (n : ℕ) (s : Multiset α) : powersetLen n s
/- warning: multiset.powerset_len_mono -> Multiset.powersetLen_mono is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α} {t : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) -> (LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powersetLen.{u1} α n t))
+ forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α} {t : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) -> (LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toHasLe.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.partialOrder.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powersetLen.{u1} α n t))
but is expected to have type
forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α} {t : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t) -> (LE.le.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Preorder.toLE.{u1} (Multiset.{u1} (Multiset.{u1} α)) (PartialOrder.toPreorder.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instPartialOrderMultiset.{u1} (Multiset.{u1} α)))) (Multiset.powersetLen.{u1} α n s) (Multiset.powersetLen.{u1} α n t))
Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_mono Multiset.powersetLen_monoₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -174,7 +174,7 @@ theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset
lean 3 declaration is
forall {α : Type.{u1}} (s : Multiset.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} (Multiset.{u1} α)) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powerset.{u1} α s)) (HPow.hPow.{0, 0, 0} Nat Nat Nat (instHPow.{0, 0} Nat Nat (Monoid.Pow.{0} Nat Nat.monoid)) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s))
but is expected to have type
- forall {α : Type.{u1}} (s : Multiset.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) (fun (_x : Multiset.{u1} (Multiset.{u1} α)) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α)))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powerset.{u1} α s)) (HPow.hPow.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) (instHPow.{0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) instPowNat) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) 2 (instOfNatNat 2)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s))
+ forall {α : Type.{u1}} (s : Multiset.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) (fun (_x : Multiset.{u1} (Multiset.{u1} α)) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α)))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powerset.{u1} α s)) (HPow.hPow.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) (instHPow.{0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) instPowNat) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powerset.{u1} α s)) 2 (instOfNatNat 2)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s))
Case conversion may be inaccurate. Consider using '#align multiset.card_powerset Multiset.card_powersetₓ'. -/
@[simp]
theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
@@ -259,7 +259,7 @@ theorem powersetLenAux_eq_map_coe {n} {l : List α} :
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (List.{u1} α) (Multiset.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (coeBase.{succ u1, succ u1} (List.{u1} α) (Multiset.{u1} α) (Multiset.hasCoe.{u1} α)))) l)) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
but is expected to have type
- forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.instMembershipList.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s (Multiset.ofList.{u1} α l)) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
+ forall {α : Type.{u1}} {n : Nat} {l : List.{u1} α} {s : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (List.{u1} (Multiset.{u1} α)) (List.instMembershipList.{u1} (Multiset.{u1} α)) s (Multiset.powersetLenAux.{u1} α n l)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s (Multiset.ofList.{u1} α l)) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAuxₓ'. -/
@[simp]
theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔ s ≤ ↑l ∧ card s = n :=
@@ -360,7 +360,7 @@ theorem powersetLen_cons (n : ℕ) (a : α) (s) :
lean 3 declaration is
forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) s t) (Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n))
but is expected to have type
- forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
+ forall {α : Type.{u1}} {n : Nat} {s : Multiset.{u1} α} {t : Multiset.{u1} α}, Iff (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) s (Multiset.powersetLen.{u1} α n t)) (And (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) s t) (Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n))
Case conversion may be inaccurate. Consider using '#align multiset.mem_powerset_len Multiset.mem_powersetLenₓ'. -/
@[simp]
theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t ↔ s ≤ t ∧ card s = n :=
@@ -371,7 +371,7 @@ theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t
lean 3 declaration is
forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} (Multiset.{u1} α)) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.orderedCancelAddCommMonoid.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s)) (Nat.choose (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n)
but is expected to have type
- forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powersetLen.{u1} α n s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) (fun (_x : Multiset.{u1} (Multiset.{u1} α)) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} (Multiset.{u1} α)) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α)))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s)) (Nat.choose (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n)
+ forall {α : Type.{u1}} (n : Nat) (s : Multiset.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) (Multiset.powersetLen.{u1} α n s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) (fun (_x : Multiset.{u1} (Multiset.{u1} α)) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} (Multiset.{u1} α)) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α)))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} (Multiset.{u1} α))))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s)) (Nat.choose (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n)
Case conversion may be inaccurate. Consider using '#align multiset.card_powerset_len Multiset.card_powersetLenₓ'. -/
@[simp]
theorem card_powersetLen (n : ℕ) (s : Multiset α) :
@@ -406,7 +406,7 @@ theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
lean 3 declaration is
forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α}, (LT.lt.{0} Nat Nat.hasLt (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) n) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (OfNat.mk.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.zero.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasZero.{u1} (Multiset.{u1} α))))))
but is expected to have type
- forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α}, (LT.lt.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) instLTNat (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.toOfNat0.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instZeroMultiset.{u1} (Multiset.{u1} α)))))
+ forall {α : Type.{u1}} (n : Nat) {s : Multiset.{u1} α}, (LT.lt.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) instLTNat (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) n) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α n s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.toOfNat0.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instZeroMultiset.{u1} (Multiset.{u1} α)))))
Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_empty Multiset.powersetLen_emptyₓ'. -/
@[simp]
theorem powersetLen_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card < n) :
@@ -418,7 +418,7 @@ theorem powersetLen_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : s.card
lean 3 declaration is
forall {α : Type.{u1}} (s : Multiset.{u1} α) {i : Nat}, (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) i) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s) i) s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (OfNat.mk.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.zero.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasZero.{u1} (Multiset.{u1} α))))))
but is expected to have type
- forall {α : Type.{u1}} (s : Multiset.{u1} α) {i : Nat}, (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) i) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) s) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) i) s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.toOfNat0.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instZeroMultiset.{u1} (Multiset.{u1} α)))))
+ forall {α : Type.{u1}} (s : Multiset.{u1} α) {i : Nat}, (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) i) -> (Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.powersetLen.{u1} α (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) s) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s) i) s) (OfNat.ofNat.{u1} (Multiset.{u1} (Multiset.{u1} α)) 0 (Zero.toOfNat0.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instZeroMultiset.{u1} (Multiset.{u1} α)))))
Case conversion may be inaccurate. Consider using '#align multiset.powerset_len_card_add Multiset.powersetLen_card_addₓ'. -/
@[simp]
theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
@@ -448,7 +448,7 @@ theorem pairwise_disjoint_powersetLen (s : Multiset α) :
lean 3 declaration is
forall {α : Type.{u1}} (S : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.bind.{0, u1} Nat (Multiset.{u1} α) (Multiset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) S) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k S)) (Multiset.powerset.{u1} α S)
but is expected to have type
- forall {α : Type.{u1}} (S : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.bind.{0, u1} Nat (Multiset.{u1} α) (Multiset.range (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) S) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) S) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) S) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) S) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k S)) (Multiset.powerset.{u1} α S)
+ forall {α : Type.{u1}} (S : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.bind.{0, u1} Nat (Multiset.{u1} α) (Multiset.range (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) S) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) S) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) S) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) S) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k S)) (Multiset.powerset.{u1} α S)
Case conversion may be inaccurate. Consider using '#align multiset.bind_powerset_len Multiset.bind_powerset_lenₓ'. -/
theorem bind_powerset_len {α : Type _} (S : Multiset α) :
(bind (Multiset.range (S.card + 1)) fun k => S.powersetLen k) = S.powerset :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -12,9 +12,6 @@ import Mathlib.Data.Multiset.Bind
# The powerset of a multiset
-/
-set_option autoImplicit true
-
-
namespace Multiset
open List
@@ -140,8 +137,7 @@ theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux
exact Quot.sound (revzip_sublists' _ _ _ h)
#align multiset.revzip_powerset_aux' Multiset.revzip_powersetAux'
--- Porting note: I don't understand why `{α : Type u}` is necessary here
-theorem revzip_powersetAux_lemma {α : Type u} [DecidableEq α] (l : List α) {l' : List (Multiset α)}
+theorem revzip_powersetAux_lemma {α : Type*} [DecidableEq α] (l : List α) {l' : List (Multiset α)}
(H : ∀ ⦃x : _ × _⦄, x ∈ revzip l' → x.1 + x.2 = ↑l) :
revzip l' = l'.map fun x => (x, (l : Multiset α) - x) := by
have :
Algebra.BigOperators.List.Basic
, Data.List.Chain
not depend on Data.Nat.Order.Basic
by using Nat
-specific Std lemmas rather than general mathlib ones. I leave the Data.Nat.Basic
import since Algebra.BigOperators.List.Basic
is algebra territory.Algebra.BigOperators.List.Basic
not depend on Algebra.Divisibility.Basic
. I'm not too sure about that one since they already are algebra. My motivation is that they involve ring-like objects while big operators are about group-like objects, but this is in some sense a second order refactor.MonoidWithZero
lemmas from Algebra.BigOperators.List.Basic
to Algebra.BigOperators.List.Lemmas
.Algebra.BigOperators.List.Defs
to Algebra.BigOperators.List.Basic
since no file imported the former without the latter and their imports are becoming very close after this PR.Data.List.Count
, Data.List.Dedup
, Data.List.ProdSigma
, Data.List.Zip
not depend on Algebra.BigOperators.List.Basic
.Algebra.BigOperators.List.Basic
. For the lemmas that were Nat
-specific, keep a version of them stated using Nat.sum
.Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum
.@@ -298,7 +298,7 @@ theorem powersetCard_eq_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card
@[simp]
theorem powersetCard_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
s.powersetCard (card s + i) = 0 :=
- powersetCard_eq_empty _ (lt_add_of_pos_right (card s) hi)
+ powersetCard_eq_empty _ (Nat.lt_add_of_pos_right hi)
#align multiset.powerset_len_card_add Multiset.powersetCard_card_add
theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
Make use of Nat
-specific lemmas from Std rather than the general ones provided by mathlib. Also reverse the dependency between Multiset.Nodup
/Multiset.dedup
and Multiset.sum
since only the latter needs algebra. Also rename Algebra.BigOperators.Multiset.Abs
to Algebra.BigOperators.Multiset.Order
and move some lemmas from Algebra.BigOperators.Multiset.Basic
to it.
The ultimate goal here is to carve out Data
, Algebra
and Order
sublibraries.
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Data.List.Sublists
-import Mathlib.Data.Multiset.Nodup
+import Mathlib.Data.Multiset.Bind
#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
@@ -115,9 +115,9 @@ theorem mem_powerset {s t : Multiset α} : s ∈ powerset t ↔ s ≤ t :=
theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset s :=
Quotient.inductionOn s fun l => by
simp only [powerset_coe, quot_mk_to_coe, coe_le, map_coe]
- show l.map (((↑) : List α → Multiset α) ∘ List.ret) <+~ (sublists l).map (↑)
+ show l.map (((↑) : List α → Multiset α) ∘ pure) <+~ (sublists l).map (↑)
rw [← List.map_map]
- exact ((map_ret_sublist_sublists _).map _).subperm
+ exact ((map_pure_sublist_sublists _).map _).subperm
#align multiset.map_single_le_powerset Multiset.map_single_le_powerset
@[simp]
@@ -57,7 +57,7 @@ theorem powersetAux'_nil : powersetAux' (@nil α) = [0] :=
@[simp]
theorem powersetAux'_cons (a : α) (l : List α) :
powersetAux' (a :: l) = powersetAux' l ++ List.map (cons a) (powersetAux' l) := by
- simp [powersetAux']; rfl
+ simp only [powersetAux', sublists'_cons, map_append, List.map_map, append_cancel_left_eq]; rfl
#align multiset.powerset_aux'_cons Multiset.powersetAux'_cons
theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂ := by
@@ -102,7 +102,9 @@ theorem powerset_zero : @powerset α 0 = {0} :=
@[simp]
theorem powerset_cons (a : α) (s) : powerset (a ::ₘ s) = powerset s + map (cons a) (powerset s) :=
- Quotient.inductionOn s fun l => by simp; rfl
+ Quotient.inductionOn s fun l => by
+ simp only [quot_mk_to_coe, cons_coe, powerset_coe', sublists'_cons, map_append, List.map_map,
+ map_coe, coe_add, coe_eq_coe]; rfl
#align multiset.powerset_cons Multiset.powerset_cons
@[simp]
@@ -206,7 +208,8 @@ theorem powersetCardAux_nil (n : ℕ) : powersetCardAux (n + 1) (@nil α) = [] :
theorem powersetCardAux_cons (n : ℕ) (a : α) (l : List α) :
powersetCardAux (n + 1) (a :: l) =
powersetCardAux (n + 1) l ++ List.map (cons a) (powersetCardAux n l) := by
- simp [powersetCardAux_eq_map_coe]; rfl
+ simp only [powersetCardAux_eq_map_coe, sublistsLen_succ_cons, map_append, List.map_map,
+ append_cancel_left_eq]; rfl
#align multiset.powerset_len_aux_cons Multiset.powersetCardAux_cons
theorem powersetCardAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
@@ -23,7 +23,7 @@ variable {α : Type*}
/-! ### powerset -/
--- Porting note: TODO: Write a more efficient version
+-- Porting note (#11215): TODO: Write a more efficient version
/-- A helper function for the powerset of a multiset. Given a list `l`, returns a list
of sublists of `l` as multisets. -/
def powersetAux (l : List α) : List (Multiset α) :=
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -23,7 +23,7 @@ variable {α : Type*}
/-! ### powerset -/
---Porting note: TODO: Write a more efficient version
+-- Porting note: TODO: Write a more efficient version
/-- A helper function for the powerset of a multiset. Given a list `l`, returns a list
of sublists of `l` as multisets. -/
def powersetAux (l : List α) : List (Multiset α) :=
@@ -138,7 +138,7 @@ theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux
exact Quot.sound (revzip_sublists' _ _ _ h)
#align multiset.revzip_powerset_aux' Multiset.revzip_powersetAux'
---Porting note: I don't understand why `{α : Type u}` is necessary here
+-- Porting note: I don't understand why `{α : Type u}` is necessary here
theorem revzip_powersetAux_lemma {α : Type u} [DecidableEq α] (l : List α) {l' : List (Multiset α)}
(H : ∀ ⦃x : _ × _⦄, x ∈ revzip l' → x.1 + x.2 = ↑l) :
revzip l' = l'.map fun x => (x, (l : Multiset α) - x) := by
List → Multiset
(#11099)
These did not respect the naming convention by having the coe
as a prefix instead of a suffix, or vice-versa. Also add a bunch of norm_cast
@@ -112,7 +112,7 @@ theorem mem_powerset {s t : Multiset α} : s ∈ powerset t ↔ s ≤ t :=
theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset s :=
Quotient.inductionOn s fun l => by
- simp only [powerset_coe, quot_mk_to_coe, coe_le, coe_map]
+ simp only [powerset_coe, quot_mk_to_coe, coe_le, map_coe]
show l.map (((↑) : List α → Multiset α) ∘ List.ret) <+~ (sublists l).map (↑)
rw [← List.map_map]
exact ((map_ret_sublist_sublists _).map _).subperm
slow / slower
porting notes (#11084)
Classifies by adding issue number #11083 to porting notes claiming anything semantically equivalent to:
attribute
because it caused extremely slow tactic
"@@ -78,7 +78,7 @@ theorem powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux l
(powerset_aux'_perm p).trans powersetAux_perm_powersetAux'.symm
#align multiset.powerset_aux_perm Multiset.powersetAux_perm
---Porting note: slightly slower implementation due to `map ofList`
+--Porting note (#11083): slightly slower implementation due to `map ofList`
/-- The power set of a multiset. -/
def powerset (s : Multiset α) : Multiset (Multiset α) :=
Quot.liftOn s
@@ -287,15 +287,15 @@ theorem powersetCard_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
#align multiset.powerset_len_mono Multiset.powersetCard_mono
@[simp]
-theorem powersetCard_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card s < n) :
+theorem powersetCard_eq_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card s < n) :
powersetCard n s = 0 :=
card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetCard _ _)
-#align multiset.powerset_len_empty Multiset.powersetCard_empty
+#align multiset.powerset_len_empty Multiset.powersetCard_eq_empty
@[simp]
theorem powersetCard_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
s.powersetCard (card s + i) = 0 :=
- powersetCard_empty _ (lt_add_of_pos_right (card s) hi)
+ powersetCard_eq_empty _ (lt_add_of_pos_right (card s) hi)
#align multiset.powerset_len_card_add Multiset.powersetCard_card_add
theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
Finset/Multiset.powersetCard 1
(#9137)
for [#9130](https://github.com/leanprover-community/mathlib4/pull/9130/files#r1429368677)
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
@@ -258,6 +258,10 @@ theorem powersetCard_cons (n : ℕ) (a : α) (s) :
Quotient.inductionOn s fun l => by simp [powersetCard_coe']
#align multiset.powerset_len_cons Multiset.powersetCard_cons
+theorem powersetCard_one (s : Multiset α) : powersetCard 1 s = s.map singleton :=
+ Quotient.inductionOn s fun l ↦ by
+ simp [powersetCard_coe, sublistsLen_one, map_reverse, Function.comp]
+
@[simp]
theorem mem_powersetCard {n : ℕ} {s t : Multiset α} : s ∈ powersetCard n t ↔ s ≤ t ∧ card s = n :=
Quotient.inductionOn t fun l => by simp [powersetCard_coe']
@@ -322,7 +322,7 @@ theorem nodup_powerset {s : Multiset α} : Nodup (powerset s) ↔ Nodup s :=
simp only [quot_mk_to_coe, powerset_coe', coe_nodup]
refine' (nodup_sublists'.2 h).map_on _
exact fun x sx y sy e =>
- (h.sublist_ext (mem_sublists'.1 sx) (mem_sublists'.1 sy)).1 (Quotient.exact e)⟩
+ (h.perm_iff_eq_of_sublist (mem_sublists'.1 sx) (mem_sublists'.1 sy)).1 (Quotient.exact e)⟩
#align multiset.nodup_powerset Multiset.nodup_powerset
alias ⟨Nodup.ofPowerset, Nodup.powerset⟩ := nodup_powerset
Removes nonterminal simps on lines looking like simp [...]
@@ -163,7 +163,8 @@ theorem revzip_powersetAux_perm_aux' {l : List α} :
theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) :
revzip (powersetAux l₁) ~ revzip (powersetAux l₂) := by
haveI := Classical.decEq α
- simp [fun l : List α => revzip_powersetAux_lemma l revzip_powersetAux, coe_eq_coe.2 p]
+ simp only [fun l : List α => revzip_powersetAux_lemma l revzip_powersetAux, coe_eq_coe.2 p,
+ ge_iff_le]
exact (powersetAux_perm p).map _
#align multiset.revzip_powerset_aux_perm Multiset.revzip_powersetAux_perm
@@ -184,7 +185,8 @@ theorem powersetCardAux_eq_map_coe {n} {l : List α} :
@[simp]
theorem mem_powersetCardAux {n} {l : List α} {s} : s ∈ powersetCardAux n l ↔ s ≤ ↑l ∧ card s = n :=
Quotient.inductionOn s <| by
- simp [powersetCardAux_eq_map_coe, Subperm]
+ simp only [quot_mk_to_coe, powersetCardAux_eq_map_coe, List.mem_map, mem_sublistsLen,
+ coe_eq_coe, coe_le, Subperm, exists_prop, coe_card]
exact fun l₁ =>
⟨fun ⟨l₂, ⟨s, e⟩, p⟩ => ⟨⟨_, p, s⟩, p.symm.length_eq.trans e⟩,
fun ⟨⟨l₂, p, s⟩, e⟩ => ⟨_, ⟨s, p.length_eq.trans e⟩, p⟩⟩
@@ -167,148 +167,148 @@ theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) :
exact (powersetAux_perm p).map _
#align multiset.revzip_powerset_aux_perm Multiset.revzip_powersetAux_perm
-/-! ### powersetLen -/
+/-! ### powersetCard -/
-/-- Helper function for `powersetLen`. Given a list `l`, `powersetLenAux n l` is the list
+/-- Helper function for `powersetCard`. Given a list `l`, `powersetCardAux n l` is the list
of sublists of length `n`, as multisets. -/
-def powersetLenAux (n : ℕ) (l : List α) : List (Multiset α) :=
+def powersetCardAux (n : ℕ) (l : List α) : List (Multiset α) :=
sublistsLenAux n l (↑) []
-#align multiset.powerset_len_aux Multiset.powersetLenAux
+#align multiset.powerset_len_aux Multiset.powersetCardAux
-theorem powersetLenAux_eq_map_coe {n} {l : List α} :
- powersetLenAux n l = (sublistsLen n l).map (↑) := by
- rw [powersetLenAux, sublistsLenAux_eq, append_nil]
-#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetLenAux_eq_map_coe
+theorem powersetCardAux_eq_map_coe {n} {l : List α} :
+ powersetCardAux n l = (sublistsLen n l).map (↑) := by
+ rw [powersetCardAux, sublistsLenAux_eq, append_nil]
+#align multiset.powerset_len_aux_eq_map_coe Multiset.powersetCardAux_eq_map_coe
@[simp]
-theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔ s ≤ ↑l ∧ card s = n :=
+theorem mem_powersetCardAux {n} {l : List α} {s} : s ∈ powersetCardAux n l ↔ s ≤ ↑l ∧ card s = n :=
Quotient.inductionOn s <| by
- simp [powersetLenAux_eq_map_coe, Subperm]
+ simp [powersetCardAux_eq_map_coe, Subperm]
exact fun l₁ =>
⟨fun ⟨l₂, ⟨s, e⟩, p⟩ => ⟨⟨_, p, s⟩, p.symm.length_eq.trans e⟩,
fun ⟨⟨l₂, p, s⟩, e⟩ => ⟨_, ⟨s, p.length_eq.trans e⟩, p⟩⟩
-#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAux
+#align multiset.mem_powerset_len_aux Multiset.mem_powersetCardAux
@[simp]
-theorem powersetLenAux_zero (l : List α) : powersetLenAux 0 l = [0] := by
- simp [powersetLenAux_eq_map_coe]
-#align multiset.powerset_len_aux_zero Multiset.powersetLenAux_zero
+theorem powersetCardAux_zero (l : List α) : powersetCardAux 0 l = [0] := by
+ simp [powersetCardAux_eq_map_coe]
+#align multiset.powerset_len_aux_zero Multiset.powersetCardAux_zero
@[simp]
-theorem powersetLenAux_nil (n : ℕ) : powersetLenAux (n + 1) (@nil α) = [] :=
+theorem powersetCardAux_nil (n : ℕ) : powersetCardAux (n + 1) (@nil α) = [] :=
rfl
-#align multiset.powerset_len_aux_nil Multiset.powersetLenAux_nil
+#align multiset.powerset_len_aux_nil Multiset.powersetCardAux_nil
@[simp]
-theorem powersetLenAux_cons (n : ℕ) (a : α) (l : List α) :
- powersetLenAux (n + 1) (a :: l) =
- powersetLenAux (n + 1) l ++ List.map (cons a) (powersetLenAux n l) := by
- simp [powersetLenAux_eq_map_coe]; rfl
-#align multiset.powerset_len_aux_cons Multiset.powersetLenAux_cons
-
-theorem powersetLenAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
- powersetLenAux n l₁ ~ powersetLenAux n l₂ := by
+theorem powersetCardAux_cons (n : ℕ) (a : α) (l : List α) :
+ powersetCardAux (n + 1) (a :: l) =
+ powersetCardAux (n + 1) l ++ List.map (cons a) (powersetCardAux n l) := by
+ simp [powersetCardAux_eq_map_coe]; rfl
+#align multiset.powerset_len_aux_cons Multiset.powersetCardAux_cons
+
+theorem powersetCardAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
+ powersetCardAux n l₁ ~ powersetCardAux n l₂ := by
induction' n with n IHn generalizing l₁ l₂
· simp
induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂
· rfl
- · simp only [powersetLenAux_cons]
+ · simp only [powersetCardAux_cons]
exact IH.append ((IHn p).map _)
- · simp only [powersetLenAux_cons, append_assoc]
+ · simp only [powersetCardAux_cons, append_assoc]
apply Perm.append_left
cases n
· simp [Perm.swap]
- simp only [powersetLenAux_cons, map_append, List.map_map]
+ simp only [powersetCardAux_cons, map_append, List.map_map]
rw [← append_assoc, ← append_assoc,
(by funext s; simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
exact perm_append_comm.append_right _
· exact IH₁.trans IH₂
-#align multiset.powerset_len_aux_perm Multiset.powersetLenAux_perm
+#align multiset.powerset_len_aux_perm Multiset.powersetCardAux_perm
-/-- `powersetLen n s` is the multiset of all submultisets of `s` of length `n`. -/
-def powersetLen (n : ℕ) (s : Multiset α) : Multiset (Multiset α) :=
- Quot.liftOn s (fun l => (powersetLenAux n l : Multiset (Multiset α))) fun _ _ h =>
- Quot.sound (powersetLenAux_perm h)
-#align multiset.powerset_len Multiset.powersetLen
+/-- `powersetCard n s` is the multiset of all submultisets of `s` of length `n`. -/
+def powersetCard (n : ℕ) (s : Multiset α) : Multiset (Multiset α) :=
+ Quot.liftOn s (fun l => (powersetCardAux n l : Multiset (Multiset α))) fun _ _ h =>
+ Quot.sound (powersetCardAux_perm h)
+#align multiset.powerset_len Multiset.powersetCard
-theorem powersetLen_coe' (n) (l : List α) : @powersetLen α n l = powersetLenAux n l :=
+theorem powersetCard_coe' (n) (l : List α) : @powersetCard α n l = powersetCardAux n l :=
rfl
-#align multiset.powerset_len_coe' Multiset.powersetLen_coe'
+#align multiset.powerset_len_coe' Multiset.powersetCard_coe'
-theorem powersetLen_coe (n) (l : List α) :
- @powersetLen α n l = ((sublistsLen n l).map (↑) : List (Multiset α)) :=
- congr_arg ((↑) : List (Multiset α) → Multiset (Multiset α)) powersetLenAux_eq_map_coe
-#align multiset.powerset_len_coe Multiset.powersetLen_coe
+theorem powersetCard_coe (n) (l : List α) :
+ @powersetCard α n l = ((sublistsLen n l).map (↑) : List (Multiset α)) :=
+ congr_arg ((↑) : List (Multiset α) → Multiset (Multiset α)) powersetCardAux_eq_map_coe
+#align multiset.powerset_len_coe Multiset.powersetCard_coe
@[simp]
-theorem powersetLen_zero_left (s : Multiset α) : powersetLen 0 s = {0} :=
- Quotient.inductionOn s fun l => by simp [powersetLen_coe']
-#align multiset.powerset_len_zero_left Multiset.powersetLen_zero_left
+theorem powersetCard_zero_left (s : Multiset α) : powersetCard 0 s = {0} :=
+ Quotient.inductionOn s fun l => by simp [powersetCard_coe']
+#align multiset.powerset_len_zero_left Multiset.powersetCard_zero_left
-theorem powersetLen_zero_right (n : ℕ) : @powersetLen α (n + 1) 0 = 0 :=
+theorem powersetCard_zero_right (n : ℕ) : @powersetCard α (n + 1) 0 = 0 :=
rfl
-#align multiset.powerset_len_zero_right Multiset.powersetLen_zero_right
+#align multiset.powerset_len_zero_right Multiset.powersetCard_zero_right
@[simp]
-theorem powersetLen_cons (n : ℕ) (a : α) (s) :
- powersetLen (n + 1) (a ::ₘ s) = powersetLen (n + 1) s + map (cons a) (powersetLen n s) :=
- Quotient.inductionOn s fun l => by simp [powersetLen_coe']
-#align multiset.powerset_len_cons Multiset.powersetLen_cons
+theorem powersetCard_cons (n : ℕ) (a : α) (s) :
+ powersetCard (n + 1) (a ::ₘ s) = powersetCard (n + 1) s + map (cons a) (powersetCard n s) :=
+ Quotient.inductionOn s fun l => by simp [powersetCard_coe']
+#align multiset.powerset_len_cons Multiset.powersetCard_cons
@[simp]
-theorem mem_powersetLen {n : ℕ} {s t : Multiset α} : s ∈ powersetLen n t ↔ s ≤ t ∧ card s = n :=
- Quotient.inductionOn t fun l => by simp [powersetLen_coe']
-#align multiset.mem_powerset_len Multiset.mem_powersetLen
+theorem mem_powersetCard {n : ℕ} {s t : Multiset α} : s ∈ powersetCard n t ↔ s ≤ t ∧ card s = n :=
+ Quotient.inductionOn t fun l => by simp [powersetCard_coe']
+#align multiset.mem_powerset_len Multiset.mem_powersetCard
@[simp]
-theorem card_powersetLen (n : ℕ) (s : Multiset α) :
- card (powersetLen n s) = Nat.choose (card s) n :=
- Quotient.inductionOn s <| by simp [powersetLen_coe]
-#align multiset.card_powerset_len Multiset.card_powersetLen
+theorem card_powersetCard (n : ℕ) (s : Multiset α) :
+ card (powersetCard n s) = Nat.choose (card s) n :=
+ Quotient.inductionOn s <| by simp [powersetCard_coe]
+#align multiset.card_powerset_len Multiset.card_powersetCard
-theorem powersetLen_le_powerset (n : ℕ) (s : Multiset α) : powersetLen n s ≤ powerset s :=
+theorem powersetCard_le_powerset (n : ℕ) (s : Multiset α) : powersetCard n s ≤ powerset s :=
Quotient.inductionOn s fun l => by
- simp only [quot_mk_to_coe, powersetLen_coe, powerset_coe', coe_le]
+ simp only [quot_mk_to_coe, powersetCard_coe, powerset_coe', coe_le]
exact ((sublistsLen_sublist_sublists' _ _).map _).subperm
-#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powerset
+#align multiset.powerset_len_le_powerset Multiset.powersetCard_le_powerset
-theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
- powersetLen n s ≤ powersetLen n t :=
+theorem powersetCard_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
+ powersetCard n s ≤ powersetCard n t :=
leInductionOn h fun {l₁ l₂} h => by
- simp only [powersetLen_coe, coe_le]
+ simp only [powersetCard_coe, coe_le]
exact ((sublistsLen_sublist_of_sublist _ h).map _).subperm
-#align multiset.powerset_len_mono Multiset.powersetLen_mono
+#align multiset.powerset_len_mono Multiset.powersetCard_mono
@[simp]
-theorem powersetLen_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card s < n) :
- powersetLen n s = 0 :=
- card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetLen _ _)
-#align multiset.powerset_len_empty Multiset.powersetLen_empty
+theorem powersetCard_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card s < n) :
+ powersetCard n s = 0 :=
+ card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetCard _ _)
+#align multiset.powerset_len_empty Multiset.powersetCard_empty
@[simp]
-theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
- s.powersetLen (card s + i) = 0 :=
- powersetLen_empty _ (lt_add_of_pos_right (card s) hi)
-#align multiset.powerset_len_card_add Multiset.powersetLen_card_add
+theorem powersetCard_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
+ s.powersetCard (card s + i) = 0 :=
+ powersetCard_empty _ (lt_add_of_pos_right (card s) hi)
+#align multiset.powerset_len_card_add Multiset.powersetCard_card_add
-theorem powersetLen_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
- powersetLen n (s.map f) = (powersetLen n s).map (map f) := by
+theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
+ powersetCard n (s.map f) = (powersetCard n s).map (map f) := by
induction' s using Multiset.induction with t s ih generalizing n
- · cases n <;> simp [powersetLen_zero_left, powersetLen_zero_right]
+ · cases n <;> simp [powersetCard_zero_left, powersetCard_zero_right]
· cases n <;> simp [ih, map_comp_cons]
-#align multiset.powerset_len_map Multiset.powersetLen_map
+#align multiset.powerset_len_map Multiset.powersetCard_map
-theorem pairwise_disjoint_powersetLen (s : Multiset α) :
- _root_.Pairwise fun i j => Multiset.Disjoint (s.powersetLen i) (s.powersetLen j) :=
+theorem pairwise_disjoint_powersetCard (s : Multiset α) :
+ _root_.Pairwise fun i j => Multiset.Disjoint (s.powersetCard i) (s.powersetCard j) :=
fun _ _ h _ hi hj =>
- h (Eq.trans (Multiset.mem_powersetLen.mp hi).right.symm (Multiset.mem_powersetLen.mp hj).right)
-#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetLen
+ h (Eq.trans (Multiset.mem_powersetCard.mp hi).right.symm (Multiset.mem_powersetCard.mp hj).right)
+#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetCard
theorem bind_powerset_len {α : Type*} (S : Multiset α) :
- (bind (Multiset.range (card S + 1)) fun k => S.powersetLen k) = S.powerset := by
+ (bind (Multiset.range (card S + 1)) fun k => S.powersetCard k) = S.powerset := by
induction S using Quotient.inductionOn
- simp_rw [quot_mk_to_coe, powerset_coe', powersetLen_coe, ← coe_range, coe_bind, ← List.bind_map,
+ simp_rw [quot_mk_to_coe, powerset_coe', powersetCard_coe, ← coe_range, coe_bind, ← List.bind_map,
coe_card]
exact coe_eq_coe.mpr ((List.range_bind_sublistsLen_perm _).map _)
#align multiset.bind_powerset_len Multiset.bind_powerset_len
@@ -327,9 +327,9 @@ alias ⟨Nodup.ofPowerset, Nodup.powerset⟩ := nodup_powerset
#align multiset.nodup.of_powerset Multiset.Nodup.ofPowerset
#align multiset.nodup.powerset Multiset.Nodup.powerset
-protected theorem Nodup.powersetLen {n : ℕ} {s : Multiset α} (h : Nodup s) :
- Nodup (powersetLen n s) :=
- nodup_of_le (powersetLen_le_powerset _ _) (nodup_powerset.2 h)
-#align multiset.nodup.powerset_len Multiset.Nodup.powersetLen
+protected theorem Nodup.powersetCard {n : ℕ} {s : Multiset α} (h : Nodup s) :
+ Nodup (powersetCard n s) :=
+ nodup_of_le (powersetCard_le_powerset _ _) (nodup_powerset.2 h)
+#align multiset.nodup.powerset_len Multiset.Nodup.powersetCard
end Multiset
@@ -323,7 +323,7 @@ theorem nodup_powerset {s : Multiset α} : Nodup (powerset s) ↔ Nodup s :=
(h.sublist_ext (mem_sublists'.1 sx) (mem_sublists'.1 sy)).1 (Quotient.exact e)⟩
#align multiset.nodup_powerset Multiset.nodup_powerset
-alias nodup_powerset ↔ Nodup.ofPowerset Nodup.powerset
+alias ⟨Nodup.ofPowerset, Nodup.powerset⟩ := nodup_powerset
#align multiset.nodup.of_powerset Multiset.Nodup.ofPowerset
#align multiset.nodup.powerset Multiset.Nodup.powerset
Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.
The intent of this PR is to make autoImplicit
opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true
in the few files that rely on it.
That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.
I claim that many of the uses of autoImplicit
in these files are accidental; situations such as:
variables
are in scope, but pasting the lemma in the wrong sectionHaving set_option autoImplicit false
as the default prevents these types of mistake being made in the 90% of files where autoImplicit
s are not used at all, and causes them to be caught by CI during review.
I think there were various points during the port where we encouraged porters to delete the universes u v
lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.
A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18
as the no:dontcare:yes
vote ratio.
While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true
has been placed locally within a section, rather than at the top of the file.
@@ -12,6 +12,8 @@ import Mathlib.Data.Multiset.Nodup
# The powerset of a multiset
-/
+set_option autoImplicit true
+
namespace Multiset
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -17,7 +17,7 @@ namespace Multiset
open List
-variable {α : Type _}
+variable {α : Type*}
/-! ### powerset -/
@@ -279,7 +279,7 @@ theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
#align multiset.powerset_len_mono Multiset.powersetLen_mono
@[simp]
-theorem powersetLen_empty {α : Type _} (n : ℕ) {s : Multiset α} (h : card s < n) :
+theorem powersetLen_empty {α : Type*} (n : ℕ) {s : Multiset α} (h : card s < n) :
powersetLen n s = 0 :=
card_eq_zero.mp (Nat.choose_eq_zero_of_lt h ▸ card_powersetLen _ _)
#align multiset.powerset_len_empty Multiset.powersetLen_empty
@@ -290,7 +290,7 @@ theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
powersetLen_empty _ (lt_add_of_pos_right (card s) hi)
#align multiset.powerset_len_card_add Multiset.powersetLen_card_add
-theorem powersetLen_map {β : Type _} (f : α → β) (n : ℕ) (s : Multiset α) :
+theorem powersetLen_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) :
powersetLen n (s.map f) = (powersetLen n s).map (map f) := by
induction' s using Multiset.induction with t s ih generalizing n
· cases n <;> simp [powersetLen_zero_left, powersetLen_zero_right]
@@ -303,7 +303,7 @@ theorem pairwise_disjoint_powersetLen (s : Multiset α) :
h (Eq.trans (Multiset.mem_powersetLen.mp hi).right.symm (Multiset.mem_powersetLen.mp hj).right)
#align multiset.pairwise_disjoint_powerset_len Multiset.pairwise_disjoint_powersetLen
-theorem bind_powerset_len {α : Type _} (S : Multiset α) :
+theorem bind_powerset_len {α : Type*} (S : Multiset α) :
(bind (Multiset.range (card S + 1)) fun k => S.powersetLen k) = S.powerset := by
induction S using Quotient.inductionOn
simp_rw [quot_mk_to_coe, powerset_coe', powersetLen_coe, ← coe_range, coe_bind, ← List.bind_map,
@@ -2,15 +2,12 @@
Copyright (c) 2018 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.multiset.powerset
-! leanprover-community/mathlib commit 9003f28797c0664a49e4179487267c494477d853
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.List.Sublists
import Mathlib.Data.Multiset.Nodup
+#align_import data.multiset.powerset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
+
/-!
# The powerset of a multiset
-/
Notably incorporates https://github.com/leanprover/std4/pull/98 and https://github.com/leanprover/std4/pull/109.
https://github.com/leanprover/std4/pull/98 moves a number of lemmas from Mathlib to Std, so the bump requires deleting them in Mathlib. I did check on each lemma whether its attributes were kept in the move (and gave attribute markings in Mathlib if they were not present in Std), but a reviewer may wish to re-check.
List.mem_map
changed statement from b ∈ l.map f ↔ ∃ a, a ∈ l ∧ b = f a
to b ∈ l.map f ↔ ∃ a, a ∈ l ∧ f a = b
. Similarly for List.exists_of_mem_map
. This was a deliberate change, so I have simply adjusted proofs (many become simpler, which supports the change). I also deleted List.mem_map'
, List.exists_of_mem_map'
, which were temporary versions in Mathlib while waiting for this change (replacing their uses with the unprimed versions).
Also, the lemma sublist_nil_iff_eq_nil
seems to have been renamed to sublist_nil
during the move, so I added an alias for the old name.
(another issue fixed during review by @digama0) List.Sublist.filter
had an argument change from explicit to implicit. This appears to have been an oversight (cc @JamesGallicchio). I have temporarily introduced List.Sublist.filter'
with the argument explicit, and replaced Mathlib uses of Sublist.filter
with Sublist.filter'
. Later we can fix the argument in Std, and then delete List.Sublist.filter'
.
@@ -125,7 +125,7 @@ theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
#align multiset.card_powerset Multiset.card_powerset
theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l := by
- rw [revzip, powersetAux_eq_map_coe, ← map_reverse, zip_map, ← revzip, mem_map'] at h
+ rw [revzip, powersetAux_eq_map_coe, ← map_reverse, zip_map, ← revzip, List.mem_map] at h
simp only [Prod_map, Prod.exists] at h
rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists _ _ _ h)
@@ -133,7 +133,7 @@ theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux
theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) :
x.1 + x.2 = ↑l := by
- rw [revzip, powersetAux', ← map_reverse, zip_map, ← revzip, mem_map'] at h
+ rw [revzip, powersetAux', ← map_reverse, zip_map, ← revzip, List.mem_map] at h
simp only [Prod_map, Prod.exists] at h
rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists' _ _ _ h)
@@ -61,8 +61,7 @@ theorem powersetAux'_cons (a : α) (l : List α) :
simp [powersetAux']; rfl
#align multiset.powerset_aux'_cons Multiset.powersetAux'_cons
-theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂ :=
- by
+theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂ := by
induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂
· simp
· simp only [powersetAux'_cons]
@@ -125,16 +124,15 @@ theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
Quotient.inductionOn s <| by simp
#align multiset.card_powerset Multiset.card_powerset
-theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l :=
- by
+theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l := by
rw [revzip, powersetAux_eq_map_coe, ← map_reverse, zip_map, ← revzip, mem_map'] at h
simp only [Prod_map, Prod.exists] at h
rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists _ _ _ h)
#align multiset.revzip_powerset_aux Multiset.revzip_powersetAux
-theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) : x.1 + x.2 = ↑l :=
- by
+theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) :
+ x.1 + x.2 = ↑l := by
rw [revzip, powersetAux', ← map_reverse, zip_map, ← revzip, mem_map'] at h
simp only [Prod_map, Prod.exists] at h
rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
@@ -206,8 +204,8 @@ theorem powersetLenAux_nil (n : ℕ) : powersetLenAux (n + 1) (@nil α) = [] :=
@[simp]
theorem powersetLenAux_cons (n : ℕ) (a : α) (l : List α) :
powersetLenAux (n + 1) (a :: l) =
- powersetLenAux (n + 1) l ++ List.map (cons a) (powersetLenAux n l) :=
- by simp [powersetLenAux_eq_map_coe]; rfl
+ powersetLenAux (n + 1) l ++ List.map (cons a) (powersetLenAux n l) := by
+ simp [powersetLenAux_eq_map_coe]; rfl
#align multiset.powerset_len_aux_cons Multiset.powersetLenAux_cons
theorem powersetLenAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
@@ -63,10 +63,11 @@ theorem powersetAux'_cons (a : α) (l : List α) :
theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂ :=
by
- induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂; · simp
+ induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂
· simp
+ · simp only [powersetAux'_cons]
exact IH.append (IH.map _)
- · simp
+ · simp only [powersetAux'_cons, map_append, List.map_map, append_assoc]
apply Perm.append_left
rw [← append_assoc, ← append_assoc,
(by funext s; simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
@@ -126,15 +127,17 @@ theorem card_powerset (s : Multiset α) : card (powerset s) = 2 ^ card s :=
theorem revzip_powersetAux {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux l)) : x.1 + x.2 = ↑l :=
by
- rw [revzip, powersetAux_eq_map_coe, ← map_reverse, zip_map, ← revzip] at h
- simp at h; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
+ rw [revzip, powersetAux_eq_map_coe, ← map_reverse, zip_map, ← revzip, mem_map'] at h
+ simp only [Prod_map, Prod.exists] at h
+ rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists _ _ _ h)
#align multiset.revzip_powerset_aux Multiset.revzip_powersetAux
theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) : x.1 + x.2 = ↑l :=
by
- rw [revzip, powersetAux', ← map_reverse, zip_map, ← revzip] at h
- simp at h; rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
+ rw [revzip, powersetAux', ← map_reverse, zip_map, ← revzip, mem_map'] at h
+ simp only [Prod_map, Prod.exists] at h
+ rcases h with ⟨l₁, l₂, h, rfl, rfl⟩
exact Quot.sound (revzip_sublists' _ _ _ h)
#align multiset.revzip_powerset_aux' Multiset.revzip_powersetAux'
@@ -144,8 +147,7 @@ theorem revzip_powersetAux_lemma {α : Type u} [DecidableEq α] (l : List α) {l
revzip l' = l'.map fun x => (x, (l : Multiset α) - x) := by
have :
Forall₂ (fun (p : Multiset α × Multiset α) (s : Multiset α) => p = (s, ↑l - s)) (revzip l')
- ((revzip l').map Prod.fst) :=
- by
+ ((revzip l').map Prod.fst) := by
rw [forall₂_map_right_iff, forall₂_same]
rintro ⟨s, t⟩ h
dsimp
@@ -157,14 +159,12 @@ theorem revzip_powersetAux_lemma {α : Type u} [DecidableEq α] (l : List α) {l
theorem revzip_powersetAux_perm_aux' {l : List α} :
revzip (powersetAux l) ~ revzip (powersetAux' l) := by
haveI := Classical.decEq α
- rw [revzip_powersetAux_lemma l revzip_powersetAux,
- revzip_powersetAux_lemma l revzip_powersetAux']
+ rw [revzip_powersetAux_lemma l revzip_powersetAux, revzip_powersetAux_lemma l revzip_powersetAux']
exact powersetAux_perm_powersetAux'.map _
#align multiset.revzip_powerset_aux_perm_aux' Multiset.revzip_powersetAux_perm_aux'
theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) :
- revzip (powersetAux l₁) ~ revzip (powersetAux l₂) :=
- by
+ revzip (powersetAux l₁) ~ revzip (powersetAux l₂) := by
haveI := Classical.decEq α
simp [fun l : List α => revzip_powersetAux_lemma l revzip_powersetAux, coe_eq_coe.2 p]
exact (powersetAux_perm p).map _
@@ -187,10 +187,10 @@ theorem powersetLenAux_eq_map_coe {n} {l : List α} :
@[simp]
theorem mem_powersetLenAux {n} {l : List α} {s} : s ∈ powersetLenAux n l ↔ s ≤ ↑l ∧ card s = n :=
Quotient.inductionOn s <| by
- simp [powersetLenAux_eq_map_coe, Subperm];
- exact fun l₁ =>
- ⟨fun ⟨l₂, ⟨s, e⟩, p⟩ => ⟨⟨_, p, s⟩, p.symm.length_eq.trans e⟩, fun ⟨⟨l₂, p, s⟩, e⟩ =>
- ⟨_, ⟨s, p.length_eq.trans e⟩, p⟩⟩
+ simp [powersetLenAux_eq_map_coe, Subperm]
+ exact fun l₁ =>
+ ⟨fun ⟨l₂, ⟨s, e⟩, p⟩ => ⟨⟨_, p, s⟩, p.symm.length_eq.trans e⟩,
+ fun ⟨⟨l₂, p, s⟩, e⟩ => ⟨_, ⟨s, p.length_eq.trans e⟩, p⟩⟩
#align multiset.mem_powerset_len_aux Multiset.mem_powersetLenAux
@[simp]
@@ -211,18 +211,18 @@ theorem powersetLenAux_cons (n : ℕ) (a : α) (l : List α) :
#align multiset.powerset_len_aux_cons Multiset.powersetLenAux_cons
theorem powersetLenAux_perm {n} {l₁ l₂ : List α} (p : l₁ ~ l₂) :
- powersetLenAux n l₁ ~ powersetLenAux n l₂ :=
- by
- induction' n with n IHn generalizing l₁ l₂; · simp
- induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂; · rfl
+ powersetLenAux n l₁ ~ powersetLenAux n l₂ := by
+ induction' n with n IHn generalizing l₁ l₂
· simp
+ induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂
+ · rfl
+ · simp only [powersetLenAux_cons]
exact IH.append ((IHn p).map _)
- · simp
+ · simp only [powersetLenAux_cons, append_assoc]
apply Perm.append_left
cases n
- · simp
- apply Perm.swap
- simp
+ · simp [Perm.swap]
+ simp only [powersetLenAux_cons, map_append, List.map_map]
rw [← append_assoc, ← append_assoc,
(by funext s; simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
exact perm_append_comm.append_right _
@@ -272,13 +272,15 @@ theorem card_powersetLen (n : ℕ) (s : Multiset α) :
theorem powersetLen_le_powerset (n : ℕ) (s : Multiset α) : powersetLen n s ≤ powerset s :=
Quotient.inductionOn s fun l => by
- simp [powersetLen_coe]; exact ((sublistsLen_sublist_sublists' _ _).map _).subperm
+ simp only [quot_mk_to_coe, powersetLen_coe, powerset_coe', coe_le]
+ exact ((sublistsLen_sublist_sublists' _ _).map _).subperm
#align multiset.powerset_len_le_powerset Multiset.powersetLen_le_powerset
theorem powersetLen_mono (n : ℕ) {s t : Multiset α} (h : s ≤ t) :
powersetLen n s ≤ powersetLen n t :=
- leInductionOn h @fun l₁ l₂ h => by
- simp [powersetLen_coe]; exact ((sublistsLen_sublist_of_sublist _ h).map _).subperm
+ leInductionOn h fun {l₁ l₂} h => by
+ simp only [powersetLen_coe, coe_le]
+ exact ((sublistsLen_sublist_of_sublist _ h).map _).subperm
#align multiset.powerset_len_mono Multiset.powersetLen_mono
@[simp]
@@ -294,8 +296,7 @@ theorem powersetLen_card_add (s : Multiset α) {i : ℕ} (hi : 0 < i) :
#align multiset.powerset_len_card_add Multiset.powersetLen_card_add
theorem powersetLen_map {β : Type _} (f : α → β) (n : ℕ) (s : Multiset α) :
- powersetLen n (s.map f) = (powersetLen n s).map (map f) :=
- by
+ powersetLen n (s.map f) = (powersetLen n s).map (map f) := by
induction' s using Multiset.induction with t s ih generalizing n
· cases n <;> simp [powersetLen_zero_left, powersetLen_zero_right]
· cases n <;> simp [ih, map_comp_cons]
@@ -319,9 +320,10 @@ theorem bind_powerset_len {α : Type _} (S : Multiset α) :
theorem nodup_powerset {s : Multiset α} : Nodup (powerset s) ↔ Nodup s :=
⟨fun h => (nodup_of_le (map_single_le_powerset _) h).of_map _,
Quotient.inductionOn s fun l h => by
- simp; refine' (nodup_sublists'.2 h).map_on _;
- exact fun x sx y sy e =>
- (h.sublist_ext (mem_sublists'.1 sx) (mem_sublists'.1 sy)).1 (Quotient.exact e)⟩
+ simp only [quot_mk_to_coe, powerset_coe', coe_nodup]
+ refine' (nodup_sublists'.2 h).map_on _
+ exact fun x sx y sy e =>
+ (h.sublist_ext (mem_sublists'.1 sx) (mem_sublists'.1 sy)).1 (Quotient.exact e)⟩
#align multiset.nodup_powerset Multiset.nodup_powerset
alias nodup_powerset ↔ Nodup.ofPowerset Nodup.powerset
The unported dependencies are