l3lab/ntp-mathlib huggingface dataset:
theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : ℝ × ℝ → E) :
    (∫ p in polarCoord.target, p.1 • f (polarCoord.symm p)) = ∫ p, f p := by
  set B : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ × ℝ := fun p =>
    LinearMap.toContinuousLinearMap (Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ)
      !![cos p.2, -p.1 * sin p.2; sin p.2, p.1 * cos p.2])
  have A : ∀ p ∈ polarCoord.symm.source, HasFDerivAt polarCoord.symm (B p) p := fun p _ =>
    hasFDerivAt_polarCoord_symm p
  have B_det : ∀ p, (B p).det = p.1 := by
    intro p
    conv_rhs => rw [← one_mul p.1, ← cos_sq_add_sin_sq p.2]
    simp only [neg_mul, LinearMap.det_toContinuousLinearMap, LinearMap.det_toLin,
      Matrix.det_fin_two_of, sub_neg_eq_add]
    ring
  symm
  calc
    ∫ p, f p = ∫ p in polarCoord.source, f p := by
      rw [← integral_univ]
      apply set_integral_congr_set_ae
      exact polarCoord_source_ae_eq_univ.symm
    _ = ∫ p in polarCoord.target, abs (B p).det • f (polarCoord.symm p) := by
      apply integral_target_eq_integral_abs_det_fderiv_smul volume A
    _ = ∫ p in polarCoord.target, p.1 • f (polarCoord.symm p) := by
      

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ × ℝ → E
B : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ × ℝ :=
  fun p =>
    LinearMap.toContinuousLinearMap
      ((Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ))
        (Matrix.of ![![cos p.2, -p.1 * sin p.2], ![sin p.2, p.1 * cos p.2]]))
A :
  ∀ p ∈ (PartialHomeomorph.symm polarCoord).toPartialEquiv.source,
    HasFDerivAt (↑(PartialHomeomorph.symm polarCoord)) (B p) p
B_det : ∀ (p : ℝ × ℝ), ContinuousLinearMap.det (B p) = p.1
⊢ ∫ (p : ℝ × ℝ) in polarCoord.target, |ContinuousLinearMap.det (B p)| • f (↑(PartialHomeomorph.symm polarCoord) p) =
    ∫ (p : ℝ × ℝ) in polarCoord.target, p.1 • f (↑(PartialHomeomorph.symm polarCoord) p)

Next tactic:
apply set_integral_congr polarCoord.open_target.measurableSet fun x hx => ?_
theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : ℝ × ℝ → E) :
    (∫ p in polarCoord.target, p.1 • f (polarCoord.symm p)) = ∫ p, f p := by
  set B : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ × ℝ := fun p =>
    LinearMap.toContinuousLinearMap (Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ)
      !![cos p.2, -p.1 * sin p.2; sin p.2, p.1 * cos p.2])
  have A : ∀ p ∈ polarCoord.symm.source, HasFDerivAt polarCoord.symm (B p) p := fun p _ =>
    hasFDerivAt_polarCoord_symm p
  have B_det : ∀ p, (B p).det = p.1 := by
    intro p
    conv_rhs => rw [← one_mul p.1, ← cos_sq_add_sin_sq p.2]
    simp only [neg_mul, LinearMap.det_toContinuousLinearMap, LinearMap.det_toLin,
      Matrix.det_fin_two_of, sub_neg_eq_add]
    ring
  symm
  calc
    ∫ p, f p = ∫ p in polarCoord.source, f p := by
      rw [← integral_univ]
      apply set_integral_congr_set_ae
      exact polarCoord_source_ae_eq_univ.symm
    _ = ∫ p in polarCoord.target, abs (B p).det • f (polarCoord.symm p) := by
      apply integral_target_eq_integral_abs_det_fderiv_smul volume A
    _ = ∫ p in polarCoord.target, p.1 • f (polarCoord.symm p) := by
      apply set_integral_congr polarCoord.open_target.measurableSet fun x hx => ?_
      

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ × ℝ → E
B : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ × ℝ :=
  fun p =>
    LinearMap.toContinuousLinearMap
      ((Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ))
        (Matrix.of ![![cos p.2, -p.1 * sin p.2], ![sin p.2, p.1 * cos p.2]]))
A :
  ∀ p ∈ (PartialHomeomorph.symm polarCoord).toPartialEquiv.source,
    HasFDerivAt (↑(PartialHomeomorph.symm polarCoord)) (B p) p
B_det : ∀ (p : ℝ × ℝ), ContinuousLinearMap.det (B p) = p.1
x : ℝ × ℝ
hx : x ∈ polarCoord.target
⊢ |ContinuousLinearMap.det (B x)| • f (↑(PartialHomeomorph.symm polarCoord) x) =
    x.1 • f (↑(PartialHomeomorph.symm polarCoord) x)

Next tactic:
rw [B_det, abs_of_pos]
theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : ℝ × ℝ → E) :
    (∫ p in polarCoord.target, p.1 • f (polarCoord.symm p)) = ∫ p, f p := by
  set B : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ × ℝ := fun p =>
    LinearMap.toContinuousLinearMap (Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ)
      !![cos p.2, -p.1 * sin p.2; sin p.2, p.1 * cos p.2])
  have A : ∀ p ∈ polarCoord.symm.source, HasFDerivAt polarCoord.symm (B p) p := fun p _ =>
    hasFDerivAt_polarCoord_symm p
  have B_det : ∀ p, (B p).det = p.1 := by
    intro p
    conv_rhs => rw [← one_mul p.1, ← cos_sq_add_sin_sq p.2]
    simp only [neg_mul, LinearMap.det_toContinuousLinearMap, LinearMap.det_toLin,
      Matrix.det_fin_two_of, sub_neg_eq_add]
    ring
  symm
  calc
    ∫ p, f p = ∫ p in polarCoord.source, f p := by
      rw [← integral_univ]
      apply set_integral_congr_set_ae
      exact polarCoord_source_ae_eq_univ.symm
    _ = ∫ p in polarCoord.target, abs (B p).det • f (polarCoord.symm p) := by
      apply integral_target_eq_integral_abs_det_fderiv_smul volume A
    _ = ∫ p in polarCoord.target, p.1 • f (polarCoord.symm p) := by
      apply set_integral_congr polarCoord.open_target.measurableSet fun x hx => ?_
      rw [B_det, abs_of_pos]
      

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℝ × ℝ → E
B : ℝ × ℝ → ℝ × ℝ →L[ℝ] ℝ × ℝ :=
  fun p =>
    LinearMap.toContinuousLinearMap
      ((Matrix.toLin (Basis.finTwoProd ℝ) (Basis.finTwoProd ℝ))
        (Matrix.of ![![cos p.2, -p.1 * sin p.2], ![sin p.2, p.1 * cos p.2]]))
A :
  ∀ p ∈ (PartialHomeomorph.symm polarCoord).toPartialEquiv.source,
    HasFDerivAt (↑(PartialHomeomorph.symm polarCoord)) (B p) p
B_det : ∀ (p : ℝ × ℝ), ContinuousLinearMap.det (B p) = p.1
x : ℝ × ℝ
hx : x ∈ polarCoord.target
⊢ 0 < x.1

Next tactic:
exact hx.1
protected theorem polarCoord_apply (a : ℂ) :
    Complex.polarCoord a = (Complex.abs a, Complex.arg a) := by
  

Proof state:
a : ℂ
⊢ ↑Complex.polarCoord a = (abs a, arg a)

Next tactic:
simp_rw [Complex.abs_def, Complex.normSq_apply, ← pow_two]
protected theorem polarCoord_apply (a : ℂ) :
    Complex.polarCoord a = (Complex.abs a, Complex.arg a) := by
  simp_rw [Complex.abs_def, Complex.normSq_apply, ← pow_two]
  

Proof state:
a : ℂ
⊢ ↑Complex.polarCoord a = (Real.sqrt (a.re ^ 2 + a.im ^ 2), arg a)

Next tactic:
rfl
protected theorem polarCoord_source :
    Complex.polarCoord.source = {a | 0 < a.re} ∪ {a | a.im ≠ 0} := by 

Proof state:
⊢ Complex.polarCoord.source = {a | 0 < a.re} ∪ {a | a.im ≠ 0}

Next tactic:
simp [Complex.polarCoord]
protected theorem polarCoord_target :
    Complex.polarCoord.target = Set.Ioi (0 : ℝ) ×ˢ Set.Ioo (-π) π := by 

Proof state:
⊢ Complex.polarCoord.target = Set.Ioi 0 ×ˢ Set.Ioo (-π) π

Next tactic:
simp [Complex.polarCoord]
@[simp]
protected theorem polarCoord_symm_apply (p : ℝ × ℝ) :
    Complex.polarCoord.symm p = p.1 * (Real.cos p.2 + Real.sin p.2 * Complex.I) := by
  

Proof state:
p : ℝ × ℝ
⊢ ↑(PartialHomeomorph.symm Complex.polarCoord) p = ↑p.1 * (↑(Real.cos p.2) + ↑(Real.sin p.2) * I)

Next tactic:
simp [Complex.polarCoord, equivRealProdClm_symm_apply, mul_add, mul_assoc]
theorem polardCoord_symm_abs (p : ℝ × ℝ) :
    Complex.abs (Complex.polarCoord.symm p) = |p.1| := by 

Proof state:
p : ℝ × ℝ
⊢ abs (↑(PartialHomeomorph.symm Complex.polarCoord) p) = |p.1|

Next tactic:
simp
protected theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] (f : ℂ → E) :
    (∫ p in polarCoord.target, p.1 • f (Complex.polarCoord.symm p)) = ∫ p, f p := by
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℂ → E
⊢ ∫ (p : ℝ × ℝ) in polarCoord.target, p.1 • f (↑(PartialHomeomorph.symm Complex.polarCoord) p) = ∫ (p : ℂ), f p

Next tactic:
rw [← (Complex.volume_preserving_equiv_real_prod.symm).integral_comp
    measurableEquivRealProd.symm.measurableEmbedding, ← integral_comp_polarCoord_symm]
protected theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] (f : ℂ → E) :
    (∫ p in polarCoord.target, p.1 • f (Complex.polarCoord.symm p)) = ∫ p, f p := by
  rw [← (Complex.volume_preserving_equiv_real_prod.symm).integral_comp
    measurableEquivRealProd.symm.measurableEmbedding, ← integral_comp_polarCoord_symm]
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : ℂ → E
⊢ ∫ (p : ℝ × ℝ) in polarCoord.target, p.1 • f (↑(PartialHomeomorph.symm Complex.polarCoord) p) =
    ∫ (p : ℝ × ℝ) in polarCoord.target, p.1 • f (measurableEquivRealProd.symm (↑(PartialHomeomorph.symm polarCoord) p))

Next tactic:
rfl
@[ext]
lemma DoubleCentralizer.ext (𝕜 : Type u) (A : Type v) [NontriviallyNormedField 𝕜]
    [NonUnitalNormedRing A] [NormedSpace 𝕜 A] [SMulCommClass 𝕜 A A] [IsScalarTower 𝕜 A A]
    (a b : 𝓜(𝕜, A)) (h : a.toProd = b.toProd) : a = b := by
  

Proof state:
𝕜 : Type u
A : Type v
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a b : 𝓜(𝕜, A)
h : a.toProd = b.toProd
⊢ a = b

Next tactic:
cases a
@[ext]
lemma DoubleCentralizer.ext (𝕜 : Type u) (A : Type v) [NontriviallyNormedField 𝕜]
    [NonUnitalNormedRing A] [NormedSpace 𝕜 A] [SMulCommClass 𝕜 A A] [IsScalarTower 𝕜 A A]
    (a b : 𝓜(𝕜, A)) (h : a.toProd = b.toProd) : a = b := by
  cases a
  

Proof state:
case mk
𝕜 : Type u
A : Type v
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
b : 𝓜(𝕜, A)
toProd✝ : (A →L[𝕜] A) × (A →L[𝕜] A)
central✝ : ∀ (x y : A), toProd✝.2 x * y = x * toProd✝.1 y
h : { toProd := toProd✝, central := central✝ }.toProd = b.toProd
⊢ { toProd := toProd✝, central := central✝ } = b

Next tactic:
cases b
@[ext]
lemma DoubleCentralizer.ext (𝕜 : Type u) (A : Type v) [NontriviallyNormedField 𝕜]
    [NonUnitalNormedRing A] [NormedSpace 𝕜 A] [SMulCommClass 𝕜 A A] [IsScalarTower 𝕜 A A]
    (a b : 𝓜(𝕜, A)) (h : a.toProd = b.toProd) : a = b := by
  cases a
  cases b
  

Proof state:
case mk.mk
𝕜 : Type u
A : Type v
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
toProd✝¹ : (A →L[𝕜] A) × (A →L[𝕜] A)
central✝¹ : ∀ (x y : A), toProd✝¹.2 x * y = x * toProd✝¹.1 y
toProd✝ : (A →L[𝕜] A) × (A →L[𝕜] A)
central✝ : ∀ (x y : A), toProd✝.2 x * y = x * toProd✝.1 y
h : { toProd := toProd✝¹, central := central✝¹ }.toProd = { toProd := toProd✝, central := central✝ }.toProd
⊢ { toProd := toProd✝¹, central := central✝¹ } = { toProd := toProd✝, central := central✝ }

Next tactic:
simpa using h
theorem range_toProd :
    Set.range toProd = { lr : (A →L[𝕜] A) × (A →L[𝕜] A) | ∀ x y, lr.2 x * y = x * lr.1 y } :=
  Set.ext fun x =>
    ⟨by
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
x : (A →L[𝕜] A) × (A →L[𝕜] A)
⊢ x ∈ Set.range toProd → x ∈ {lr | ∀ (x y : A), lr.2 x * y = x * lr.1 y}

Next tactic:
rintro ⟨a, rfl⟩
theorem range_toProd :
    Set.range toProd = { lr : (A →L[𝕜] A) × (A →L[𝕜] A) | ∀ x y, lr.2 x * y = x * lr.1 y } :=
  Set.ext fun x =>
    ⟨by
      rintro ⟨a, rfl⟩
      

Proof state:
case intro
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
⊢ a.toProd ∈ {lr | ∀ (x y : A), lr.2 x * y = x * lr.1 y}

Next tactic:
exact a.central
instance instAdd : Add 𝓜(𝕜, A) where
  add a b :=
    { toProd := a.toProd + b.toProd
      central := fun x y =>
        show (a.snd + b.snd) x * y = x * (a.fst + b.fst) y by
          

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a b : 𝓜(𝕜, A)
x y : A
⊢ (a.toProd.2 + b.toProd.2) x * y = x * (a.toProd.1 + b.toProd.1) y

Next tactic:
simp only [ContinuousLinearMap.add_apply, mul_add, add_mul, central]
instance instNeg : Neg 𝓜(𝕜, A) where
  neg a :=
    { toProd := -a.toProd
      central := fun x y =>
        show -a.snd x * y = x * -a.fst y by
          

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
x y : A
⊢ -a.toProd.2 x * y = x * -a.toProd.1 y

Next tactic:
simp only [ContinuousLinearMap.neg_apply, neg_mul, mul_neg, central]
instance instSub : Sub 𝓜(𝕜, A) where
  sub a b :=
    { toProd := a.toProd - b.toProd
      central := fun x y =>
        show (a.snd - b.snd) x * y = x * (a.fst - b.fst) y by
          

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a b : 𝓜(𝕜, A)
x y : A
⊢ (a.toProd.2 - b.toProd.2) x * y = x * (a.toProd.1 - b.toProd.1) y

Next tactic:
simp only [ContinuousLinearMap.sub_apply, _root_.sub_mul, _root_.mul_sub, central]
instance instSMul : SMul S 𝓜(𝕜, A) where
  smul s a :=
    { toProd := s • a.toProd
      central := fun x y =>
        show (s • a.snd) x * y = x * (s • a.fst) y by
          

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝¹⁰ : NontriviallyNormedField 𝕜
inst✝⁹ : NonUnitalNormedRing A
inst✝⁸ : NormedSpace 𝕜 A
inst✝⁷ : SMulCommClass 𝕜 A A
inst✝⁶ : IsScalarTower 𝕜 A A
S : Type u_3
inst✝⁵ : Monoid S
inst✝⁴ : DistribMulAction S A
inst✝³ : SMulCommClass 𝕜 S A
inst✝² : ContinuousConstSMul S A
inst✝¹ : IsScalarTower S A A
inst✝ : SMulCommClass S A A
s : S
a : 𝓜(𝕜, A)
x y : A
⊢ (s • a.toProd.2) x * y = x * (s • a.toProd.1) y

Next tactic:
simp only [ContinuousLinearMap.smul_apply, mul_smul_comm, smul_mul_assoc, central]
instance instMul : Mul 𝓜(𝕜, A) where
  mul a b :=
    { toProd := (a.fst.comp b.fst, b.snd.comp a.snd)
      central := fun x y => show b.snd (a.snd x) * y = x * a.fst (b.fst y) by 

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a b : 𝓜(𝕜, A)
x y : A
⊢ b.toProd.2 (a.toProd.2 x) * y = x * a.toProd.1 (b.toProd.1 y)

Next tactic:
simp only [central]
instance instNatCast : NatCast 𝓜(𝕜, A) where
  natCast n :=
    ⟨n, fun x y => by
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
n : ℕ
x y : A
⊢ (↑n).2 x * y = x * (↑n).1 y

Next tactic:
rw [Prod.snd_natCast, Prod.fst_natCast]
instance instNatCast : NatCast 𝓜(𝕜, A) where
  natCast n :=
    ⟨n, fun x y => by
      rw [Prod.snd_natCast, Prod.fst_natCast]
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
n : ℕ
x y : A
⊢ ↑n x * y = x * ↑n y

Next tactic:
simp only [← Nat.smul_one_eq_coe, smul_apply, one_apply, mul_smul_comm, smul_mul_assoc]
instance instIntCast : IntCast 𝓜(𝕜, A) where
  intCast n :=
    ⟨n, fun x y => by
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
n : ℤ
x y : A
⊢ (↑n).2 x * y = x * (↑n).1 y

Next tactic:
rw [Prod.snd_intCast, Prod.fst_intCast]
instance instIntCast : IntCast 𝓜(𝕜, A) where
  intCast n :=
    ⟨n, fun x y => by
      rw [Prod.snd_intCast, Prod.fst_intCast]
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
n : ℤ
x y : A
⊢ ↑n x * y = x * ↑n y

Next tactic:
simp only [← Int.smul_one_eq_coe, smul_apply, one_apply, mul_smul_comm, smul_mul_assoc]
instance instPow : Pow 𝓜(𝕜, A) ℕ where
  pow a n :=
    ⟨a.toProd ^ n, fun x y => by
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
n : ℕ
x y : A
⊢ (a.toProd ^ n).2 x * y = x * (a.toProd ^ n).1 y

Next tactic:
induction' n with k hk generalizing x y
instance instPow : Pow 𝓜(𝕜, A) ℕ where
  pow a n :=
    ⟨a.toProd ^ n, fun x y => by
      induction' n with k hk generalizing x y
      · 

Proof state:
case zero
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
x y : A
⊢ (a.toProd ^ Nat.zero).2 x * y = x * (a.toProd ^ Nat.zero).1 y

Next tactic:
rfl
instance instPow : Pow 𝓜(𝕜, A) ℕ where
  pow a n :=
    ⟨a.toProd ^ n, fun x y => by
      induction' n with k hk generalizing x y
      · rfl
      · 

Proof state:
case succ
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
k : ℕ
hk : ∀ (x y : A), (a.toProd ^ k).2 x * y = x * (a.toProd ^ k).1 y
x y : A
⊢ (a.toProd ^ Nat.succ k).2 x * y = x * (a.toProd ^ Nat.succ k).1 y

Next tactic:
rw [Prod.pow_snd, Prod.pow_fst] at hk ⊢
instance instPow : Pow 𝓜(𝕜, A) ℕ where
  pow a n :=
    ⟨a.toProd ^ n, fun x y => by
      induction' n with k hk generalizing x y
      · rfl
      · rw [Prod.pow_snd, Prod.pow_fst] at hk ⊢
        

Proof state:
case succ
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
k : ℕ
hk : ∀ (x y : A), (a.toProd.2 ^ k) x * y = x * (a.toProd.1 ^ k) y
x y : A
⊢ (a.toProd.2 ^ Nat.succ k) x * y = x * (a.toProd.1 ^ Nat.succ k) y

Next tactic:
rw [pow_succ a.snd, mul_apply, a.central, hk, pow_succ' a.fst, mul_apply]
theorem range_toProdMulOpposite :
    Set.range toProdMulOpposite =
      { lr : (A →L[𝕜] A) × (A →L[𝕜] A)ᵐᵒᵖ | ∀ x y, unop lr.2 x * y = x * lr.1 y } :=
  Set.ext fun x =>
    ⟨by
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
x : (A →L[𝕜] A) × (A →L[𝕜] A)ᵐᵒᵖ
⊢ x ∈ Set.range toProdMulOpposite → x ∈ {lr | ∀ (x y : A), (unop lr.2) x * y = x * lr.1 y}

Next tactic:
rintro ⟨a, rfl⟩
theorem range_toProdMulOpposite :
    Set.range toProdMulOpposite =
      { lr : (A →L[𝕜] A) × (A →L[𝕜] A)ᵐᵒᵖ | ∀ x y, unop lr.2 x * y = x * lr.1 y } :=
  Set.ext fun x =>
    ⟨by
      rintro ⟨a, rfl⟩
      

Proof state:
case intro
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
a : 𝓜(𝕜, A)
⊢ toProdMulOpposite a ∈ {lr | ∀ (x y : A), (unop lr.2) x * y = x * lr.1 y}

Next tactic:
exact a.central
instance instAlgebra : Algebra 𝕜 𝓜(𝕜, A) where
  toFun k :=
    { toProd := algebraMap 𝕜 ((A →L[𝕜] A) × (A →L[𝕜] A)) k
      central := fun x y => by
        

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁴ : NontriviallyNormedField 𝕜
inst✝³ : NonUnitalNormedRing A
inst✝² : NormedSpace 𝕜 A
inst✝¹ : SMulCommClass 𝕜 A A
inst✝ : IsScalarTower 𝕜 A A
k : 𝕜
x y : A
⊢ ((algebraMap 𝕜 ((A →L[𝕜] A) × (A →L[𝕜] A))) k).2 x * y = x * ((algebraMap 𝕜 ((A →L[𝕜] A) × (A →L[𝕜] A))) k).1 y

Next tactic:
simp_rw [Prod.algebraMap_apply, Algebra.algebraMap_eq_smul_one, smul_apply, one_apply,
          mul_smul_comm, smul_mul_assoc]
/-- The star operation on `a : 𝓜(𝕜, A)` is given by
`(star a).toProd = (star ∘ a.snd ∘ star, star ∘ a.fst ∘ star)`. -/
instance instStar : Star 𝓜(𝕜, A) where
  star a :=
    { fst :=
        (((starₗᵢ 𝕜 : A ≃ₗᵢ⋆[𝕜] A) : A →L⋆[𝕜] A).comp a.snd).comp
          ((starₗᵢ 𝕜 : A ≃ₗᵢ⋆[𝕜] A) : A →L⋆[𝕜] A)
      snd :=
        (((starₗᵢ 𝕜 : A ≃ₗᵢ⋆[𝕜] A) : A →L⋆[𝕜] A).comp a.fst).comp
          ((starₗᵢ 𝕜 : A ≃ₗᵢ⋆[𝕜] A) : A →L⋆[𝕜] A)
      central := fun x y => by
        

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NonUnitalNormedRing A
inst✝⁶ : NormedSpace 𝕜 A
inst✝⁵ : SMulCommClass 𝕜 A A
inst✝⁴ : IsScalarTower 𝕜 A A
inst✝³ : StarRing 𝕜
inst✝² : StarRing A
inst✝¹ : StarModule 𝕜 A
inst✝ : NormedStarGroup A
a : 𝓜(𝕜, A)
x y : A
⊢ (comp (comp (↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv)) a.toProd.2)
              ↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv),
            comp (comp (↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv)) a.toProd.1)
              ↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv)).2
        x *
      y =
    x *
      (comp (comp (↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv)) a.toProd.2)
              ↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv),
            comp (comp (↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv)) a.toProd.1)
              ↑(ContinuousLinearEquiv.mk (starₗᵢ 𝕜).toLinearEquiv)).1
        y

Next tactic:
simpa only [star_mul, star_star] using (congr_arg star (a.central (star y) (star x))).symm
instance instStarAddMonoid : StarAddMonoid 𝓜(𝕜, A) :=
  { DoubleCentralizer.instStar with
    star_involutive := fun x => by 

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NonUnitalNormedRing A
inst✝⁶ : NormedSpace 𝕜 A
inst✝⁵ : SMulCommClass 𝕜 A A
inst✝⁴ : IsScalarTower 𝕜 A A
inst✝³ : StarRing 𝕜
inst✝² : StarRing A
inst✝¹ : StarModule 𝕜 A
inst✝ : NormedStarGroup A
src✝ : Star 𝓜(𝕜, A) := instStar
x : 𝓜(𝕜, A)
⊢ star (star x) = x

Next tactic:
ext
instance instStarAddMonoid : StarAddMonoid 𝓜(𝕜, A) :=
  { DoubleCentralizer.instStar with
    star_involutive := fun x => by ext <;> 

Proof state:
case h.a.h
𝕜 : Type u_1
A : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NonUnitalNormedRing A
inst✝⁶ : NormedSpace 𝕜 A
inst✝⁵ : SMulCommClass 𝕜 A A
inst✝⁴ : IsScalarTower 𝕜 A A
inst✝³ : StarRing 𝕜
inst✝² : StarRing A
inst✝¹ : StarModule 𝕜 A
inst✝ : NormedStarGroup A
src✝ : Star 𝓜(𝕜, A) := instStar
x : 𝓜(𝕜, A)
x✝ : A
⊢ (star (star x)).toProd.1 x✝ = x.toProd.1 x✝

Next tactic:
simp only [star_fst, star_snd, star_star]
instance instStarAddMonoid : StarAddMonoid 𝓜(𝕜, A) :=
  { DoubleCentralizer.instStar with
    star_involutive := fun x => by ext <;> 

Proof state:
case h.a.h
𝕜 : Type u_1
A : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NonUnitalNormedRing A
inst✝⁶ : NormedSpace 𝕜 A
inst✝⁵ : SMulCommClass 𝕜 A A
inst✝⁴ : IsScalarTower 𝕜 A A
inst✝³ : StarRing 𝕜
inst✝² : StarRing A
inst✝¹ : StarModule 𝕜 A
inst✝ : NormedStarGroup A
src✝ : Star 𝓜(𝕜, A) := instStar
x : 𝓜(𝕜, A)
x✝ : A
⊢ (star (star x)).toProd.2 x✝ = x.toProd.2 x✝

Next tactic:
simp only [star_fst, star_snd, star_star]
instance instStarAddMonoid : StarAddMonoid 𝓜(𝕜, A) :=
  { DoubleCentralizer.instStar with
    star_involutive := fun x => by ext <;> simp only [star_fst, star_snd, star_star]
    star_add := fun x y => by
      

Proof state:
𝕜 : Type u_1
A : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NonUnitalNormedRing A
inst✝⁶ : NormedSpace 𝕜 A
inst✝⁵ : SMulCommClass 𝕜 A A
inst✝⁴ : IsScalarTower 𝕜 A A
inst✝³ : StarRing 𝕜
inst✝² : StarRing A
inst✝¹ : StarModule 𝕜 A
inst✝ : NormedStarGroup A
src✝ : Star 𝓜(𝕜, A) := instStar
x y : 𝓜(𝕜, A)
⊢ star (x + y) = star x + star y

Next tactic:
ext
instance instStarAddMonoid : StarAddMonoid 𝓜(𝕜, A) :=
  { DoubleCentralizer.instStar with
    star_involutive := fun x => by ext <;> simp only [star_fst, star_snd, star_star]
    star_add := fun x y => by
      ext <;>
        

Proof state:
case h.a.h
𝕜 : Type u_1
A : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜
inst✝⁷ : NonUnitalNormedRing A
inst✝⁶ : NormedSpace 𝕜 A
inst✝⁵ : SMulCommClass 𝕜 A A
inst✝⁴ : IsScalarTower 𝕜 A A
inst✝³ : StarRing 𝕜
inst✝² : StarRing A
inst✝¹ : StarModule 𝕜 A
inst✝ : NormedStarGroup A
src✝ : Star 𝓜(𝕜, A) := instStar
x y : 𝓜(𝕜, A)
x✝ : A
⊢ (star (x + y)).toProd.1 x✝ = (star x + star y).toProd.1 x✝

Next tactic:
simp only [star_fst, star_snd, add_fst, add_snd, ContinuousLinearMap.add_apply, star_add]