l3lab/ntp-mathlib huggingface dataset:
/-- Pushforward a `SMulWithZero` structure along a surjective zero-preserving homomorphism.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Surjective.smulWithZero (f : ZeroHom M M') (hf : Function.Surjective f)
    (smul : ∀ (a : R) (b), f (a • b) = a • f b) :
    SMulWithZero R M' where
  smul := (· • ·)
  zero_smul m := by
    rcases hf m with ⟨x, rfl⟩
    

Proof state:
case intro
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁵ : Zero R
inst✝⁴ : Zero M
inst✝³ : SMulWithZero R M
a : R
b : M
inst✝² : Zero R'
inst✝¹ : Zero M'
inst✝ : SMul R M'
f : ZeroHom M M'
hf : Surjective ⇑f
smul : ∀ (a : R) (b : M), f (a • b) = a • f b
x : M
⊢ 0 • f x = 0

Next tactic:
simp [← smul]
/-- Compose a `SMulWithZero` with a `ZeroHom`, with action `f r' • m` -/
def SMulWithZero.compHom (f : ZeroHom R' R) : SMulWithZero R' M where
  smul := (f · • ·)
  smul_zero m := smul_zero (f m)
  zero_smul m := by 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁵ : Zero R
inst✝⁴ : Zero M
inst✝³ : SMulWithZero R M
a : R
b : M
inst✝² : Zero R'
inst✝¹ : Zero M'
inst✝ : SMul R M'
f : ZeroHom R' R
m : M
⊢ 0 • m = 0

Next tactic:
show (f 0) • m = 0
/-- Compose a `SMulWithZero` with a `ZeroHom`, with action `f r' • m` -/
def SMulWithZero.compHom (f : ZeroHom R' R) : SMulWithZero R' M where
  smul := (f · • ·)
  smul_zero m := smul_zero (f m)
  zero_smul m := by show (f 0) • m = 0; 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁵ : Zero R
inst✝⁴ : Zero M
inst✝³ : SMulWithZero R M
a : R
b : M
inst✝² : Zero R'
inst✝¹ : Zero M'
inst✝ : SMul R M'
f : ZeroHom R' R
m : M
⊢ f 0 • m = 0

Next tactic:
rw [map_zero, zero_smul]
protected lemma MulActionWithZero.subsingleton
    [MulActionWithZero R M] [Subsingleton R] : Subsingleton M :=
  ⟨λ x y => by
    

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁴ : MonoidWithZero R
inst✝³ : MonoidWithZero R'
inst✝² : Zero M
inst✝¹ : MulActionWithZero R M
inst✝ : Subsingleton R
x y : M
⊢ x = y

Next tactic:
rw [← one_smul R x, ← one_smul R y, Subsingleton.elim (1 : R) 0, zero_smul, zero_smul]
@[simp]
lemma ite_zero_smul (a : R) (b : M) : (if p then a else 0 : R) • b = if p then a • b else 0 := by
  

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁶ : MonoidWithZero R
inst✝⁵ : MonoidWithZero R'
inst✝⁴ : Zero M
inst✝³ : MulActionWithZero R M
inst✝² : Zero M'
inst✝¹ : SMul R M'
p : Prop
inst✝ : Decidable p
a : R
b : M
⊢ (if p then a else 0) • b = if p then a • b else 0

Next tactic:
rw [ite_smul, zero_smul]
lemma boole_smul (a : M) : (if p then 1 else 0 : R) • a = if p then a else 0 := by 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁶ : MonoidWithZero R
inst✝⁵ : MonoidWithZero R'
inst✝⁴ : Zero M
inst✝³ : MulActionWithZero R M
inst✝² : Zero M'
inst✝¹ : SMul R M'
p : Prop
inst✝ : Decidable p
a : M
⊢ (if p then 1 else 0) • a = if p then a else 0

Next tactic:
simp
/-- Compose a `MulActionWithZero` with a `MonoidWithZeroHom`, with action `f r' • m` -/
def MulActionWithZero.compHom (f : R' →*₀ R) : MulActionWithZero R' M :=
  { SMulWithZero.compHom M f.toZeroHom with
    mul_smul := fun r s m => by show f (r * s) • m = (f r) • (f s) • m; simp [mul_smul]
    one_smul := fun m => by 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁶ : MonoidWithZero R
inst✝⁵ : MonoidWithZero R'
inst✝⁴ : Zero M
inst✝³ : MulActionWithZero R M
inst✝² : Zero M'
inst✝¹ : SMul R M'
p : Prop
inst✝ : Decidable p
f : R' →*₀ R
src✝ : SMulWithZero R' M := SMulWithZero.compHom M ↑f
m : M
⊢ 1 • m = m

Next tactic:
show (f 1) • m = m
/-- Compose a `MulActionWithZero` with a `MonoidWithZeroHom`, with action `f r' • m` -/
def MulActionWithZero.compHom (f : R' →*₀ R) : MulActionWithZero R' M :=
  { SMulWithZero.compHom M f.toZeroHom with
    mul_smul := fun r s m => by show f (r * s) • m = (f r) • (f s) • m; simp [mul_smul]
    one_smul := fun m => by show (f 1) • m = m; 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁶ : MonoidWithZero R
inst✝⁵ : MonoidWithZero R'
inst✝⁴ : Zero M
inst✝³ : MulActionWithZero R M
inst✝² : Zero M'
inst✝¹ : SMul R M'
p : Prop
inst✝ : Decidable p
f : R' →*₀ R
src✝ : SMulWithZero R' M := SMulWithZero.compHom M ↑f
m : M
⊢ f 1 • m = m

Next tactic:
simp
/-- Compose a `MulActionWithZero` with a `MonoidWithZeroHom`, with action `f r' • m` -/
def MulActionWithZero.compHom (f : R' →*₀ R) : MulActionWithZero R' M :=
  { SMulWithZero.compHom M f.toZeroHom with
    mul_smul := fun r s m => by 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁶ : MonoidWithZero R
inst✝⁵ : MonoidWithZero R'
inst✝⁴ : Zero M
inst✝³ : MulActionWithZero R M
inst✝² : Zero M'
inst✝¹ : SMul R M'
p : Prop
inst✝ : Decidable p
f : R' →*₀ R
src✝ : SMulWithZero R' M := SMulWithZero.compHom M ↑f
r s : R'
m : M
⊢ (r * s) • m = r • s • m

Next tactic:
show f (r * s) • m = (f r) • (f s) • m
/-- Compose a `MulActionWithZero` with a `MonoidWithZeroHom`, with action `f r' • m` -/
def MulActionWithZero.compHom (f : R' →*₀ R) : MulActionWithZero R' M :=
  { SMulWithZero.compHom M f.toZeroHom with
    mul_smul := fun r s m => by show f (r * s) • m = (f r) • (f s) • m; 

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
inst✝⁶ : MonoidWithZero R
inst✝⁵ : MonoidWithZero R'
inst✝⁴ : Zero M
inst✝³ : MulActionWithZero R M
inst✝² : Zero M'
inst✝¹ : SMul R M'
p : Prop
inst✝ : Decidable p
f : R' →*₀ R
src✝ : SMulWithZero R' M := SMulWithZero.compHom M ↑f
r s : R'
m : M
⊢ f (r * s) • m = f r • f s • m

Next tactic:
simp [mul_smul]
theorem smul_inv₀ [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  

Proof state:
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : GroupWithZero α
inst✝³ : GroupWithZero β
inst✝² : MulActionWithZero α β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
⊢ (c • x)⁻¹ = c⁻¹ • x⁻¹

Next tactic:
obtain rfl | hc := eq_or_ne c 0
theorem smul_inv₀ [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  obtain rfl | hc := eq_or_ne c 0
  · 

Proof state:
case inl
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : GroupWithZero α
inst✝³ : GroupWithZero β
inst✝² : MulActionWithZero α β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
x : β
⊢ (0 • x)⁻¹ = 0⁻¹ • x⁻¹

Next tactic:
simp only [inv_zero, zero_smul]
theorem smul_inv₀ [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  obtain rfl | hc := eq_or_ne c 0
  · simp only [inv_zero, zero_smul]
  

Proof state:
case inr
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : GroupWithZero α
inst✝³ : GroupWithZero β
inst✝² : MulActionWithZero α β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
hc : c ≠ 0
⊢ (c • x)⁻¹ = c⁻¹ • x⁻¹

Next tactic:
obtain rfl | hx := eq_or_ne x 0
theorem smul_inv₀ [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  obtain rfl | hc := eq_or_ne c 0
  · simp only [inv_zero, zero_smul]
  obtain rfl | hx := eq_or_ne x 0
  · 

Proof state:
case inr.inl
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : GroupWithZero α
inst✝³ : GroupWithZero β
inst✝² : MulActionWithZero α β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
hc : c ≠ 0
⊢ (c • 0)⁻¹ = c⁻¹ • 0⁻¹

Next tactic:
simp only [inv_zero, smul_zero]
theorem smul_inv₀ [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  obtain rfl | hc := eq_or_ne c 0
  · simp only [inv_zero, zero_smul]
  obtain rfl | hx := eq_or_ne x 0
  · simp only [inv_zero, smul_zero]
  · 

Proof state:
case inr.inr
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : GroupWithZero α
inst✝³ : GroupWithZero β
inst✝² : MulActionWithZero α β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
hc : c ≠ 0
hx : x ≠ 0
⊢ (c • x)⁻¹ = c⁻¹ • x⁻¹

Next tactic:
refine' inv_eq_of_mul_eq_one_left _
theorem smul_inv₀ [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  obtain rfl | hc := eq_or_ne c 0
  · simp only [inv_zero, zero_smul]
  obtain rfl | hx := eq_or_ne x 0
  · simp only [inv_zero, smul_zero]
  · refine' inv_eq_of_mul_eq_one_left _
    

Proof state:
case inr.inr
R : Type u_1
R' : Type u_2
M : Type u_3
M' : Type u_4
α : Type u_5
β : Type u_6
inst✝⁴ : GroupWithZero α
inst✝³ : GroupWithZero β
inst✝² : MulActionWithZero α β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
hc : c ≠ 0
hx : x ≠ 0
⊢ c⁻¹ • x⁻¹ * c • x = 1

Next tactic:
rw [smul_mul_smul, inv_mul_cancel hc, inv_mul_cancel hx, one_smul]
theorem summable_inner (f g : lp G 2) : Summable fun i => ⟪f i, g i⟫ := by
  -- Apply the Direct Comparison Test, comparing with ∑' i, ‖f i‖ * ‖g i‖ (summable by Hölder)
  

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
f g : ↥(lp G 2)
⊢ Summable fun i => inner (↑f i) (↑g i)

Next tactic:
refine' .of_norm_bounded (fun i => ‖f i‖ * ‖g i‖) (lp.summable_mul _ f g) _
theorem summable_inner (f g : lp G 2) : Summable fun i => ⟪f i, g i⟫ := by
  -- Apply the Direct Comparison Test, comparing with ∑' i, ‖f i‖ * ‖g i‖ (summable by Hölder)
  refine' .of_norm_bounded (fun i => ‖f i‖ * ‖g i‖) (lp.summable_mul _ f g) _
  · 

Proof state:
case refine'_1
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
f g : ↥(lp G 2)
⊢ Real.IsConjugateExponent (ENNReal.toReal 2) (ENNReal.toReal 2)

Next tactic:
rw [Real.isConjugateExponent_iff]
theorem summable_inner (f g : lp G 2) : Summable fun i => ⟪f i, g i⟫ := by
  -- Apply the Direct Comparison Test, comparing with ∑' i, ‖f i‖ * ‖g i‖ (summable by Hölder)
  refine' .of_norm_bounded (fun i => ‖f i‖ * ‖g i‖) (lp.summable_mul _ f g) _
  · rw [Real.isConjugateExponent_iff] <;> 

Proof state:
case refine'_1
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
f g : ↥(lp G 2)
⊢ ENNReal.toReal 2 = ENNReal.toReal 2 / (ENNReal.toReal 2 - 1)

Next tactic:
norm_num
theorem summable_inner (f g : lp G 2) : Summable fun i => ⟪f i, g i⟫ := by
  -- Apply the Direct Comparison Test, comparing with ∑' i, ‖f i‖ * ‖g i‖ (summable by Hölder)
  refine' .of_norm_bounded (fun i => ‖f i‖ * ‖g i‖) (lp.summable_mul _ f g) _
  · rw [Real.isConjugateExponent_iff] <;> 

Proof state:
case refine'_1
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
f g : ↥(lp G 2)
⊢ 1 < ENNReal.toReal 2

Next tactic:
norm_num
theorem summable_inner (f g : lp G 2) : Summable fun i => ⟪f i, g i⟫ := by
  -- Apply the Direct Comparison Test, comparing with ∑' i, ‖f i‖ * ‖g i‖ (summable by Hölder)
  refine' .of_norm_bounded (fun i => ‖f i‖ * ‖g i‖) (lp.summable_mul _ f g) _
  · rw [Real.isConjugateExponent_iff] <;> norm_num
  

Proof state:
case refine'_2
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
f g : ↥(lp G 2)
⊢ ∀ (i : ι), ‖inner (↑f i) (↑g i)‖ ≤ (fun i => ‖↑f i‖ * ‖↑g i‖) i

Next tactic:
intro i
theorem summable_inner (f g : lp G 2) : Summable fun i => ⟪f i, g i⟫ := by
  -- Apply the Direct Comparison Test, comparing with ∑' i, ‖f i‖ * ‖g i‖ (summable by Hölder)
  refine' .of_norm_bounded (fun i => ‖f i‖ * ‖g i‖) (lp.summable_mul _ f g) _
  · rw [Real.isConjugateExponent_iff] <;> norm_num
  intro i
  -- Then apply Cauchy-Schwarz pointwise
  

Proof state:
case refine'_2
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
f g : ↥(lp G 2)
i : ι
⊢ ‖inner (↑f i) (↑g i)‖ ≤ (fun i => ‖↑f i‖ * ‖↑g i‖) i

Next tactic:
exact norm_inner_le_norm (𝕜 := 𝕜) _ _
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ ‖f‖ ^ 2 = re (inner f f)

Next tactic:
calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          rw [norm_sq_eq_inner (𝕜 := 𝕜)]
          -- porting note: `simp` couldn't do this anymore
        _ = re (∑' i, ⟪f i, f i⟫) := (IsROrC.reClm.map_tsum ?_).symm
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by 

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ ‖f‖ ^ 2 = ‖f‖ ^ ENNReal.toReal 2

Next tactic:
norm_cast
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by 

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ ∑' (i : ι), ‖↑f i‖ ^ ENNReal.toReal 2 = ∑' (i : ι), ‖↑f i‖ ^ 2

Next tactic:
norm_cast
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ ∑' (i : ι), ‖↑f i‖ ^ 2 = ∑' (i : ι), re (inner (↑f i) (↑f i))

Next tactic:
congr
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          

Proof state:
case e_f
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ (fun i => ‖↑f i‖ ^ 2) = fun i => re (inner (↑f i) (↑f i))

Next tactic:
funext i
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          

Proof state:
case e_f.h
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
i : ι
⊢ ‖↑f i‖ ^ 2 = re (inner (↑f i) (↑f i))

Next tactic:
rw [norm_sq_eq_inner (𝕜 := 𝕜)]
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          rw [norm_sq_eq_inner (𝕜 := 𝕜)]
          -- porting note: `simp` couldn't do this anymore
        _ = re (∑' i, ⟪f i, f i⟫) := (IsROrC.reClm.map_tsum ?_).symm
      · 

Proof state:
case calc_1
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ 0 < ENNReal.toReal 2

Next tactic:
norm_num
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          rw [norm_sq_eq_inner (𝕜 := 𝕜)]
          -- porting note: `simp` couldn't do this anymore
        _ = re (∑' i, ⟪f i, f i⟫) := (IsROrC.reClm.map_tsum ?_).symm
      · norm_num
      · 

Proof state:
case calc_2
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f : ↥(lp G 2)
⊢ Summable fun i => inner (↑f i) (↑f i)

Next tactic:
exact summable_inner f f
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          rw [norm_sq_eq_inner (𝕜 := 𝕜)]
          -- porting note: `simp` couldn't do this anymore
        _ = re (∑' i, ⟪f i, f i⟫) := (IsROrC.reClm.map_tsum ?_).symm
      · norm_num
      · exact summable_inner f f
    conj_symm := fun f g => by
      

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f g : ↥(lp G 2)
⊢ (starRingEnd 𝕜) (inner g f) = inner f g

Next tactic:
calc
        conj _ = conj (∑' i, ⟪g i, f i⟫) := by congr
        _ = ∑' i, conj ⟪g i, f i⟫ := IsROrC.conjCle.map_tsum
        _ = ∑' i, ⟪f i, g i⟫ := by simp only [inner_conj_symm]
        _ = _ := by congr
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          rw [norm_sq_eq_inner (𝕜 := 𝕜)]
          -- porting note: `simp` couldn't do this anymore
        _ = re (∑' i, ⟪f i, f i⟫) := (IsROrC.reClm.map_tsum ?_).symm
      · norm_num
      · exact summable_inner f f
    conj_symm := fun f g => by
      calc
        conj _ = conj (∑' i, ⟪g i, f i⟫) := by 

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f g : ↥(lp G 2)
⊢ (starRingEnd 𝕜) (inner g f) = (starRingEnd 𝕜) (∑' (i : ι), inner (↑g i) (↑f i))

Next tactic:
congr
instance instInnerProductSpace : InnerProductSpace 𝕜 (lp G 2) :=
  { lp.normedAddCommGroup (E := G) (p := 2) with
    inner := fun f g => ∑' i, ⟪f i, g i⟫
    norm_sq_eq_inner := fun f => by
      calc
        ‖f‖ ^ 2 = ‖f‖ ^ (2 : ℝ≥0∞).toReal := by norm_cast
        _ = ∑' i, ‖f i‖ ^ (2 : ℝ≥0∞).toReal := (lp.norm_rpow_eq_tsum ?_ f)
        _ = ∑' i, ‖f i‖ ^ (2 : ℕ) := by norm_cast
        _ = ∑' i, re ⟪f i, f i⟫ := by
          congr
          funext i
          rw [norm_sq_eq_inner (𝕜 := 𝕜)]
          -- porting note: `simp` couldn't do this anymore
        _ = re (∑' i, ⟪f i, f i⟫) := (IsROrC.reClm.map_tsum ?_).symm
      · norm_num
      · exact summable_inner f f
    conj_symm := fun f g => by
      calc
        conj _ = conj (∑' i, ⟪g i, f i⟫) := by congr
        _ = ∑' i, conj ⟪g i, f i⟫ := IsROrC.conjCle.map_tsum
        _ = ∑' i, ⟪f i, g i⟫ := by 

Proof state:
ι : Type u_1
𝕜 : Type u_2
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_4
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
src✝ : NormedAddCommGroup ↥(lp G 2) := normedAddCommGroup
f g : ↥(lp G 2)
⊢ ∑' (i : ι), (starRingEnd 𝕜) (inner (↑g i) (↑f i)) = ∑' (i : ι), inner (↑f i) (↑g i)

Next tactic:
simp only [inner_conj_symm]