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

tactic: intro j i hij
state_before: 𝕜 : Type u_3
E : Type u_2
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
⊢ ∀ {j i : ι}, i ≤ j → gramSchmidt 𝕜 f i ∈ span 𝕜 (f '' Set.Iic j)

tactic: rw [gramSchmidt_def 𝕜 f i]
state_before: 𝕜 : Type u_3
E : Type u_2
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
j i : ι
hij : i ≤ j
⊢ gramSchmidt 𝕜 f i ∈ span 𝕜 (f '' Set.Iic j)

tactic: simp_rw [orthogonalProjection_singleton]
state_before: 𝕜 : Type u_3
E : Type u_2
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
j i : ι
hij : i ≤ j
⊢ f i - ∑ i_1 in Finset.Iio i, ↑(↑(orthogonalProjection (span 𝕜 {gramSchmidt 𝕜 f i_1})) (f i)) ∈ span 𝕜 (f '' Set.Iic j)

tactic: refine' Submodule.sub_mem _ (subset_span (mem_image_of_mem _ hij))
  (Submodule.sum_mem _ fun k hk => _)
state_before: 𝕜 : Type u_3
E : Type u_2
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
j i : ι
hij : i ≤ j
⊢ f i - ∑ x in Finset.Iio i, (inner (gramSchmidt 𝕜 f x) (f i) / ↑(‖gramSchmidt 𝕜 f x‖ ^ 2)) • gramSchmidt 𝕜 f x ∈
    span 𝕜 (f '' Set.Iic j)

tactic: let hkj : k < j := (Finset.mem_Iio.1 hk).trans_le hij
state_before: 𝕜 : Type u_3
E : Type u_2
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
j i : ι
hij : i ≤ j
k : ι
hk : k ∈ Finset.Iio i
⊢ (inner (gramSchmidt 𝕜 f k) (f i) / ↑(‖gramSchmidt 𝕜 f k‖ ^ 2)) • gramSchmidt 𝕜 f k ∈ span 𝕜 (f '' Set.Iic j)

tactic: exact smul_mem _ _
  (span_mono (image_subset f <| Iic_subset_Iic.2 hkj.le) <| gramSchmidt_mem_span _ le_rfl)
state_before: 𝕜 : Type u_3
E : Type u_2
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
j i : ι
hij : i ≤ j
k : ι
hk : k ∈ Finset.Iio i
hkj : k < j := LT.lt.trans_le (Iff.mp Finset.mem_Iio hk) hij
⊢ (inner (gramSchmidt 𝕜 f k) (f i) / ↑(‖gramSchmidt 𝕜 f k‖ ^ 2)) • gramSchmidt 𝕜 f k ∈ span 𝕜 (f '' Set.Iic j)

tactic: exact hkj
state_before: 𝕜 : Type u_3
E : Type u_2
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
_x✝ : (j : ι) ×' (i : ι) ×' i ≤ j
a✝² :
  ∀ (y : (j : ι) ×' (i : ι) ×' i ≤ j),
    (invImage (fun a => PSigma.casesOn a fun j snd => PSigma.casesOn snd fun i snd => j) IsWellOrder.toHasWellFounded).1
        y _x✝ →
      gramSchmidt 𝕜 f y.2.1 ∈ span 𝕜 (f '' Set.Iic y.1)
j : ι
i✝ : (i : ι) ×' i ≤ j
a✝¹ :
  ∀ (y : (j : ι) ×' (i : ι) ×' i ≤ j),
    (invImage (fun a => PSigma.casesOn a fun j snd => PSigma.casesOn snd fun i snd => j) IsWellOrder.toHasWellFounded).1
        y { fst := j, snd := i✝ } →
      gramSchmidt 𝕜 f y.2.1 ∈ span 𝕜 (f '' Set.Iic y.1)
i : ι
hij : i ≤ j
a✝ :
  ∀ (y : (j : ι) ×' (i : ι) ×' i ≤ j),
    (invImage (fun a => PSigma.casesOn a fun j snd => PSigma.casesOn snd fun i snd => j) IsWellOrder.toHasWellFounded).1
        y { fst := j, snd := { fst := i, snd := hij } } →
      gramSchmidt 𝕜 f y.2.1 ∈ span 𝕜 (f '' Set.Iic y.1)
k : ι
hk : k ∈ Finset.Iio i
hkj : k < j := LT.lt.trans_le (Iff.mp Finset.mem_Iio hk) hij
⊢ (invImage (fun a => PSigma.casesOn a fun j snd => PSigma.casesOn snd fun i snd => j) IsWellOrder.toHasWellFounded).1
    { fst := k, snd := { fst := k, snd := (_ : k ≤ k) } } { fst := j, snd := { fst := i, snd := hij } }