l3lab/ntp-mathlib huggingface dataset:
instance : SpectralMapClass (SpectralMap α β) α β
    where
  coe := SpectralMap.toFun
  coe_injective' f g h := by cases f; cases g; 

Proof state:
case mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
toFun✝¹ : α → β
spectral'✝¹ : IsSpectralMap toFun✝¹
toFun✝ : α → β
spectral'✝ : IsSpectralMap toFun✝
h : { toFun := toFun✝¹, spectral' := spectral'✝¹ }.toFun = { toFun := toFun✝, spectral' := spectral'✝ }.toFun
⊢ { toFun := toFun✝¹, spectral' := spectral'✝¹ } = { toFun := toFun✝, spectral' := spectral'✝ }

Next tactic:
congr
@[simp]
theorem coe_comp_continuousMap (f : SpectralMap β γ) (g : SpectralMap α β) :
    (f ∘ g)= (f : ContinuousMap β γ) ∘ (g: ContinuousMap α β) := by
   

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
f : SpectralMap β γ
g : SpectralMap α β
⊢ ⇑f ∘ ⇑g = ⇑↑f ∘ ⇑↑g

Next tactic:
rfl
theorem coe_comp_continuousMap' (f : SpectralMap β γ) (g : SpectralMap α β) :
    (f.comp g : ContinuousMap α γ) = (f : ContinuousMap β γ).comp g := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
f : SpectralMap β γ
g : SpectralMap α β
⊢ ↑(comp f g) = ContinuousMap.comp ↑f ↑g

Next tactic:
rfl
@[simp]
theorem cancel_left {g : SpectralMap β γ} {f₁ f₂ : SpectralMap α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ :=
  ⟨fun h => ext fun a => hg <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
g : SpectralMap β γ
f₁ f₂ : SpectralMap α β
hg : Injective ⇑g
h : comp g f₁ = comp g f₂
a : α
⊢ g (f₁ a) = g (f₂ a)

Next tactic:
rw [← comp_apply, h, comp_apply]
@[simp]
theorem apply_diag_ne [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i : V) : ¬A i i = 1 :=
  by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
i : V
⊢ ¬A i i = 1

Next tactic:
simp [h.apply_diag i]
@[simp]
theorem apply_ne_one_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) :
    ¬A i j = 1 ↔ A i j = 0 := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
i j : V
⊢ ¬A i j = 1 ↔ A i j = 0

Next tactic:
obtain h | h := h.zero_or_one i j
@[simp]
theorem apply_ne_one_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) :
    ¬A i j = 1 ↔ A i j = 0 := by obtain h | h := h.zero_or_one i j <;> 

Proof state:
case inl
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
i j : V
h : A i j = 0
⊢ ¬A i j = 1 ↔ A i j = 0

Next tactic:
simp [h]
@[simp]
theorem apply_ne_one_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) :
    ¬A i j = 1 ↔ A i j = 0 := by obtain h | h := h.zero_or_one i j <;> 

Proof state:
case inr
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
i j : V
h : A i j = 1
⊢ ¬A i j = 1 ↔ A i j = 0

Next tactic:
simp [h]
@[simp]
theorem apply_ne_zero_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) :
    ¬A i j = 0 ↔ A i j = 1 := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
i j : V
⊢ ¬A i j = 0 ↔ A i j = 1

Next tactic:
rw [← apply_ne_one_iff h, Classical.not_not]
/-- For `A : Matrix V V α` and `h : IsAdjMatrix A`,
    `h.toGraph` is the simple graph whose adjacency matrix is `A`. -/
@[simps]
def toGraph [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) : SimpleGraph V where
  Adj i j := A i j = 1
  symm i j hij := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
i j : V
hij : (fun i j => A i j = 1) i j
⊢ (fun i j => A i j = 1) j i

Next tactic:
simp only
/-- For `A : Matrix V V α` and `h : IsAdjMatrix A`,
    `h.toGraph` is the simple graph whose adjacency matrix is `A`. -/
@[simps]
def toGraph [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) : SimpleGraph V where
  Adj i j := A i j = 1
  symm i j hij := by simp only; 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
i j : V
hij : (fun i j => A i j = 1) i j
⊢ A j i = 1

Next tactic:
rwa [h.symm.apply i j]
/-- For `A : Matrix V V α` and `h : IsAdjMatrix A`,
    `h.toGraph` is the simple graph whose adjacency matrix is `A`. -/
@[simps]
def toGraph [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) : SimpleGraph V where
  Adj i j := A i j = 1
  symm i j hij := by simp only; rwa [h.symm.apply i j]
  loopless i := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
i : V
⊢ ¬(fun i j => A i j = 1) i i

Next tactic:
simp [h]
instance [MulZeroOneClass α] [Nontrivial α] [DecidableEq α] (h : IsAdjMatrix A) :
    DecidableRel h.toGraph.Adj := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝² : MulZeroOneClass α
inst✝¹ : Nontrivial α
inst✝ : DecidableEq α
h : IsAdjMatrix A
⊢ DecidableRel (toGraph h).Adj

Next tactic:
simp only [toGraph]
instance [MulZeroOneClass α] [Nontrivial α] [DecidableEq α] (h : IsAdjMatrix A) :
    DecidableRel h.toGraph.Adj := by
  simp only [toGraph]
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
A : Matrix V V α
inst✝² : MulZeroOneClass α
inst✝¹ : Nontrivial α
inst✝ : DecidableEq α
h : IsAdjMatrix A
⊢ DecidableRel fun i j => A i j = 1

Next tactic:
infer_instance
@[simp]
theorem compl_apply_diag [Zero α] [One α] (i : V) : A.compl i i = 0 := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
i : V
⊢ compl A i i = 0

Next tactic:
simp [compl]
@[simp]
theorem compl_apply [Zero α] [One α] (i j : V) : A.compl i j = 0 ∨ A.compl i j = 1 := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
i j : V
⊢ compl A i j = 0 ∨ compl A i j = 1

Next tactic:
unfold compl
@[simp]
theorem compl_apply [Zero α] [One α] (i j : V) : A.compl i j = 0 ∨ A.compl i j = 1 := by
  unfold compl
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
i j : V
⊢ (if i = j then 0 else if A i j = 0 then 1 else 0) = 0 ∨ (if i = j then 0 else if A i j = 0 then 1 else 0) = 1

Next tactic:
split_ifs
@[simp]
theorem compl_apply [Zero α] [One α] (i j : V) : A.compl i j = 0 ∨ A.compl i j = 1 := by
  unfold compl
  split_ifs <;> 

Proof state:
case pos
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
i j : V
h✝ : i = j
⊢ 0 = 0 ∨ 0 = 1

Next tactic:
simp
@[simp]
theorem compl_apply [Zero α] [One α] (i j : V) : A.compl i j = 0 ∨ A.compl i j = 1 := by
  unfold compl
  split_ifs <;> 

Proof state:
case pos
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
i j : V
h✝¹ : ¬i = j
h✝ : A i j = 0
⊢ 1 = 0 ∨ 1 = 1

Next tactic:
simp
@[simp]
theorem compl_apply [Zero α] [One α] (i j : V) : A.compl i j = 0 ∨ A.compl i j = 1 := by
  unfold compl
  split_ifs <;> 

Proof state:
case neg
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
i j : V
h✝¹ : ¬i = j
h✝ : ¬A i j = 0
⊢ 0 = 0 ∨ 0 = 1

Next tactic:
simp
@[simp]
theorem isSymm_compl [Zero α] [One α] (h : A.IsSymm) : A.compl.IsSymm := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
h : IsSymm A
⊢ IsSymm (compl A)

Next tactic:
ext
@[simp]
theorem isSymm_compl [Zero α] [One α] (h : A.IsSymm) : A.compl.IsSymm := by
  ext
  

Proof state:
case a.h
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
h : IsSymm A
i✝ x✝ : V
⊢ (compl A)ᵀ i✝ x✝ = compl A i✝ x✝

Next tactic:
simp [compl, h.apply, eq_comm]
@[simp]
theorem isAdjMatrix_compl [Zero α] [One α] (h : A.IsSymm) : IsAdjMatrix A.compl :=
  { symm := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : Zero α
inst✝ : One α
h : IsSymm A
⊢ IsSymm (compl A)

Next tactic:
simp [h]
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
⊢ toGraph (_ : IsAdjMatrix (Matrix.compl A)) = (toGraph h)ᶜ

Next tactic:
ext v w
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  

Proof state:
case Adj.h.h.a
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h : IsAdjMatrix A
v w : V
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h)ᶜ v w

Next tactic:
cases' h.zero_or_one v w with h h
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  cases' h.zero_or_one v w with h h <;> 

Proof state:
case Adj.h.h.a.inl
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
v w : V
h : A v w = 0
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h✝)ᶜ v w

Next tactic:
by_cases hvw : v = w
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  cases' h.zero_or_one v w with h h <;> 

Proof state:
case Adj.h.h.a.inr
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
v w : V
h : A v w = 1
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h✝)ᶜ v w

Next tactic:
by_cases hvw : v = w
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  cases' h.zero_or_one v w with h h <;> by_cases hvw : v = w <;> 

Proof state:
case pos
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
v w : V
h : A v w = 0
hvw : v = w
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h✝)ᶜ v w

Next tactic:
simp [Matrix.compl, h, hvw]
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  cases' h.zero_or_one v w with h h <;> by_cases hvw : v = w <;> 

Proof state:
case neg
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
v w : V
h : A v w = 0
hvw : ¬v = w
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h✝)ᶜ v w

Next tactic:
simp [Matrix.compl, h, hvw]
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  cases' h.zero_or_one v w with h h <;> by_cases hvw : v = w <;> 

Proof state:
case pos
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
v w : V
h : A v w = 1
hvw : v = w
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h✝)ᶜ v w

Next tactic:
simp [Matrix.compl, h, hvw]
theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ := by
  ext v w
  cases' h.zero_or_one v w with h h <;> by_cases hvw : v = w <;> 

Proof state:
case neg
V : Type u_1
α : Type u_2
β : Type u_3
inst✝³ : DecidableEq α
inst✝² : DecidableEq V
A : Matrix V V α
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
h✝ : IsAdjMatrix A
v w : V
h : A v w = 1
hvw : ¬v = w
⊢ Adj (toGraph (_ : IsAdjMatrix (Matrix.compl A))) v w ↔ Adj (toGraph h✝)ᶜ v w

Next tactic:
simp [Matrix.compl, h, hvw]
@[simp]
theorem transpose_adjMatrix [Zero α] [One α] : (G.adjMatrix α)ᵀ = G.adjMatrix α := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Zero α
inst✝ : One α
⊢ (adjMatrix α G)ᵀ = adjMatrix α G

Next tactic:
ext
@[simp]
theorem transpose_adjMatrix [Zero α] [One α] : (G.adjMatrix α)ᵀ = G.adjMatrix α := by
  ext
  

Proof state:
case a.h
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Zero α
inst✝ : One α
i✝ x✝ : V
⊢ (adjMatrix α G)ᵀ i✝ x✝ = adjMatrix α G i✝ x✝

Next tactic:
simp [adj_comm]
/-- The adjacency matrix of `G` is an adjacency matrix. -/
@[simp]
theorem isAdjMatrix_adjMatrix [Zero α] [One α] : (G.adjMatrix α).IsAdjMatrix :=
  { zero_or_one := fun i j => by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Zero α
inst✝ : One α
i j : V
⊢ adjMatrix α G i j = 0 ∨ adjMatrix α G i j = 1

Next tactic:
by_cases h : G.Adj i j
/-- The adjacency matrix of `G` is an adjacency matrix. -/
@[simp]
theorem isAdjMatrix_adjMatrix [Zero α] [One α] : (G.adjMatrix α).IsAdjMatrix :=
  { zero_or_one := fun i j => by by_cases h : G.Adj i j <;> 

Proof state:
case pos
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Zero α
inst✝ : One α
i j : V
h : Adj G i j
⊢ adjMatrix α G i j = 0 ∨ adjMatrix α G i j = 1

Next tactic:
simp [h]
/-- The adjacency matrix of `G` is an adjacency matrix. -/
@[simp]
theorem isAdjMatrix_adjMatrix [Zero α] [One α] : (G.adjMatrix α).IsAdjMatrix :=
  { zero_or_one := fun i j => by by_cases h : G.Adj i j <;> 

Proof state:
case neg
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Zero α
inst✝ : One α
i j : V
h : ¬Adj G i j
⊢ adjMatrix α G i j = 0 ∨ adjMatrix α G i j = 1

Next tactic:
simp [h]
/-- The graph induced by the adjacency matrix of `G` is `G` itself. -/
theorem toGraph_adjMatrix_eq [MulZeroOneClass α] [Nontrivial α] :
    (G.isAdjMatrix_adjMatrix α).toGraph = G := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
⊢ IsAdjMatrix.toGraph (_ : IsAdjMatrix (adjMatrix α G)) = G

Next tactic:
ext
/-- The graph induced by the adjacency matrix of `G` is `G` itself. -/
theorem toGraph_adjMatrix_eq [MulZeroOneClass α] [Nontrivial α] :
    (G.isAdjMatrix_adjMatrix α).toGraph = G := by
  ext
  

Proof state:
case Adj.h.h.a
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
x✝¹ x✝ : V
⊢ Adj (IsAdjMatrix.toGraph (_ : IsAdjMatrix (adjMatrix α G))) x✝¹ x✝ ↔ Adj G x✝¹ x✝

Next tactic:
simp only [IsAdjMatrix.toGraph_adj, adjMatrix_apply, ite_eq_left_iff, zero_ne_one]
/-- The graph induced by the adjacency matrix of `G` is `G` itself. -/
theorem toGraph_adjMatrix_eq [MulZeroOneClass α] [Nontrivial α] :
    (G.isAdjMatrix_adjMatrix α).toGraph = G := by
  ext
  simp only [IsAdjMatrix.toGraph_adj, adjMatrix_apply, ite_eq_left_iff, zero_ne_one]
  

Proof state:
case Adj.h.h.a
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : MulZeroOneClass α
inst✝ : Nontrivial α
x✝¹ x✝ : V
⊢ ¬Adj G x✝¹ x✝ → False ↔ Adj G x✝¹ x✝

Next tactic:
apply Classical.not_not
@[simp]
theorem adjMatrix_dotProduct [NonAssocSemiring α] (v : V) (vec : V → α) :
    dotProduct (G.adjMatrix α v) vec = ∑ u in G.neighborFinset v, vec u := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ adjMatrix α G v ⬝ᵥ vec = ∑ u in neighborFinset G v, vec u

Next tactic:
simp [neighborFinset_eq_filter, dotProduct, sum_filter]
@[simp]
theorem dotProduct_adjMatrix [NonAssocSemiring α] (v : V) (vec : V → α) :
    dotProduct vec (G.adjMatrix α v) = ∑ u in G.neighborFinset v, vec u := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ vec ⬝ᵥ adjMatrix α G v = ∑ u in neighborFinset G v, vec u

Next tactic:
simp [neighborFinset_eq_filter, dotProduct, sum_filter, Finset.sum_apply]
@[simp]
theorem adjMatrix_mulVec_apply [NonAssocSemiring α] (v : V) (vec : V → α) :
    ((G.adjMatrix α).mulVec vec) v = ∑ u in G.neighborFinset v, vec u := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ mulVec (adjMatrix α G) vec v = ∑ u in neighborFinset G v, vec u

Next tactic:
rw [mulVec, adjMatrix_dotProduct]
@[simp]
theorem adjMatrix_vecMul_apply [NonAssocSemiring α] (v : V) (vec : V → α) :
    ((G.adjMatrix α).vecMul vec) v = ∑ u in G.neighborFinset v, vec u := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ vecMul vec (adjMatrix α G) v = ∑ u in neighborFinset G v, vec u

Next tactic:
simp only [← dotProduct_adjMatrix, vecMul]
@[simp]
theorem adjMatrix_vecMul_apply [NonAssocSemiring α] (v : V) (vec : V → α) :
    ((G.adjMatrix α).vecMul vec) v = ∑ u in G.neighborFinset v, vec u := by
  simp only [← dotProduct_adjMatrix, vecMul]
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ (vec ⬝ᵥ fun i => adjMatrix α G i v) = (fun u => vec u) ⬝ᵥ adjMatrix α G v

Next tactic:
refine' congr rfl _
@[simp]
theorem adjMatrix_vecMul_apply [NonAssocSemiring α] (v : V) (vec : V → α) :
    ((G.adjMatrix α).vecMul vec) v = ∑ u in G.neighborFinset v, vec u := by
  simp only [← dotProduct_adjMatrix, vecMul]
  refine' congr rfl _; 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ (fun i => adjMatrix α G i v) = adjMatrix α G v

Next tactic:
ext x
@[simp]
theorem adjMatrix_vecMul_apply [NonAssocSemiring α] (v : V) (vec : V → α) :
    ((G.adjMatrix α).vecMul vec) v = ∑ u in G.neighborFinset v, vec u := by
  simp only [← dotProduct_adjMatrix, vecMul]
  refine' congr rfl _; ext x
  

Proof state:
case h
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
x : V
⊢ adjMatrix α G x v = adjMatrix α G v x

Next tactic:
rw [← transpose_apply (adjMatrix α G) x v, transpose_adjMatrix]
@[simp]
theorem adjMatrix_mul_apply [NonAssocSemiring α] (M : Matrix V V α) (v w : V) :
    (G.adjMatrix α * M) v w = ∑ u in G.neighborFinset v, M u w := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
M : Matrix V V α
v w : V
⊢ (adjMatrix α G * M) v w = ∑ u in neighborFinset G v, M u w

Next tactic:
simp [mul_apply, neighborFinset_eq_filter, sum_filter]
@[simp]
theorem mul_adjMatrix_apply [NonAssocSemiring α] (M : Matrix V V α) (v w : V) :
    (M * G.adjMatrix α) v w = ∑ u in G.neighborFinset w, M v u := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
M : Matrix V V α
v w : V
⊢ (M * adjMatrix α G) v w = ∑ u in neighborFinset G w, M v u

Next tactic:
simp [mul_apply, neighborFinset_eq_filter, sum_filter, adj_comm]
@[simp]
theorem trace_adjMatrix [AddCommMonoid α] [One α] : Matrix.trace (G.adjMatrix α) = 0 := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝³ : DecidableRel G.Adj
inst✝² : Fintype V
inst✝¹ : AddCommMonoid α
inst✝ : One α
⊢ trace (adjMatrix α G) = 0

Next tactic:
simp [Matrix.trace]
theorem adjMatrix_mul_self_apply_self [NonAssocSemiring α] (i : V) :
    (G.adjMatrix α * G.adjMatrix α) i i = degree G i := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
i : V
⊢ (adjMatrix α G * adjMatrix α G) i i = ↑(degree G i)

Next tactic:
simp [degree]
theorem adjMatrix_mulVec_const_apply [Semiring α] {a : α} {v : V} :
    (G.adjMatrix α).mulVec (Function.const _ a) v = G.degree v * a := by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : Semiring α
a : α
v : V
⊢ mulVec (adjMatrix α G) (Function.const V a) v = ↑(degree G v) * a

Next tactic:
simp [degree]
theorem adjMatrix_mulVec_const_apply_of_regular [Semiring α] {d : ℕ} {a : α}
    (hd : G.IsRegularOfDegree d) {v : V} : (G.adjMatrix α).mulVec (Function.const _ a) v = d * a :=
  by 

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : Semiring α
d : ℕ
a : α
hd : IsRegularOfDegree G d
v : V
⊢ mulVec (adjMatrix α G) (Function.const V a) v = ↑d * a

Next tactic:
simp [hd v]
theorem adjMatrix_pow_apply_eq_card_walk [DecidableEq V] [Semiring α] (n : ℕ) (u v : V) :
    (G.adjMatrix α ^ n) u v = Fintype.card { p : G.Walk u v | p.length = n } := by
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝³ : DecidableRel G.Adj
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : Semiring α
n : ℕ
u v : V
⊢ (adjMatrix α G ^ n) u v = ↑(Fintype.card ↑{p | Walk.length p = n})

Next tactic:
rw [card_set_walk_length_eq]
theorem adjMatrix_pow_apply_eq_card_walk [DecidableEq V] [Semiring α] (n : ℕ) (u v : V) :
    (G.adjMatrix α ^ n) u v = Fintype.card { p : G.Walk u v | p.length = n } := by
  rw [card_set_walk_length_eq]
  

Proof state:
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝³ : DecidableRel G.Adj
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : Semiring α
n : ℕ
u v : V
⊢ (adjMatrix α G ^ n) u v = ↑(card (finsetWalkLength G n u v))

Next tactic:
induction' n with n ih generalizing u v
theorem adjMatrix_pow_apply_eq_card_walk [DecidableEq V] [Semiring α] (n : ℕ) (u v : V) :
    (G.adjMatrix α ^ n) u v = Fintype.card { p : G.Walk u v | p.length = n } := by
  rw [card_set_walk_length_eq]
  induction' n with n ih generalizing u v
  · 

Proof state:
case zero
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝³ : DecidableRel G.Adj
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : Semiring α
u v : V
⊢ (adjMatrix α G ^ Nat.zero) u v = ↑(card (finsetWalkLength G Nat.zero u v))

Next tactic:
obtain rfl | h := eq_or_ne u v
theorem adjMatrix_pow_apply_eq_card_walk [DecidableEq V] [Semiring α] (n : ℕ) (u v : V) :
    (G.adjMatrix α ^ n) u v = Fintype.card { p : G.Walk u v | p.length = n } := by
  rw [card_set_walk_length_eq]
  induction' n with n ih generalizing u v
  · obtain rfl | h := eq_or_ne u v <;> 

Proof state:
case zero.inl
V : Type u_1
α : Type u_2
β : Type u_3
G : SimpleGraph V
inst✝³ : DecidableRel G.Adj
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : Semiring α
u : V
⊢ (adjMatrix α G ^ Nat.zero) u u = ↑(card (finsetWalkLength G Nat.zero u u))

Next tactic:
simp [finsetWalkLength, *]