Skip to content

Commit 89898ca

Browse files
committed
refactor(Topology/Algebra/Module/LinearMap): adjust statement of coe_mul and coe_pow (leanprover-community#35269)
In `Topology/Algebra/Module/LinearMap`, it seems to be the pattern to have `coe_zero`/`coe_id`/`coe_add`/`coe_neg`/`coe_sub` for the coercions from `ContinuousLinearMap` to `LinearMap` and primed versions `coe_zero'`/`coe_id'`/`coe_add'`/`coe_neg'`/`coe_sub'` for the coercions from `ContinuousLinearMap` to `Function`. This PR adjusts the statements of `coe_mul` and `coe_pow` to fit this pattern, as well as adding `coe_one`. Co-authored-by: tb65536 <thomas.l.browning@gmail.com>
1 parent 7470699 commit 89898ca

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

Mathlib/Analysis/CStarAlgebra/Multiplier.lean

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,21 +404,16 @@ theorem star_snd (a : 𝓜(𝕜, A)) (b : A) : (star a).snd b = star (a.fst (sta
404404

405405
instance instStarAddMonoid : StarAddMonoid 𝓜(𝕜, A) :=
406406
{ DoubleCentralizer.instStar with
407-
star_involutive := fun x => by ext <;> simp only [star_fst, star_snd, star_star]
408-
star_add := fun x y => by
409-
ext <;>
410-
simp only [star_fst, star_snd, add_fst, add_snd, ContinuousLinearMap.add_apply, star_add] }
407+
star_involutive _ := by ext <;> simp
408+
star_add _ _ := by ext <;> simp }
411409

412410
instance instStarRing : StarRing 𝓜(𝕜, A) :=
413411
{ DoubleCentralizer.instStarAddMonoid with
414-
star_mul := fun a b => by
415-
ext <;>
416-
simp only [star_fst, star_snd, mul_fst, mul_snd, star_star, ContinuousLinearMap.coe_mul,
417-
Function.comp_apply] }
412+
star_mul _ _ := by ext <;> simp }
418413

419414
instance instStarModule : StarModule 𝕜 𝓜(𝕜, A) :=
420415
{ DoubleCentralizer.instStarAddMonoid (𝕜 := 𝕜) (A := A) with
421-
star_smul := fun k a => by ext <;> exact star_smul _ _ }
416+
star_smul _ _ := by ext <;> exact star_smul _ _ }
422417

423418
end Star
424419

Mathlib/Topology/Algebra/Module/LinearMap.lean

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ theorem coe_id : (ContinuousLinearMap.id R₁ M₁ : M₁ →ₗ[R₁] M₁) = L
351351
theorem coe_id' : ⇑(ContinuousLinearMap.id R₁ M₁) = id :=
352352
rfl
353353

354+
@[simp, norm_cast]
355+
theorem coe_one : ((1 : M₁ →L[R₁] M₁) : M₁ →ₗ[R₁] M₁) = 1 :=
356+
rfl
357+
354358
@[simp, norm_cast]
355359
theorem toContinuousAddMonoidHom_id :
356360
(ContinuousLinearMap.id R₁ M₁ : ContinuousAddMonoidHom M₁ M₁) = .id _ := rfl
@@ -531,8 +535,12 @@ instance instMul : Mul (M₁ →L[R₁] M₁) :=
531535
theorem mul_def (f g : M₁ →L[R₁] M₁) : f * g = f.comp g :=
532536
rfl
533537

534-
@[simp]
535-
theorem coe_mul (f g : M₁ →L[R₁] M₁) : ⇑(f * g) = f ∘ g :=
538+
@[simp, norm_cast]
539+
theorem coe_mul (f g : M₁ →L[R₁] M₁) : (↑(f * g) : M₁ →ₗ[R₁] M₁) = f * g :=
540+
rfl
541+
542+
@[simp, norm_cast]
543+
theorem coe_mul' (f g : M₁ →L[R₁] M₁) : ⇑(f * g) = f ∘ g :=
536544
rfl
537545

538546
theorem mul_apply (f g : M₁ →L[R₁] M₁) (x : M₁) : (f * g) x = f (g x) :=
@@ -545,9 +553,14 @@ instance monoidWithZero : MonoidWithZero (M₁ →L[R₁] M₁) where
545553
one_mul _ := ext fun _ => rfl
546554
mul_assoc _ _ _ := ext fun _ => rfl
547555

548-
theorem coe_pow (f : M₁ →L[R₁] M₁) (n : ℕ) : ⇑(f ^ n) = f^[n] :=
556+
@[simp, norm_cast]
557+
theorem coe_pow' (f : M₁ →L[R₁] M₁) (n : ℕ) : ⇑(f ^ n) = f^[n] :=
549558
hom_coe_pow _ rfl (fun _ _ ↦ rfl) _ _
550559

560+
@[simp, norm_cast]
561+
theorem coe_pow (f : M₁ →L[R₁] M₁) (n : ℕ) : (↑(f ^ n) : M₁ →ₗ[R₁] M₁) = f ^ n :=
562+
DFunLike.ext' <| (coe_pow' f n).trans <| .symm <| hom_coe_pow _ rfl (fun _ _ ↦ rfl) _ _
563+
551564
instance instNatCast [ContinuousAdd M₁] : NatCast (M₁ →L[R₁] M₁) where
552565
natCast n := n • (1 : M₁ →L[R₁] M₁)
553566

0 commit comments

Comments
 (0)