Skip to content

Commit

Permalink
3 more
Browse files Browse the repository at this point in the history
  • Loading branch information
adomani committed Apr 23, 2024
1 parent 603322b commit 68a02d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 7 additions & 5 deletions Mathlib/Data/Finset/NoncommProd.lean
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ theorem mul_noncommProd_erase [DecidableEq α] (s : Multiset α) {a : α} (h : a
simp only [quot_mk_to_coe, mem_coe, coe_erase, noncommProd_coe] at comm h ⊢
suffices ∀ x ∈ l, ∀ y ∈ l, x * y = y * x by rw [List.prod_erase_of_comm h this]
intro x hx y hy
rcases eq_or_ne x y with rfl | hxy; rfl
rcases eq_or_ne x y with rfl | hxy
· rfl
exact comm hx hy hxy

theorem noncommProd_erase_mul [DecidableEq α] (s : Multiset α) {a : α} (h : a ∈ s) (comm)
Expand All @@ -244,7 +245,8 @@ theorem noncommProd_erase_mul [DecidableEq α] (s : Multiset α) {a : α} (h : a
suffices ∀ b ∈ erase s a, Commute a b by
rw [← (noncommProd_commute (s.erase a) comm' a this).eq, mul_noncommProd_erase s h comm comm']
intro b hb
rcases eq_or_ne a b with rfl | hab; rfl
rcases eq_or_ne a b with rfl | hab
· rfl
exact comm h (mem_of_mem_erase hb) hab

end Multiset
Expand Down Expand Up @@ -365,8 +367,8 @@ theorem noncommProd_map [MonoidHomClass F β γ] (s : Finset α) (f : α → β)
theorem noncommProd_eq_pow_card (s : Finset α) (f : α → β) (comm) (m : β) (h : ∀ x ∈ s, f x = m) :
s.noncommProd f comm = m ^ s.card := by
rw [noncommProd, Multiset.noncommProd_eq_pow_card _ _ m]
simp only [Finset.card_def, Multiset.card_map]
simpa using h
· simp only [Finset.card_def, Multiset.card_map]
· simpa using h
#align finset.noncomm_prod_eq_pow_card Finset.noncommProd_eq_pow_card
#align finset.noncomm_sum_eq_card_nsmul Finset.noncommSum_eq_card_nsmul

Expand Down Expand Up @@ -473,7 +475,7 @@ theorem noncommProd_mul_single [Fintype ι] [DecidableEq ι] (x : ∀ i, M i) :
· intro j _; dsimp
· rw [noncommProd_insert_of_not_mem _ _ _ _ (not_mem_erase _ _),
noncommProd_eq_pow_card (univ.erase i), one_pow, mul_one]
simp only [MonoidHom.mulSingle_apply, ne_eq, Pi.mulSingle_eq_same]
· simp only [MonoidHom.mulSingle_apply, ne_eq, Pi.mulSingle_eq_same]
· intro j hj
simp? at hj says simp only [mem_erase, ne_eq, mem_univ, and_true] at hj
simp only [MonoidHom.mulSingle_apply, Pi.mulSingle, Function.update, Eq.ndrec, Pi.one_apply,
Expand Down
10 changes: 5 additions & 5 deletions Mathlib/Data/Finsupp/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,8 @@ theorem prod_option_index [AddCommMonoid M] [CommMonoid N] (f : Option α →₀
· simp [some_zero, h_zero]
· intro f₁ f₂ h₁ h₂
rw [Finsupp.prod_add_index, h₁, h₂, some_add, Finsupp.prod_add_index]
simp only [h_add, Pi.add_apply, Finsupp.coe_add]
rw [mul_mul_mul_comm]
· simp only [h_add, Pi.add_apply, Finsupp.coe_add]
rw [mul_mul_mul_comm]
all_goals simp [h_zero, h_add]
· rintro (_ | a) m <;> simp [h_zero, h_add]
#align finsupp.prod_option_index Finsupp.prod_option_index
Expand Down Expand Up @@ -1598,9 +1598,9 @@ theorem mapRange_smul {_ : Monoid R} [AddMonoid M] [DistribMulAction R M] [AddMo
[DistribMulAction R N] {f : M → N} {hf : f 0 = 0} (c : R) (v : α →₀ M)
(hsmul : ∀ x, f (c • x) = c • f x) : mapRange f hf (c • v) = c • mapRange f hf v := by
erw [← mapRange_comp]
have : f ∘ (c • ·) = (c • ·) ∘ f := funext hsmul
simp_rw [this]
apply mapRange_comp
· have : f ∘ (c • ·) = (c • ·) ∘ f := funext hsmul
simp_rw [this]
apply mapRange_comp
simp only [Function.comp_apply, smul_zero, hf]
#align finsupp.map_range_smul Finsupp.mapRange_smul

Expand Down
1 change: 0 additions & 1 deletion Mathlib/Data/List/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,6 @@ theorem bidirectionalRec_cons_append {motive : List α → Sort*}
| nil => rfl
| cons x xs =>
simp only [List.cons_append]
congr
dsimp only [← List.cons_append]
suffices ∀ (ys init : List α) (hinit : init = ys) (last : α) (hlast : last = b),
(cons_append a init last
Expand Down

0 comments on commit 68a02d1

Please sign in to comment.