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

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
⊢ 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: 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 → ℝ),
    ∑ 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
⊢ ∀ (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
⊢ ∀ (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: 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 : ↑(∑ 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: 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)
⊢ ∀ (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: obtain ⟨i, h'⟩ : ∃ i : V, G.connectedComponentMk i = c := Quot.exists_rep 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: exact h' ▸ congrFun h0 i
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: simp only [lapMatrix_ker_basis_aux, SetLike.mk_smul_mk, AddSubmonoid.coe_finset_sum]
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
⊢ ↑(∑ c : G.ConnectedComponent, g c • G.lapMatrix_ker_basis_aux c) = fun i => g (G.connectedComponentMk i)
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
⊢ (∑ x : G.ConnectedComponent, g x • fun i => if G.connectedComponentMk i = x then 1 else 0) = fun i =>
    g (G.connectedComponentMk i)

tactic: conv_lhs => enter [2, c, j]; rw [Pi.smul_apply, smul_eq_mul, mul_ite, mul_one, mul_zero]
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
⊢ (∑ x : G.ConnectedComponent, g x • fun i => if G.connectedComponentMk i = x then 1 else 0) = fun i =>
    g (G.connectedComponentMk i)
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
⊢ (∑ c : G.ConnectedComponent, fun j => if G.connectedComponentMk j = c then g c else 0) = fun i =>
    g (G.connectedComponentMk i)

tactic: ext i
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
⊢ (∑ c : G.ConnectedComponent, fun j => if G.connectedComponentMk j = c then g c else 0) = fun i =>
    g (G.connectedComponentMk i)
state_after: case h
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 : V
⊢ (∑ c : G.ConnectedComponent, fun j => if G.connectedComponentMk j = c then g c else 0) i =
    g (G.connectedComponentMk i)

tactic: simp only [Finset.sum_apply, sum_ite_eq, mem_univ, ite_true]
state_before: case h
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 : V
⊢ (∑ c : G.ConnectedComponent, fun j => if G.connectedComponentMk j = c then g c else 0) i =
    g (G.connectedComponentMk i)
state_after: no goals