combinatorics.simple_graph.inc_matrix
⟷
Mathlib.Combinatorics.SimpleGraph.IncMatrix
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -157,7 +157,7 @@ theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSetEmbedding → ∑ a,
classical
refine' e.ind _
intro a b h
- rw [mem_edge_set] at h
+ rw [mem_edge_set] at h
rw [← Nat.cast_two, ← card_doubleton h.ne]
simp only [inc_matrix_apply', sum_boole, mk_mem_incidence_set_iff, h, true_and_iff]
congr 2
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -85,7 +85,9 @@ variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
#print SimpleGraph.incMatrix_apply_mul_incMatrix_apply /-
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 :=
- by classical
+ by
+ classical simp only [inc_matrix, Set.indicator_apply, ← ite_zero_mul_ite_zero, Pi.one_apply,
+ mul_one, Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
-/
@@ -151,7 +153,16 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
#print SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet /-
theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSetEmbedding → ∑ a, G.incMatrix R a e = 2 :=
- by classical
+ by
+ classical
+ refine' e.ind _
+ intro a b h
+ rw [mem_edge_set] at h
+ rw [← Nat.cast_two, ← card_doubleton h.ne]
+ simp only [inc_matrix_apply', sum_boole, mk_mem_incidence_set_iff, h, true_and_iff]
+ congr 2
+ ext e
+ simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
-/
@@ -164,7 +175,23 @@ theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
#print SimpleGraph.incMatrix_transpose_mul_diag /-
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
- ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by classical
+ ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
+ classical
+ simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_zero_mul_ite_zero, one_mul,
+ sum_boole, and_self_iff]
+ split_ifs with h
+ · revert h
+ refine' e.ind _
+ intro v w h
+ rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
+ simp [mk_mem_incidence_set_iff, G.mem_edge_set.mp h]
+ congr 2
+ ext u
+ simp
+ · revert h
+ refine' e.ind _
+ intro v w h
+ simp [mk_mem_incidence_set_iff, G.mem_edge_set.not.mp h]
#align simple_graph.inc_matrix_transpose_mul_diag SimpleGraph.incMatrix_transpose_mul_diag
-/
@@ -176,7 +203,14 @@ variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
#print SimpleGraph.incMatrix_mul_transpose_apply_of_adj /-
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
- (G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by classical
+ (G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
+ classical
+ simp_rw [Matrix.mul_apply, Matrix.transpose_apply, inc_matrix_apply_mul_inc_matrix_apply,
+ Set.indicator_apply, Pi.one_apply, sum_boole]
+ convert Nat.cast_one
+ convert card_singleton ⟦(a, b)⟧
+ rw [← coe_eq_singleton, coe_filter_univ]
+ exact G.incidence_set_inter_incidence_set_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -85,9 +85,7 @@ variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
#print SimpleGraph.incMatrix_apply_mul_incMatrix_apply /-
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 :=
- by
- classical simp only [inc_matrix, Set.indicator_apply, ← ite_zero_mul_ite_zero, Pi.one_apply,
- mul_one, Set.mem_inter_iff]
+ by classical
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
-/
@@ -153,16 +151,7 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
#print SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet /-
theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSetEmbedding → ∑ a, G.incMatrix R a e = 2 :=
- by
- classical
- refine' e.ind _
- intro a b h
- rw [mem_edge_set] at h
- rw [← Nat.cast_two, ← card_doubleton h.ne]
- simp only [inc_matrix_apply', sum_boole, mk_mem_incidence_set_iff, h, true_and_iff]
- congr 2
- ext e
- simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
+ by classical
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
-/
@@ -175,23 +164,7 @@ theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
#print SimpleGraph.incMatrix_transpose_mul_diag /-
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
- ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
- classical
- simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_zero_mul_ite_zero, one_mul,
- sum_boole, and_self_iff]
- split_ifs with h
- · revert h
- refine' e.ind _
- intro v w h
- rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
- simp [mk_mem_incidence_set_iff, G.mem_edge_set.mp h]
- congr 2
- ext u
- simp
- · revert h
- refine' e.ind _
- intro v w h
- simp [mk_mem_incidence_set_iff, G.mem_edge_set.not.mp h]
+ ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by classical
#align simple_graph.inc_matrix_transpose_mul_diag SimpleGraph.incMatrix_transpose_mul_diag
-/
@@ -203,14 +176,7 @@ variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
#print SimpleGraph.incMatrix_mul_transpose_apply_of_adj /-
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
- (G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
- classical
- simp_rw [Matrix.mul_apply, Matrix.transpose_apply, inc_matrix_apply_mul_inc_matrix_apply,
- Set.indicator_apply, Pi.one_apply, sum_boole]
- convert Nat.cast_one
- convert card_singleton ⟦(a, b)⟧
- rw [← coe_eq_singleton, coe_filter_univ]
- exact G.incidence_set_inter_incidence_set_of_adj h
+ (G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by classical
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -86,8 +86,8 @@ variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
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 :=
by
- classical simp only [inc_matrix, Set.indicator_apply, ← ite_and_mul_zero, Pi.one_apply, mul_one,
- Set.mem_inter_iff]
+ classical simp only [inc_matrix, Set.indicator_apply, ← ite_zero_mul_ite_zero, Pi.one_apply,
+ mul_one, Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
-/
@@ -147,7 +147,7 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a a = G.degree a :=
by
rw [← sum_inc_matrix_apply]
- simp [Matrix.mul_apply, inc_matrix_apply', ← ite_and_mul_zero]
+ simp [Matrix.mul_apply, inc_matrix_apply', ← ite_zero_mul_ite_zero]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
-/
@@ -177,7 +177,7 @@ theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
classical
- simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_and_mul_zero, one_mul,
+ simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_zero_mul_ite_zero, one_mul,
sum_boole, and_self_iff]
split_ifs with h
· revert h
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2021 Gabriel Moise. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
-/
-import Mathbin.Combinatorics.SimpleGraph.Basic
-import Mathbin.Data.Matrix.Basic
+import Combinatorics.SimpleGraph.Basic
+import Data.Matrix.Basic
#align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"75be6b616681ab6ca66d798ead117e75cd64f125"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2021 Gabriel Moise. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
-
-! This file was ported from Lean 3 source module combinatorics.simple_graph.inc_matrix
-! leanprover-community/mathlib commit 75be6b616681ab6ca66d798ead117e75cd64f125
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Combinatorics.SimpleGraph.Basic
import Mathbin.Data.Matrix.Basic
+#align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"75be6b616681ab6ca66d798ead117e75cd64f125"
+
/-!
# Incidence matrix of a simple graph
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -222,7 +222,7 @@ theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Ad
G.incMatrix R ⬝ (G.incMatrix R)ᵀ = fun a b =>
if a = b then G.degree a else if G.Adj a b then 1 else 0 :=
by
- ext (a b)
+ ext a b
split_ifs with h h'
· subst b
convert G.inc_matrix_mul_transpose_diag
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -67,27 +67,34 @@ noncomputable def incMatrix [Zero R] [One R] : Matrix α (Sym2 α) R := fun a =>
variable {R}
+#print SimpleGraph.incMatrix_apply /-
theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} :
G.incMatrix R a e = (G.incidenceSet a).indicator 1 e :=
rfl
#align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply
+-/
+#print SimpleGraph.incMatrix_apply' /-
/-- 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 := by convert rfl
#align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply'
+-/
section MulZeroOneClass
variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
+#print SimpleGraph.incMatrix_apply_mul_incMatrix_apply /-
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 :=
by
classical simp only [inc_matrix, Set.indicator_apply, ← ite_and_mul_zero, Pi.one_apply, mul_one,
Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
+-/
+#print SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj /-
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 :=
by
@@ -95,26 +102,35 @@ theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a ≠ b) (h : ¬G.
rw [G.incidence_set_inter_incidence_set_of_not_adj h hab]
exact Set.not_mem_empty e
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj
+-/
+#print SimpleGraph.incMatrix_of_not_mem_incidenceSet /-
theorem incMatrix_of_not_mem_incidenceSet (h : e ∉ G.incidenceSet a) : G.incMatrix R a e = 0 := by
rw [inc_matrix_apply, Set.indicator_of_not_mem h]
#align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSet
+-/
+#print SimpleGraph.incMatrix_of_mem_incidenceSet /-
theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 := by
rw [inc_matrix_apply, Set.indicator_of_mem h, Pi.one_apply]
#align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSet
+-/
variable [Nontrivial R]
+#print SimpleGraph.incMatrix_apply_eq_zero_iff /-
theorem incMatrix_apply_eq_zero_iff : G.incMatrix R a e = 0 ↔ e ∉ G.incidenceSet a :=
by
simp only [inc_matrix_apply, Set.indicator_apply_eq_zero, Pi.one_apply, one_ne_zero]
exact Iff.rfl
#align simple_graph.inc_matrix_apply_eq_zero_iff SimpleGraph.incMatrix_apply_eq_zero_iff
+-/
+#print SimpleGraph.incMatrix_apply_eq_one_iff /-
theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a := by
convert one_ne_zero.ite_eq_left_iff; infer_instance
#align simple_graph.inc_matrix_apply_eq_one_iff SimpleGraph.incMatrix_apply_eq_one_iff
+-/
end MulZeroOneClass
@@ -122,18 +138,23 @@ section NonAssocSemiring
variable [Fintype α] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
+#print SimpleGraph.sum_incMatrix_apply /-
theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
∑ e, G.incMatrix R a e = G.degree a := by
simp [inc_matrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
+-/
+#print SimpleGraph.incMatrix_mul_transpose_diag /-
theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a a = G.degree a :=
by
rw [← sum_inc_matrix_apply]
simp [Matrix.mul_apply, inc_matrix_apply', ← ite_and_mul_zero]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
+-/
+#print SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet /-
theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSetEmbedding → ∑ a, G.incMatrix R a e = 2 :=
by
classical
@@ -146,12 +167,16 @@ theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSetEmbedding → ∑ a,
ext e
simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
+-/
+#print SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet /-
theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
∑ a, G.incMatrix R a e = 0 :=
sum_eq_zero fun a _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
+-/
+#print SimpleGraph.incMatrix_transpose_mul_diag /-
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
classical
@@ -171,6 +196,7 @@ theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
intro v w h
simp [mk_mem_incidence_set_iff, G.mem_edge_set.not.mp h]
#align simple_graph.inc_matrix_transpose_mul_diag SimpleGraph.incMatrix_transpose_mul_diag
+-/
end NonAssocSemiring
@@ -178,6 +204,7 @@ section Semiring
variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
+#print SimpleGraph.incMatrix_mul_transpose_apply_of_adj /-
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
classical
@@ -188,7 +215,9 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
rw [← coe_eq_singleton, coe_filter_univ]
exact G.incidence_set_inter_incidence_set_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
+-/
+#print SimpleGraph.incMatrix_mul_transpose /-
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
G.incMatrix R ⬝ (G.incMatrix R)ᵀ = fun a b =>
if a = b then G.degree a else if G.Adj a b then 1 else 0 :=
@@ -202,6 +231,7 @@ theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Ad
simp only [Matrix.mul_apply, Matrix.transpose_apply,
G.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj h h', sum_const_zero]
#align simple_graph.inc_matrix_mul_transpose SimpleGraph.incMatrix_mul_transpose
+-/
end Semiring
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -123,7 +123,7 @@ section NonAssocSemiring
variable [Fintype α] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
- (∑ e, G.incMatrix R a e) = G.degree a := by
+ ∑ e, G.incMatrix R a e = G.degree a := by
simp [inc_matrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
@@ -134,8 +134,8 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
simp [Matrix.mul_apply, inc_matrix_apply', ← ite_and_mul_zero]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
-theorem sum_incMatrix_apply_of_mem_edgeSet :
- e ∈ G.edgeSetEmbedding → (∑ a, G.incMatrix R a e) = 2 := by
+theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSetEmbedding → ∑ a, G.incMatrix R a e = 2 :=
+ by
classical
refine' e.ind _
intro a b h
@@ -148,7 +148,7 @@ theorem sum_incMatrix_apply_of_mem_edgeSet :
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
- (∑ a, G.incMatrix R a e) = 0 :=
+ ∑ a, G.incMatrix R a e = 0 :=
sum_eq_zero fun a _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -85,7 +85,7 @@ 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 :=
by
classical simp only [inc_matrix, Set.indicator_apply, ← ite_and_mul_zero, Pi.one_apply, mul_one,
- Set.mem_inter_iff]
+ Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a ≠ b) (h : ¬G.Adj a b) :
@@ -137,14 +137,14 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
theorem sum_incMatrix_apply_of_mem_edgeSet :
e ∈ G.edgeSetEmbedding → (∑ a, G.incMatrix R a e) = 2 := by
classical
- refine' e.ind _
- intro a b h
- rw [mem_edge_set] at h
- rw [← Nat.cast_two, ← card_doubleton h.ne]
- simp only [inc_matrix_apply', sum_boole, mk_mem_incidence_set_iff, h, true_and_iff]
- congr 2
- ext e
- simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
+ refine' e.ind _
+ intro a b h
+ rw [mem_edge_set] at h
+ rw [← Nat.cast_two, ← card_doubleton h.ne]
+ simp only [inc_matrix_apply', sum_boole, mk_mem_incidence_set_iff, h, true_and_iff]
+ congr 2
+ ext e
+ simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
@@ -155,21 +155,21 @@ theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
classical
- simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_and_mul_zero, one_mul,
- sum_boole, and_self_iff]
- split_ifs with h
- · revert h
- refine' e.ind _
- intro v w h
- rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
- simp [mk_mem_incidence_set_iff, G.mem_edge_set.mp h]
- congr 2
- ext u
- simp
- · revert h
- refine' e.ind _
- intro v w h
- simp [mk_mem_incidence_set_iff, G.mem_edge_set.not.mp h]
+ simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_and_mul_zero, one_mul,
+ sum_boole, and_self_iff]
+ split_ifs with h
+ · revert h
+ refine' e.ind _
+ intro v w h
+ rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
+ simp [mk_mem_incidence_set_iff, G.mem_edge_set.mp h]
+ congr 2
+ ext u
+ simp
+ · revert h
+ refine' e.ind _
+ intro v w h
+ simp [mk_mem_incidence_set_iff, G.mem_edge_set.not.mp h]
#align simple_graph.inc_matrix_transpose_mul_diag SimpleGraph.incMatrix_transpose_mul_diag
end NonAssocSemiring
@@ -181,12 +181,12 @@ variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
classical
- simp_rw [Matrix.mul_apply, Matrix.transpose_apply, inc_matrix_apply_mul_inc_matrix_apply,
- Set.indicator_apply, Pi.one_apply, sum_boole]
- convert Nat.cast_one
- convert card_singleton ⟦(a, b)⟧
- rw [← coe_eq_singleton, coe_filter_univ]
- exact G.incidence_set_inter_incidence_set_of_adj h
+ simp_rw [Matrix.mul_apply, Matrix.transpose_apply, inc_matrix_apply_mul_inc_matrix_apply,
+ Set.indicator_apply, Pi.one_apply, sum_boole]
+ convert Nat.cast_one
+ convert card_singleton ⟦(a, b)⟧
+ rw [← coe_eq_singleton, coe_filter_univ]
+ exact G.incidence_set_inter_incidence_set_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -139,7 +139,7 @@ theorem sum_incMatrix_apply_of_mem_edgeSet :
classical
refine' e.ind _
intro a b h
- rw [mem_edge_set] at h
+ rw [mem_edge_set] at h
rw [← Nat.cast_two, ← card_doubleton h.ne]
simp only [inc_matrix_apply', sum_boole, mk_mem_incidence_set_iff, h, true_and_iff]
congr 2
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -51,7 +51,7 @@ incidence matrix for each `simple_graph α` has the same type.
open Finset Matrix SimpleGraph Sym2
-open BigOperators Matrix
+open scoped BigOperators Matrix
namespace SimpleGraph
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -67,23 +67,11 @@ noncomputable def incMatrix [Zero R] [One R] : Matrix α (Sym2 α) R := fun a =>
variable {R}
-/- warning: simple_graph.inc_matrix_apply -> SimpleGraph.incMatrix_apply is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Zero.{u1} R] [_inst_2 : One.{u1} R] {a : α} {e : Sym2.{u2} α}, Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G _inst_1 _inst_2 a e) (Set.indicator.{u2, u1} (Sym2.{u2} α) R _inst_1 (SimpleGraph.incidenceSet.{u2} α G a) (OfNat.ofNat.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (OfNat.mk.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (One.one.{max u2 u1} ((Sym2.{u2} α) -> R) (Pi.instOne.{u2, u1} (Sym2.{u2} α) (fun (ᾰ : Sym2.{u2} α) => R) (fun (i : Sym2.{u2} α) => _inst_2))))) e)
-but is expected to have type
- forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : Zero.{u2} R] [_inst_2 : One.{u2} R] {a : α} {e : Sym2.{u1} α}, Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G _inst_1 _inst_2 a e) (Set.indicator.{u1, u2} (Sym2.{u1} α) R _inst_1 (SimpleGraph.incidenceSet.{u1} α G a) (OfNat.ofNat.{max u1 u2} ((Sym2.{u1} α) -> R) 1 (One.toOfNat1.{max u2 u1} ((Sym2.{u1} α) -> R) (Pi.instOne.{u1, u2} (Sym2.{u1} α) (fun (a._@.Mathlib.Algebra.IndicatorFunction._hyg.77 : Sym2.{u1} α) => R) (fun (i : Sym2.{u1} α) => _inst_2)))) e)
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_applyₓ'. -/
theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} :
G.incMatrix R a e = (G.incidenceSet a).indicator 1 e :=
rfl
#align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply
-/- warning: simple_graph.inc_matrix_apply' -> SimpleGraph.incMatrix_apply' is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Zero.{u1} R] [_inst_2 : One.{u1} R] [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)] {a : α} {e : Sym2.{u2} α}, Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G _inst_1 _inst_2 a e) (ite.{succ u1} R (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)) (SimpleGraph.decidableMemIncidenceSet.{u2} α G (fun (a : α) (b : α) => _inst_3 a b) (fun (a : α) (b : α) => _inst_4 a b) a e) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R _inst_2))) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R _inst_1))))
-but is expected to have type
- forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : Zero.{u2} R] [_inst_2 : One.{u2} R] [_inst_3 : DecidableEq.{succ u1} α] [_inst_4 : DecidableRel.{succ u1} α (SimpleGraph.Adj.{u1} α G)] {a : α} {e : Sym2.{u1} α}, Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G _inst_1 _inst_2 a e) (ite.{succ u2} R (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a)) (SimpleGraph.decidableMemIncidenceSet.{u1} α G (fun (a : α) (b : α) => _inst_3 a b) (fun (a : α) (b : α) => _inst_4 a b) a e) (OfNat.ofNat.{u2} R 1 (One.toOfNat1.{u2} R _inst_2)) (OfNat.ofNat.{u2} R 0 (Zero.toOfNat0.{u2} R _inst_1)))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply'ₓ'. -/
/-- 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 := by convert rfl
@@ -93,12 +81,6 @@ section MulZeroOneClass
variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
-/- warning: simple_graph.inc_matrix_apply_mul_inc_matrix_apply -> SimpleGraph.incMatrix_apply_mul_incMatrix_apply is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {b : α} {e : Sym2.{u2} α}, Eq.{succ u1} R (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) b e)) (Set.indicator.{u2, u1} (Sym2.{u2} α) R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (Inter.inter.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasInter.{u2} (Sym2.{u2} α)) (SimpleGraph.incidenceSet.{u2} α G a) (SimpleGraph.incidenceSet.{u2} α G b)) (OfNat.ofNat.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (OfNat.mk.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (One.one.{max u2 u1} ((Sym2.{u2} α) -> R) (Pi.instOne.{u2, u1} (Sym2.{u2} α) (fun (ᾰ : Sym2.{u2} α) => R) (fun (i : Sym2.{u2} α) => MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)))))) e)
-but is expected to have type
- forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {b : α} {e : Sym2.{u1} α}, Eq.{succ u2} R (HMul.hMul.{u2, u2, u2} R R R (instHMul.{u2} R (MulZeroClass.toMul.{u2} R (MulZeroOneClass.toMulZeroClass.{u2} R _inst_1))) (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) b e)) (Set.indicator.{u1, u2} (Sym2.{u1} α) R (MulZeroOneClass.toZero.{u2} R _inst_1) (Inter.inter.{u1} (Set.{u1} (Sym2.{u1} α)) (Set.instInterSet.{u1} (Sym2.{u1} α)) (SimpleGraph.incidenceSet.{u1} α G a) (SimpleGraph.incidenceSet.{u1} α G b)) (OfNat.ofNat.{max u1 u2} ((Sym2.{u1} α) -> R) 1 (One.toOfNat1.{max u2 u1} ((Sym2.{u1} α) -> R) (Pi.instOne.{u1, u2} (Sym2.{u1} α) (fun (a._@.Mathlib.Algebra.IndicatorFunction._hyg.77 : Sym2.{u1} α) => R) (fun (i : Sym2.{u1} α) => MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1))))) e)
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_applyₓ'. -/
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 :=
by
@@ -106,12 +88,6 @@ theorem incMatrix_apply_mul_incMatrix_apply :
Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
-/- warning: simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj -> SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {b : α} {e : Sym2.{u2} α}, (Ne.{succ u2} α a b) -> (Not (SimpleGraph.Adj.{u2} α G a b)) -> (Eq.{succ u1} R (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) b e)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {b : α} {e : Sym2.{u2} α}, (Ne.{succ u2} α a b) -> (Not (SimpleGraph.Adj.{u2} α G a b)) -> (Eq.{succ u1} R (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) b e)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R _inst_1))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adjₓ'. -/
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 :=
by
@@ -120,46 +96,22 @@ theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a ≠ b) (h : ¬G.
exact Set.not_mem_empty e
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj
-/- warning: simple_graph.inc_matrix_of_not_mem_incidence_set -> SimpleGraph.incMatrix_of_not_mem_incidenceSet is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Not (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a))) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Not (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a))) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R _inst_1))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSetₓ'. -/
theorem incMatrix_of_not_mem_incidenceSet (h : e ∉ G.incidenceSet a) : G.incMatrix R a e = 0 := by
rw [inc_matrix_apply, Set.indicator_of_not_mem h]
#align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSet
-/- warning: simple_graph.inc_matrix_of_mem_incidence_set -> SimpleGraph.incMatrix_of_mem_incidenceSet is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSetₓ'. -/
theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 := by
rw [inc_matrix_apply, Set.indicator_of_mem h, Pi.one_apply]
#align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSet
variable [Nontrivial R]
-/- warning: simple_graph.inc_matrix_apply_eq_zero_iff -> SimpleGraph.incMatrix_apply_eq_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α} [_inst_2 : Nontrivial.{u1} R], Iff (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)))))) (Not (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)))
-but is expected to have type
- forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {e : Sym2.{u1} α} [_inst_2 : Nontrivial.{u2} R], Iff (Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (OfNat.ofNat.{u2} R 0 (Zero.toOfNat0.{u2} R (MulZeroOneClass.toZero.{u2} R _inst_1)))) (Not (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a)))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_eq_zero_iff SimpleGraph.incMatrix_apply_eq_zero_iffₓ'. -/
theorem incMatrix_apply_eq_zero_iff : G.incMatrix R a e = 0 ↔ e ∉ G.incidenceSet a :=
by
simp only [inc_matrix_apply, Set.indicator_apply_eq_zero, Pi.one_apply, one_ne_zero]
exact Iff.rfl
#align simple_graph.inc_matrix_apply_eq_zero_iff SimpleGraph.incMatrix_apply_eq_zero_iff
-/- warning: simple_graph.inc_matrix_apply_eq_one_iff -> SimpleGraph.incMatrix_apply_eq_one_iff is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α} [_inst_2 : Nontrivial.{u1} R], Iff (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)))))) (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a))
-but is expected to have type
- forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {e : Sym2.{u1} α} [_inst_2 : Nontrivial.{u2} R], Iff (Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (OfNat.ofNat.{u2} R 1 (One.toOfNat1.{u2} R (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1))))) (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_eq_one_iff SimpleGraph.incMatrix_apply_eq_one_iffₓ'. -/
theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a := by
convert one_ne_zero.ite_eq_left_iff; infer_instance
#align simple_graph.inc_matrix_apply_eq_one_iff SimpleGraph.incMatrix_apply_eq_one_iff
@@ -170,23 +122,11 @@ section NonAssocSemiring
variable [Fintype α] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
-/- warning: simple_graph.sum_inc_matrix_apply -> SimpleGraph.sum_incMatrix_apply is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Finset.sum.{u1, u2} R (Sym2.{u2} α) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} (Sym2.{u2} α) (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (Prod.fintype.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.Rel.decidableRel.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b))) (fun (e : Sym2.{u2} α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))) a e)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTCₓ.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))))) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Finset.sum.{u1, u2} R (Sym2.{u2} α) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} (Sym2.{u2} α) (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (instFintypeProd.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.instRelDecidable'.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b))) (fun (e : Sym2.{u2} α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2) a e)) (Nat.cast.{u1} R (NonAssocSemiring.toNatCast.{u1} R _inst_2) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
-Case conversion may be inaccurate. Consider using '#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_applyₓ'. -/
theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
(∑ e, G.incMatrix R a e) = G.degree a := by
simp [inc_matrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
-/- warning: simple_graph.inc_matrix_mul_transpose_diag -> SimpleGraph.incMatrix_mul_transpose_diag is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (Prod.fintype.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.Rel.decidableRel.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b)) (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))) a a) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTCₓ.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))))) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (instFintypeProd.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.instRelDecidable'.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b)) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2))) a a) (Nat.cast.{u1} R (NonAssocSemiring.toNatCast.{u1} R _inst_2) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diagₓ'. -/
theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a a = G.degree a :=
by
@@ -194,12 +134,6 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
simp [Matrix.mul_apply, inc_matrix_apply', ← ite_and_mul_zero]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
-/- warning: simple_graph.sum_inc_matrix_apply_of_mem_edge_set -> SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (SimpleGraph.hasLe.{u2} α) (Set.hasLe.{u2} (Sym2.{u2} α))) (fun (_x : RelEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) => (SimpleGraph.{u2} α) -> (Set.{u2} (Sym2.{u2} α))) (RelEmbedding.hasCoeToFun.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) (SimpleGraph.edgeSetEmbedding.{u2} α) G)) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))) a e)) (OfNat.ofNat.{u1} R 2 (OfNat.mk.{u1} R 2 (bit0.{u1} R (Distrib.toHasAdd.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.edgeSet.{u2} α G)) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2) a e)) (OfNat.ofNat.{u1} R 2 (instOfNat.{u1} R 2 (NonAssocSemiring.toNatCast.{u1} R _inst_2) (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSetₓ'. -/
theorem sum_incMatrix_apply_of_mem_edgeSet :
e ∈ G.edgeSetEmbedding → (∑ a, G.incMatrix R a e) = 2 := by
classical
@@ -213,23 +147,11 @@ theorem sum_incMatrix_apply_of_mem_edgeSet :
simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
-/- warning: simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set -> SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Not (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (SimpleGraph.hasLe.{u2} α) (Set.hasLe.{u2} (Sym2.{u2} α))) (fun (_x : RelEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) => (SimpleGraph.{u2} α) -> (Set.{u2} (Sym2.{u2} α))) (RelEmbedding.hasCoeToFun.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) (SimpleGraph.edgeSetEmbedding.{u2} α) G))) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))) a e)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Not (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.edgeSet.{u2} α G))) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2) a e)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSetₓ'. -/
theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
(∑ a, G.incMatrix R a e) = 0 :=
sum_eq_zero fun a _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
-/- warning: simple_graph.inc_matrix_transpose_mul_diag -> SimpleGraph.incMatrix_transpose_mul_diag is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α} [_inst_3 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} (Sym2.{u2} α) α (Sym2.{u2} α) R _inst_1 (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))) e e) (ite.{succ u1} R (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (SimpleGraph.hasLe.{u2} α) (Set.hasLe.{u2} (Sym2.{u2} α))) (fun (_x : RelEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) => (SimpleGraph.{u2} α) -> (Set.{u2} (Sym2.{u2} α))) (RelEmbedding.hasCoeToFun.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) (SimpleGraph.edgeSetEmbedding.{u2} α) G)) (SimpleGraph.decidableMemEdgeSet.{u2} α G (fun (a : α) (b : α) => _inst_3 a b) e) (OfNat.ofNat.{u1} R 2 (OfNat.mk.{u1} R 2 (bit0.{u1} R (Distrib.toHasAdd.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))))) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α} [_inst_3 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} (Sym2.{u2} α) α (Sym2.{u2} α) R _inst_1 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2)) e e) (ite.{succ u1} R (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.edgeSet.{u2} α G)) (SimpleGraph.decidableMemEdgeSet.{u2} α G (fun (a : α) (b : α) => _inst_3 a b) e) (OfNat.ofNat.{u1} R 2 (instOfNat.{u1} R 2 (NonAssocSemiring.toNatCast.{u1} R _inst_2) (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_transpose_mul_diag SimpleGraph.incMatrix_transpose_mul_diagₓ'. -/
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
classical
@@ -256,12 +178,6 @@ section Semiring
variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
-/- warning: simple_graph.inc_matrix_mul_transpose_apply_of_adj -> SimpleGraph.incMatrix_mul_transpose_apply_of_adj is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] {a : α} {b : α}, (SimpleGraph.Adj.{u2} α G a b) -> (Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))))) a b) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] {a : α} {b : α}, (SimpleGraph.Adj.{u2} α G a b) -> (Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2))) a b) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (Semiring.toOne.{u1} R _inst_2))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adjₓ'. -/
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
classical
@@ -273,12 +189,6 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
exact G.incidence_set_inter_incidence_set_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
-/- warning: simple_graph.inc_matrix_mul_transpose -> SimpleGraph.incMatrix_mul_transpose is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] [_inst_3 : Fintype.{u2} α] [_inst_4 : DecidableEq.{succ u2} α] [_inst_5 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ (max u2 u1)} (Matrix.{u2, u2, u1} α α R) (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))) (fun (a : α) (b : α) => ite.{succ u1} R (Eq.{succ u2} α a b) (_inst_4 a b) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTCₓ.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_3 (fun (a : α) (b : α) => _inst_5 a b) a))) (ite.{succ u1} R (SimpleGraph.Adj.{u2} α G a b) (_inst_5 a b) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))))))))
-but is expected to have type
- forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] [_inst_3 : Fintype.{u2} α] [_inst_4 : DecidableEq.{succ u2} α] [_inst_5 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{max (succ u1) (succ u2)} (Matrix.{u2, u2, u1} α α R) (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2)))) (fun (a : α) (b : α) => ite.{succ u1} R (Eq.{succ u2} α a b) (_inst_4 a b) (Nat.cast.{u1} R (Semiring.toNatCast.{u1} R _inst_2) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_3 (fun (a : α) (b : α) => _inst_5 a b) a))) (ite.{succ u1} R (SimpleGraph.Adj.{u2} α G a b) (_inst_5 a b) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (Semiring.toOne.{u1} R _inst_2))) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2))))))
-Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_mul_transpose SimpleGraph.incMatrix_mul_transposeₓ'. -/
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
G.incMatrix R ⬝ (G.incMatrix R)ᵀ = fun a b =>
if a = b then G.degree a else if G.Adj a b then 1 else 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -160,10 +160,8 @@ lean 3 declaration is
but is expected to have type
forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {e : Sym2.{u1} α} [_inst_2 : Nontrivial.{u2} R], Iff (Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (OfNat.ofNat.{u2} R 1 (One.toOfNat1.{u2} R (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1))))) (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a))
Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_eq_one_iff SimpleGraph.incMatrix_apply_eq_one_iffₓ'. -/
-theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a :=
- by
- convert one_ne_zero.ite_eq_left_iff
- infer_instance
+theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a := by
+ convert one_ne_zero.ite_eq_left_iff; infer_instance
#align simple_graph.inc_matrix_apply_eq_one_iff SimpleGraph.incMatrix_apply_eq_one_iff
end MulZeroOneClass
mathlib commit https://github.com/leanprover-community/mathlib/commit/5ec62c8106221a3f9160e4e4fcc3eed79fe213e9
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
! This file was ported from Lean 3 source module combinatorics.simple_graph.inc_matrix
-! leanprover-community/mathlib commit bb168510ef455e9280a152e7f31673cabd3d7496
+! leanprover-community/mathlib commit 75be6b616681ab6ca66d798ead117e75cd64f125
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.Data.Matrix.Basic
/-!
# Incidence matrix of a simple graph
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
This file defines the unoriented incidence matrix of a simple graph.
## Main definitions
mathlib commit https://github.com/leanprover-community/mathlib/commit/1a4df69ca1a9a0e5e26bfe12e2b92814216016d0
@@ -54,19 +54,33 @@ namespace SimpleGraph
variable (R : Type _) {α : Type _} (G : SimpleGraph α)
+#print SimpleGraph.incMatrix /-
/-- `G.inc_matrix 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 := fun a =>
(G.incidenceSet a).indicator 1
#align simple_graph.inc_matrix SimpleGraph.incMatrix
+-/
variable {R}
+/- warning: simple_graph.inc_matrix_apply -> SimpleGraph.incMatrix_apply is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Zero.{u1} R] [_inst_2 : One.{u1} R] {a : α} {e : Sym2.{u2} α}, Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G _inst_1 _inst_2 a e) (Set.indicator.{u2, u1} (Sym2.{u2} α) R _inst_1 (SimpleGraph.incidenceSet.{u2} α G a) (OfNat.ofNat.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (OfNat.mk.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (One.one.{max u2 u1} ((Sym2.{u2} α) -> R) (Pi.instOne.{u2, u1} (Sym2.{u2} α) (fun (ᾰ : Sym2.{u2} α) => R) (fun (i : Sym2.{u2} α) => _inst_2))))) e)
+but is expected to have type
+ forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : Zero.{u2} R] [_inst_2 : One.{u2} R] {a : α} {e : Sym2.{u1} α}, Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G _inst_1 _inst_2 a e) (Set.indicator.{u1, u2} (Sym2.{u1} α) R _inst_1 (SimpleGraph.incidenceSet.{u1} α G a) (OfNat.ofNat.{max u1 u2} ((Sym2.{u1} α) -> R) 1 (One.toOfNat1.{max u2 u1} ((Sym2.{u1} α) -> R) (Pi.instOne.{u1, u2} (Sym2.{u1} α) (fun (a._@.Mathlib.Algebra.IndicatorFunction._hyg.77 : Sym2.{u1} α) => R) (fun (i : Sym2.{u1} α) => _inst_2)))) e)
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_applyₓ'. -/
theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} :
G.incMatrix R a e = (G.incidenceSet a).indicator 1 e :=
rfl
#align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply
+/- warning: simple_graph.inc_matrix_apply' -> SimpleGraph.incMatrix_apply' is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Zero.{u1} R] [_inst_2 : One.{u1} R] [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)] {a : α} {e : Sym2.{u2} α}, Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G _inst_1 _inst_2 a e) (ite.{succ u1} R (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)) (SimpleGraph.decidableMemIncidenceSet.{u2} α G (fun (a : α) (b : α) => _inst_3 a b) (fun (a : α) (b : α) => _inst_4 a b) a e) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R _inst_2))) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R _inst_1))))
+but is expected to have type
+ forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : Zero.{u2} R] [_inst_2 : One.{u2} R] [_inst_3 : DecidableEq.{succ u1} α] [_inst_4 : DecidableRel.{succ u1} α (SimpleGraph.Adj.{u1} α G)] {a : α} {e : Sym2.{u1} α}, Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G _inst_1 _inst_2 a e) (ite.{succ u2} R (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a)) (SimpleGraph.decidableMemIncidenceSet.{u1} α G (fun (a : α) (b : α) => _inst_3 a b) (fun (a : α) (b : α) => _inst_4 a b) a e) (OfNat.ofNat.{u2} R 1 (One.toOfNat1.{u2} R _inst_2)) (OfNat.ofNat.{u2} R 0 (Zero.toOfNat0.{u2} R _inst_1)))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply'ₓ'. -/
/-- 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 := by convert rfl
@@ -76,6 +90,12 @@ section MulZeroOneClass
variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
+/- warning: simple_graph.inc_matrix_apply_mul_inc_matrix_apply -> SimpleGraph.incMatrix_apply_mul_incMatrix_apply is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {b : α} {e : Sym2.{u2} α}, Eq.{succ u1} R (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) b e)) (Set.indicator.{u2, u1} (Sym2.{u2} α) R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (Inter.inter.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasInter.{u2} (Sym2.{u2} α)) (SimpleGraph.incidenceSet.{u2} α G a) (SimpleGraph.incidenceSet.{u2} α G b)) (OfNat.ofNat.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (OfNat.mk.{max u2 u1} ((Sym2.{u2} α) -> R) 1 (One.one.{max u2 u1} ((Sym2.{u2} α) -> R) (Pi.instOne.{u2, u1} (Sym2.{u2} α) (fun (ᾰ : Sym2.{u2} α) => R) (fun (i : Sym2.{u2} α) => MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)))))) e)
+but is expected to have type
+ forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {b : α} {e : Sym2.{u1} α}, Eq.{succ u2} R (HMul.hMul.{u2, u2, u2} R R R (instHMul.{u2} R (MulZeroClass.toMul.{u2} R (MulZeroOneClass.toMulZeroClass.{u2} R _inst_1))) (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) b e)) (Set.indicator.{u1, u2} (Sym2.{u1} α) R (MulZeroOneClass.toZero.{u2} R _inst_1) (Inter.inter.{u1} (Set.{u1} (Sym2.{u1} α)) (Set.instInterSet.{u1} (Sym2.{u1} α)) (SimpleGraph.incidenceSet.{u1} α G a) (SimpleGraph.incidenceSet.{u1} α G b)) (OfNat.ofNat.{max u1 u2} ((Sym2.{u1} α) -> R) 1 (One.toOfNat1.{max u2 u1} ((Sym2.{u1} α) -> R) (Pi.instOne.{u1, u2} (Sym2.{u1} α) (fun (a._@.Mathlib.Algebra.IndicatorFunction._hyg.77 : Sym2.{u1} α) => R) (fun (i : Sym2.{u1} α) => MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1))))) e)
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_applyₓ'. -/
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 :=
by
@@ -83,6 +103,12 @@ theorem incMatrix_apply_mul_incMatrix_apply :
Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
+/- warning: simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj -> SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {b : α} {e : Sym2.{u2} α}, (Ne.{succ u2} α a b) -> (Not (SimpleGraph.Adj.{u2} α G a b)) -> (Eq.{succ u1} R (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toHasMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) b e)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {b : α} {e : Sym2.{u2} α}, (Ne.{succ u2} α a b) -> (Not (SimpleGraph.Adj.{u2} α G a b)) -> (Eq.{succ u1} R (HMul.hMul.{u1, u1, u1} R R R (instHMul.{u1} R (MulZeroClass.toMul.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) b e)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R _inst_1))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adjₓ'. -/
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 :=
by
@@ -91,22 +117,46 @@ theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a ≠ b) (h : ¬G.
exact Set.not_mem_empty e
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj
+/- warning: simple_graph.inc_matrix_of_not_mem_incidence_set -> SimpleGraph.incMatrix_of_not_mem_incidenceSet is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Not (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a))) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Not (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a))) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R _inst_1))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSetₓ'. -/
theorem incMatrix_of_not_mem_incidenceSet (h : e ∉ G.incidenceSet a) : G.incMatrix R a e = 0 := by
rw [inc_matrix_apply, Set.indicator_of_not_mem h]
#align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSet
+/- warning: simple_graph.inc_matrix_of_mem_incidence_set -> SimpleGraph.incMatrix_of_mem_incidenceSet is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α}, (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)) -> (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R _inst_1) (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (MulOneClass.toOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSetₓ'. -/
theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 := by
rw [inc_matrix_apply, Set.indicator_of_mem h, Pi.one_apply]
#align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSet
variable [Nontrivial R]
+/- warning: simple_graph.inc_matrix_apply_eq_zero_iff -> SimpleGraph.incMatrix_apply_eq_zero_iff is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α} [_inst_2 : Nontrivial.{u1} R], Iff (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)))))) (Not (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a)))
+but is expected to have type
+ forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {e : Sym2.{u1} α} [_inst_2 : Nontrivial.{u2} R], Iff (Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (OfNat.ofNat.{u2} R 0 (Zero.toOfNat0.{u2} R (MulZeroOneClass.toZero.{u2} R _inst_1)))) (Not (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a)))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_eq_zero_iff SimpleGraph.incMatrix_apply_eq_zero_iffₓ'. -/
theorem incMatrix_apply_eq_zero_iff : G.incMatrix R a e = 0 ↔ e ∉ G.incidenceSet a :=
by
simp only [inc_matrix_apply, Set.indicator_apply_eq_zero, Pi.one_apply, one_ne_zero]
exact Iff.rfl
#align simple_graph.inc_matrix_apply_eq_zero_iff SimpleGraph.incMatrix_apply_eq_zero_iff
+/- warning: simple_graph.inc_matrix_apply_eq_one_iff -> SimpleGraph.incMatrix_apply_eq_one_iff is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : MulZeroOneClass.{u1} R] {a : α} {e : Sym2.{u2} α} [_inst_2 : Nontrivial.{u1} R], Iff (Eq.{succ u1} R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R _inst_1)) (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)) a e) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (MulOneClass.toHasOne.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R _inst_1)))))) (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (SimpleGraph.incidenceSet.{u2} α G a))
+but is expected to have type
+ forall {R : Type.{u2}} {α : Type.{u1}} (G : SimpleGraph.{u1} α) [_inst_1 : MulZeroOneClass.{u2} R] {a : α} {e : Sym2.{u1} α} [_inst_2 : Nontrivial.{u2} R], Iff (Eq.{succ u2} R (SimpleGraph.incMatrix.{u2, u1} R α G (MulZeroOneClass.toZero.{u2} R _inst_1) (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1)) a e) (OfNat.ofNat.{u2} R 1 (One.toOfNat1.{u2} R (MulOneClass.toOne.{u2} R (MulZeroOneClass.toMulOneClass.{u2} R _inst_1))))) (Membership.mem.{u1, u1} (Sym2.{u1} α) (Set.{u1} (Sym2.{u1} α)) (Set.instMembershipSet.{u1} (Sym2.{u1} α)) e (SimpleGraph.incidenceSet.{u1} α G a))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_apply_eq_one_iff SimpleGraph.incMatrix_apply_eq_one_iffₓ'. -/
theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a :=
by
convert one_ne_zero.ite_eq_left_iff
@@ -119,11 +169,23 @@ section NonAssocSemiring
variable [Fintype α] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
+/- warning: simple_graph.sum_inc_matrix_apply -> SimpleGraph.sum_incMatrix_apply is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Finset.sum.{u1, u2} R (Sym2.{u2} α) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} (Sym2.{u2} α) (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (Prod.fintype.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.Rel.decidableRel.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b))) (fun (e : Sym2.{u2} α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))) a e)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTCₓ.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))))) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Finset.sum.{u1, u2} R (Sym2.{u2} α) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} (Sym2.{u2} α) (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (instFintypeProd.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.instRelDecidable'.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b))) (fun (e : Sym2.{u2} α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2) a e)) (Nat.cast.{u1} R (NonAssocSemiring.toNatCast.{u1} R _inst_2) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
+Case conversion may be inaccurate. Consider using '#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_applyₓ'. -/
theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
(∑ e, G.incMatrix R a e) = G.degree a := by
simp [inc_matrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
+/- warning: simple_graph.inc_matrix_mul_transpose_diag -> SimpleGraph.incMatrix_mul_transpose_diag is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (Prod.fintype.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.Rel.decidableRel.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b)) (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))) a a) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTCₓ.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))))) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {a : α} [_inst_3 : DecidableEq.{succ u2} α] [_inst_4 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R (Quotient.fintype.{u2} (Prod.{u2, u2} α α) (instFintypeProd.{u2, u2} α α _inst_1 _inst_1) (Sym2.Rel.setoid.{u2} α) (fun (a : Prod.{u2, u2} α α) (b : Prod.{u2, u2} α α) => Sym2.instRelDecidable'.{u2} α (fun (a : α) (b : α) => _inst_3 a b) a b)) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2))) a a) (Nat.cast.{u1} R (NonAssocSemiring.toNatCast.{u1} R _inst_2) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_1 (fun (a : α) (b : α) => _inst_4 a b) a)))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diagₓ'. -/
theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a a = G.degree a :=
by
@@ -131,7 +193,13 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
simp [Matrix.mul_apply, inc_matrix_apply', ← ite_and_mul_zero]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
-theorem sum_incMatrix_apply_of_mem_edgeSetEmbedding :
+/- warning: simple_graph.sum_inc_matrix_apply_of_mem_edge_set -> SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (SimpleGraph.hasLe.{u2} α) (Set.hasLe.{u2} (Sym2.{u2} α))) (fun (_x : RelEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) => (SimpleGraph.{u2} α) -> (Set.{u2} (Sym2.{u2} α))) (RelEmbedding.hasCoeToFun.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) (SimpleGraph.edgeSetEmbedding.{u2} α) G)) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))) a e)) (OfNat.ofNat.{u1} R 2 (OfNat.mk.{u1} R 2 (bit0.{u1} R (Distrib.toHasAdd.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.edgeSet.{u2} α G)) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2) a e)) (OfNat.ofNat.{u1} R 2 (instOfNat.{u1} R 2 (NonAssocSemiring.toNatCast.{u1} R _inst_2) (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSetₓ'. -/
+theorem sum_incMatrix_apply_of_mem_edgeSet :
e ∈ G.edgeSetEmbedding → (∑ a, G.incMatrix R a e) = 2 := by
classical
refine' e.ind _
@@ -142,13 +210,25 @@ theorem sum_incMatrix_apply_of_mem_edgeSetEmbedding :
congr 2
ext e
simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
-#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSetEmbedding
-
-theorem sum_incMatrix_apply_of_not_mem_edgeSetEmbedding (h : e ∉ G.edgeSetEmbedding) :
+#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
+
+/- warning: simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set -> SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Not (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (SimpleGraph.hasLe.{u2} α) (Set.hasLe.{u2} (Sym2.{u2} α))) (fun (_x : RelEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) => (SimpleGraph.{u2} α) -> (Set.{u2} (Sym2.{u2} α))) (RelEmbedding.hasCoeToFun.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) (SimpleGraph.edgeSetEmbedding.{u2} α) G))) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))) a e)) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α}, (Not (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.edgeSet.{u2} α G))) -> (Eq.{succ u1} R (Finset.sum.{u1, u2} R α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Finset.univ.{u2} α _inst_1) (fun (a : α) => SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2) a e)) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSetₓ'. -/
+theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSetEmbedding) :
(∑ a, G.incMatrix R a e) = 0 :=
sum_eq_zero fun a _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
-#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSetEmbedding
-
+#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
+
+/- warning: simple_graph.inc_matrix_transpose_mul_diag -> SimpleGraph.incMatrix_transpose_mul_diag is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α} [_inst_3 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} (Sym2.{u2} α) α (Sym2.{u2} α) R _inst_1 (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2)))) e e) (ite.{succ u1} R (Membership.Mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.hasMem.{u2} (Sym2.{u2} α)) e (coeFn.{succ u2, succ u2} (OrderEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (SimpleGraph.hasLe.{u2} α) (Set.hasLe.{u2} (Sym2.{u2} α))) (fun (_x : RelEmbedding.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) => (SimpleGraph.{u2} α) -> (Set.{u2} (Sym2.{u2} α))) (RelEmbedding.hasCoeToFun.{u2, u2} (SimpleGraph.{u2} α) (Set.{u2} (Sym2.{u2} α)) (LE.le.{u2} (SimpleGraph.{u2} α) (SimpleGraph.hasLe.{u2} α)) (LE.le.{u2} (Set.{u2} (Sym2.{u2} α)) (Set.hasLe.{u2} (Sym2.{u2} α)))) (SimpleGraph.edgeSetEmbedding.{u2} α) G)) (SimpleGraph.decidableMemEdgeSet.{u2} α G (fun (a : α) (b : α) => _inst_3 a b) e) (OfNat.ofNat.{u1} R 2 (OfNat.mk.{u1} R 2 (bit0.{u1} R (Distrib.toHasAdd.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2))) (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_2))))))) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} α] [_inst_2 : NonAssocSemiring.{u1} R] {e : Sym2.{u2} α} [_inst_3 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} (Sym2.{u2} α) α (Sym2.{u2} α) R _inst_1 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)) (NonAssocSemiring.toOne.{u1} R _inst_2)) e e) (ite.{succ u1} R (Membership.mem.{u2, u2} (Sym2.{u2} α) (Set.{u2} (Sym2.{u2} α)) (Set.instMembershipSet.{u2} (Sym2.{u2} α)) e (SimpleGraph.edgeSet.{u2} α G)) (SimpleGraph.decidableMemEdgeSet.{u2} α G (fun (a : α) (b : α) => _inst_3 a b) e) (OfNat.ofNat.{u1} R 2 (instOfNat.{u1} R 2 (NonAssocSemiring.toNatCast.{u1} R _inst_2) (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MulZeroOneClass.toZero.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R _inst_2)))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_transpose_mul_diag SimpleGraph.incMatrix_transpose_mul_diagₓ'. -/
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
classical
@@ -175,6 +255,12 @@ section Semiring
variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
+/- warning: simple_graph.inc_matrix_mul_transpose_apply_of_adj -> SimpleGraph.incMatrix_mul_transpose_apply_of_adj is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] {a : α} {b : α}, (SimpleGraph.Adj.{u2} α G a b) -> (Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))))) a b) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] {a : α} {b : α}, (SimpleGraph.Adj.{u2} α G a b) -> (Eq.{succ u1} R (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2))) a b) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (Semiring.toOne.{u1} R _inst_2))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adjₓ'. -/
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
(G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
classical
@@ -186,6 +272,12 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
exact G.incidence_set_inter_incidence_set_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
+/- warning: simple_graph.inc_matrix_mul_transpose -> SimpleGraph.incMatrix_mul_transpose is a dubious translation:
+lean 3 declaration is
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] [_inst_3 : Fintype.{u2} α] [_inst_4 : DecidableEq.{succ u2} α] [_inst_5 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{succ (max u2 u1)} (Matrix.{u2, u2, u1} α α R) (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (Distrib.toHasMul.{u1} R (NonUnitalNonAssocSemiring.toDistrib.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))) (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))) (fun (a : α) (b : α) => ite.{succ u1} R (Eq.{succ u2} α a b) (_inst_4 a b) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat R (HasLiftT.mk.{1, succ u1} Nat R (CoeTCₓ.coe.{1, succ u1} Nat R (Nat.castCoe.{u1} R (AddMonoidWithOne.toNatCast.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_3 (fun (a : α) (b : α) => _inst_5 a b) a))) (ite.{succ u1} R (SimpleGraph.Adj.{u2} α G a b) (_inst_5 a b) (OfNat.ofNat.{u1} R 1 (OfNat.mk.{u1} R 1 (One.one.{u1} R (AddMonoidWithOne.toOne.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))))))) (OfNat.ofNat.{u1} R 0 (OfNat.mk.{u1} R 0 (Zero.zero.{u1} R (MulZeroClass.toHasZero.{u1} R (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2)))))))))
+but is expected to have type
+ forall {R : Type.{u1}} {α : Type.{u2}} (G : SimpleGraph.{u2} α) [_inst_1 : Fintype.{u2} (Sym2.{u2} α)] [_inst_2 : Semiring.{u1} R] [_inst_3 : Fintype.{u2} α] [_inst_4 : DecidableEq.{succ u2} α] [_inst_5 : DecidableRel.{succ u2} α (SimpleGraph.Adj.{u2} α G)], Eq.{max (succ u1) (succ u2)} (Matrix.{u2, u2, u1} α α R) (Matrix.mul.{u1, u2, u2, u2} α (Sym2.{u2} α) α R _inst_1 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_2))) (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2)) (Matrix.transpose.{u1, u2, u2} α (Sym2.{u2} α) R (SimpleGraph.incMatrix.{u1, u2} R α G (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2)) (Semiring.toOne.{u1} R _inst_2)))) (fun (a : α) (b : α) => ite.{succ u1} R (Eq.{succ u2} α a b) (_inst_4 a b) (Nat.cast.{u1} R (Semiring.toNatCast.{u1} R _inst_2) (SimpleGraph.degree.{u2} α G a (SimpleGraph.neighborSetFintype.{u2} α G _inst_3 (fun (a : α) (b : α) => _inst_5 a b) a))) (ite.{succ u1} R (SimpleGraph.Adj.{u2} α G a b) (_inst_5 a b) (OfNat.ofNat.{u1} R 1 (One.toOfNat1.{u1} R (Semiring.toOne.{u1} R _inst_2))) (OfNat.ofNat.{u1} R 0 (Zero.toOfNat0.{u1} R (MonoidWithZero.toZero.{u1} R (Semiring.toMonoidWithZero.{u1} R _inst_2))))))
+Case conversion may be inaccurate. Consider using '#align simple_graph.inc_matrix_mul_transpose SimpleGraph.incMatrix_mul_transposeₓ'. -/
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
G.incMatrix R ⬝ (G.incMatrix R)ᵀ = fun a b =>
if a = b then G.degree a else if G.Adj a b then 1 else 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/22131150f88a2d125713ffa0f4693e3355b1eb49
@@ -131,7 +131,8 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
simp [Matrix.mul_apply, inc_matrix_apply', ← ite_and_mul_zero]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
-theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSet → (∑ a, G.incMatrix R a e) = 2 := by
+theorem sum_incMatrix_apply_of_mem_edgeSetEmbedding :
+ e ∈ G.edgeSetEmbedding → (∑ a, G.incMatrix R a e) = 2 := by
classical
refine' e.ind _
intro a b h
@@ -141,14 +142,15 @@ theorem sum_incMatrix_apply_of_mem_edgeSet : e ∈ G.edgeSet → (∑ a, G.incMa
congr 2
ext e
simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
-#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
+#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSetEmbedding
-theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSet) : (∑ a, G.incMatrix R a e) = 0 :=
+theorem sum_incMatrix_apply_of_not_mem_edgeSetEmbedding (h : e ∉ G.edgeSetEmbedding) :
+ (∑ a, G.incMatrix R a e) = 0 :=
sum_eq_zero fun a _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
-#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
+#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSetEmbedding
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
- ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
+ ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSetEmbedding then 2 else 0 := by
classical
simp only [Matrix.mul_apply, inc_matrix_apply', transpose_apply, ← ite_and_mul_zero, one_mul,
sum_boole, and_self_iff]
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Decidable*
/Fintype _
assumptions (#10445)
Drop unneeded assumptions, modify other assumptions to match exactly what's required to formulate the theorems.
@@ -116,21 +116,22 @@ end MulZeroOneClass
section NonAssocSemiring
-variable [Fintype α] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
+variable [Fintype (Sym2 α)] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
-theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
+theorem sum_incMatrix_apply [Fintype (neighborSet G a)] :
∑ e, G.incMatrix R a e = G.degree a := by
- simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
+ classical simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
-theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
+theorem incMatrix_mul_transpose_diag [Fintype (neighborSet G a)] :
(G.incMatrix R * (G.incMatrix R)ᵀ) a a = G.degree a := by
+ classical
rw [← sum_incMatrix_apply]
simp only [mul_apply, incMatrix_apply', transpose_apply, mul_ite, mul_one, mul_zero]
simp_all only [ite_true, sum_boole]
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
-theorem sum_incMatrix_apply_of_mem_edgeSet :
+theorem sum_incMatrix_apply_of_mem_edgeSet [Fintype α] :
e ∈ G.edgeSet → ∑ a, G.incMatrix R a e = 2 := by
classical
refine' e.ind _
@@ -143,12 +144,12 @@ theorem sum_incMatrix_apply_of_mem_edgeSet :
simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
-theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSet) :
+theorem sum_incMatrix_apply_of_not_mem_edgeSet [Fintype α] (h : e ∉ G.edgeSet) :
∑ a, G.incMatrix R a e = 0 :=
sum_eq_zero fun _ _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
-theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
+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 := by
classical
simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
@@ -186,14 +187,14 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
exact G.incidenceSet_inter_incidenceSet_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
-theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
+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 := by
ext a b
split_ifs with h h'
· subst b
- rename Semiring R => sr
- convert @incMatrix_mul_transpose_diag _ _ _ _ sr.toNonAssocSemiring _ _ _
+ exact incMatrix_mul_transpose_diag (R := R) G
· exact G.incMatrix_mul_transpose_apply_of_adj h'
· simp only [Matrix.mul_apply, Matrix.transpose_apply,
G.incMatrix_apply_mul_incMatrix_apply_of_not_adj h h', sum_const_zero]
@@ -3,7 +3,7 @@ Copyright (c) 2021 Gabriel Moise. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
-/
-import Mathlib.Combinatorics.SimpleGraph.Basic
+import Mathlib.Combinatorics.SimpleGraph.Finite
import Mathlib.Data.Finset.Sym
import Mathlib.Data.Matrix.Basic
@@ -136,7 +136,7 @@ theorem sum_incMatrix_apply_of_mem_edgeSet :
refine' e.ind _
intro a b h
rw [mem_edgeSet] at h
- rw [← Nat.cast_two, ← card_doubleton h.ne]
+ rw [← Nat.cast_two, ← card_pair h.ne]
simp only [incMatrix_apply', sum_boole, mk'_mem_incidenceSet_iff, h, true_and_iff]
congr 2
ext e
@@ -157,7 +157,7 @@ theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
· revert h
refine' e.ind _
intro v w h
- rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
+ rw [← Nat.cast_two, ← card_pair (G.ne_of_adj h)]
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]
congr 2
Sym2
's global Prod
setoid instance, use s(x, y)
notation for unordered pairs (#8729)
The Sym2
type used a global setoid instance on α × α
so that ⟦(x, y)⟧
could stand for an unordered pair using standard Quotient
syntax. This commit refactors Sym2
to not use Quotient
and instead use its own s(x, y)
notation. One benefit to this is that this notation produces a term with type Sym2
rather than Quotient
.
The Fintype
instance for Sym2
is in Mathlib.Data.Finset.Sym
. We switch from using the one for Quotient
because it does not require DecidableEq
.
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
-/
import Mathlib.Combinatorics.SimpleGraph.Basic
+import Mathlib.Data.Finset.Sym
import Mathlib.Data.Matrix.Basic
#align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496"
@@ -180,7 +181,7 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
Set.indicator_apply, Pi.one_apply, sum_boole]
convert @Nat.cast_one R _
- convert card_singleton ⟦(a, b)⟧
+ convert card_singleton s(a, b)
rw [← coe_eq_singleton, coe_filter_univ]
exact G.incidenceSet_inter_incidenceSet_of_adj h
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
(if P then 1 else 0) • a
(#8347)
Two simple lemmas, smul_ite_zero
, and ite_smul_zero
.
Also delete Finset.sum_univ_ite
since it is now provable by simp
thanks to these.
Rename and turn around the following to match the direction that simp
goes in:
ite_mul_zero_left
→ ite_zero_mul
ite_mul_zero_right
→ mul_ite_zero
ite_and_mul_zero
→ ite_zero_mul_ite_zero
@@ -77,7 +77,7 @@ variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
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 := by
- classical simp only [incMatrix, Set.indicator_apply, ← ite_and_mul_zero, Pi.one_apply, mul_one,
+ classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one,
Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
@@ -150,7 +150,7 @@ theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSet) :
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
classical
- simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ← ite_and_mul_zero, one_mul,
+ simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ite_zero_mul_ite_zero, one_mul,
sum_boole, and_self_iff]
split_ifs with h
· revert h
@@ -67,8 +67,8 @@ theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} :
/-- 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 := by
- unfold incMatrix Set.indicator -- Porting note: was `convert rfl`
- simp only [Pi.one_apply]
+ unfold incMatrix Set.indicator
+ convert rfl
#align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply'
section MulZeroOneClass
Removes nonterminal simps on lines looking like simp [...]
@@ -157,7 +157,8 @@ theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
refine' e.ind _
intro v w h
rw [← Nat.cast_two, ← card_doubleton (G.ne_of_adj h)]
- simp [mk'_mem_incidenceSet_iff, G.mem_edgeSet.mp h]
+ 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]
congr 2
ext u
simp
⬝
notation in favor of HMul
(#6487)
The main difficulty here is that *
has a slightly difference precedence to ⬝
. notably around smul
and neg
.
The other annoyance is that ↑U ⬝ A ⬝ ↑U⁻¹ : Matrix m m 𝔸
now has to be written U.val * A * (U⁻¹).val
in order to typecheck.
A downside of this change to consider: if you have a goal of A * (B * C) = (A * B) * C
, mul_assoc
now gives the illusion of matching, when in fact Matrix.mul_assoc
is needed. Previously the distinct symbol made it easy to avoid this mistake.
On the flipside, there is now no need to rewrite by Matrix.mul_eq_mul
all the time (indeed, the lemma is now removed).
@@ -123,7 +123,7 @@ theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
- (G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a a = G.degree a := by
+ (G.incMatrix R * (G.incMatrix R)ᵀ) a a = G.degree a := by
rw [← sum_incMatrix_apply]
simp only [mul_apply, incMatrix_apply', transpose_apply, mul_ite, mul_one, mul_zero]
simp_all only [ite_true, sum_boole]
@@ -148,7 +148,7 @@ theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSet) :
#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
theorem incMatrix_transpose_mul_diag [DecidableRel G.Adj] :
- ((G.incMatrix R)ᵀ ⬝ G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
+ ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0 := by
classical
simp only [Matrix.mul_apply, incMatrix_apply', transpose_apply, ← ite_and_mul_zero, one_mul,
sum_boole, and_self_iff]
@@ -174,7 +174,7 @@ section Semiring
variable [Fintype (Sym2 α)] [Semiring R] {a b : α} {e : Sym2 α}
theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
- (G.incMatrix R ⬝ (G.incMatrix R)ᵀ) a b = (1 : R) := by
+ (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R) := by
classical
simp_rw [Matrix.mul_apply, Matrix.transpose_apply, incMatrix_apply_mul_incMatrix_apply,
Set.indicator_apply, Pi.one_apply, sum_boole]
@@ -185,7 +185,7 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
#align simple_graph.inc_matrix_mul_transpose_apply_of_adj SimpleGraph.incMatrix_mul_transpose_apply_of_adj
theorem incMatrix_mul_transpose [Fintype α] [DecidableEq α] [DecidableRel G.Adj] :
- G.incMatrix R ⬝ (G.incMatrix R)ᵀ = fun a b =>
+ 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 := by
ext a b
split_ifs with h h'
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -49,7 +49,7 @@ open BigOperators Matrix
namespace SimpleGraph
-variable (R : Type _) {α : Type _} (G : SimpleGraph α)
+variable (R : Type*) {α : Type*} (G : SimpleGraph α)
/-- `G.incMatrix R` is the `α × Sym2 α` matrix whose `(a, e)`-entry is `1` if `e` is incident to
`a` and `0` otherwise. -/
@@ -2,15 +2,12 @@
Copyright (c) 2021 Gabriel Moise. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
-
-! This file was ported from Lean 3 source module combinatorics.simple_graph.inc_matrix
-! leanprover-community/mathlib commit bb168510ef455e9280a152e7f31673cabd3d7496
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.SimpleGraph.Basic
import Mathlib.Data.Matrix.Basic
+#align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496"
+
/-!
# Incidence matrix of a simple graph
∑'
precedence (#5615)
∑
, ∏
and variants).([^a-zA-Zα-ωΑ-Ω'𝓝ℳ₀𝕂ₛ)]) \(([∑∏][^()∑∏]*,[^()∑∏:]*)\) ([⊂⊆=<≤])
replaced by $1 $2 $3
@@ -121,7 +121,7 @@ section NonAssocSemiring
variable [Fintype α] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
theorem sum_incMatrix_apply [DecidableEq α] [DecidableRel G.Adj] :
- (∑ e, G.incMatrix R a e) = G.degree a := by
+ ∑ e, G.incMatrix R a e = G.degree a := by
simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
#align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
@@ -133,7 +133,7 @@ theorem incMatrix_mul_transpose_diag [DecidableEq α] [DecidableRel G.Adj] :
#align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
theorem sum_incMatrix_apply_of_mem_edgeSet :
- e ∈ G.edgeSet → (∑ a, G.incMatrix R a e) = 2 := by
+ e ∈ G.edgeSet → ∑ a, G.incMatrix R a e = 2 := by
classical
refine' e.ind _
intro a b h
@@ -146,7 +146,7 @@ theorem sum_incMatrix_apply_of_mem_edgeSet :
#align simple_graph.sum_inc_matrix_apply_of_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_mem_edgeSet
theorem sum_incMatrix_apply_of_not_mem_edgeSet (h : e ∉ G.edgeSet) :
- (∑ a, G.incMatrix R a e) = 0 :=
+ ∑ a, G.incMatrix R a e = 0 :=
sum_eq_zero fun _ _ => G.incMatrix_of_not_mem_incidenceSet fun he => h he.1
#align simple_graph.sum_inc_matrix_apply_of_not_mem_edge_set SimpleGraph.sum_incMatrix_apply_of_not_mem_edgeSet
ext
(#5258)
Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@@ -190,7 +190,7 @@ theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
theorem incMatrix_mul_transpose [Fintype α] [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 := by
- ext (a b)
+ ext a b
split_ifs with h h'
· subst b
rename Semiring R => sr
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -78,11 +78,10 @@ section MulZeroOneClass
variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
-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 :=
- by
+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 := by
classical simp only [incMatrix, Set.indicator_apply, ← ite_and_mul_zero, Pi.one_apply, mul_one,
- Set.mem_inter_iff]
+ Set.mem_inter_iff]
#align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a ≠ b) (h : ¬G.Adj a b) :
The unported dependencies are