Theorem: SimpleGraph.linearIndependent_lapMatrix_ker_basis_aux
File: Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean

Proof steps:
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
⊢ LinearIndependent ℝ G.lapMatrix_ker_basis_aux
state_after: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
⊢ ∀ (g : G.ConnectedComponent → ℝ),
    ∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i = 0 → ∀ (i : G.ConnectedComponent), g i = 0
tactic: rw [Fintype.linearIndependent_iff]
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
⊢ ∀ (g : G.ConnectedComponent → ℝ),
    ∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i = 0 → ∀ (i : G.ConnectedComponent), g i = 0
state_after: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : ∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i = 0
⊢ ∀ (i : G.ConnectedComponent), g i = 0
tactic: intro g h0
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : ∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i = 0
⊢ ∀ (i : G.ConnectedComponent), g i = 0
state_after: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : ↑(∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i) = ↑0
⊢ ∀ (i : G.ConnectedComponent), g i = 0
tactic: rw [Subtype.ext_iff] at h0
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : ↑(∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i) = ↑0
⊢ ∀ (i : G.ConnectedComponent), g i = 0
state_after: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : ↑(∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
⊢ ∀ (i : G.ConnectedComponent), g i = 0
tactic: have h : ∑ c, g c • lapMatrix_ker_basis_aux G c = fun i ↦ g (connectedComponentMk G i) := by
    simp only [lapMatrix_ker_basis_aux, SetLike.mk_smul_mk, AddSubmonoid.coe_finset_sum]
    conv_lhs => enter [2, c, j]; rw [Pi.smul_apply, smul_eq_mul, mul_ite, mul_one, mul_zero]
    ext i
    simp only [Finset.sum_apply, sum_ite_eq, mem_univ, ite_true]
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : ↑(∑ i : G.ConnectedComponent, g i • G.lapMatrix_ker_basis_aux i) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
⊢ ∀ (i : G.ConnectedComponent), g i = 0
state_after: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : (fun i => g (G.connectedComponentMk i)) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
⊢ ∀ (i : G.ConnectedComponent), g i = 0
tactic: rw [h] at h0
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : (fun i => g (G.connectedComponentMk i)) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
⊢ ∀ (i : G.ConnectedComponent), g i = 0
state_after: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : (fun i => g (G.connectedComponentMk i)) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
c : G.ConnectedComponent
⊢ g c = 0
tactic: intro c
state_before: V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : (fun i => g (G.connectedComponentMk i)) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
c : G.ConnectedComponent
⊢ g c = 0
state_after: case intro
V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : (fun i => g (G.connectedComponentMk i)) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
c : G.ConnectedComponent
i : V
h' : G.connectedComponentMk i = c
⊢ g c = 0
tactic: obtain ⟨i, h'⟩ : ∃ i : V, G.connectedComponentMk i = c := Quot.exists_rep c
state_before: case intro
V : Type u_1
R : Type u_2
inst✝³ : Fintype V
inst✝² : DecidableEq V
G : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
g : G.ConnectedComponent → ℝ
h0 : (fun i => g (G.connectedComponentMk i)) = ↑0
h : ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
c : G.ConnectedComponent
i : V
h' : G.connectedComponentMk i = c
⊢ g c = 0
state_after: no goals
tactic: exact h' ▸ congrFun h0 i