File: Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean

full_name: SimpleGraph.incMatrix
code: /-- `G.incMatrix R` is the `α × Sym2 α` matrix whose `(a, e)`-entry is `1` if `e` is incident to
`a` and `0` otherwise. -/
noncomputable def incMatrix [Zero R] [One R] : Matrix α (Sym2 α) R 
goal: Matrix α (Sym2 α) R

full_name: SimpleGraph.incMatrix_apply
code: theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} :
    G.incMatrix R a e = (G.incidenceSet a).indicator 1 e 
goal: SimpleGraph.incMatrix R G a e = (G.incidenceSet a).indicator 1 e

full_name: SimpleGraph.incMatrix_apply'
code: /-- Entries of the incidence matrix can be computed given additional decidable instances. -/
theorem incMatrix_apply' [Zero R] [One R] [DecidableEq α] [DecidableRel G.Adj] {a : α}
    {e : Sym2 α} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 
goal: SimpleGraph.incMatrix R G a e = if e ∈ G.incidenceSet a then 1 else 0

full_name: SimpleGraph.incMatrix_apply_mul_incMatrix_apply
code: theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e =
    (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e 
goal: SimpleGraph.incMatrix R G a e * SimpleGraph.incMatrix R G b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e

full_name: SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj
code: theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a ≠ b) (h : ¬G.Adj a b) :
    G.incMatrix R a e * G.incMatrix R b e = 0 
goal: SimpleGraph.incMatrix R G a e * SimpleGraph.incMatrix R G b e = 0

full_name: SimpleGraph.incMatrix_of_not_mem_incidenceSet
code: theorem incMatrix_of_not_mem_incidenceSet (h : e ∉ G.incidenceSet a) : G.incMatrix R a e = 0 
goal: SimpleGraph.incMatrix R G a e = 0

full_name: SimpleGraph.incMatrix_of_mem_incidenceSet
code: theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 
goal: SimpleGraph.incMatrix R G a e = 1

full_name: SimpleGraph.incMatrix_apply_eq_zero_iff
code: theorem incMatrix_apply_eq_zero_iff : G.incMatrix R a e = 0 ↔ e ∉ G.incidenceSet a 
goal: SimpleGraph.incMatrix R G a e = 0 ↔ e ∉ G.incidenceSet a

full_name: SimpleGraph.incMatrix_apply_eq_one_iff
code: theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a 
goal: SimpleGraph.incMatrix R G a e = 1 ↔ e ∈ G.incidenceSet a

full_name: SimpleGraph.sum_incMatrix_apply
code: theorem sum_incMatrix_apply [Fintype (neighborSet G a)] :
    ∑ e, G.incMatrix R a e = G.degree a 
goal: ∑ e : Sym2 α, SimpleGraph.incMatrix R G a e = ↑(G.degree a)

full_name: SimpleGraph.incMatrix_mul_transpose_diag
code: theorem incMatrix_mul_transpose_diag [Fintype (neighborSet G a)] :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a a = G.degree a 
goal: (SimpleGraph.incMatrix R G * (SimpleGraph.incMatrix R G)ᵀ) a a = ↑(G.degree a)

full_name: SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
code: theorem sum_incMatrix_apply_of_mem_edgeSet [Fintype α] :
    e ∈ G.edgeSet → ∑ a, G.incMatrix R a e = 2 
goal: e ∈ G.edgeSet → ∑ a : α, SimpleGraph.incMatrix R G a e = 2

full_name: SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
code: theorem sum_incMatrix_apply_of_not_mem_edgeSet [Fintype α] (h : e ∉ G.edgeSet) :
    ∑ a, G.incMatrix R a e = 0 
goal: ∑ a : α, SimpleGraph.incMatrix R G a e = 0

full_name: SimpleGraph.incMatrix_transpose_mul_diag
code: theorem incMatrix_transpose_mul_diag [Fintype α] [Decidable (e ∈ G.edgeSet)] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 
goal: ((SimpleGraph.incMatrix R G)ᵀ * SimpleGraph.incMatrix R G) e e = if e ∈ G.edgeSet then 2 else 0

full_name: SimpleGraph.incMatrix_mul_transpose_apply_of_adj
code: theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) 
goal: (SimpleGraph.incMatrix R G * (SimpleGraph.incMatrix R G)ᵀ) a b = 1

full_name: SimpleGraph.incMatrix_mul_transpose
code: theorem incMatrix_mul_transpose
    [∀ a, Fintype (neighborSet G a)] [DecidableEq α] [DecidableRel G.Adj] :
    G.incMatrix R * (G.incMatrix R)ᵀ = fun a b =>
      if a = b then (G.degree a : R) else if G.Adj a b then 1 else 0 
goal: SimpleGraph.incMatrix R G * (SimpleGraph.incMatrix R G)ᵀ = fun a b =>
  if a = b then ↑(G.degree a) else if G.Adj a b then 1 else 0