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

Proof steps:
state_before: V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
state_after: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
tactic: rcases G.even_card_odd_degree_vertices with ⟨k, hg⟩
state_before: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
state_after: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
tactic: have hk : 0 < k := by
    have hh : (filter (fun v : V => Odd (G.degree v)) univ).Nonempty := by
      use v
      simp only [true_and_iff, mem_filter, mem_univ]
      exact h
    rwa [← card_pos, hg, ← two_mul, mul_pos_iff_of_pos_left] at hh
    exact zero_lt_two
state_before: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
state_after: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (G.degree w)) = fun w => Odd (G.degree w) ∧ w ≠ v
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
tactic: have hc : (fun w : V => w ≠ v ∧ Odd (G.degree w)) = fun w : V => Odd (G.degree w) ∧ w ≠ v := by
    ext w
    rw [and_comm]
state_before: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (G.degree w)) = fun w => Odd (G.degree w) ∧ w ≠ v
⊢ Odd (filter (fun w => w ≠ v ∧ Odd (G.degree w)) univ).card
state_after: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (G.degree w)) = fun w => Odd (G.degree w) ∧ w ≠ v
⊢ Odd (filter (fun w => Odd (G.degree w) ∧ w ≠ v) univ).card
tactic: simp only [hc, filter_congr]
state_before: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (G.degree w)) = fun w => Odd (G.degree w) ∧ w ≠ v
⊢ Odd (filter (fun w => Odd (G.degree w) ∧ w ≠ v) univ).card
state_after: case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (G.degree w)) = fun w => Odd (G.degree w) ∧ w ≠ v
⊢ Odd ((filter (fun w => Odd (G.degree w)) univ).card - 1)

case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (G.degree v)
k : ℕ
hg : (filter (fun v => Odd (G.degree v)) univ).card = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (G.degree w)) = fun w => Odd (G.degree w) ∧ w ≠ v
⊢ v ∈ filter (fun w => Odd (G.degree w)) univ
tactic: rw [← filter_filter, filter_ne', card_erase_of_mem]