Theorem: gramSchmidt_orthogonal
File: Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean

tactic: clear h₀ a b
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
a b : ι
h₀ : a ≠ b
⊢ ∀ (a b : ι), a < b → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: intro a b h₀
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
⊢ ∀ (a b : ι), a < b → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: revert a
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
a b : ι
h₀ : a < b
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: intro b ih a h₀
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b : ι
⊢ ∀ (x : ι),
    (∀ (y : ι), y < x → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0) →
      ∀ (a : ι), a < x → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f x) = 0

tactic: simp only [gramSchmidt_def 𝕜 f b, inner_sub_right, inner_sum, orthogonalProjection_singleton,
  inner_smul_right]
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: rw [Finset.sum_eq_single_of_mem a (Finset.mem_Iio.mpr h₀)]
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
⊢ inner (gramSchmidt 𝕜 f a) (f b) -
      ∑ x in Iio b,
        inner (gramSchmidt 𝕜 f x) (f b) / ↑(‖gramSchmidt 𝕜 f x‖ ^ 2) * inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f x) =
    0

tactic: intro i hi hia
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
⊢ ∀ (b_1 : ι),
    b_1 ∈ Iio b →
      b_1 ≠ a →
        inner (gramSchmidt 𝕜 f b_1) (f b) / ↑(‖gramSchmidt 𝕜 f b_1‖ ^ 2) *
            inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b_1) =
          0

tactic: simp only [mul_eq_zero, div_eq_zero_iff, inner_self_eq_zero]
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
i : ι
hi : i ∈ Iio b
hia : i ≠ a
⊢ inner (gramSchmidt 𝕜 f i) (f b) / ↑(‖gramSchmidt 𝕜 f i‖ ^ 2) * inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f i) = 0

tactic: right
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
i : ι
hi : i ∈ Iio b
hia : i ≠ a
⊢ (inner (gramSchmidt 𝕜 f i) (f b) = 0 ∨ ↑(‖gramSchmidt 𝕜 f i‖ ^ 2) = 0) ∨
    inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f i) = 0

tactic: cases' hia.lt_or_lt with hia₁ hia₂
state_before: case h
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
i : ι
hi : i ∈ Iio b
hia : i ≠ a
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f i) = 0

tactic: cases' h₀.lt_or_lt with ha hb
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
a b : ι
h₀ : a ≠ b
this : ∀ (a b : ι), a < b → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: exact this _ _ ha
state_before: case inl
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
a b : ι
h₀ : a ≠ b
this : ∀ (a b : ι), a < b → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0
ha : a < b
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: rw [inner_eq_zero_symm]
state_before: case inr
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
a b : ι
h₀ : a ≠ b
this : ∀ (a b : ι), a < b → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0
hb : b < a
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0

tactic: exact this _ _ hb
state_before: case inr
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
a b : ι
h₀ : a ≠ b
this : ∀ (a b : ι), a < b → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f b) = 0
hb : b < a
⊢ inner (gramSchmidt 𝕜 f b) (gramSchmidt 𝕜 f a) = 0

tactic: by_cases h : gramSchmidt 𝕜 f a = 0
state_before: 𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
⊢ inner (gramSchmidt 𝕜 f a) (f b) -
      inner (gramSchmidt 𝕜 f a) (f b) / ↑(‖gramSchmidt 𝕜 f a‖ ^ 2) * inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f a) =
    0

tactic: simp only [h, inner_zero_left, zero_div, MulZeroClass.zero_mul, sub_zero]
state_before: case pos
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
h : gramSchmidt 𝕜 f a = 0
⊢ inner (gramSchmidt 𝕜 f a) (f b) -
      inner (gramSchmidt 𝕜 f a) (f b) / ↑(‖gramSchmidt 𝕜 f a‖ ^ 2) * inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f a) =
    0

tactic: rw [IsROrC.ofReal_pow, ← inner_self_eq_norm_sq_to_K, div_mul_cancel, sub_self]
state_before: case neg
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
h : ¬gramSchmidt 𝕜 f a = 0
⊢ inner (gramSchmidt 𝕜 f a) (f b) -
      inner (gramSchmidt 𝕜 f a) (f b) / ↑(‖gramSchmidt 𝕜 f a‖ ^ 2) * inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f a) =
    0

tactic: rwa [inner_self_ne_zero]
state_before: case neg.h
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
h : ¬gramSchmidt 𝕜 f a = 0
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f a) ≠ 0

tactic: rw [inner_eq_zero_symm]
state_before: case h.inl
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
i : ι
hi : i ∈ Iio b
hia : i ≠ a
hia₁ : i < a
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f i) = 0

tactic: exact ih a h₀ i hia₁
state_before: case h.inl
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
i : ι
hi : i ∈ Iio b
hia : i ≠ a
hia₁ : i < a
⊢ inner (gramSchmidt 𝕜 f i) (gramSchmidt 𝕜 f a) = 0

tactic: exact ih i (mem_Iio.1 hi) a hia₂
state_before: case h.inr
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
b✝ b : ι
ih : ∀ (y : ι), y < b → ∀ (a : ι), a < y → inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f y) = 0
a : ι
h₀ : a < b
i : ι
hi : i ∈ Iio b
hia : i ≠ a
hia₂ : a < i
⊢ inner (gramSchmidt 𝕜 f a) (gramSchmidt 𝕜 f i) = 0