l3lab/ntp-mathlib huggingface dataset:
/-- **Gershgorin's circle theorem**: for any eigenvalue `μ` of a square matrix `A`, there exists an
index `k` such that `μ` lies in the closed ball of center the diagonal term `A k k` and of
radius the sum of the norms `∑ j ≠ k, ‖A k j‖. -/
theorem eigenvalue_mem_ball {μ : K} (hμ : Module.End.HasEigenvalue (Matrix.toLin' A) μ) :
    ∃ k, μ ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) := by
  cases isEmpty_or_nonempty n
  · exfalso
    exact hμ Submodule.eq_bot_of_subsingleton
  · obtain ⟨v, h_eg, h_nz⟩ := hμ.exists_hasEigenvector
    obtain ⟨i, -, h_i⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty (fun i => ‖v i‖)
    have h_nz : v i ≠ 0 := by
      contrapose! h_nz
      ext j
      rw [Pi.zero_apply, ← norm_le_zero_iff]
      refine (h_i ▸ Finset.le_sup' (fun i => ‖v i‖) (Finset.mem_univ j)).trans ?_
      exact norm_le_zero_iff.mpr h_nz
    have h_le : ∀ j, ‖v j * (v i)⁻¹‖ ≤ 1 := fun j => by
      rw [norm_mul, norm_inv, mul_inv_le_iff' (norm_pos_iff.mpr h_nz), one_mul]
      exact h_i ▸ Finset.le_sup' (fun i => ‖v i‖) (Finset.mem_univ j)
    simp_rw [mem_closedBall_iff_norm']
    refine ⟨i, ?_⟩
    calc
      _ = ‖(A i i * v i - μ * v i) * (v i)⁻¹‖ := by congr; field_simp [h_nz]; ring
      _ = ‖(A i i * v i - ∑ j, A i j * v j) * (v i)⁻¹‖ := by
                rw [show μ * v i = ∑ x : n, A i x * v x by
                  rw [← Matrix.dotProduct, ← Matrix.mulVec]
                  exact (congrFun (Module.End.mem_eigenspace_iff.mp h_eg) i).symm]
      _ = ‖(∑ j in Finset.univ.erase i, A i j * v j) * (v i)⁻¹‖ := by
                rw [Finset.sum_erase_eq_sub (Finset.mem_univ i), ← neg_sub, neg_mul, norm_neg]
      _ ≤ ∑ j in Finset.univ.erase i, ‖A i j‖ * ‖v j * (v i)⁻¹‖ := by
                rw [Finset.sum_mul]
                

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
μ : K
hμ : Module.End.HasEigenvalue (Matrix.toLin' A) μ
h✝ : Nonempty n
v : n → K
h_eg : v ∈ Module.End.eigenspace (Matrix.toLin' A) μ
h_nz✝ : v ≠ 0
i : n
h_i : (Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) fun i => ‖v i‖) = ‖v i‖
h_nz : v i ≠ 0
h_le : ∀ (j : n), ‖v j * (v i)⁻¹‖ ≤ 1
⊢ ‖∑ x in Finset.erase Finset.univ i, A i x * v x * (v i)⁻¹‖ ≤
    ∑ j in Finset.erase Finset.univ i, ‖A i j‖ * ‖v j * (v i)⁻¹‖

Next tactic:
exact (norm_sum_le _ _).trans (le_of_eq (by simp_rw [mul_assoc, norm_mul]))
/-- **Gershgorin's circle theorem**: for any eigenvalue `μ` of a square matrix `A`, there exists an
index `k` such that `μ` lies in the closed ball of center the diagonal term `A k k` and of
radius the sum of the norms `∑ j ≠ k, ‖A k j‖. -/
theorem eigenvalue_mem_ball {μ : K} (hμ : Module.End.HasEigenvalue (Matrix.toLin' A) μ) :
    ∃ k, μ ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) := by
  cases isEmpty_or_nonempty n
  · exfalso
    exact hμ Submodule.eq_bot_of_subsingleton
  · obtain ⟨v, h_eg, h_nz⟩ := hμ.exists_hasEigenvector
    obtain ⟨i, -, h_i⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty (fun i => ‖v i‖)
    have h_nz : v i ≠ 0 := by
      contrapose! h_nz
      ext j
      rw [Pi.zero_apply, ← norm_le_zero_iff]
      refine (h_i ▸ Finset.le_sup' (fun i => ‖v i‖) (Finset.mem_univ j)).trans ?_
      exact norm_le_zero_iff.mpr h_nz
    have h_le : ∀ j, ‖v j * (v i)⁻¹‖ ≤ 1 := fun j => by
      rw [norm_mul, norm_inv, mul_inv_le_iff' (norm_pos_iff.mpr h_nz), one_mul]
      exact h_i ▸ Finset.le_sup' (fun i => ‖v i‖) (Finset.mem_univ j)
    simp_rw [mem_closedBall_iff_norm']
    refine ⟨i, ?_⟩
    calc
      _ = ‖(A i i * v i - μ * v i) * (v i)⁻¹‖ := by congr; field_simp [h_nz]; ring
      _ = ‖(A i i * v i - ∑ j, A i j * v j) * (v i)⁻¹‖ := by
                rw [show μ * v i = ∑ x : n, A i x * v x by
                  rw [← Matrix.dotProduct, ← Matrix.mulVec]
                  exact (congrFun (Module.End.mem_eigenspace_iff.mp h_eg) i).symm]
      _ = ‖(∑ j in Finset.univ.erase i, A i j * v j) * (v i)⁻¹‖ := by
                rw [Finset.sum_erase_eq_sub (Finset.mem_univ i), ← neg_sub, neg_mul, norm_neg]
      _ ≤ ∑ j in Finset.univ.erase i, ‖A i j‖ * ‖v j * (v i)⁻¹‖ := by
                rw [Finset.sum_mul]
                exact (norm_sum_le _ _).trans (le_of_eq (by 

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
μ : K
hμ : Module.End.HasEigenvalue (Matrix.toLin' A) μ
h✝ : Nonempty n
v : n → K
h_eg : v ∈ Module.End.eigenspace (Matrix.toLin' A) μ
h_nz✝ : v ≠ 0
i : n
h_i : (Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) fun i => ‖v i‖) = ‖v i‖
h_nz : v i ≠ 0
h_le : ∀ (j : n), ‖v j * (v i)⁻¹‖ ≤ 1
⊢ ∑ i_1 in Finset.erase Finset.univ i, ‖A i i_1 * v i_1 * (v i)⁻¹‖ =
    ∑ j in Finset.erase Finset.univ i, ‖A i j‖ * ‖v j * (v i)⁻¹‖

Next tactic:
simp_rw [mul_assoc, norm_mul]
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : ∀ (k : n), ∑ j in Finset.erase Finset.univ k, ‖A k j‖ < ‖A k k‖
⊢ Matrix.det A ≠ 0

Next tactic:
contrapose! h
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : Matrix.det A = 0
⊢ ∃ k, ‖A k k‖ ≤ ∑ j in Finset.erase Finset.univ k, ‖A k j‖

Next tactic:
suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    exact this.imp (fun a h ↦ by rwa [mem_closedBall_iff_norm', sub_zero] at h)
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : Matrix.det A = 0
this : ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.erase Finset.univ k, ‖A k j‖)
⊢ ∃ k, ‖A k k‖ ≤ ∑ j in Finset.erase Finset.univ k, ‖A k j‖

Next tactic:
exact this.imp (fun a h ↦ by rwa [mem_closedBall_iff_norm', sub_zero] at h)
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    exact this.imp (fun a h ↦ by 

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h✝ : Matrix.det A = 0
this : ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.erase Finset.univ k, ‖A k j‖)
a : n
h : 0 ∈ Metric.closedBall (A a a) (∑ j in Finset.erase Finset.univ a, ‖A a j‖)
⊢ ‖A a a‖ ≤ ∑ j in Finset.erase Finset.univ a, ‖A a j‖

Next tactic:
rwa [mem_closedBall_iff_norm', sub_zero] at h
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    exact this.imp (fun a h ↦ by rwa [mem_closedBall_iff_norm', sub_zero] at h)
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : Matrix.det A = 0
⊢ ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.erase Finset.univ k, ‖A k j‖)

Next tactic:
refine eigenvalue_mem_ball ?_
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    exact this.imp (fun a h ↦ by rwa [mem_closedBall_iff_norm', sub_zero] at h)
  refine eigenvalue_mem_ball ?_
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : Matrix.det A = 0
⊢ Module.End.HasEigenvalue (Matrix.toLin' fun k => A k) 0

Next tactic:
rw [Module.End.HasEigenvalue,  Module.End.eigenspace_zero, ne_comm]
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    exact this.imp (fun a h ↦ by rwa [mem_closedBall_iff_norm', sub_zero] at h)
  refine eigenvalue_mem_ball ?_
  rw [Module.End.HasEigenvalue,  Module.End.eigenspace_zero, ne_comm]
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : Matrix.det A = 0
⊢ ⊥ ≠ LinearMap.ker (Matrix.toLin' fun k => A k)

Next tactic:
exact ne_of_lt (LinearMap.bot_lt_ker_of_det_eq_zero (by rwa [LinearMap.det_toLin']))
/-- If `A` is a row strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_row_lt_diag (h : ∀ k, ∑ j in Finset.univ.erase k, ‖A k j‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  contrapose! h
  suffices ∃ k, 0 ∈ Metric.closedBall (A k k) (∑ j in Finset.univ.erase k, ‖A k j‖) by
    exact this.imp (fun a h ↦ by rwa [mem_closedBall_iff_norm', sub_zero] at h)
  refine eigenvalue_mem_ball ?_
  rw [Module.End.HasEigenvalue,  Module.End.eigenspace_zero, ne_comm]
  exact ne_of_lt (LinearMap.bot_lt_ker_of_det_eq_zero (by 

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : Matrix.det A = 0
⊢ LinearMap.det (Matrix.toLin' fun k => A k) = 0

Next tactic:
rwa [LinearMap.det_toLin']
/-- If `A` is a column strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_col_lt_diag (h : ∀ k, ∑ i in Finset.univ.erase k, ‖A i k‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : ∀ (k : n), ∑ i in Finset.erase Finset.univ k, ‖A i k‖ < ‖A k k‖
⊢ Matrix.det A ≠ 0

Next tactic:
rw [← Matrix.det_transpose]
/-- If `A` is a column strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_col_lt_diag (h : ∀ k, ∑ i in Finset.univ.erase k, ‖A i k‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : ∀ (k : n), ∑ i in Finset.erase Finset.univ k, ‖A i k‖ < ‖A k k‖
⊢ Matrix.det (Matrix.transpose A) ≠ 0

Next tactic:
exact det_ne_zero_of_sum_row_lt_diag (by simp_rw [Matrix.transpose_apply]; exact h)
/-- If `A` is a column strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_col_lt_diag (h : ∀ k, ∑ i in Finset.univ.erase k, ‖A i k‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  exact det_ne_zero_of_sum_row_lt_diag (by 

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : ∀ (k : n), ∑ i in Finset.erase Finset.univ k, ‖A i k‖ < ‖A k k‖
⊢ ∀ (k : n), ∑ j in Finset.erase Finset.univ k, ‖Matrix.transpose A k j‖ < ‖Matrix.transpose A k k‖

Next tactic:
simp_rw [Matrix.transpose_apply]
/-- If `A` is a column strictly dominant diagonal matrix, then it's determinant is nonzero. -/
theorem det_ne_zero_of_sum_col_lt_diag (h : ∀ k, ∑ i in Finset.univ.erase k, ‖A i k‖ < ‖A k k‖) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  exact det_ne_zero_of_sum_row_lt_diag (by simp_rw [Matrix.transpose_apply]; 

Proof state:
K : Type u_1
n : Type u_2
inst✝² : NormedField K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A : Matrix n n K
h : ∀ (k : n), ∑ i in Finset.erase Finset.univ k, ‖A i k‖ < ‖A k k‖
⊢ ∀ (k : n), ∑ x in Finset.erase Finset.univ k, ‖A x k‖ < ‖A k k‖

Next tactic:
exact h
instance : NormedSpace 𝕜 (Completion E) :=
  { Completion.instModule with
    norm_smul_le := fun c x =>
      induction_on x
        (isClosed_le (continuous_const_smul _).norm (continuous_const.mul continuous_norm)) fun y =>
        by 

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
src✝ : Module 𝕜 (Completion E) := instModule
c : 𝕜
x : Completion E
y : E
⊢ ‖c • ↑E y‖ ≤ ‖c‖ * ‖↑E y‖

Next tactic:
simp only [← coe_smul, norm_coe, norm_smul, le_rfl]
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : Completion A
⊢ dist x y = ‖x - y‖

Next tactic:
refine Completion.induction_on₂ x y ?_ ?_
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> 

Proof state:
case refine_1
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : Completion A
⊢ IsClosed {x | dist x.1 x.2 = ‖x.1 - x.2‖}

Next tactic:
clear x y
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> 

Proof state:
case refine_2
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : Completion A
⊢ ∀ (a b : A), dist (↑A a) (↑A b) = ‖↑A a - ↑A b‖

Next tactic:
clear x y
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · 

Proof state:
case refine_1
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
⊢ IsClosed {x | dist x.1 x.2 = ‖x.1 - x.2‖}

Next tactic:
refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        

Proof state:
case refine_1
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
⊢ Continuous fun x => ‖x.1 - x.2‖

Next tactic:
exact Continuous.comp Completion.continuous_extension continuous_sub
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · 

Proof state:
case refine_2
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
⊢ ∀ (a b : A), dist (↑A a) (↑A b) = ‖↑A a - ↑A b‖

Next tactic:
intro x y
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        

Proof state:
case refine_2
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : A
⊢ dist (↑A x) (↑A y) = ‖↑A x - ↑A y‖

Next tactic:
rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
    norm_mul := fun x y => by
      

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : Completion A
⊢ ‖x * y‖ ≤ ‖x‖ * ‖y‖

Next tactic:
refine Completion.induction_on₂ x y ?_ ?_
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
    norm_mul := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> 

Proof state:
case refine_1
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : Completion A
⊢ IsClosed {x | ‖x.1 * x.2‖ ≤ ‖x.1‖ * ‖x.2‖}

Next tactic:
clear x y
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
    norm_mul := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> 

Proof state:
case refine_2
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : Completion A
⊢ ∀ (a b : A), ‖↑A a * ↑A b‖ ≤ ‖↑A a‖ * ‖↑A b‖

Next tactic:
clear x y
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
    norm_mul := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · 

Proof state:
case refine_1
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
⊢ IsClosed {x | ‖x.1 * x.2‖ ≤ ‖x.1‖ * ‖x.2‖}

Next tactic:
exact
          isClosed_le (Continuous.comp continuous_norm continuous_mul)
            (Continuous.comp _root_.continuous_mul
              (Continuous.prod_map continuous_norm continuous_norm))
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
    norm_mul := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · exact
          isClosed_le (Continuous.comp continuous_norm continuous_mul)
            (Continuous.comp _root_.continuous_mul
              (Continuous.prod_map continuous_norm continuous_norm))
      · 

Proof state:
case refine_2
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
⊢ ∀ (a b : A), ‖↑A a * ↑A b‖ ≤ ‖↑A a‖ * ‖↑A b‖

Next tactic:
intro x y
instance [SeminormedRing A] : NormedRing (Completion A) :=
  { Completion.ring,
    Completion.instMetricSpace with
    dist_eq := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · refine' isClosed_eq (Completion.uniformContinuous_extension₂ _).continuous _
        exact Continuous.comp Completion.continuous_extension continuous_sub
      · intro x y
        rw [← Completion.coe_sub, norm_coe, Completion.dist_eq, dist_eq_norm]
    norm_mul := fun x y => by
      refine Completion.induction_on₂ x y ?_ ?_ <;> clear x y
      · exact
          isClosed_le (Continuous.comp continuous_norm continuous_mul)
            (Continuous.comp _root_.continuous_mul
              (Continuous.prod_map continuous_norm continuous_norm))
      · intro x y
        

Proof state:
case refine_2
𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
A : Type u_3
inst✝ : SeminormedRing A
src✝¹ : Ring (Completion A) := ring
src✝ : MetricSpace (Completion A) := instMetricSpace
x y : A
⊢ ‖↑A x * ↑A y‖ ≤ ‖↑A x‖ * ‖↑A y‖

Next tactic:
simp only [← coe_mul, norm_coe]