declaration stringlengths 27 11.3k | file stringlengths 52 114 | context dict | tactic_states listlengths 1 1.24k |
|---|---|---|---|
lemma prod_of_injOn (e : ι → κ) (he : Set.InjOn e s) (hest : Set.MapsTo e s t)
(h' : ∀ i ∈ t, i ∉ e '' s → g i = 1) (h : ∀ i ∈ s, f i = g (e i)) :
∏ i ∈ s, f i = ∏ j ∈ t, g j := by
classical
exact (prod_nbij e (fun a ↦ mem_image_of_mem e) he (by simp [Set.surjOn_image]) h).trans <|
prod_subset (image_s... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}"
]
} | [
{
"line": "classical\n exact\n (prod_nbij e (fun a ↦ mem_image_of_mem e) he (by simp [Set.surjOn_image]) h).trans <|\n prod_subset (image_subset_iff.2 hest) <| by simpa using h'",
"before_state": "ι : Type u_1\nκ : Type u_2\nM : Type u_4\ninst✝ : CommMonoid M\ns : Finset ι\nt : Finset κ\nf : ι → M\ng :... |
lemma prod_fiberwise_eq_prod_filter' (s : Finset ι) (t : Finset κ) (g : ι → κ) (f : κ → M) :
∏ j ∈ t, ∏ i ∈ s with g i = j, f j = ∏ i ∈ s with g i ∈ t, f (g i) := by
calc
_ = ∏ j ∈ t, ∏ i ∈ s with g i = j, f (g i) :=
prod_congr rfl fun j _ ↦ prod_congr rfl fun i hi ↦ by rw [(mem_filter.1 hi).2]
_ ... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]"
]
} | [
{
"line": "calc\n _ = ∏ j ∈ t, ∏ i ∈ s with g i = j, f (g i) :=\n prod_congr rfl fun j _ ↦ prod_congr rfl fun i hi ↦ by rw [(mem_filter.1 hi).2]\n _ = _ := prod_fiberwise_eq_prod_filter _ _ _ _",
"before_state": "ι : Type u_1\nκ : Type u_2\nM : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : DecidableEq κ\ns ... |
lemma prod_fiberwise_of_maps_to' {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : κ → M) :
∏ j ∈ t, ∏ i ∈ s with g i = j, f j = ∏ i ∈ s, f (g i) := by
calc
_ = ∏ j ∈ t, ∏ i ∈ s with g i = j, f (g i) :=
prod_congr rfl fun y _ ↦ prod_congr rfl fun x hx ↦ by rw [(mem_filter.1 hx).2]
_ = _ := prod_fiberwise_of... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]"
]
} | [
{
"line": "calc\n _ = ∏ j ∈ t, ∏ i ∈ s with g i = j, f (g i) :=\n prod_congr rfl fun y _ ↦ prod_congr rfl fun x hx ↦ by rw [(mem_filter.1 hx).2]\n _ = _ := prod_fiberwise_of_maps_to h _",
"before_state": "ι : Type u_1\nκ : Type u_2\nM : Type u_4\ninst✝¹ : CommMonoid M\ns : Finset ι\nt : Finset κ\ninst✝... |
lemma prod_diag [DecidableEq ι] (s : Finset ι) (f : ι × ι → M) :
∏ i ∈ s.diag, f i = ∏ i ∈ s, f (i, i) := by
apply prod_nbij' Prod.fst (fun i ↦ (i, i)) <;> simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]"
]
} | [
{
"line": "focus\n apply prod_nbij' Prod.fst (fun i ↦ (i, i))\n with_annotate_state\"<;>\" skip\n all_goals simp",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : DecidableEq ι\ns : Finset ι\nf : ι × ι → M\n⊢ ∏ i ∈ s.diag, f i = ∏ i ∈ s, f (i, i)",
"after_state": "No Goals... |
theorem prod_filter (p : ι → Prop) [DecidablePred p] (f : ι → M) :
∏ a ∈ s with p a, f a = ∏ a ∈ s, if p a then f a else 1 :=
calc
∏ a ∈ s with p a, f a = ∏ a ∈ s with p a, if p a then f a else 1 :=
prod_congr rfl fun a h => by rw [if_pos]; simpa using (mem_filter.1 h).2
_ = ∏ a ∈ s, if p a then f a... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]"
]
} | [
{
"line": "{ refine prod_subset (filter_subset _ s) fun x hs h => ?_\n rw [mem_filter] at h\n rw [not_and] at h\n exact if_neg (by simpa using h hs)\n}",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝¹ : CommMonoid M\ns : Finset ι\np : ι → Prop\ninst✝ : DecidablePred p\nf : ι → M\n⊢ (∏ a ∈ {a ∈ s | p... |
theorem prod_eq_single_of_mem {s : Finset ι} {f : ι → M} (a : ι) (h : a ∈ s)
(h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x ∈ s, f x = f a := by
haveI := Classical.decEq ι
calc
∏ x ∈ s, f x = ∏ x ∈ {a}, f x := by
{ refine (prod_subset ?_ ?_).symm
· intro _ H
rwa [mem_singleton.1 H]
· ... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]"
]
} | [
{
"line": "haveI := Classical.decEq ι",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝ : CommMonoid M\ns : Finset ι\nf : ι → M\na : ι\nh : a ∈ s\nh₀ : ∀ b ∈ s, b ≠ a → f b = 1\n⊢ ∏ x ∈ s, f x = f a",
"after_state": "ι : Type u_1\nM : Type u_4\ninst✝ : CommMonoid M\ns : Finset ι\nf : ι → M\na : ι\nh ... |
theorem prod_subtype_map_embedding {p : ι → Prop} {s : Finset { x // p x }} {f : { x // p x } → M}
{g : ι → M} (h : ∀ x : { x // p x }, x ∈ s → g x = f x) :
(∏ x ∈ s.map (Function.Embedding.subtype _), g x) = ∏ x ∈ s, f x := by
rw [Finset.prod_map]
exact Finset.prod_congr rfl h
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]"
]
} | [
{
"line": "rw [Finset.prod_map]",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝ : CommMonoid M\np : ι → Prop\ns : Finset { x // p x }\nf : { x // p x } → M\ng : ι → M\nh : ∀ x ∈ s, g ↑x = f x\n⊢ ∏ x ∈ Finset.map (Embedding.subtype fun x => p x) s, g x = ∏ x ∈ s, f x",
"after_state": "ι : Type u_1\n... |
theorem prod_list_count [DecidableEq M] (s : List M) :
s.prod = ∏ m ∈ s.toFinset, m ^ s.count m := by simpa using prod_list_map_count s id
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "simpa using prod_list_map_count s id",
"before_state": "M : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : DecidableEq M\ns : List M\n⊢ s.prod = ∏ m ∈ s.toFinset, m ^ count m s",
"after_state": "No Goals!"
}
] |
theorem prod_multiset_count [DecidableEq M] (s : Multiset M) :
s.prod = ∏ m ∈ s.toFinset, m ^ s.count m := by
convert prod_multiset_map_count s id
rw [Multiset.map_id]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "convert prod_multiset_map_count s id",
"before_state": "M : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : DecidableEq M\ns : Multiset M\n⊢ s.prod = ∏ m ∈ s.toFinset, m ^ Multiset.count m s",
"after_state": "No Goals!"
}
] |
theorem prod_multiset_count_of_subset [DecidableEq M] (m : Multiset M) (s : Finset M)
(hs : m.toFinset ⊆ s) : m.prod = ∏ i ∈ s, i ^ m.count i := by
revert hs
refine Quot.induction_on m fun l => ?_
simp only [quot_mk_to_coe'']
simp only [prod_coe]
simp only [coe_count]
apply prod_list_count_of_subset l s... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "revert hs",
"before_state": "M : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : DecidableEq M\nm : Multiset M\ns : Finset M\nhs : m.toFinset ⊆ s\n⊢ m.prod = ∏ i ∈ s, i ^ Multiset.count i m",
"after_state": "M : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : DecidableEq M\nm : Multiset M\ns : Finset M\n⊢ ... |
theorem prod_range_induction (f s : ℕ → M) (base : s 0 = 1)
(step : ∀ n, s (n + 1) = s n * f n) (n : ℕ) :
∏ k ∈ Finset.range n, f k = s n := by
induction n with
| zero => rw [Finset.prod_range_zero, base]
| succ k hk => simp only [hk, Finset.prod_range_succ, step, mul_comm]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "induction n with\n| zero => rw [Finset.prod_range_zero, base]\n| succ k hk => simp only [hk, Finset.prod_range_succ, step, mul_comm]",
"before_state": "M : Type u_4\ninst✝ : CommMonoid M\nf s : ℕ → M\nbase : s 0 = 1\nstep : ∀ (n : ℕ), s (n + 1) = s n * f n\nn : ℕ\n⊢ ∏ k ∈ Finset.range n, f k = s ... |
theorem prod_partition (R : Setoid ι) [DecidableRel R.r] :
∏ x ∈ s, f x = ∏ xbar ∈ s.image (Quotient.mk _), ∏ y ∈ s with ⟦y⟧ = xbar, f y := by
refine (Finset.prod_image' f fun x _hx => ?_).symm
rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "refine (Finset.prod_image' f fun x _hx => ?_).symm",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝¹ : CommMonoid M\ns : Finset ι\nf : ι → M\nR : Setoid ι\ninst✝ : DecidableRel ⇑R\n⊢ ∏ x ∈ s, f x = ∏ xbar ∈ Finset.image (Quotient.mk R) s, ∏ y ∈ {y ∈ s | ⟦y⟧ = xbar}, f y",
"after_state": "... |
theorem prod_erase_lt_of_one_lt {κ : Type*} [DecidableEq ι] [CommMonoid κ] [LT κ]
[MulLeftStrictMono κ] {s : Finset ι} {d : ι} (hd : d ∈ s) {f : ι → κ}
(hdf : 1 < f d) : ∏ m ∈ s.erase d, f m < ∏ m ∈ s, f m := by
conv in ∏ m ∈ s, f m => rw [← Finset.insert_erase hd]
rw [Finset.prod_insert (Finset.not_mem_era... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "conv in ∏ m ∈ s, f m => rw [← Finset.insert_erase hd]",
"before_state": "ι : Type u_1\nκ : Type u_5\ninst✝³ : DecidableEq ι\ninst✝² : CommMonoid κ\ninst✝¹ : LT κ\ninst✝ : MulLeftStrictMono κ\ns : Finset ι\nd : ι\nhd : d ∈ s\nf : ι → κ\nhdf : 1 < f d\n⊢ ∏ m ∈ s.erase d, f m < ∏ m ∈ s, f m",
"a... |
theorem eq_one_of_prod_eq_one {s : Finset ι} {f : ι → M} {a : ι} (hp : ∏ x ∈ s, f x = 1)
(h1 : ∀ x ∈ s, x ≠ a → f x = 1) : ∀ x ∈ s, f x = 1 := by
intro x hx
classical
by_cases h : x = a
· rw [h]
rw [h] at hx
rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_single... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "intro x hx",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝ : CommMonoid M\ns : Finset ι\nf : ι → M\na : ι\nhp : ∏ x ∈ s, f x = 1\nh1 : ∀ x ∈ s, x ≠ a → f x = 1\n⊢ ∀ x ∈ s, f x = 1",
"after_state": "ι : Type u_1\nM : Type u_4\ninst✝ : CommMonoid M\ns : Finset ι\nf : ι → M\na : ι\nhp : ∏ x... |
lemma prod_image_of_disjoint [DecidableEq ι] [PartialOrder ι] [OrderBot ι] {f : κ → ι} {g : ι → M}
(hg_bot : g ⊥ = 1) {I : Finset κ} (hf_disj : (I : Set κ).PairwiseDisjoint f) :
∏ s ∈ I.image f, g s = ∏ i ∈ I, g (f i) := by
refine prod_image_of_pairwise_eq_one <| hf_disj.imp fun i j hdisj hfij ↦ ?_
rw [Func... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "refine prod_image_of_pairwise_eq_one <| hf_disj.imp fun i j hdisj hfij ↦ ?_",
"before_state": "ι : Type u_1\nκ : Type u_2\nM : Type u_4\ninst✝⁵ : CommMonoid M\ninst✝⁴ : DecidableEq κ\ninst✝³ : Fintype κ\ninst✝² : DecidableEq ι\ninst✝¹ : PartialOrder ι\ninst✝ : OrderBot ι\nf : κ → ι\ng : ι → M\nhg... |
theorem prod_unique_nonempty [Unique ι] (s : Finset ι) (f : ι → M) (h : s.Nonempty) :
∏ x ∈ s, f x = f default := by
rw [h.eq_singleton_default]
rw [Finset.prod_singleton]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "rw [h.eq_singleton_default]",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : Unique ι\ns : Finset ι\nf : ι → M\nh : s.Nonempty\n⊢ ∏ x ∈ s, f x = f default",
"after_state": "ι : Type u_1\nM : Type u_4\ninst✝¹ : CommMonoid M\ninst✝ : Unique ι\ns : Finset ι\nf : ι → ... |
lemma prod_dvd_prod_of_dvd (f g : ι → M) (h : ∀ i ∈ s, f i ∣ g i) :
∏ i ∈ s, f i ∣ ∏ i ∈ s, g i := by
induction s using Finset.cons_induction with
| empty => simp
| cons a T haT IH =>
rw [Finset.prod_cons]
rw [Finset.prod_cons]
rw [Finset.forall_mem_cons] at h
exact mul_dvd_mul h.1 <| IH h.2
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}"
]
} | [
{
"line": "induction s using Finset.cons_induction with\n| empty => simp\n| cons a T haT IH =>\n rw [Finset.prod_cons]\n rw [Finset.prod_cons]\n rw [Finset.forall_mem_cons] at h\n exact mul_dvd_mul h.1 <| IH h.2",
"before_state": "ι : Type u_1\nM : Type u_4\ninst✝ : CommMonoid M\ns : Finset ι\nf g : ι →... |
lemma prod_insert_div (ha : a ∉ s) (f : ι → G) :
(∏ x ∈ insert a s, f x) / f a = ∏ x ∈ s, f x := by simp [ha]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
"[DecidableEq ... | [
{
"line": "simp [ha]",
"before_state": "ι : Type u_1\nG : Type u_3\na : ι\ninst✝² : DecidableEq ι\ns : Finset ι\ninst✝¹ : CommGroup G\ninst✝ : DecidableEq ι\nha : a ∉ s\nf : ι → G\n⊢ (∏ x ∈ insert a s, f x) / f a = ∏ x ∈ s, f x",
"after_state": "No Goals!"
}
] |
theorem prod_sdiff_div_prod_sdiff :
(∏ x ∈ s₂ \ s₁, f x) / ∏ x ∈ s₁ \ s₂, f x = (∏ x ∈ s₂, f x) / ∏ x ∈ s₁, f x := by
simp [← Finset.prod_sdiff (@inf_le_left _ _ s₁ s₂), ← Finset.prod_sdiff (@inf_le_right _ _ s₁ s₂)]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
"[DecidableEq ... | [
{
"line": "simp [← Finset.prod_sdiff (@inf_le_left _ _ s₁ s₂), ← Finset.prod_sdiff (@inf_le_right _ _ s₁ s₂)]",
"before_state": "ι : Type u_1\nG : Type u_3\ns₁ s₂ : Finset ι\ninst✝² : DecidableEq ι\ninst✝¹ : CommGroup G\ninst✝ : DecidableEq ι\nf : ι → G\n⊢ (∏ x ∈ s₂ \\ s₁, f x) / ∏ x ∈ s₁ \\ s₂, f x = (∏ x ... |
lemma prod_of_injective (e : ι → κ) (he : Injective e) (f : ι → M) (g : κ → M)
(h' : ∀ i ∉ Set.range e, g i = 1) (h : ∀ i, f i = g (e i)) : ∏ i, f i = ∏ j, g j :=
prod_of_injOn e he.injOn (by simp) (by simpa using h') (fun i _ ↦ h i)
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "simp",
"before_state": "M : Type u_4\ninst✝⁹ : CommMonoid M\ninst✝⁸ : CancelCommMonoid M\ninst✝⁷ : AddCommMonoid M\ninst✝⁶ : PartialOrder M\ninst✝⁵ : Sub M\ninst✝⁴ : OrderedSub M\ninst✝³ : AddLeftMono M\nκ : Type u_6\nι : Type u_7\ninst✝² : Fintype ι\ninst✝¹ : Fintype κ\ninst✝ : CommMonoid M\ne :... |
lemma prod_fiberwise [DecidableEq κ] (g : ι → κ) (f : ι → M) :
∏ j, ∏ i : {i // g i = j}, f i = ∏ i, f i := by
rw [← Finset.prod_fiberwise _ g f]
congr with j
exact (prod_subtype _ (by simp) _).symm
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "rw [← Finset.prod_fiberwise _ g f]",
"before_state": "M : Type u_4\ninst✝¹⁰ : CommMonoid M\ninst✝⁹ : CancelCommMonoid M\ninst✝⁸ : AddCommMonoid M\ninst✝⁷ : PartialOrder M\ninst✝⁶ : Sub M\ninst✝⁵ : OrderedSub M\ninst✝⁴ : AddLeftMono M\nκ : Type u_6\nι : Type u_7\ninst✝³ : Fintype ι\ninst✝² : Finty... |
lemma prod_fiberwise' [DecidableEq κ] (g : ι → κ) (f : κ → M) :
∏ j, ∏ _i : {i // g i = j}, f j = ∏ i, f (g i) := by
rw [← Finset.prod_fiberwise' _ g f]
congr with j
exact (prod_subtype _ (by simp) fun _ ↦ _).symm
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "rw [← Finset.prod_fiberwise' _ g f]",
"before_state": "M : Type u_4\ninst✝¹⁰ : CommMonoid M\ninst✝⁹ : CancelCommMonoid M\ninst✝⁸ : AddCommMonoid M\ninst✝⁷ : PartialOrder M\ninst✝⁶ : Sub M\ninst✝⁵ : OrderedSub M\ninst✝⁴ : AddLeftMono M\nκ : Type u_6\nι : Type u_7\ninst✝³ : Fintype ι\ninst✝² : Fint... |
theorem prod_subtype_mul_prod_subtype (p : ι → Prop) (f : ι → M) [DecidablePred p] :
(∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by
classical
let s := { x | p x }.toFinset
rw [← Finset.prod_subtype s]
rw [← Finset.prod_subtype sᶜ]
· exact Finset.prod_mul_prod_compl _ _
·... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "classical\nlet s := {x | p x}.toFinset\nrw [← Finset.prod_subtype s]\nrw [← Finset.prod_subtype sᶜ]\n· exact Finset.prod_mul_prod_compl _ _\n· simp [s]\n· simp [s]",
"before_state": "M : Type u_4\ninst✝⁹ : CommMonoid M\ninst✝⁸ : CancelCommMonoid M\ninst✝⁷ : AddCommMonoid M\ninst✝⁶ : PartialOrder ... |
theorem prod_toFinset {M : Type*} [DecidableEq ι] [CommMonoid M] (f : ι → M) :
∀ {l : List ι} (_hl : l.Nodup), l.toFinset.prod f = (l.map f).prod
| [], _ => by simp
| a :: l, hl => by
let ⟨not_mem, hl⟩ := List.nodup_cons.mp hl
simp [Finset.prod_insert (mt List.mem_toFinset.mp not_mem), prod_toFinset _ h... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "simp",
"before_state": "ι : Type u_7\ninst✝² : Fintype ι\nM : Type u_8\ninst✝¹ : DecidableEq ι\ninst✝ : CommMonoid M\nf : ι → M\nx✝ : [].Nodup\n⊢ [].toFinset.prod f = (List.map f []).prod",
"after_state": "No Goals!"
},
{
"line": "let ⟨not_mem, hl⟩ := List.nodup_cons.mp hl",
"befo... |
theorem sum_toFinset_count_eq_length [DecidableEq ι] (l : List ι) :
∑ a ∈ l.toFinset, l.count a = l.length := by
simpa [List.map_const'] using (Finset.sum_list_map_count l fun _ => (1 : ℕ)).symm
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "simpa [List.map_const'] using (Finset.sum_list_map_count l fun _ => (1 : ℕ)).symm",
"before_state": "ι : Type u_7\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\nl : List ι\n⊢ ∑ a ∈ l.toFinset, List.count a l = l.length",
"after_state": "No Goals!"
}
] |
theorem toFinset_sum_count_eq (s : Multiset ι) : ∑ a ∈ s.toFinset, s.count a = card s := by
simpa using (Finset.sum_multiset_map_count s (fun _ => (1 : ℕ))).symm
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "simpa using (Finset.sum_multiset_map_count s (fun _ => (1 : ℕ))).symm",
"before_state": "ι : Type u_7\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ns : Multiset ι\n⊢ ∑ a ∈ s.toFinset, Multiset.count a s = s.card",
"after_state": "No Goals!"
}
] |
theorem toFinset_sum_count_nsmul_eq (s : Multiset ι) :
∑ a ∈ s.toFinset, s.count a • {a} = s := by
rw [← Finset.sum_multiset_map_count]
rw [Multiset.sum_map_singleton]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "rw [← Finset.sum_multiset_map_count]",
"before_state": "ι : Type u_7\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ns : Multiset ι\n⊢ ∑ a ∈ s.toFinset, Multiset.count a s • {a} = s",
"after_state": "ι : Type u_7\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ns : Multiset ι\n⊢ (Multiset.map singleto... |
theorem exists_smul_of_dvd_count (s : Multiset ι) {k : ℕ}
(h : ∀ a : ι, a ∈ s → k ∣ Multiset.count a s) : ∃ u : Multiset ι, s = k • u := by
use ∑ a ∈ s.toFinset, (s.count a / k) • {a}
have h₂ :
(∑ x ∈ s.toFinset, k • (count x s / k) • ({x} : Multiset ι)) =
∑ x ∈ s.toFinset, count x s • {x} := by
a... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "use ∑ a ∈ s.toFinset, (s.count a / k) • { a }",
"before_state": "ι : Type u_7\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ns : Multiset ι\nk : ℕ\nh : ∀ a ∈ s, k ∣ Multiset.count a s\n⊢ ∃ u, s = k • u",
"after_state": "case h\nι : Type u_7\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ns : Multise... |
theorem prod_sum {ι : Type*} [CommMonoid M] (f : ι → Multiset M) (s : Finset ι) :
(∑ x ∈ s, f x).prod = ∏ x ∈ s, (f x).prod := by
induction s using Finset.cons_induction with
| empty => rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]
| cons a s has ih => rw [Finset.sum_cons, Finset.prod_cons, Mul... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean | {
"open": [
"Fin Function",
"List",
"Multiset",
"Finset"
],
"variables": [
"{ι κ G M : Type*} {s s₁ s₂ : Finset ι} {a : ι}",
"[CommMonoid M] {f g : ι → M}",
"{s : Finset ι} {t : Finset κ} {f : ι → M} {g : κ → M}",
"[DecidableEq κ]",
"[Fintype κ]",
"(f s)",
"{f s}",
... | [
{
"line": "induction s using Finset.cons_induction with\n| empty => rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]\n| cons a s has ih => rw [Finset.sum_cons, Finset.prod_cons, Multiset.prod_add, ih]",
"before_state": "M : Type u_4\ninst✝⁸ : CommMonoid M\ninst✝⁷ : CancelCommMonoid M\ninst✝⁶ : A... |
theorem prod_val [CommMonoid α] (s : Finset α) : s.1.prod = s.prod id := by
rw [Finset.prod]
rw [Multiset.map_id]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function"
],
"variables": [
"{ι κ α β γ : Type*}"
]
} | [
{
"line": "rw [Finset.prod]",
"before_state": "α : Type u_3\ninst✝ : CommMonoid α\ns : Finset α\n⊢ s.val.prod = s.prod id",
"after_state": "α : Type u_3\ninst✝ : CommMonoid α\ns : Finset α\n⊢ s.val.prod = (Multiset.map id s.val).prod"
},
{
"line": "rewrite [Finset.prod]",
"before_state": "α ... |
theorem prod_const_one : (∏ _x ∈ s, (1 : β)) = 1 := by
simp only [Finset.prod]
simp only [Multiset.map_const']
simp only [Multiset.prod_replicate]
simp only [one_pow]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "simp only [Finset.prod]",
"before_state": "α : Type u_3\nβ : Type u_4\ns : Finset α\ninst✝ : CommMonoid β\n⊢ ∏ _x ∈ s, 1 = 1",
"after_state": "α : Type u_3\nβ : Type u_4\ns : Finset α\ninst✝ : CommMonoid β\n⊢ (Multiset.map (fun _x => 1) s.val).prod = 1"
},
{
"line": "simp only [Multis... |
theorem prod_map_toList (s : Finset α) (f : α → β) : (s.toList.map f).prod = s.prod f := by
rw [Finset.prod]
rw [← Multiset.prod_coe]
rw [← Multiset.map_coe]
rw [Finset.coe_toList]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "rw [Finset.prod]",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝ : CommMonoid β\ns : Finset α\nf : α → β\n⊢ (List.map f s.toList).prod = s.prod f",
"after_state": "α : Type u_3\nβ : Type u_4\ninst✝ : CommMonoid β\ns : Finset α\nf : α → β\n⊢ (List.map f s.toList).prod = (Multiset.map f s.... |
theorem prod_toList {α : Type*} [CommMonoid α] (s : Finset α) :
s.toList.prod = ∏ x ∈ s, x := by
simpa using s.prod_map_toList id
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "simpa using s.prod_map_toList id",
"before_state": "α : Type u_6\ninst✝ : CommMonoid α\ns : Finset α\n⊢ s.toList.prod = ∏ x ∈ s, x",
"after_state": "No Goals!"
}
] |
theorem prod_bij' (i : ∀ a ∈ s, κ) (j : ∀ a ∈ t, ι) (hi : ∀ a ha, i a ha ∈ t)
(hj : ∀ a ha, j a ha ∈ s) (left_inv : ∀ a ha, j (i a ha) (hi a ha) = a)
(right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) (h : ∀ a ha, f a = g (i a ha)) :
∏ x ∈ s, f x = ∏ x ∈ t, g x := by
refine prod_bij i hi (fun a1 h1 a2 h2 eq ↦... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "refine prod_bij i hi (fun a1 h1 a2 h2 eq ↦ ?_) (fun b hb ↦ ⟨_, hj b hb, right_inv b hb⟩) h",
"before_state": "ι : Type u_6\nκ : Type u_7\nα : Type u_8\ninst✝ : CommMonoid α\ns : Finset ι\nt : Finset κ\nf : ι → α\ng : κ → α\ni : (a : ι) → a ∈ s → κ\nj : (a : κ) → a ∈ t → ι\nhi : ∀ (a : ι) (ha : a ... |
lemma prod_equiv (e : ι ≃ κ) (hst : ∀ i, i ∈ s ↔ e i ∈ t) (hfg : ∀ i ∈ s, f i = g (e i)) :
∏ i ∈ s, f i = ∏ i ∈ t, g i := by refine prod_nbij' e e.symm ?_ ?_ ?_ ?_ hfg <;> simp [hst]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "focus\n refine prod_nbij' e e.symm ?_ ?_ ?_ ?_ hfg\n with_annotate_state\"<;>\" skip\n all_goals simp [hst]",
"before_state": "ι : Type u_6\nκ : Type u_7\nα : Type u_8\ninst✝ : CommMonoid α\ns : Finset ι\nt : Finset κ\nf : ι → α\ng : κ → α\ne : ι ≃ κ\nhst : ∀ (i : ι), i ∈ s ↔ e i ∈ t\nhfg : ∀ ... |
theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g : α → γ} {s : Finset α}
(h₁ : r 1 1) (h₂ : ∀ a b c, r b c → r (f a * b) (g a * c)) :
r (∏ x ∈ s, f x) (∏ x ∈ s, g x) := by
delta Finset.prod
apply Multiset.prod_hom_rel <;> assumption
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "delta Finset.prod",
"before_state": "β : Type u_4\nγ : Type u_5\ninst✝³ inst✝² : CommMonoid β\nα : Type u_8\ninst✝¹ : CommMonoid α\ninst✝ : CommMonoid γ\nr : β → γ → Prop\nf : α → β\ng : α → γ\ns : Finset α\nh₁ : r 1 1\nh₂ : ∀ (a : α) (b : β) (c : γ), r b c → r (f a * b) (g a * c)\n⊢ r (∏ x ∈ s, ... |
theorem prod_ite_irrel (p : Prop) [Decidable p] (s : Finset α) (f g : α → β) :
∏ x ∈ s, (if p then f x else g x) = if p then ∏ x ∈ s, f x else ∏ x ∈ s, g x := by
split_ifs with h <;> rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "focus\n split_ifs with h\n with_annotate_state\"<;>\" skip\n all_goals rfl",
"before_state": "β : Type u_4\ninst✝³ inst✝² : CommMonoid β\nα : Type u_8\ninst✝¹ : CommMonoid α\np : Prop\ninst✝ : Decidable p\ns : Finset α\nf g : α → β\n⊢ (∏ x ∈ s, if p then f x else g x) = if p then ∏ x ∈ s, f x ... |
theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α → β) (g : ¬p → α → β) :
∏ x ∈ s, (if h : p then f h x else g h x) =
if h : p then ∏ x ∈ s, f h x else ∏ x ∈ s, g h x := by
split_ifs with h <;> rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
"{s s₁ s... | [
{
"line": "focus\n split_ifs with h\n with_annotate_state\"<;>\" skip\n all_goals rfl",
"before_state": "β : Type u_4\ninst✝³ inst✝² : CommMonoid β\nα : Type u_8\ninst✝¹ : CommMonoid α\np : Prop\ninst✝ : Decidable p\ns : Finset α\nf : p → α → β\ng : ¬p → α → β\n⊢ (∏ x ∈ s, if h : p then f h x else g h x)... |
theorem sum_filter_count_eq_countP [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
∑ x ∈ l.toFinset with p x, l.count x = l.countP p := by
simp [Finset.sum, sum_map_count_dedup_filter_eq_countP p l]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} {f g : α → β}",
... | [
{
"line": "simp [Finset.sum, sum_map_count_dedup_filter_eq_countP p l]",
"before_state": "α : Type u_8\ninst✝² : CommMonoid α\ninst✝¹ : DecidableEq α\np : α → Prop\ninst✝ : DecidablePred p\nl : List α\n⊢ ∑ x ∈ {x ∈ l.toFinset | p x}, count x l = countP (fun b => decide (p b)) l",
"after_state": "No Goal... |
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
(hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x ∈ m.toFinset, g x := by
refine prod_bij' (fun x _ ↦ x) (fun x hx ↦ ⟨x, Multiset.mem_toFinset.1 hx⟩) ?_ ?_ ?_ ?_ ?_ <;>
simp [hfg]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} ... | [
{
"line": "focus\n refine prod_bij' (fun x _ ↦ x) (fun x hx ↦ ⟨x, Multiset.mem_toFinset.1 hx⟩) ?_ ?_ ?_ ?_ ?_\n with_annotate_state\"<;>\" skip\n all_goals simp [hfg]",
"before_state": "β : Type u_4\ninst✝³ inst✝² : CommMonoid β\nα : Type u_8\ninst✝¹ : CommMonoid α\ninst✝ : DecidableEq α\nm : Multiset α\... |
theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι) (f : ι → M)
(h : s ⊆ t) : (∏ i ∈ s, f i) ∣ ∏ i ∈ t, f i :=
Multiset.prod_dvd_prod_of_le <| Multiset.map_le_map <| by simpa
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ : Finset α} {a : α} ... | [
{
"line": "simpa",
"before_state": "ι : Type u_9\nM : Type u_10\ninst✝ : CommMonoid M\ns t : Finset ι\nf : ι → M\nh : s ⊆ t\n⊢ s.val ≤ t.val",
"after_state": "No Goals!"
}
] |
theorem sum_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
(∑ i ∈ s, f i) % n = (∑ i ∈ s, f i % n) % n :=
(Multiset.sum_nat_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]; rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ :... | [
{
"line": "rw [Finset.sum, Multiset.map_map]",
"before_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\nn : ℕ\nf : α → ℕ\n⊢ (Multiset.map (fun x => x % n) (Multiset.map (fun i => f i) s.val)).sum % n = (∑ i ∈ s, f i % n) % n",
"after_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\nn... |
theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
(∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n :=
(Multiset.prod_nat_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]; rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ :... | [
{
"line": "rw [Finset.prod, Multiset.map_map]",
"before_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\nn : ℕ\nf : α → ℕ\n⊢ (Multiset.map (fun x => x % n) (Multiset.map (fun i => f i) s.val)).prod % n = (∏ i ∈ s, f i % n) % n",
"after_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\... |
theorem sum_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∑ i ∈ s, f i) % n = (∑ i ∈ s, f i % n) % n :=
(Multiset.sum_int_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]; rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ :... | [
{
"line": "rw [Finset.sum, Multiset.map_map]",
"before_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\nn : ℤ\nf : α → ℤ\n⊢ (Multiset.map (fun x => x % n) (Multiset.map (fun i => f i) s.val)).sum % n = (∑ i ∈ s, f i % n) % n",
"after_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\nn... |
theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n :=
(Multiset.prod_int_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]; rfl
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite"
],
"variables": [
"{ι κ α β γ : Type*}",
"{s s₁ s₂ :... | [
{
"line": "rw [Finset.prod, Multiset.map_map]",
"before_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\nn : ℤ\nf : α → ℤ\n⊢ (Multiset.map (fun x => x % n) (Multiset.map (fun i => f i) s.val)).prod % n = (∏ i ∈ s, f i % n) % n",
"after_state": "α : Type u_8\ninst✝ : CommMonoid α\ns : Finset α\... |
lemma prod_bijective (e : ι → κ) (he : e.Bijective) (f : ι → α) (g : κ → α)
(h : ∀ x, f x = g (e x)) : ∏ x, f x = ∏ x, g x :=
prod_equiv (.ofBijective e he) (by simp) (by simp [h])
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "simp",
"before_state": "ι : Type u_9\nκ : Type u_10\nα : Type u_11\ninst✝² : Fintype ι\ninst✝¹ : Fintype κ\ninst✝ : CommMonoid α\ne : ι → κ\nhe : Bijective e\nf : ι → α\ng : κ → α\nh : ∀ (x : ι), f x = g (e x)\n⊢ ∀ (i : ι), i ∈ univ ↔ (Equiv.ofBijective e he) i ∈ univ",
"after_state": "No Goa... |
lemma prod_attach_univ [Fintype ι] (f : {i // i ∈ @univ ι _} → α) :
∏ i ∈ univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩ :=
Fintype.prod_equiv (Equiv.subtypeUnivEquiv mem_univ) _ _ <| by simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "simp",
"before_state": "ι : Type u_9\nα : Type u_11\ninst✝³ : Fintype ι\ninst✝² inst✝¹ : CommMonoid α\ninst✝ : Fintype ι\nf : { i // i ∈ univ } → α\n⊢ ∀ (x : Subtype (Membership.mem univ)), f x = f ⟨(Equiv.subtypeUnivEquiv ⋯) x, ⋯⟩",
"after_state": "No Goals!"
}
] |
theorem disjoint_list_sum_left {a : Multiset α} {l : List (Multiset α)} :
Disjoint l.sum a ↔ ∀ b ∈ l, Disjoint b a := by
induction l with
| nil =>
simp only [zero_disjoint]
simp only [List.not_mem_nil]
simp only [IsEmpty.forall_iff]
simp only [forall_const]
simp only [List.sum_nil]
| cons ... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "induction l with\n| nil =>\n simp only [zero_disjoint]\n simp only [List.not_mem_nil]\n simp only [IsEmpty.forall_iff]\n simp only [forall_const]\n simp only [List.sum_nil]\n| cons b bs ih =>\n simp_rw [List.sum_cons, disjoint_add_left, List.mem_cons, forall_eq_or_imp]\n simp [and_congr_left_i... |
theorem disjoint_list_sum_right {a : Multiset α} {l : List (Multiset α)} :
Disjoint a l.sum ↔ ∀ b ∈ l, Disjoint a b := by
simpa only [disjoint_comm (a := a)] using disjoint_list_sum_left
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "simpa only [disjoint_comm (a := a)] using disjoint_list_sum_left",
"before_state": "α : Type u_11\ninst✝¹ inst✝ : CommMonoid α\na : Multiset α\nl : List (Multiset α)\n⊢ _root_.Disjoint a l.sum ↔ ∀ b ∈ l, _root_.Disjoint a b",
"after_state": "No Goals!"
}
] |
theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
Disjoint i.sum a ↔ ∀ b ∈ i, Disjoint b a :=
Quotient.inductionOn i fun l => by
rw [quot_mk_to_coe]
rw [Multiset.sum_coe]
exact disjoint_list_sum_left
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "rw [quot_mk_to_coe]",
"before_state": "α : Type u_11\ninst✝¹ inst✝ : CommMonoid α\na : Multiset α\ni : Multiset (Multiset α)\nl : List (Multiset α)\n⊢ _root_.Disjoint (Multiset.sum ⟦l⟧) a ↔ ∀ b ∈ ⟦l⟧, _root_.Disjoint b a",
"after_state": "α : Type u_11\ninst✝¹ inst✝ : CommMonoid α\na : Multis... |
theorem disjoint_sum_right {a : Multiset α} {i : Multiset (Multiset α)} :
Disjoint a i.sum ↔ ∀ b ∈ i, Disjoint a b := by
simpa only [disjoint_comm (a := a)] using disjoint_sum_left
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "simpa only [disjoint_comm (a := a)] using disjoint_sum_left",
"before_state": "α : Type u_11\ninst✝¹ inst✝ : CommMonoid α\na : Multiset α\ni : Multiset (Multiset α)\n⊢ _root_.Disjoint a i.sum ↔ ∀ b ∈ i, _root_.Disjoint a b",
"after_state": "No Goals!"
}
] |
theorem disjoint_finset_sum_left {β : Type*} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
Disjoint (i.sum f) a ↔ ∀ b ∈ i, Disjoint (f b) a := by
convert @disjoint_sum_left _ a (map f i.val)
simp [and_congr_left_iff]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "convert @disjoint_sum_left _ a (map f i.val)",
"before_state": "α : Type u_11\ninst✝¹ inst✝ : CommMonoid α\nβ : Type u_12\ni : Finset β\nf : β → Multiset α\na : Multiset α\n⊢ _root_.Disjoint (i.sum f) a ↔ ∀ b ∈ i, _root_.Disjoint (f b) a",
"after_state": "case h.e'_2.a\nα : Type u_11\ninst✝¹ ... |
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
count a (∑ x ∈ s, f x) = ∑ x ∈ s, count a (f x) := by
dsimp only [Finset.sum]
rw [count_sum]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "dsimp only [Finset.sum]",
"before_state": "β : Type u_4\ninst✝⁵ inst✝⁴ : CommMonoid β\ninst✝³ : DivisionCommMonoid β\nα : Type u_11\ninst✝² inst✝¹ : CommMonoid α\ninst✝ : DecidableEq α\ns : Finset β\na : α\nf : β → Multiset α\n⊢ Multiset.count a (∑ x ∈ s, f x) = ∑ x ∈ s, Multiset.count a (f x)",
... |
theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.prod id ∣ S.prod := by
rw [Finset.prod_eq_multiset_prod]
refine Multiset.prod_dvd_prod_of_le ?_
simp [Multiset.dedup_le S]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean | {
"open": [
"Fin Function",
"Batteries.ExtendedBinder Lean Meta",
"Elab Term Tactic TryThis",
"Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr",
"scoped Batteries.ExtendedBinder",
"List",
"Multiset",
"MulOpposite",
"Finset"
],
"variables": [
"{ι κ α β γ : Type*}",
... | [
{
"line": "rw [Finset.prod_eq_multiset_prod]",
"before_state": "α : Type u_11\ninst✝³ inst✝² : CommMonoid α\ninst✝¹ : DecidableEq α\ninst✝ : CommMonoid α\nS : Multiset α\n⊢ S.toFinset.prod id ∣ S.prod",
"after_state": "α : Type u_11\ninst✝³ inst✝² : CommMonoid α\ninst✝¹ : DecidableEq α\ninst✝ : CommMono... |
lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t : ι → Set κ) (g : ι → κ)
[DecidablePred fun i ↦ g i ∈ t i] :
∏ i ∈ s, mulIndicator (t i) (f i) (g i) = ∏ i ∈ s with g i ∈ t i, f i (g i) := by
refine (prod_filter_mul_prod_filter_not s (fun i ↦ g i ∈ t i) _).symm.trans <|
Eq.trans (... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Indicator.lean | {
"open": [
"Set"
],
"variables": [
"{ι κ α β : Type*} [CommMonoid β]"
]
} | [
{
"line": "refine\n (prod_filter_mul_prod_filter_not s (fun i ↦ g i ∈ t i) _).symm.trans <|\n Eq.trans (congr_arg₂ (· * ·) ?_ ?_) (mul_one _)",
"before_state": "ι : Type u_1\nκ : Type u_2\nβ : Type u_4\ninst✝¹ : CommMonoid β\ns : Finset ι\nf : ι → κ → β\nt : ι → Set κ\ng : ι → κ\ninst✝ : DecidablePred f... |
lemma isSquare_prod {s : Finset ι} [CommMonoid α] (f : ι → α)
(h : ∀ c ∈ s, IsSquare (f c)) : IsSquare (∏ i ∈ s, f i) := by
rw [isSquare_iff_exists_sq]
use (∏ (x : s), ((isSquare_iff_exists_sq _).mp (h _ x.2)).choose)
rw [@sq]
rw [← Finset.prod_mul_distrib]
rw [← Finset.prod_coe_sort]
congr
ext i
rw... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Lemmas.lean | {
"open": [
"Function in"
],
"variables": [
"{ι α β γ : Type*}",
"[CommMonoid β]"
]
} | [
{
"line": "rw [isSquare_iff_exists_sq]",
"before_state": "ι : Type u_1\nα : Type u_2\ns : Finset ι\ninst✝ : CommMonoid α\nf : ι → α\nh : ∀ c ∈ s, IsSquare (f c)\n⊢ IsSquare (∏ i ∈ s, f i)",
"after_state": "ι : Type u_1\nα : Type u_2\ns : Finset ι\ninst✝ : CommMonoid α\nf : ι → α\nh : ∀ c ∈ s, IsSquare (... |
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
[DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
(∏ x ∈ s, h (if hx : p x then f x hx else g x hx)) =
(∏ x : {x ∈ s | p x}, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
∏ ... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "simpa using (mem_filter.mp x.2).2",
"before_state": "ι : Type u_1\nκ : Type u_2\nα : Type u_3\nβ : Type u_4\nγ : Type u_5\ns✝ : Finset α\ninst✝¹ : CommMonoid β\ns : Finset α\np : α → Prop\nhp : DecidablePred p\ninst✝ : DecidablePred fun x => ¬p x\nf : (x : α) → p x → γ\ng : (x : α) → ¬p x → γ\nh ... |
lemma prod_dite_of_false {p : α → Prop} {_ : DecidablePred p} (h : ∀ i ∈ s, ¬ p i)
(f : ∀ i, p i → β) (g : ∀ i, ¬ p i → β) :
∏ i ∈ s, (if hi : p i then f i hi else g i hi) = ∏ i : s, g i.1 (h _ i.2) := by
refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_ <;> aesop
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "focus\n refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_\n with_annotate_state\"<;>\" skip\n all_goals aesop",
"before_state": "α : Type u_3\nβ : Type u_4\ns : Finset α\ninst✝ : CommMonoid β\np : α → Prop\nx✝ : DecidablePred p\nh : ∀ i ∈ s, ¬p i\nf : (i : α) → p i → β\ng : (... |
lemma prod_dite_of_true {p : α → Prop} {_ : DecidablePred p} (h : ∀ i ∈ s, p i) (f : ∀ i, p i → β)
(g : ∀ i, ¬ p i → β) :
∏ i ∈ s, (if hi : p i then f i hi else g i hi) = ∏ i : s, f i.1 (h _ i.2) := by
refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_ <;> aesop
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "focus\n refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_\n with_annotate_state\"<;>\" skip\n all_goals aesop",
"before_state": "α : Type u_3\nβ : Type u_4\ns : Finset α\ninst✝ : CommMonoid β\np : α → Prop\nx✝ : DecidablePred p\nh : ∀ i ∈ s, p i\nf : (i : α) → p i → β\ng : (i... |
theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
(h : ∀ x ∈ s, ¬p x) : (∏ x ∈ s, k (if p x then f x else g x)) = ∏ x ∈ s, k (g x) := by
simp_rw [apply_ite k]
exact prod_ite_of_false h _ _
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "simp_rw [apply_ite k]",
"before_state": "α : Type u_3\nβ : Type u_4\nγ : Type u_5\ns : Finset α\ninst✝ : CommMonoid β\np : α → Prop\nhp : DecidablePred p\nf g : α → γ\nk : γ → β\nh : ∀ x ∈ s, ¬p x\n⊢ ∏ x ∈ s, k (if p x then f x else g x) = ∏ x ∈ s, k (g x)",
"after_state": "α : Type u_3\nβ : ... |
theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
(h : ∀ x ∈ s, p x) : (∏ x ∈ s, k (if p x then f x else g x)) = ∏ x ∈ s, k (f x) := by
simp_rw [apply_ite k]
exact prod_ite_of_true h _ _
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "simp_rw [apply_ite k]",
"before_state": "α : Type u_3\nβ : Type u_4\nγ : Type u_5\ns : Finset α\ninst✝ : CommMonoid β\np : α → Prop\nhp : DecidablePred p\nf g : α → γ\nk : γ → β\nh : ∀ x ∈ s, p x\n⊢ ∏ x ∈ s, k (if p x then f x else g x) = ∏ x ∈ s, k (f x)",
"after_state": "α : Type u_3\nβ : T... |
theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
∏ i ∈ s, (if i ∈ t then f i else 1) = ∏ i ∈ s ∩ t, f i := by
rw [← Finset.prod_filter]
rw [Finset.filter_mem_eq_inter]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "rw [← Finset.prod_filter]",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns t : Finset α\nf : α → β\n⊢ (∏ i ∈ s, if i ∈ t then f i else 1) = ∏ i ∈ s ∩ t, f i",
"after_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α... |
lemma prod_attach_eq_prod_dite [Fintype α] (s : Finset α) (f : s → β) [DecidablePred (· ∈ s)] :
∏ i ∈ s.attach, f i = ∏ i, if h : i ∈ s then f ⟨i, h⟩ else 1 := by
rw [Finset.prod_dite]
rw [Finset.univ_eq_attach]
rw [Finset.prod_const_one]
rw [mul_one]
congr
· ext; simp
· ext; simp
· apply Function.h... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "rw [Finset.prod_dite]",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝² : CommMonoid β\ninst✝¹ : Fintype α\ns : Finset α\nf : { x // x ∈ s } → β\ninst✝ : DecidablePred fun x => x ∈ s\n⊢ ∏ i ∈ s.attach, f i = ∏ i, if h : i ∈ s then f ⟨i, h⟩ else 1",
"after_state": "α : Type u_3\nβ : Type u... |
theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, a = x → β) :
∏ x ∈ s, (if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
· intros _ _ h
rw [dif_neg]
exact h.symm
· simp [h]
· rw [Finset.pro... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "split_ifs with h",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns : Finset α\na : α\nb : (x : α) → a = x → β\n⊢ (∏ x ∈ s, if h : a = x then b x h else 1) = if a ∈ s then b a ⋯ else 1",
"after_state": "case pos\nα : Type u_3\nβ : Type u_4\ninst✝¹ :... |
theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, x = a → β) :
∏ x ∈ s, (if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
· intros _ _ h
rw [dif_neg]
exact h
· simp [h]
· rw [Finset.prod_eq... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "split_ifs with h",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns : Finset α\na : α\nb : (x : α) → x = a → β\n⊢ (∏ x ∈ s, if h : x = a then b x h else 1) = if a ∈ s then b a ⋯ else 1",
"after_state": "case pos\nα : Type u_3\nβ : Type u_4\ninst✝¹ :... |
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
(∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, f x = ∏ x ∈ s, f x := by
convert (s.prod_piecewise t f f).symm
simp +unfoldPartialApp [Finset.piecewise]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "convert (s.prod_piecewise t f f).symm",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns t : Finset α\nf : α → β\n⊢ (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \\ t, f x = ∏ x ∈ s, f x",
"after_state": "case h.e'_3.a.h.e\nα : Type u_3\nβ : Type u_4\ninst✝¹ : CommM... |
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : ∏ x ∈ s, f x = f i * ∏ x ∈ s \ {i}, f x := by
convert (s.prod_inter_mul_prod_diff {i} f).symm
simp [h]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "convert (s.prod_inter_mul_prod_diff { i } f).symm",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns : Finset α\ni : α\nh : i ∈ s\nf : α → β\n⊢ ∏ x ∈ s, f x = f i * ∏ x ∈ s \\ {i}, f x",
"after_state": "case h.e'_3.h.e'_5\nα : Type u_3\nβ : Type u_4... |
theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i ∈ s, f i := by
classical
rw [Finset.prod_eq_mul_prod_diff_singleton ha]
exact dvd_mul_right _ _
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "classical\nrw [Finset.prod_eq_mul_prod_diff_singleton ha]\nexact dvd_mul_right _ _",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝ : CommMonoid β\nf : α → β\na : α\ns : Finset α\nha : a ∈ s\n⊢ f a ∣ ∏ i ∈ s, f i",
"after_state": "No Goals!"
},
{
"line": "rw [Finset.prod_eq_mul_pr... |
theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∉ s) (f : α → β)
(b : β) : ∏ x ∈ s, Function.update f i b x = ∏ x ∈ s, f x := by
apply prod_congr rfl
intros j hj
have : j ≠ i := by
rintro rfl
exact h hj
simp [this]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "apply prod_congr rfl",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns : Finset α\ni : α\nh : i ∉ s\nf : α → β\nb : β\n⊢ ∏ x ∈ s, Function.update f i b x = ∏ x ∈ s, f x",
"after_state": "No Goals!"
}
] |
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
(∏ x ∈ s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1 := by simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]"
]
} | [
{
"line": "simp",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝¹ : CommMonoid β\ninst✝ : DecidableEq α\ns : Finset α\nf : α → β\na : α\n⊢ (∏ x ∈ s, f x ^ if a = x then 1 else 0) = if a ∈ s then f a else 1",
"after_state": "No Goals!"
}
] |
lemma prod_ite_eq_ite_exists (p : ι → Prop) [DecidablePred p] (h : ∀ i j, p i → p j → i = j)
(a : α) : ∏ i, ite (p i) a 1 = ite (∃ i, p i) a 1 := by
simp [prod_ite_one univ p (by simpa using h)]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [
"Finset"
],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]",
"[CommMonoid α] [Fintype ι]"
]
} | [
{
"line": "simp [prod_ite_one univ p (by simpa using h)]",
"before_state": "ι : Type u_1\nα : Type u_3\ninst✝² : CommMonoid α\ninst✝¹ : Fintype ι\np : ι → Prop\ninst✝ : DecidablePred p\nh : ∀ (i j : ι), p i → p j → i = j\na : α\n⊢ (∏ i, if p i then a else 1) = if ∃ i, p i then a else 1",
"after_state": ... |
lemma prod_ite_mem (s : Finset ι) (f : ι → α) : ∏ i, (if i ∈ s then f i else 1) = ∏ i ∈ s, f i := by
simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [
"Finset"
],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]",
"[CommMonoid α] [Fintype ι]",
"[DecidableEq ι]"
]
} | [
{
"line": "simp",
"before_state": "ι : Type u_1\nα : Type u_3\ninst✝² : CommMonoid α\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ns : Finset ι\nf : ι → α\n⊢ (∏ i, if i ∈ s then f i else 1) = ∏ i ∈ s, f i",
"after_state": "No Goals!"
}
] |
lemma prod_ite_eq (i : ι) (f : ι → α) : ∏ j, (if i = j then f j else 1) = f i := by
rw [Finset.prod_ite_eq]
rw [if_pos (mem_univ _)]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [
"Finset"
],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]",
"[CommMonoid α] [Fintype ι]",
"[DecidableEq ι]"
]
} | [
{
"line": "rw [Finset.prod_ite_eq]",
"before_state": "ι : Type u_1\nα : Type u_3\ninst✝² : CommMonoid α\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ni : ι\nf : ι → α\n⊢ (∏ j, if i = j then f j else 1) = f i",
"after_state": "ι : Type u_1\nα : Type u_3\ninst✝² : CommMonoid α\ninst✝¹ : Fintype ι\ninst✝ : D... |
lemma prod_ite_eq' (i : ι) (f : ι → α) : ∏ j, (if j = i then f j else 1) = f i := by
rw [Finset.prod_ite_eq']
rw [if_pos (mem_univ _)]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Finset/Piecewise.lean | {
"open": [
"Finset"
],
"variables": [
"{ι κ α β γ : Type*} {s : Finset α}",
"[CommMonoid β]",
"[CommMonoid α] [Fintype ι]",
"[DecidableEq ι]"
]
} | [
{
"line": "rw [Finset.prod_ite_eq']",
"before_state": "ι : Type u_1\nα : Type u_3\ninst✝² : CommMonoid α\ninst✝¹ : Fintype ι\ninst✝ : DecidableEq ι\ni : ι\nf : ι → α\n⊢ (∏ j, if j = i then f j else 1) = f i",
"after_state": "ι : Type u_1\nα : Type u_3\ninst✝² : CommMonoid α\ninst✝¹ : Fintype ι\ninst✝ : ... |
theorem prod_hom_nonempty {l : List M} {F : Type*} [FunLike F M N] [MulHomClass F M N] (f : F)
(hl : l ≠ []) : (l.map f).prod = f l.prod :=
match l, hl with | x :: xs, hl => by induction xs generalizing x <;> aesop
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "focus\n induction xs generalizing x\n with_annotate_state\"<;>\" skip\n all_goals aesop",
"before_state": "M : Type u_2\nN : Type u_3\ninst✝³ : Monoid M\ninst✝² : Monoid N\nl : List M\nF : Type u_1\ninst✝¹ : FunLike F M N\ninst✝ : MulHomClass F M N\nf : F\nhl✝ : l ≠ []\nx : M\nxs : List M\nhl ... |
theorem prod_hom₂_nonempty {l : List ι} (f : M → N → P)
(hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d) (f₁ : ι → M) (f₂ : ι → N) (hl : l ≠ []) :
(l.map fun i => f (f₁ i) (f₂ i)).prod = f (l.map f₁).prod (l.map f₂).prod := by
match l, hl with | x :: xs, hl => induction xs generalizing x <;> aesop
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "match l, hl with\n| x :: xs, hl => induction xs generalizing x <;> aesop",
"before_state": "M : Type u_3\nN : Type u_4\nP : Type u_2\ninst✝² : Monoid M\ninst✝¹ : Monoid N\ninst✝ : Monoid P\nι : Type u_1\nl : List ι\nf : M → N → P\nhf : ∀ (a b : M) (c d : N), f (a * b) (c * d) = f a c * f b d\nf₁ ... |
theorem prod_take_mul_prod_drop (L : List M) (i : ℕ) :
(L.take i).prod * (L.drop i).prod = L.prod := by
simp [← prod_append]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "simp [← prod_append]",
"before_state": "M : Type u_1\ninst✝ : Monoid M\nL : List M\ni : ℕ\n⊢ (List.take i L).prod * (List.drop i L).prod = L.prod",
"after_state": "No Goals!"
}
] |
theorem length_pos_of_prod_ne_one (L : List M) (h : L.prod ≠ 1) : 0 < L.length := by
cases L
· simp at h
· simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "cases L",
"before_state": "M : Type u_1\ninst✝ : Monoid M\nL : List M\nh : L.prod ≠ 1\n⊢ 0 < L.length",
"after_state": "case nil\nM : Type u_1\ninst✝ : Monoid M\nh : [].prod ≠ 1\n⊢ 0 < [].length\n---\ncase cons\nM : Type u_1\ninst✝ : Monoid M\nhead✝ : M\ntail✝ : List M\nh : (head✝ :: tail✝).p... |
theorem prod_set :
∀ (L : List M) (n : ℕ) (a : M),
(L.set n a).prod =
((L.take n).prod * if n < L.length then a else 1) * (L.drop (n + 1)).prod
| x :: xs, 0, a => by simp [set]
| x :: xs, i + 1, a => by
simp [set, prod_set xs i a, mul_assoc, Nat.add_lt_add_iff_right]
| [], _, _ => by simp [s... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "simp [set]",
"before_state": "M : Type u_1\ninst✝ : Monoid M\nx : M\nxs : List M\na : M\n⊢ ((x :: xs).set 0 a).prod =\n ((List.take 0 (x :: xs)).prod * if 0 < (x :: xs).length then a else 1) * (List.drop (0 + 1) (x :: xs)).prod",
"after_state": "No Goals!"
},
{
"line": "simp [set, ... |
theorem getElem?_zero_mul_tail_prod (l : List M) : l[0]?.getD 1 * l.tail.prod = l.prod := by
cases l <;> simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "focus\n cases l\n with_annotate_state\"<;>\" skip\n all_goals simp",
"before_state": "M : Type u_1\ninst✝ : Monoid M\nl : List M\n⊢ l[0]?.getD 1 * l.tail.prod = l.prod",
"after_state": "No Goals!"
},
{
"line": "cases l",
"before_state": "M : Type u_1\ninst✝ : Monoid M\nl : List... |
theorem headI_mul_tail_prod_of_ne_nil [Inhabited M] (l : List M) (h : l ≠ []) :
l.headI * l.tail.prod = l.prod := by cases l <;> [contradiction; simp]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "cases l <;> [contradiction; simp]",
"before_state": "M : Type u_1\ninst✝¹ : Monoid M\ninst✝ : Inhabited M\nl : List M\nh : l ≠ []\n⊢ l.headI * l.tail.prod = l.prod",
"after_state": "No Goals!"
},
{
"line": "focus (cases l; map_tacs [contradiction; simp])",
"before_state": "M : Typ... |
lemma eq_of_prod_take_eq [LeftCancelMonoid M] {L L' : List M} (h : L.length = L'.length)
(h' : ∀ i ≤ L.length, (L.take i).prod = (L'.take i).prod) : L = L' := by
refine ext_get h fun i h₁ h₂ => ?_
have : (L.take (i + 1)).prod = (L'.take (i + 1)).prod := h' _ (Nat.succ_le_of_lt h₁)
rw [prod_take_succ L i h₁] a... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}"
]
} | [
{
"line": "refine ext_get h fun i h₁ h₂ => ?_",
"before_state": "M : Type u_1\ninst✝² : Monoid M\ninst✝¹ : CommMonoid M\ninst✝ : LeftCancelMonoid M\nL L' : List M\nh : L.length = L'.length\nh' : ∀ i ≤ L.length, (List.take i L).prod = (List.take i L').prod\n⊢ L = L'",
"after_state": "No Goals!"
}
] |
theorem prod_inv_reverse : ∀ L : List G, L.prod⁻¹ = (L.map fun x => x⁻¹).reverse.prod
| [] => by simp
| x :: xs => by simp [prod_inv_reverse xs]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}",
"[Group G]"
]
} | [
{
"line": "simp",
"before_state": "G : Type u_1\ninst✝ : Group G\n⊢ [].prod⁻¹ = (List.map (fun x => x⁻¹) []).reverse.prod",
"after_state": "No Goals!"
},
{
"line": "simp [prod_inv_reverse xs]",
"before_state": "G : Type u_1\ninst✝ : Group G\nx : G\nxs : List G\n⊢ (x :: xs).prod⁻¹ = (List.map... |
theorem prod_drop_succ :
∀ (L : List G) (i : ℕ) (p : i < L.length), (L.drop (i + 1)).prod = L[i]⁻¹ * (L.drop i).prod
| [], _, p => False.elim (Nat.not_lt_zero _ p)
| _ :: _, 0, _ => by simp
| _ :: xs, i + 1, p => prod_drop_succ xs i (Nat.lt_of_succ_lt_succ p)
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}",
"[Group G]"
]
} | [
{
"line": "get_elem_tactic",
"before_state": "M : Type ?u.254\nN : Type ?u.257\nP : Type ?u.260\nG : Type ?u.288\ninst✝⁴ : Monoid M\ninst✝³ : Monoid N\ninst✝² : Monoid P\nl✝ l₁✝ l₂✝ : List M\na✝ : M\ninst✝¹ : CommMonoid M\na : M\nl l₁ l₂ : List M\ninst✝ : Group G\nL : List G\ni : ℕ\np : i < L.length\n⊢ i < ... |
theorem prod_set' (L : List G) (n : ℕ) (a : G) :
(L.set n a).prod = L.prod * if hn : n < L.length then L[n]⁻¹ * a else 1 := by
refine (prod_set L n a).trans ?_
split_ifs with hn
· rw [mul_comm _ a, mul_assoc a, prod_drop_succ L n hn, mul_comm _ (drop n L).prod, ←
mul_assoc (take n L).prod, prod_take_mul... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}",
"[Group G]",
"[CommGroup G]"
]
} | [
{
"line": "get_elem_tactic",
"before_state": "M : Type ?u.357\nN : Type ?u.360\nP : Type ?u.363\nG : Type ?u.391\ninst✝⁵ : Monoid M\ninst✝⁴ : Monoid N\ninst✝³ : Monoid P\nl✝ l₁✝ l₂✝ : List M\na✝¹ : M\ninst✝² : CommMonoid M\na✝ : M\nl l₁ l₂ : List M\ninst✝¹ : Group G\ninst✝ : CommGroup G\nL : List G\nn : ℕ\n... |
theorem headI_add_tail_sum (L : List ℕ) : L.headI + L.tail.sum = L.sum := by
cases L <;> simp
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}",
"[Group G]",
"[CommGroup G]"
]
} | [
{
"line": "focus\n cases L\n with_annotate_state\"<;>\" skip\n all_goals simp",
"before_state": "L : List ℕ\n⊢ L.headI + L.tail.sum = L.sum",
"after_state": "No Goals!"
},
{
"line": "cases L",
"before_state": "L : List ℕ\n⊢ L.headI + L.tail.sum = L.sum",
"after_state": "case nil\n⊢ []... |
lemma sum_int_mod (l : List ℤ) (n : ℤ) : l.sum % n = (l.map (· % n)).sum % n := by
induction l <;> simp [Int.add_emod, *]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}",
"[Group G]",
"[CommGroup G]",
"[One α] [Mul α] [Inv α]",
"[CommGroup α]"
]
} | [
{
"line": "focus\n induction l\n with_annotate_state\"<;>\" skip\n all_goals simp [Int.add_emod, *]",
"before_state": "l : List ℤ\nn : ℤ\n⊢ l.sum % n = (List.map (fun x => x % n) l).sum % n",
"after_state": "No Goals!"
},
{
"line": "induction l",
"before_state": "l : List ℤ\nn : ℤ\n⊢ l.su... |
lemma prod_int_mod (l : List ℤ) (n : ℤ) : l.prod % n = (l.map (· % n)).prod % n := by
induction l <;> simp [Int.mul_emod, *]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Basic.lean | {
"open": [
"scoped Relator in"
],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[CommMonoid M] {a : M} {l l₁ l₂ : List M}",
"[Group G]",
"[CommGroup G]",
"[One α] [Mul α] [Inv α]",
"[CommGroup α]"
]
} | [
{
"line": "focus\n induction l\n with_annotate_state\"<;>\" skip\n all_goals simp [Int.mul_emod, *]",
"before_state": "l : List ℤ\nn : ℤ\n⊢ l.prod % n = (List.map (fun x => x % n) l).prod % n",
"after_state": "No Goals!"
},
{
"line": "induction l",
"before_state": "l : List ℤ\nn : ℤ\n⊢ l.... |
theorem prod_isUnit : ∀ {L : List M}, (∀ m ∈ L, IsUnit m) → IsUnit L.prod
| [], _ => by simp
| h :: t, u => by
simp only [List.prod_cons]
exact IsUnit.mul (u h mem_cons_self) (prod_isUnit fun m mt => u m (mem_cons_of_mem h mt))
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean | {
"open": [],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}"
]
} | [
{
"line": "simp",
"before_state": "M : Type u_4\ninst✝ : Monoid M\nx✝ : ∀ m ∈ [], IsUnit m\n⊢ IsUnit [].prod",
"after_state": "No Goals!"
},
{
"line": "simp only [List.prod_cons]",
"before_state": "M : Type u_4\ninst✝ : Monoid M\nh : M\nt : List M\nu : ∀ m ∈ h :: t, IsUnit m\n⊢ IsUnit (h :: ... |
theorem sum_map_count_dedup_filter_eq_countP (p : α → Bool) (l : List α) :
((l.dedup.filter p).map fun x => l.count x).sum = l.countP p := by
induction l with
| nil => simp
| cons a as h =>
simp_rw [List.countP_cons, List.count_cons, List.sum_map_add]
congr 1
· refine _root_.trans ?_ h
by_ca... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean | {
"open": [],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[Group G]",
"[DecidableEq α]"
]
} | [
{
"line": "induction l with\n| nil => simp\n| cons a as h =>\n simp_rw [List.countP_cons, List.count_cons, List.sum_map_add]\n congr 1\n · refine _root_.trans ?_ h\n by_cases ha : a ∈ as\n · simp [dedup_cons_of_mem ha]\n · simp only [dedup_cons_of_not_mem ha, List.filter]\n match p a with\n ... |
theorem sum_map_count_dedup_eq_length (l : List α) :
(l.dedup.map fun x => l.count x).sum = l.length := by
simpa using sum_map_count_dedup_filter_eq_countP (fun _ => True) l
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean | {
"open": [],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[Group G]",
"[DecidableEq α]"
]
} | [
{
"line": "simpa using sum_map_count_dedup_filter_eq_countP (fun _ => True) l",
"before_state": "α : Type u_2\ninst✝ : DecidableEq α\nl : List α\n⊢ (List.map (fun x => List.count x l) l.dedup).sum = l.length",
"after_state": "No Goals!"
}
] |
theorem neg_one_mem_of_prod_eq_neg_one {l : List ℤ} (h : l.prod = -1) : (-1 : ℤ) ∈ l := by
obtain ⟨x, h₁, h₂⟩ := exists_mem_ne_one_of_prod_ne_one (ne_of_eq_of_ne h (by decide))
exact Or.resolve_left
(Int.isUnit_iff.mp (prod_isUnit_iff.mp
(h.symm ▸ ⟨⟨-1, -1, by decide, by decide⟩, rfl⟩ : IsUnit l.prod) x h... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean | {
"open": [],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[Group G]",
"[DecidableEq α]"
]
} | [
{
"line": "obtain ⟨x, h₁, h₂⟩ := exists_mem_ne_one_of_prod_ne_one (ne_of_eq_of_ne h (by decide))",
"before_state": "l : List ℤ\nh : l.prod = -1\n⊢ -1 ∈ l",
"after_state": "No Goals!"
}
] |
theorem dvd_prod [CommMonoid M] {a} {l : List M} (ha : a ∈ l) : a ∣ l.prod := by
let ⟨s, t, h⟩ := append_of_mem ha
rw [h]
rw [prod_append]
rw [prod_cons]
rw [mul_left_comm]
exact dvd_mul_right _ _
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/List/Lemmas.lean | {
"open": [],
"variables": [
"{ι α β M N P G : Type*}",
"[Monoid M] [Monoid N] [Monoid P] {l l₁ l₂ : List M} {a : M}",
"[Group G]",
"[DecidableEq α]"
]
} | [
{
"line": "let ⟨s, t, h⟩ := append_of_mem ha",
"before_state": "M : Type u_4\ninst✝¹ : Monoid M\ninst✝ : CommMonoid M\na : M\nl : List M\nha : a ∈ l\n⊢ a ∣ l.prod",
"after_state": "No Goals!"
},
{
"line": "refine_lift\n let ⟨s, t, h⟩ := append_of_mem ha;\n ?_",
"before_state": "M : Type u_... |
theorem prod_map_eq_pow_single [DecidableEq ι] (i : ι)
(hf : ∀ i' ≠ i, i' ∈ m → f i' = 1) : (m.map f).prod = f i ^ m.count i := by
induction m using Quotient.inductionOn
simp [List.prod_map_eq_pow_single i f hf]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "induction m using Quotient.inductionOn",
"before_state": "ι : Type u_2\nα : Type u_3\ninst✝¹ : CommMonoid α\nm : Multiset ι\nf : ι → α\ninst✝ : DecidableEq ι\ni : ι\nhf : ∀ (i' : ι), i' ≠ i → i' ∈ m → f i' = 1\n⊢ (Multiset.map f m).prod = f i ^ Multiset.count i m",
"after_state": "case h\nι :... |
theorem prod_eq_pow_single [DecidableEq α] (a : α) (h : ∀ a' ≠ a, a' ∈ s → a' = 1) :
s.prod = a ^ s.count a := by
induction s using Quotient.inductionOn; simp [List.prod_eq_pow_single a h]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "induction s using Quotient.inductionOn",
"before_state": "α : Type u_3\ninst✝¹ : CommMonoid α\ns : Multiset α\ninst✝ : DecidableEq α\na : α\nh : ∀ (a' : α), a' ≠ a → a' ∈ s → a' = 1\n⊢ s.prod = a ^ Multiset.count a s",
"after_state": "case h\nα : Type u_3\ninst✝¹ : CommMonoid α\ns : Multiset ... |
lemma prod_eq_one (h : ∀ x ∈ s, x = (1 : α)) : s.prod = 1 := by
induction s using Quotient.inductionOn; simp [List.prod_eq_one h]
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "induction s using Quotient.inductionOn",
"before_state": "α : Type u_3\ninst✝ : CommMonoid α\ns : Multiset α\nh : ∀ x ∈ s, x = 1\n⊢ s.prod = 1",
"after_state": "case h\nα : Type u_3\ninst✝ : CommMonoid α\ns : Multiset α\na✝ : List α\nh : ∀ x ∈ ⟦a✝⟧, x = 1\n⊢ Multiset.prod ⟦a✝⟧ = 1"
},
{
... |
theorem prod_hom_ne_zero {s : Multiset α} (hs : s ≠ 0) {F : Type*} [FunLike F α β]
[MulHomClass F α β] (f : F) :
(s.map f).prod = f s.prod := by
induction s using Quot.inductionOn; aesop (add simp List.prod_hom_nonempty)
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "induction s using Quot.inductionOn",
"before_state": "α : Type u_3\nβ : Type u_4\ninst✝³ : CommMonoid α\ninst✝² : CommMonoid β\ns : Multiset α\nhs : s ≠ 0\nF : Type u_7\ninst✝¹ : FunLike F α β\ninst✝ : MulHomClass F α β\nf : F\n⊢ (Multiset.map (⇑f) s).prod = f s.prod",
"after_state": "case h\... |
theorem prod_hom' (s : Multiset ι) {F : Type*} [FunLike F α β]
[MonoidHomClass F α β] (f : F)
(g : ι → α) : (s.map fun i => f <| g i).prod = f (s.map g).prod := by
convert (s.map g).prod_hom f
exact (map_map _ _ _).symm
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "convert (s.map g).prod_hom f",
"before_state": "ι : Type u_2\nα : Type u_3\nβ : Type u_4\ninst✝³ : CommMonoid α\ninst✝² : CommMonoid β\ns : Multiset ι\nF : Type u_7\ninst✝¹ : FunLike F α β\ninst✝ : MonoidHomClass F α β\nf : F\ng : ι → α\n⊢ (Multiset.map (fun i => f (g i)) s).prod = f (Multiset.ma... |
theorem prod_hom₂_ne_zero [CommMonoid γ] {s : Multiset ι} (hs : s ≠ 0) (f : α → β → γ)
(hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d) (f₁ : ι → α) (f₂ : ι → β) :
(s.map fun i => f (f₁ i) (f₂ i)).prod = f (s.map f₁).prod (s.map f₂).prod := by
induction s using Quotient.inductionOn; aesop (add simp List.pr... | /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "induction s using Quotient.inductionOn",
"before_state": "ι : Type u_2\nα : Type u_3\nβ : Type u_4\nγ : Type u_6\ninst✝² : CommMonoid α\ninst✝¹ : CommMonoid β\ninst✝ : CommMonoid γ\ns : Multiset ι\nhs : s ≠ 0\nf : α → β → γ\nhf : ∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d\nf₁ : ι → ... |
lemma dvd_prod : a ∈ s → a ∣ s.prod :=
Quotient.inductionOn s (fun l a h ↦ by simpa using List.dvd_prod h) a
| /root/DuelModelResearch/mathlib4/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean | {
"open": [],
"variables": [
"{F ι α β β' γ : Type*}",
"[CommMonoid α] [CommMonoid β] {s t : Multiset α} {a : α} {m : Multiset ι} {f g : ι → α}"
]
} | [
{
"line": "simpa using List.dvd_prod h",
"before_state": "α : Type u_3\ninst✝ : CommMonoid α\ns : Multiset α\na✝ : α\nl : List α\na : α\nh : a ∈ ⟦l⟧\n⊢ a ∣ Multiset.prod ⟦l⟧",
"after_state": "No Goals!"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.