Theorem: SimpleGraph.dart_card_eq_twice_card_edges
File: Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean

tactic: classical
rw [← card_univ]
rw [@card_eq_sum_card_fiberwise _ _ _ Dart.edge _ G.edgeFinset fun d _h =>
    by rw [mem_edgeFinset]; apply Dart.edge_mem]
rw [← mul_comm, sum_const_nat]
intro e h
apply G.dart_edge_fiber_card e
rwa [← mem_edgeFinset]
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ Fintype.card G.Dart = 2 * G.edgeFinset.card
state_after: no goals

tactic: rw [← card_univ]
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ Fintype.card G.Dart = 2 * G.edgeFinset.card
state_after: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ univ.card = 2 * G.edgeFinset.card

tactic: rw [@card_eq_sum_card_fiberwise _ _ _ Dart.edge _ G.edgeFinset fun d _h =>
    by rw [mem_edgeFinset]; apply Dart.edge_mem]
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ univ.card = 2 * G.edgeFinset.card
state_after: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ ∑ a ∈ G.edgeFinset, (filter (fun x => x.edge = a) univ).card = 2 * G.edgeFinset.card

tactic: rw [← mul_comm, sum_const_nat]
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ ∑ a ∈ G.edgeFinset, (filter (fun x => x.edge = a) univ).card = 2 * G.edgeFinset.card
state_after: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ ∀ x ∈ G.edgeFinset, (filter (fun x_1 => x_1.edge = x) univ).card = 2

tactic: intro e h
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ ∀ x ∈ G.edgeFinset, (filter (fun x_1 => x_1.edge = x) univ).card = 2
state_after: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
e : Sym2 V
h : e ∈ G.edgeFinset
⊢ (filter (fun x => x.edge = e) univ).card = 2

tactic: apply G.dart_edge_fiber_card e
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
e : Sym2 V
h : e ∈ G.edgeFinset
⊢ (filter (fun x => x.edge = e) univ).card = 2
state_after: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
e : Sym2 V
h : e ∈ G.edgeFinset
⊢ e ∈ G.edgeSet

tactic: rwa [← mem_edgeFinset]
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
e : Sym2 V
h : e ∈ G.edgeFinset
⊢ e ∈ G.edgeSet
state_after: no goals

tactic: rw [mem_edgeFinset]
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
d : G.Dart
_h : d ∈ univ
⊢ d.edge ∈ G.edgeFinset
state_after: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
d : G.Dart
_h : d ∈ univ
⊢ d.edge ∈ G.edgeSet

tactic: apply Dart.edge_mem
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
d : G.Dart
_h : d ∈ univ
⊢ d.edge ∈ G.edgeSet
state_after: no goals