Theorem: SimpleGraph.incMatrix_transpose_mul_diag
File: Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean

tactic: simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
  sum_boole, and_self_iff]
state_before: R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ((incMatrix R G)ᵀ * incMatrix R G) e e = if e ∈ G.edgeSet then 2 else 0
state_after: R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = if e ∈ G.edgeSet then 2 else 0

tactic: split_ifs with h
state_before: R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = if e ∈ G.edgeSet then 2 else 0
state_after: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
h : e ∈ G.edgeSet
⊢ ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 2

case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
h : e ∉ G.edgeSet
⊢ ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 0

tactic: revert h
state_before: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
h : e ∈ G.edgeSet
⊢ ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 2
state_after: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ e ∈ G.edgeSet → ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 2

tactic: refine e.ind ?_
state_before: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ e ∈ G.edgeSet → ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 2
state_after: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ∀ (x y : α), s(x, y) ∈ G.edgeSet → ↑(filter (fun x_1 => s(x, y) ∈ G.incidenceSet x_1) univ).card = 2

tactic: intro v w h
state_before: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ∀ (x y : α), s(x, y) ∈ G.edgeSet → ↑(filter (fun x_1 => s(x, y) ∈ G.incidenceSet x_1) univ).card = 2
state_after: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ ↑(filter (fun x => s(v, w) ∈ G.incidenceSet x) univ).card = 2

tactic: rw [← Nat.cast_two, ← card_pair (G.ne_of_adj h)]
state_before: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ ↑(filter (fun x => s(v, w) ∈ G.incidenceSet x) univ).card = 2
state_after: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ ↑(filter (fun x => s(v, w) ∈ G.incidenceSet x) univ).card = ↑{(v, w).1, (v, w).2}.card

tactic: simp only [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h, true_and, mem_univ, forall_true_left,
  forall_eq_or_imp, forall_eq, and_self, mem_singleton, ne_eq]
state_before: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ ↑(filter (fun x => s(v, w) ∈ G.incidenceSet x) univ).card = ↑{(v, w).1, (v, w).2}.card
state_after: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ ↑(filter (fun x => x = v ∨ x = w) univ).card = ↑{v, w}.card

tactic: congr 2
state_before: case pos
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ ↑(filter (fun x => x = v ∨ x = w) univ).card = ↑{v, w}.card
state_after: case pos.e_a.e_s
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ filter (fun x => x = v ∨ x = w) univ = {v, w}

tactic: ext u
state_before: case pos.e_a.e_s
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
⊢ filter (fun x => x = v ∨ x = w) univ = {v, w}
state_after: case pos.e_a.e_s.a
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
u : α
⊢ u ∈ filter (fun x => x = v ∨ x = w) univ ↔ u ∈ {v, w}

tactic: simp
state_before: case pos.e_a.e_s.a
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∈ G.edgeSet
u : α
⊢ u ∈ filter (fun x => x = v ∨ x = w) univ ↔ u ∈ {v, w}
state_after: no goals

tactic: revert h
state_before: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
h : e ∉ G.edgeSet
⊢ ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 0
state_after: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ e ∉ G.edgeSet → ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 0

tactic: refine e.ind ?_
state_before: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ e ∉ G.edgeSet → ↑(filter (fun x => e ∈ G.incidenceSet x) univ).card = 0
state_after: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ∀ (x y : α), s(x, y) ∉ G.edgeSet → ↑(filter (fun x_1 => s(x, y) ∈ G.incidenceSet x_1) univ).card = 0

tactic: intro v w h
state_before: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
⊢ ∀ (x y : α), s(x, y) ∉ G.edgeSet → ↑(filter (fun x_1 => s(x, y) ∈ G.incidenceSet x_1) univ).card = 0
state_after: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∉ G.edgeSet
⊢ ↑(filter (fun x => s(v, w) ∈ G.incidenceSet x) univ).card = 0

tactic: simp [mk'_mem_incidenceSet_iff, G.mem_edgeSet.not.mp h]
state_before: case neg
R : Type u_1
α : Type u_2
G : SimpleGraph α
inst✝³ : Fintype (Sym2 α)
inst✝² : NonAssocSemiring R
a b : α
e : Sym2 α
inst✝¹ : Fintype α
inst✝ : Decidable (e ∈ G.edgeSet)
v w : α
h : s(v, w) ∉ G.edgeSet
⊢ ↑(filter (fun x => s(v, w) ∈ G.incidenceSet x) univ).card = 0
state_after: no goals