Theorem: SimpleGraph.mem_ker_toLin'_lapMatrix_of_connectedComponent
File: Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean

tactic: rw [LinearMap.mem_ker, lapMatrix_toLin'_apply_eq_zero_iff_forall_reachable]
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
⊢ (fun i => if G.connectedComponentMk i = c then 1 else 0) ∈ LinearMap.ker (toLin' (lapMatrix ℝ G))
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
⊢ ∀ (i j : V),
    G.Reachable i j → (if G.connectedComponentMk i = c then 1 else 0) = if G.connectedComponentMk j = c then 1 else 0

tactic: intro i j h
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
⊢ ∀ (i j : V),
    G.Reachable i j → (if G.connectedComponentMk i = c then 1 else 0) = if G.connectedComponentMk j = c then 1 else 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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
⊢ (if G.connectedComponentMk i = c then 1 else 0) = if G.connectedComponentMk j = c then 1 else 0

tactic: split_ifs with h₁ h₂ h₃
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
⊢ (if G.connectedComponentMk i = c then 1 else 0) = if G.connectedComponentMk j = c then 1 else 0
state_after: case pos
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : G.connectedComponentMk i = c
h₂ : G.connectedComponentMk j = c
⊢ 1 = 1

case neg
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : G.connectedComponentMk i = c
h₂ : ¬G.connectedComponentMk j = c
⊢ 1 = 0

case pos
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : ¬G.connectedComponentMk i = c
h₃ : G.connectedComponentMk j = c
⊢ 0 = 1

case neg
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : ¬G.connectedComponentMk i = c
h₃ : ¬G.connectedComponentMk j = c
⊢ 0 = 0

tactic: rfl
state_before: case pos
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : G.connectedComponentMk i = c
h₂ : G.connectedComponentMk j = c
⊢ 1 = 1
state_after: no goals

tactic: rw [← ConnectedComponent.eq] at h
state_before: case neg
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : G.connectedComponentMk i = c
h₂ : ¬G.connectedComponentMk j = c
⊢ 1 = 0
state_after: case neg
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.connectedComponentMk i = G.connectedComponentMk j
h₁ : G.connectedComponentMk i = c
h₂ : ¬G.connectedComponentMk j = c
⊢ 1 = 0

tactic: exact (h₂ (h₁ ▸ h.symm)).elim
state_before: case neg
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.connectedComponentMk i = G.connectedComponentMk j
h₁ : G.connectedComponentMk i = c
h₂ : ¬G.connectedComponentMk j = c
⊢ 1 = 0
state_after: no goals

tactic: rw [← ConnectedComponent.eq] at h
state_before: case pos
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : ¬G.connectedComponentMk i = c
h₃ : G.connectedComponentMk j = c
⊢ 0 = 1
state_after: case pos
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.connectedComponentMk i = G.connectedComponentMk j
h₁ : ¬G.connectedComponentMk i = c
h₃ : G.connectedComponentMk j = c
⊢ 0 = 1

tactic: exact (h₁ (h₃ ▸ h)).elim
state_before: case pos
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.connectedComponentMk i = G.connectedComponentMk j
h₁ : ¬G.connectedComponentMk i = c
h₃ : G.connectedComponentMk j = c
⊢ 0 = 1
state_after: no goals

tactic: rfl
state_before: case neg
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 : SimpleGraph V
inst✝¹ : DecidableRel G.Adj
inst✝ : DecidableEq G.ConnectedComponent
c : G.ConnectedComponent
i j : V
h : G.Reachable i j
h₁ : ¬G.connectedComponentMk i = c
h₃ : ¬G.connectedComponentMk j = c
⊢ 0 = 0
state_after: no goals