Skip to content

Commit 2c3e6f2

Browse files
mattrobballdagurtomas
authored andcommitted
chore: clean up uses of Pi.smul_apply (#9970)
After #9949, `Pi.smul_apply` can be used in `simp` again. This PR cleans up some workarounds.
1 parent 9ee43a5 commit 2c3e6f2

File tree

9 files changed

+11
-12
lines changed

9 files changed

+11
-12
lines changed

Mathlib/GroupTheory/GroupAction/Pi.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,9 @@ theorem Function.extend_smul {R α β γ : Type*} [SMul R γ] (r : R) (f : α
270270
funext fun x => by
271271
-- Porting note: Lean4 is unable to automatically call `Classical.propDecidable`
272272
haveI : Decidable (∃ a : α, f a = x) := Classical.propDecidable _
273-
rw [extend_def, Pi.smul_apply, Pi.smul_apply, extend_def]
273+
simp only [extend_def, Pi.smul_apply]
274274
split_ifs <;>
275275
rfl
276-
-- convert (apply_dite (fun c : γ => r • c) _ _ _).symm
277276
#align function.extend_smul Function.extend_smul
278277
#align function.extend_vadd Function.extend_vadd
279278

Mathlib/LinearAlgebra/FiniteDimensional.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1)
321321
apply_fun b.repr using b.repr.toEquiv.injective
322322
apply_fun Equiv.finsuppUnique
323323
simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
324-
RingHom.id_apply, smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
324+
smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
325325
exact div_mul_cancel _ h
326326
right_inv := fun f => by
327327
ext

Mathlib/LinearAlgebra/LinearIndependent.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ theorem LinearIndependent.group_smul {G : Type*} [hG : Group G] [DistribMulActio
613613
exact (hgs i hi).symm ▸ smul_zero _
614614
· rw [← hsum, Finset.sum_congr rfl _]
615615
intros
616-
erw [Pi.smul_apply, smul_assoc, smul_comm]
616+
dsimp
617+
rw [smul_assoc, smul_comm]
617618
#align linear_independent.group_smul LinearIndependent.group_smul
618619

619620
-- This lemma cannot be proved with `LinearIndependent.group_smul` since the action of

Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ theorem lpMeasToLpTrim_smul (hm : m ≤ m0) (c : 𝕜) (f : lpMeas F 𝕜 m p μ
438438
refine' (lpMeasToLpTrim_ae_eq hm _).trans _
439439
refine' (Lp.coeFn_smul _ _).trans _
440440
refine' (lpMeasToLpTrim_ae_eq hm f).mono fun x hx => _
441-
rw [Pi.smul_apply, Pi.smul_apply, hx]
441+
simp only [Pi.smul_apply, hx]
442442
#align measure_theory.Lp_meas_to_Lp_trim_smul MeasureTheory.lpMeasToLpTrim_smul
443443

444444
/-- `lpMeasSubgroupToLpTrim` preserves the norm. -/

Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ theorem condexp_smul (c : 𝕜) (f : α → F') : μ[c • f|m] =ᵐ[μ] c •
310310
rw [condexpL1_smul c f]
311311
refine' (@condexp_ae_eq_condexpL1 _ _ _ _ _ m _ _ hm _ f).mp _
312312
refine' (coeFn_smul c (condexpL1 hm μ f)).mono fun x hx1 hx2 => _
313-
rw [hx1, Pi.smul_apply, Pi.smul_apply, hx2]
313+
simp only [hx1, hx2, Pi.smul_apply]
314314
#align measure_theory.condexp_smul MeasureTheory.condexp_smul
315315

316316
theorem condexp_neg (f : α → F') : μ[-f|m] =ᵐ[μ] -μ[f|m] := by

Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ theorem condexpIndL1Fin_smul (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c :
110110
rw [condexpIndSMul_smul hs hμs c x]
111111
refine' (Lp.coeFn_smul _ _).trans _
112112
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => _
113-
rw [Pi.smul_apply, Pi.smul_apply, hy]
113+
simp only [Pi.smul_apply, hy]
114114
#align measure_theory.condexp_ind_L1_fin_smul MeasureTheory.condexpIndL1Fin_smul
115115

116116
theorem condexpIndL1Fin_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s)
@@ -122,7 +122,7 @@ theorem condexpIndL1Fin_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs
122122
rw [condexpIndSMul_smul' hs hμs c x]
123123
refine' (Lp.coeFn_smul _ _).trans _
124124
refine' (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => _
125-
rw [Pi.smul_apply, Pi.smul_apply, hy]
125+
simp only [Pi.smul_apply, hy]
126126
#align measure_theory.condexp_ind_L1_fin_smul' MeasureTheory.condexpIndL1Fin_smul'
127127

128128
theorem norm_condexpIndL1Fin_le (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :

Mathlib/MeasureTheory/Integral/SetIntegral.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ theorem Lp_toLp_restrict_smul (c : 𝕜) (f : Lp F p μ) (s : Set α) :
924924
refine' (Memℒp.coeFn_toLp ((Lp.memℒp (c • f)).restrict s)).mp _
925925
refine'
926926
(Lp.coeFn_smul c (Memℒp.toLp f ((Lp.memℒp f).restrict s))).mono fun x hx1 hx2 hx3 hx4 => _
927-
rw [hx2, hx1, Pi.smul_apply, hx3, hx4, Pi.smul_apply]
927+
simp only [hx2, hx1, hx3, hx4, Pi.smul_apply]
928928
set_option linter.uppercaseLean3 false in
929929
#align measure_theory.Lp_to_Lp_restrict_smul MeasureTheory.Lp_toLp_restrict_smul
930930

Mathlib/Probability/Martingale/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ theorem sub (hf : Martingale f ℱ μ) (hg : Martingale g ℱ μ) : Martingale (
129129
theorem smul (c : ℝ) (hf : Martingale f ℱ μ) : Martingale (c • f) ℱ μ := by
130130
refine' ⟨hf.adapted.smul c, fun i j hij => _⟩
131131
refine' (condexp_smul c (f j)).trans ((hf.2 i j hij).mono fun x hx => _)
132-
rw [Pi.smul_apply, hx, Pi.smul_apply, Pi.smul_apply]
132+
simp only [Pi.smul_apply, hx]
133133
#align measure_theory.martingale.smul MeasureTheory.Martingale.smul
134134

135135
theorem supermartingale [Preorder E] (hf : Martingale f ℱ μ) : Supermartingale f ℱ μ :=

Mathlib/Topology/ContinuousFunction/Algebra.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,7 @@ theorem coe_smul [SMul R M] [ContinuousConstSMul R M] (c : R) (f : C(α, M)) :
619619
#align continuous_map.coe_smul ContinuousMap.coe_smul
620620
#align continuous_map.coe_vadd ContinuousMap.coe_vadd
621621

622-
-- Porting note: adding `@[simp]` here, as `Pi.smul_apply` no longer fires.
623-
@[to_additive (attr := simp)]
622+
@[to_additive]
624623
theorem smul_apply [SMul R M] [ContinuousConstSMul R M] (c : R) (f : C(α, M)) (a : α) :
625624
(c • f) a = c • f a :=
626625
rfl

0 commit comments

Comments
 (0)