[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
⊢ filter (fun d => d.fst = v) univ = image (dartOfNeighborSet G v) univ
[PROOFSTEP]
ext d
[GOAL]
case a
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
d : Dart G
⊢ d ∈ filter (fun d => d.fst = v) univ ↔ d ∈ image (dartOfNeighborSet G v) univ
[PROOFSTEP]
simp only [mem_image, true_and_iff, mem_filter, SetCoe.exists, mem_univ, exists_prop_of_true]
[GOAL]
case a
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
d : Dart G
⊢ d.fst = v ↔ ∃ x h, dartOfNeighborSet G v { val := x, property := h } = d
[PROOFSTEP]
constructor
[GOAL]
case a.mp
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
d : Dart G
⊢ d.fst = v → ∃ x h, dartOfNeighborSet G v { val := x, property := h } = d
[PROOFSTEP]
rintro rfl
[GOAL]
case a.mp
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d : Dart G
⊢ ∃ x h, dartOfNeighborSet G d.fst { val := x, property := h } = d
[PROOFSTEP]
exact ⟨_, d.is_adj, by ext <;> rfl⟩
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d : Dart G
⊢ dartOfNeighborSet G d.fst { val := d.snd, property := (_ : Adj G d.fst d.snd) } = d
[PROOFSTEP]
ext
[GOAL]
case h.h₁
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d : Dart G
⊢ (dartOfNeighborSet G d.fst { val := d.snd, property := (_ : Adj G d.fst d.snd) }).toProd.fst = d.fst
[PROOFSTEP]
rfl
[GOAL]
case h.h₂
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d : Dart G
⊢ (dartOfNeighborSet G d.fst { val := d.snd, property := (_ : Adj G d.fst d.snd) }).toProd.snd = d.snd
[PROOFSTEP]
rfl
[GOAL]
case a.mpr
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
d : Dart G
⊢ (∃ x h, dartOfNeighborSet G v { val := x, property := h } = d) → d.fst = v
[PROOFSTEP]
rintro ⟨e, he, rfl⟩
[GOAL]
case a.mpr.intro.intro
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v e : V
he : e ∈ neighborSet G v
⊢ (dartOfNeighborSet G v { val := e, property := he }).toProd.fst = v
[PROOFSTEP]
rfl
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
⊢ card (filter (fun d => d.fst = v) univ) = degree G v
[PROOFSTEP]
simpa only [dart_fst_fiber, Finset.card_univ, card_neighborSet_eq_degree] using
  card_image_of_injective univ (G.dartOfNeighborSet_injective v)
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
⊢ Fintype.card (Dart G) = ∑ v : V, degree G v
[PROOFSTEP]
haveI := Classical.decEq V
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
this : DecidableEq V
⊢ Fintype.card (Dart G) = ∑ v : V, degree G v
[PROOFSTEP]
simp only [← card_univ, ← dart_fst_fiber_card_eq_degree]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
this : DecidableEq V
⊢ card univ = ∑ x : V, card (filter (fun d => d.fst = x) univ)
[PROOFSTEP]
exact card_eq_sum_card_fiberwise (by simp)
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableRel G.Adj
inst✝ : Fintype (Sym2 V)
this : DecidableEq V
⊢ ∀ (x : Dart G), x ∈ univ → x.fst ∈ univ
[PROOFSTEP]
simp
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d d' : Dart G
⊢ d' ∈ filter (fun d' => edge d' = edge d) univ ↔ d' ∈ {d, symm d}
[PROOFSTEP]
simpa using dart_edge_eq_iff d' d
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h : e ∈ edgeSet G
⊢ card (filter (fun d => Dart.edge d = e) univ) = 2
[PROOFSTEP]
refine' Sym2.ind (fun v w h => _) e h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h✝ : e ∈ edgeSet G
v w : V
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ edgeSet G
⊢ card (filter (fun d => Dart.edge d = Quotient.mk (Sym2.Rel.setoid V) (v, w)) univ) = 2
[PROOFSTEP]
let d : G.Dart := ⟨(v, w), h⟩
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h✝ : e ∈ edgeSet G
v w : V
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ edgeSet G
d : Dart G := { toProd := (v, w), is_adj := h }
⊢ card (filter (fun d => Dart.edge d = Quotient.mk (Sym2.Rel.setoid V) (v, w)) univ) = 2
[PROOFSTEP]
convert congr_arg card d.edge_fiber
[GOAL]
case h.e'_3
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h✝ : e ∈ edgeSet G
v w : V
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ edgeSet G
d : Dart G := { toProd := (v, w), is_adj := h }
⊢ 2 = card {d, Dart.symm d}
[PROOFSTEP]
rw [card_insert_of_not_mem, card_singleton]
[GOAL]
case h.e'_3
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h✝ : e ∈ edgeSet G
v w : V
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ edgeSet G
d : Dart G := { toProd := (v, w), is_adj := h }
⊢ ¬d ∈ {Dart.symm d}
[PROOFSTEP]
rw [mem_singleton]
[GOAL]
case h.e'_3
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h✝ : e ∈ edgeSet G
v w : V
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ edgeSet G
d : Dart G := { toProd := (v, w), is_adj := h }
⊢ ¬d = Dart.symm d
[PROOFSTEP]
exact d.symm_ne.symm
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
⊢ Fintype.card (Dart G) = 2 * card (edgeFinset G)
[PROOFSTEP]
rw [← card_univ]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
⊢ card univ = 2 * card (edgeFinset G)
[PROOFSTEP]
rw [@card_eq_sum_card_fiberwise _ _ _ Dart.edge _ G.edgeFinset fun d _h => by rw [mem_edgeFinset]; apply Dart.edge_mem]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d : Dart G
_h : d ∈ univ
⊢ Dart.edge d ∈ edgeFinset G
[PROOFSTEP]
rw [mem_edgeFinset]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
d : Dart G
_h : d ∈ univ
⊢ Dart.edge d ∈ edgeSet G
[PROOFSTEP]
apply Dart.edge_mem
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
⊢ ∑ a in edgeFinset G, card (filter (fun x => Dart.edge x = a) univ) = 2 * card (edgeFinset G)
[PROOFSTEP]
rw [← mul_comm, sum_const_nat]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
⊢ ∀ (x : Sym2 V), x ∈ edgeFinset G → card (filter (fun x_1 => Dart.edge x_1 = x) univ) = 2
[PROOFSTEP]
intro e h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h : e ∈ edgeFinset G
⊢ card (filter (fun x => Dart.edge x = e) univ) = 2
[PROOFSTEP]
apply G.dart_edge_fiber_card e
[GOAL]
V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
e : Sym2 V
h : e ∈ edgeFinset G
⊢ e ∈ edgeSet G
[PROOFSTEP]
rwa [← mem_edgeFinset]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
classical
have h := congr_arg (fun n => ↑n : ℕ → ZMod 2) G.sum_degrees_eq_twice_card_edges
simp only [ZMod.nat_cast_self, zero_mul, Nat.cast_mul] at h
rw [Nat.cast_sum, ← sum_filter_ne_zero] at h
rw [@sum_congr _ _ _ _ (fun v => (G.degree v : ZMod 2)) (fun _v => (1 : ZMod 2)) _ rfl] at h
· simp only [filter_congr, mul_one, nsmul_eq_mul, sum_const, Ne.def] at h
  rw [← ZMod.eq_zero_iff_even]
  convert h
  exact ZMod.ne_zero_iff_odd.symm
· intro v
  simp only [true_and_iff, mem_filter, mem_univ, Ne.def]
  rw [ZMod.eq_zero_iff_even, ZMod.eq_one_iff_odd, Nat.odd_iff_not_even, imp_self]
  trivial
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
have h := congr_arg (fun n => ↑n : ℕ → ZMod 2) G.sum_degrees_eq_twice_card_edges
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h : (fun n => ↑n) (∑ v : V, degree G v) = (fun n => ↑n) (2 * card (edgeFinset G))
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
simp only [ZMod.nat_cast_self, zero_mul, Nat.cast_mul] at h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h : ↑(∑ v : V, degree G v) = 0
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
rw [Nat.cast_sum, ← sum_filter_ne_zero] at h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ∑ x in filter (fun x => ↑(degree G x) ≠ 0) univ, ↑(degree G x) = 0
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
rw [@sum_congr _ _ _ _ (fun v => (G.degree v : ZMod 2)) (fun _v => (1 : ZMod 2)) _ rfl] at h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ∑ _v in filter (fun x => ↑(degree G x) ≠ 0) univ, 1 = 0
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
simp only [filter_congr, mul_one, nsmul_eq_mul, sum_const, Ne.def] at h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ↑(card (filter (fun x => ¬↑(degree G x) = 0) univ)) = 0
⊢ Even (card (filter (fun v => Odd (degree G v)) univ))
[PROOFSTEP]
rw [← ZMod.eq_zero_iff_even]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ↑(card (filter (fun x => ¬↑(degree G x) = 0) univ)) = 0
⊢ ↑(card (filter (fun v => Odd (degree G v)) univ)) = 0
[PROOFSTEP]
convert h
[GOAL]
case h.e'_2.h.e'_3.h.e'_2.h.e'_2.h.a
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ↑(card (filter (fun x => ¬↑(degree G x) = 0) univ)) = 0
x✝ : V
⊢ Odd (degree G x✝) ↔ ¬↑(degree G x✝) = 0
[PROOFSTEP]
exact ZMod.ne_zero_iff_odd.symm
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ∑ x in filter (fun x => ↑(degree G x) ≠ 0) univ, ↑(degree G x) = 0
⊢ ∀ (x : V), x ∈ filter (fun x => ↑(degree G x) ≠ 0) univ → ↑(degree G x) = 1
[PROOFSTEP]
intro v
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ∑ x in filter (fun x => ↑(degree G x) ≠ 0) univ, ↑(degree G x) = 0
v : V
⊢ v ∈ filter (fun x => ↑(degree G x) ≠ 0) univ → ↑(degree G v) = 1
[PROOFSTEP]
simp only [true_and_iff, mem_filter, mem_univ, Ne.def]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ∑ x in filter (fun x => ↑(degree G x) ≠ 0) univ, ↑(degree G x) = 0
v : V
⊢ ¬↑(degree G v) = 0 → ↑(degree G v) = 1
[PROOFSTEP]
rw [ZMod.eq_zero_iff_even, ZMod.eq_one_iff_odd, Nat.odd_iff_not_even, imp_self]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
h✝ : ∑ x : V, ↑(degree G x) = 0
h : ∑ x in filter (fun x => ↑(degree G x) ≠ 0) univ, ↑(degree G x) = 0
v : V
⊢ True
[PROOFSTEP]
trivial
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
⊢ Odd (card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ))
[PROOFSTEP]
rcases G.even_card_odd_degree_vertices with ⟨k, hg⟩
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
⊢ Odd (card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ))
[PROOFSTEP]
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, zero_lt_mul_left] at hh
  exact zero_lt_two
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
⊢ 0 < k
[PROOFSTEP]
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
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
⊢ Finset.Nonempty (filter (fun v => Odd (degree G v)) univ)
[PROOFSTEP]
use v
[GOAL]
case h
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
⊢ v ∈ filter (fun v => Odd (degree G v)) univ
[PROOFSTEP]
simp only [true_and_iff, mem_filter, mem_univ]
[GOAL]
case h
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
⊢ Odd (degree G v)
[PROOFSTEP]
exact h
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hh : Finset.Nonempty (filter (fun v => Odd (degree G v)) univ)
⊢ 0 < k
[PROOFSTEP]
rwa [← card_pos, hg, ← two_mul, zero_lt_mul_left] at hh
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hh : 0 < 2 * k
⊢ 0 < 2
[PROOFSTEP]
exact zero_lt_two
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
⊢ Odd (card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ))
[PROOFSTEP]
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]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
⊢ (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
[PROOFSTEP]
ext w
[GOAL]
case h.a
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
w : V
⊢ w ≠ v ∧ Odd (degree G w) ↔ Odd (degree G w) ∧ w ≠ v
[PROOFSTEP]
rw [and_comm]
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ Odd (card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ))
[PROOFSTEP]
simp only [hc, filter_congr]
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ Odd (card (filter (fun w => Odd (degree G w) ∧ w ≠ v) univ))
[PROOFSTEP]
rw [← filter_filter, filter_ne', card_erase_of_mem]
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ Odd (card (filter (fun w => Odd (degree G w)) univ) - 1)
[PROOFSTEP]
refine' ⟨k - 1, tsub_eq_of_eq_add <| hg.trans _⟩
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ k + k = 2 * (k - 1) + 1 + 1
[PROOFSTEP]
rw [add_assoc, one_add_one_eq_two, ← Nat.mul_succ, ← two_mul]
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ 2 * k = 2 * Nat.succ (k - 1)
[PROOFSTEP]
congr
[GOAL]
case intro.e_a
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ k = Nat.succ (k - 1)
[PROOFSTEP]
exact (tsub_add_cancel_of_le <| Nat.succ_le_iff.2 hk).symm
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝² : Fintype V
inst✝¹ : DecidableEq V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
k : ℕ
hg : card (filter (fun v => Odd (degree G v)) univ) = k + k
hk : 0 < k
hc : (fun w => w ≠ v ∧ Odd (degree G w)) = fun w => Odd (degree G w) ∧ w ≠ v
⊢ v ∈ filter (fun w => Odd (degree G w)) univ
[PROOFSTEP]
simpa only [true_and_iff, mem_filter, mem_univ]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
⊢ ∃ w, w ≠ v ∧ Odd (degree G w)
[PROOFSTEP]
haveI := Classical.decEq V
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
⊢ ∃ w, w ≠ v ∧ Odd (degree G w)
[PROOFSTEP]
rcases G.odd_card_odd_degree_vertices_ne v h with ⟨k, hg⟩
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
k : ℕ
hg : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) = 2 * k + 1
⊢ ∃ w, w ≠ v ∧ Odd (degree G w)
[PROOFSTEP]
have hg' : (filter (fun w : V => w ≠ v ∧ Odd (G.degree w)) univ).card > 0 :=
  by
  rw [hg]
  apply Nat.succ_pos
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
k : ℕ
hg : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) = 2 * k + 1
⊢ card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) > 0
[PROOFSTEP]
rw [hg]
[GOAL]
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
k : ℕ
hg : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) = 2 * k + 1
⊢ 2 * k + 1 > 0
[PROOFSTEP]
apply Nat.succ_pos
[GOAL]
case intro
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
k : ℕ
hg : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) = 2 * k + 1
hg' : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) > 0
⊢ ∃ w, w ≠ v ∧ Odd (degree G w)
[PROOFSTEP]
rcases card_pos.mp hg' with ⟨w, hw⟩
[GOAL]
case intro.intro
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
k : ℕ
hg : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) = 2 * k + 1
hg' : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) > 0
w : V
hw : w ∈ filter (fun w => w ≠ v ∧ Odd (degree G w)) univ
⊢ ∃ w, w ≠ v ∧ Odd (degree G w)
[PROOFSTEP]
simp only [true_and_iff, mem_filter, mem_univ, Ne.def] at hw
[GOAL]
case intro.intro
V : Type u
G : SimpleGraph V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
v : V
h : Odd (degree G v)
this : DecidableEq V
k : ℕ
hg : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) = 2 * k + 1
hg' : card (filter (fun w => w ≠ v ∧ Odd (degree G w)) univ) > 0
w : V
hw : ¬w = v ∧ Odd (degree G w)
⊢ ∃ w, w ≠ v ∧ Odd (degree G w)
[PROOFSTEP]
exact ⟨w, hw⟩


[GOAL]
α : Type u
⊢ ∀ (t₁ : Set (Ultrafilter α)),
    t₁ ∈ ultrafilterBasis α →
      ∀ (t₂ : Set (Ultrafilter α)),
        t₂ ∈ ultrafilterBasis α →
          ∀ (x : Ultrafilter α), x ∈ t₁ ∩ t₂ → ∃ t₃, t₃ ∈ ultrafilterBasis α ∧ x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂
[PROOFSTEP]
rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ u ⟨ua, ub⟩
[GOAL]
case intro.intro.intro
α : Type u
a b : Set α
u : Ultrafilter α
ua : u ∈ (fun s => {u | s ∈ u}) a
ub : u ∈ (fun s => {u | s ∈ u}) b
⊢ ∃ t₃, t₃ ∈ ultrafilterBasis α ∧ u ∈ t₃ ∧ t₃ ⊆ (fun s => {u | s ∈ u}) a ∩ (fun s => {u | s ∈ u}) b
[PROOFSTEP]
refine' ⟨_, ⟨a ∩ b, rfl⟩, inter_mem ua ub, fun v hv => ⟨_, _⟩⟩
[GOAL]
case intro.intro.intro.refine'_1
α : Type u
a b : Set α
u : Ultrafilter α
ua : u ∈ (fun s => {u | s ∈ u}) a
ub : u ∈ (fun s => {u | s ∈ u}) b
v : Ultrafilter α
hv : v ∈ (fun s => {u | s ∈ u}) (a ∩ b)
⊢ v ∈ (fun s => {u | s ∈ u}) a
[PROOFSTEP]
apply mem_of_superset hv
[GOAL]
case intro.intro.intro.refine'_2
α : Type u
a b : Set α
u : Ultrafilter α
ua : u ∈ (fun s => {u | s ∈ u}) a
ub : u ∈ (fun s => {u | s ∈ u}) b
v : Ultrafilter α
hv : v ∈ (fun s => {u | s ∈ u}) (a ∩ b)
⊢ v ∈ (fun s => {u | s ∈ u}) b
[PROOFSTEP]
apply mem_of_superset hv
[GOAL]
case intro.intro.intro.refine'_1
α : Type u
a b : Set α
u : Ultrafilter α
ua : u ∈ (fun s => {u | s ∈ u}) a
ub : u ∈ (fun s => {u | s ∈ u}) b
v : Ultrafilter α
hv : v ∈ (fun s => {u | s ∈ u}) (a ∩ b)
⊢ a ∩ b ⊆ a
[PROOFSTEP]
simp [inter_subset_right a b]
[GOAL]
case intro.intro.intro.refine'_2
α : Type u
a b : Set α
u : Ultrafilter α
ua : u ∈ (fun s => {u | s ∈ u}) a
ub : u ∈ (fun s => {u | s ∈ u}) b
v : Ultrafilter α
hv : v ∈ (fun s => {u | s ∈ u}) (a ∩ b)
⊢ a ∩ b ⊆ b
[PROOFSTEP]
simp [inter_subset_right a b]
[GOAL]
α : Type u
s : Set α
⊢ IsClosed {u | s ∈ u}
[PROOFSTEP]
rw [← isOpen_compl_iff]
[GOAL]
α : Type u
s : Set α
⊢ IsOpen {u | s ∈ u}ᶜ
[PROOFSTEP]
convert ultrafilter_isOpen_basic sᶜ using 1
[GOAL]
case h.e'_3
α : Type u
s : Set α
⊢ {u | s ∈ u}ᶜ = {u | sᶜ ∈ u}
[PROOFSTEP]
ext u
[GOAL]
case h.e'_3.h
α : Type u
s : Set α
u : Ultrafilter α
⊢ u ∈ {u | s ∈ u}ᶜ ↔ u ∈ {u | sᶜ ∈ u}
[PROOFSTEP]
exact Ultrafilter.compl_mem_iff_not_mem.symm
[GOAL]
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
⊢ ↑u ≤ 𝓝 x ↔ x = joinM u
[PROOFSTEP]
rw [eq_comm, ← Ultrafilter.coe_le_coe]
[GOAL]
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
⊢ ↑u ≤ 𝓝 x ↔ ↑(joinM u) ≤ ↑x
[PROOFSTEP]
change ↑u ≤ 𝓝 x ↔ ∀ s ∈ x, {v : Ultrafilter α | s ∈ v} ∈ u
[GOAL]
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
⊢ ↑u ≤ 𝓝 x ↔ ∀ (s : Set α), s ∈ x → {v | s ∈ v} ∈ u
[PROOFSTEP]
simp only [TopologicalSpace.nhds_generateFrom, le_iInf_iff, ultrafilterBasis, le_principal_iff, mem_setOf_eq]
[GOAL]
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
⊢ (∀ (i : Set (Ultrafilter α)), (x ∈ i ∧ i ∈ range fun s => {u | s ∈ u}) → i ∈ ↑u) ↔
    ∀ (s : Set α), s ∈ x → {v | s ∈ v} ∈ u
[PROOFSTEP]
constructor
[GOAL]
case mp
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
⊢ (∀ (i : Set (Ultrafilter α)), (x ∈ i ∧ i ∈ range fun s => {u | s ∈ u}) → i ∈ ↑u) →
    ∀ (s : Set α), s ∈ x → {v | s ∈ v} ∈ u
[PROOFSTEP]
intro h a ha
[GOAL]
case mp
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
h : ∀ (i : Set (Ultrafilter α)), (x ∈ i ∧ i ∈ range fun s => {u | s ∈ u}) → i ∈ ↑u
a : Set α
ha : a ∈ x
⊢ {v | a ∈ v} ∈ u
[PROOFSTEP]
exact h _ ⟨ha, a, rfl⟩
[GOAL]
case mpr
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
⊢ (∀ (s : Set α), s ∈ x → {v | s ∈ v} ∈ u) →
    ∀ (i : Set (Ultrafilter α)), (x ∈ i ∧ i ∈ range fun s => {u | s ∈ u}) → i ∈ ↑u
[PROOFSTEP]
rintro h a ⟨xi, a, rfl⟩
[GOAL]
case mpr.intro.intro
α : Type u
u : Ultrafilter (Ultrafilter α)
x : Ultrafilter α
h : ∀ (s : Set α), s ∈ x → {v | s ∈ v} ∈ u
a : Set α
xi : x ∈ (fun s => {u | s ∈ u}) a
⊢ (fun s => {u | s ∈ u}) a ∈ ↑u
[PROOFSTEP]
exact h _ xi
[GOAL]
α : Type u
⊢ TotallyDisconnectedSpace (Ultrafilter α)
[PROOFSTEP]
rw [totallyDisconnectedSpace_iff_connectedComponent_singleton]
[GOAL]
α : Type u
⊢ ∀ (x : Ultrafilter α), connectedComponent x = {x}
[PROOFSTEP]
intro A
[GOAL]
α : Type u
A : Ultrafilter α
⊢ connectedComponent A = {A}
[PROOFSTEP]
simp only [Set.eq_singleton_iff_unique_mem, mem_connectedComponent, true_and_iff]
[GOAL]
α : Type u
A : Ultrafilter α
⊢ ∀ (x : Ultrafilter α), x ∈ connectedComponent A → x = A
[PROOFSTEP]
intro B hB
[GOAL]
α : Type u
A B : Ultrafilter α
hB : B ∈ connectedComponent A
⊢ B = A
[PROOFSTEP]
rw [← Ultrafilter.coe_le_coe]
[GOAL]
α : Type u
A B : Ultrafilter α
hB : B ∈ connectedComponent A
⊢ ↑B ≤ ↑A
[PROOFSTEP]
intro s hs
[GOAL]
α : Type u
A B : Ultrafilter α
hB : B ∈ connectedComponent A
s : Set α
hs : s ∈ ↑A
⊢ s ∈ ↑B
[PROOFSTEP]
rw [connectedComponent_eq_iInter_clopen, Set.mem_iInter] at hB
[GOAL]
α : Type u
A B : Ultrafilter α
hB : ∀ (i : { Z // IsClopen Z ∧ A ∈ Z }), B ∈ ↑i
s : Set α
hs : s ∈ ↑A
⊢ s ∈ ↑B
[PROOFSTEP]
let Z := {F : Ultrafilter α | s ∈ F}
[GOAL]
α : Type u
A B : Ultrafilter α
hB : ∀ (i : { Z // IsClopen Z ∧ A ∈ Z }), B ∈ ↑i
s : Set α
hs : s ∈ ↑A
Z : Set (Ultrafilter α) := {F | s ∈ F}
⊢ s ∈ ↑B
[PROOFSTEP]
have hZ : IsClopen Z := ⟨ultrafilter_isOpen_basic s, ultrafilter_isClosed_basic s⟩
[GOAL]
α : Type u
A B : Ultrafilter α
hB : ∀ (i : { Z // IsClopen Z ∧ A ∈ Z }), B ∈ ↑i
s : Set α
hs : s ∈ ↑A
Z : Set (Ultrafilter α) := {F | s ∈ F}
hZ : IsClopen Z
⊢ s ∈ ↑B
[PROOFSTEP]
exact hB ⟨Z, hZ, hs⟩
[GOAL]
α : Type u
b : Ultrafilter α
⊢ Tendsto pure (↑b) (𝓝 b)
[PROOFSTEP]
rw [Tendsto, ← coe_map, ultrafilter_converges_iff]
[GOAL]
α : Type u
b : Ultrafilter α
⊢ b = joinM (map pure b)
[PROOFSTEP]
ext s
[GOAL]
case h
α : Type u
b : Ultrafilter α
s : Set α
⊢ s ∈ b ↔ s ∈ joinM (map pure b)
[PROOFSTEP]
change s ∈ b ↔ {t | s ∈ t} ∈ map pure b
[GOAL]
case h
α : Type u
b : Ultrafilter α
s : Set α
⊢ s ∈ b ↔ {t | s ∈ t} ∈ map pure b
[PROOFSTEP]
simp_rw [mem_map, preimage_setOf_eq, mem_pure, setOf_mem_eq]
[GOAL]
α : Type u
b : Ultrafilter α
⊢ comap pure (𝓝 b) ≤ ↑b
[PROOFSTEP]
rw [TopologicalSpace.nhds_generateFrom]
[GOAL]
α : Type u
b : Ultrafilter α
⊢ comap pure (⨅ (s : Set (Ultrafilter α)) (_ : s ∈ {s | b ∈ s ∧ s ∈ ultrafilterBasis α}), 𝓟 s) ≤ ↑b
[PROOFSTEP]
simp only [comap_iInf, comap_principal]
[GOAL]
α : Type u
b : Ultrafilter α
⊢ ⨅ (i : Set (Ultrafilter α)) (_ : i ∈ {s | b ∈ s ∧ s ∈ ultrafilterBasis α}), 𝓟 (pure ⁻¹' i) ≤ ↑b
[PROOFSTEP]
intro s hs
[GOAL]
α : Type u
b : Ultrafilter α
s : Set α
hs : s ∈ ↑b
⊢ s ∈ ⨅ (i : Set (Ultrafilter α)) (_ : i ∈ {s | b ∈ s ∧ s ∈ ultrafilterBasis α}), 𝓟 (pure ⁻¹' i)
[PROOFSTEP]
rw [← le_principal_iff]
[GOAL]
α : Type u
b : Ultrafilter α
s : Set α
hs : s ∈ ↑b
⊢ ⨅ (i : Set (Ultrafilter α)) (_ : i ∈ {s | b ∈ s ∧ s ∈ ultrafilterBasis α}), 𝓟 (pure ⁻¹' i) ≤ 𝓟 s
[PROOFSTEP]
refine' iInf_le_of_le {u | s ∈ u} _
[GOAL]
α : Type u
b : Ultrafilter α
s : Set α
hs : s ∈ ↑b
⊢ ⨅ (_ : {u | s ∈ u} ∈ {s | b ∈ s ∧ s ∈ ultrafilterBasis α}), 𝓟 (pure ⁻¹' {u | s ∈ u}) ≤ 𝓟 s
[PROOFSTEP]
refine' iInf_le_of_le ⟨hs, ⟨s, rfl⟩⟩ _
[GOAL]
α : Type u
b : Ultrafilter α
s : Set α
hs : s ∈ ↑b
⊢ 𝓟 (pure ⁻¹' {u | s ∈ u}) ≤ 𝓟 s
[PROOFSTEP]
exact principal_mono.2 fun a => id
[GOAL]
α : Type u
⊢ Function.Injective pure
[PROOFSTEP]
intro x y h
[GOAL]
α : Type u
x y : α
h : pure x = pure y
⊢ x = y
[PROOFSTEP]
have : { x } ∈ (pure x : Ultrafilter α) := singleton_mem_pure
[GOAL]
α : Type u
x y : α
h : pure x = pure y
this : {x} ∈ pure x
⊢ x = y
[PROOFSTEP]
rw [h] at this
[GOAL]
α : Type u
x y : α
h : pure x = pure y
this : {x} ∈ pure y
⊢ x = y
[PROOFSTEP]
exact (mem_singleton_iff.mp (mem_pure.mp this)).symm
[GOAL]
α : Type u
⊢ induced pure Ultrafilter.topologicalSpace = ⊥
[PROOFSTEP]
apply eq_bot_of_singletons_open
[GOAL]
case h
α : Type u
⊢ ∀ (x : α), IsOpen {x}
[PROOFSTEP]
intro x
[GOAL]
case h
α : Type u
x : α
⊢ IsOpen {x}
[PROOFSTEP]
use{u : Ultrafilter α | { x } ∈ u}, ultrafilter_isOpen_basic _
[GOAL]
case right
α : Type u
x : α
⊢ pure ⁻¹' {u | {x} ∈ u} = {x}
[PROOFSTEP]
simp
[GOAL]
α : Type u
γ : Type u_1
inst✝¹ : TopologicalSpace γ
inst✝ : T2Space γ
f : α → γ
⊢ Ultrafilter.extend f ∘ pure = f
[PROOFSTEP]
letI : TopologicalSpace α := ⊥
[GOAL]
α : Type u
γ : Type u_1
inst✝¹ : TopologicalSpace γ
inst✝ : T2Space γ
f : α → γ
this : TopologicalSpace α := ⊥
⊢ Ultrafilter.extend f ∘ pure = f
[PROOFSTEP]
haveI : DiscreteTopology α := ⟨rfl⟩
[GOAL]
α : Type u
γ : Type u_1
inst✝¹ : TopologicalSpace γ
inst✝ : T2Space γ
f : α → γ
this✝ : TopologicalSpace α := ⊥
this : DiscreteTopology α
⊢ Ultrafilter.extend f ∘ pure = f
[PROOFSTEP]
exact funext (denseInducing_pure.extend_eq continuous_of_discreteTopology)
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
⊢ Continuous (Ultrafilter.extend f)
[PROOFSTEP]
have h : ∀ b : Ultrafilter α, ∃ c, Tendsto f (comap pure (𝓝 b)) (𝓝 c) :=
  fun b =>
    -- b.map f is an ultrafilter on γ, which is compact, so it converges to some c in γ.
  let ⟨c, _, h'⟩ := isCompact_univ.ultrafilter_le_nhds (b.map f) (by rw [le_principal_iff]; exact univ_mem)
  ⟨c, le_trans (map_mono (ultrafilter_comap_pure_nhds _)) h'⟩
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
⊢ ↑(Ultrafilter.map f b) ≤ 𝓟 univ
[PROOFSTEP]
rw [le_principal_iff]
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
⊢ univ ∈ ↑(Ultrafilter.map f b)
[PROOFSTEP]
exact univ_mem
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
h : ∀ (b : Ultrafilter α), ∃ c, Tendsto f (comap pure (𝓝 b)) (𝓝 c)
⊢ Continuous (Ultrafilter.extend f)
[PROOFSTEP]
letI : TopologicalSpace α := ⊥
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
h : ∀ (b : Ultrafilter α), ∃ c, Tendsto f (comap pure (𝓝 b)) (𝓝 c)
this : TopologicalSpace α := ⊥
⊢ Continuous (Ultrafilter.extend f)
[PROOFSTEP]
haveI : NormalSpace γ := normalOfCompactT2
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
h : ∀ (b : Ultrafilter α), ∃ c, Tendsto f (comap pure (𝓝 b)) (𝓝 c)
this✝ : TopologicalSpace α := ⊥
this : NormalSpace γ
⊢ Continuous (Ultrafilter.extend f)
[PROOFSTEP]
exact denseInducing_pure.continuous_extend h
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
⊢ ↑(Ultrafilter.map f b) ≤ 𝓝 c
[PROOFSTEP]
let b' : Ultrafilter (Ultrafilter α) := b.map pure
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
⊢ ↑(Ultrafilter.map f b) ≤ 𝓝 c
[PROOFSTEP]
have t : ↑b' ≤ 𝓝 b := ultrafilter_converges_iff.mpr (bind_pure _).symm
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
t : ↑b' ≤ 𝓝 b
⊢ ↑(Ultrafilter.map f b) ≤ 𝓝 c
[PROOFSTEP]
rw [← h]
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
t : ↑b' ≤ 𝓝 b
⊢ ↑(Ultrafilter.map f b) ≤ 𝓝 (Ultrafilter.extend f b)
[PROOFSTEP]
have := (continuous_ultrafilter_extend f).tendsto b
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
t : ↑b' ≤ 𝓝 b
this : Tendsto (Ultrafilter.extend f) (𝓝 b) (𝓝 (Ultrafilter.extend f b))
⊢ ↑(Ultrafilter.map f b) ≤ 𝓝 (Ultrafilter.extend f b)
[PROOFSTEP]
refine' le_trans _ (le_trans (map_mono t) this)
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
t : ↑b' ≤ 𝓝 b
this : Tendsto (Ultrafilter.extend f) (𝓝 b) (𝓝 (Ultrafilter.extend f b))
⊢ ↑(Ultrafilter.map f b) ≤ map (Ultrafilter.extend f) ↑b'
[PROOFSTEP]
change _ ≤ map (Ultrafilter.extend f ∘ pure) ↑b
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
t : ↑b' ≤ 𝓝 b
this : Tendsto (Ultrafilter.extend f) (𝓝 b) (𝓝 (Ultrafilter.extend f b))
⊢ ↑(Ultrafilter.map f b) ≤ map (Ultrafilter.extend f ∘ pure) ↑b
[PROOFSTEP]
rw [ultrafilter_extend_extends]
[GOAL]
α : Type u
γ : Type u_1
inst✝² : TopologicalSpace γ
inst✝¹ : T2Space γ
inst✝ : CompactSpace γ
f : α → γ
b : Ultrafilter α
c : γ
h : Ultrafilter.extend f b = c
b' : Ultrafilter (Ultrafilter α) := Ultrafilter.map pure b
t : ↑b' ≤ 𝓝 b
this : Tendsto (Ultrafilter.extend f) (𝓝 b) (𝓝 (Ultrafilter.extend f b))
⊢ ↑(Ultrafilter.map f b) ≤ map f ↑b
[PROOFSTEP]
exact le_rfl
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
⊢ TopologicalSpace (StoneCech α)
[PROOFSTEP]
unfold StoneCech
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
⊢ TopologicalSpace (Quotient (stoneCechSetoid α))
[PROOFSTEP]
infer_instance
[GOAL]
α : Type u
inst✝¹ : TopologicalSpace α
inst✝ : Inhabited α
⊢ Inhabited (StoneCech α)
[PROOFSTEP]
unfold StoneCech
[GOAL]
α : Type u
inst✝¹ : TopologicalSpace α
inst✝ : Inhabited α
⊢ Inhabited (Quotient (stoneCechSetoid α))
[PROOFSTEP]
infer_instance
[GOAL]
α : Type u
inst✝⁵ : TopologicalSpace α
γ : Type u
inst✝⁴ : TopologicalSpace γ
inst✝³ : T2Space γ
inst✝² : CompactSpace γ
γ' : Type u
inst✝¹ : TopologicalSpace γ'
inst✝ : T2Space γ'
f : α → γ
hf : Continuous f
g₁ g₂ : StoneCech α → γ'
h₁ : Continuous g₁
h₂ : Continuous g₂
h : g₁ ∘ stoneCechUnit = g₂ ∘ stoneCechUnit
⊢ g₁ = g₂
[PROOFSTEP]
apply Continuous.ext_on denseRange_stoneCechUnit h₁ h₂
[GOAL]
α : Type u
inst✝⁵ : TopologicalSpace α
γ : Type u
inst✝⁴ : TopologicalSpace γ
inst✝³ : T2Space γ
inst✝² : CompactSpace γ
γ' : Type u
inst✝¹ : TopologicalSpace γ'
inst✝ : T2Space γ'
f : α → γ
hf : Continuous f
g₁ g₂ : StoneCech α → γ'
h₁ : Continuous g₁
h₂ : Continuous g₂
h : g₁ ∘ stoneCechUnit = g₂ ∘ stoneCechUnit
⊢ EqOn g₁ g₂ (range stoneCechUnit)
[PROOFSTEP]
rintro x ⟨x, rfl⟩
[GOAL]
case intro
α : Type u
inst✝⁵ : TopologicalSpace α
γ : Type u
inst✝⁴ : TopologicalSpace γ
inst✝³ : T2Space γ
inst✝² : CompactSpace γ
γ' : Type u
inst✝¹ : TopologicalSpace γ'
inst✝ : T2Space γ'
f : α → γ
hf : Continuous f
g₁ g₂ : StoneCech α → γ'
h₁ : Continuous g₁
h₂ : Continuous g₂
h : g₁ ∘ stoneCechUnit = g₂ ∘ stoneCechUnit
x : α
⊢ g₁ (stoneCechUnit x) = g₂ (stoneCechUnit x)
[PROOFSTEP]
apply congr_fun h x
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f u = Ultrafilter.extend f (pure x)
[PROOFSTEP]
skip
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f u = Ultrafilter.extend f (pure x)
[PROOFSTEP]
trans f x
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f u = f x
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ f x = Ultrafilter.extend f (pure x)
[PROOFSTEP]
swap
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ f x = Ultrafilter.extend f (pure x)
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f u = f x
[PROOFSTEP]
symm
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f (pure x) = f x
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f u = f x
[PROOFSTEP]
all_goals refine' ultrafilter_extend_eq_iff.mpr (le_trans (map_mono _) (hf.tendsto _))
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f (pure x) = f x
[PROOFSTEP]
refine' ultrafilter_extend_eq_iff.mpr (le_trans (map_mono _) (hf.tendsto _))
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f u = f x
[PROOFSTEP]
refine' ultrafilter_extend_eq_iff.mpr (le_trans (map_mono _) (hf.tendsto _))
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ ↑(pure x) ≤ 𝓝 x
[PROOFSTEP]
apply pure_le_nhds
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
u : Ultrafilter α
x : α
ux : ↑u ≤ 𝓝 x
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ ↑u ≤ 𝓝 x
[PROOFSTEP]
exact ux
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
x : α
g : Ultrafilter α
gx : ↑g ≤ 𝓝 x
⊢ Tendsto stoneCechUnit (↑g) (𝓝 (stoneCechUnit x))
[PROOFSTEP]
have : (g.map pure).toFilter ≤ 𝓝 g := by
  rw [ultrafilter_converges_iff]
  exact (bind_pure _).symm
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
x : α
g : Ultrafilter α
gx : ↑g ≤ 𝓝 x
⊢ ↑(Ultrafilter.map pure g) ≤ 𝓝 g
[PROOFSTEP]
rw [ultrafilter_converges_iff]
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
x : α
g : Ultrafilter α
gx : ↑g ≤ 𝓝 x
⊢ g = joinM (Ultrafilter.map pure g)
[PROOFSTEP]
exact (bind_pure _).symm
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
x : α
g : Ultrafilter α
gx : ↑g ≤ 𝓝 x
this : ↑(Ultrafilter.map pure g) ≤ 𝓝 g
⊢ Tendsto stoneCechUnit (↑g) (𝓝 (stoneCechUnit x))
[PROOFSTEP]
have : (g.map stoneCechUnit : Filter (StoneCech α)) ≤ 𝓝 ⟦g⟧ :=
  continuousAt_iff_ultrafilter.mp (continuous_quotient_mk'.tendsto g) _ this
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
x : α
g : Ultrafilter α
gx : ↑g ≤ 𝓝 x
this✝ : ↑(Ultrafilter.map pure g) ≤ 𝓝 g
this : ↑(Ultrafilter.map stoneCechUnit g) ≤ 𝓝 (Quotient.mk (stoneCechSetoid α) g)
⊢ Tendsto stoneCechUnit (↑g) (𝓝 (stoneCechUnit x))
[PROOFSTEP]
rwa [show ⟦g⟧ = ⟦pure x⟧ from Quotient.sound <| convergent_eqv_pure gx] at this
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
⊢ T2Space (StoneCech α)
[PROOFSTEP]
rw [t2_iff_ultrafilter]
[GOAL]
α : Type u
inst✝ : TopologicalSpace α
⊢ ∀ {x y : StoneCech α} (f : Ultrafilter (StoneCech α)), ↑f ≤ 𝓝 x → ↑f ≤ 𝓝 y → x = y
[PROOFSTEP]
rintro ⟨x⟩ ⟨y⟩ g gx gy
[GOAL]
case mk.mk
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
⊢ Quot.mk Setoid.r x = Quot.mk Setoid.r y
[PROOFSTEP]
apply Quotient.sound
[GOAL]
case mk.mk.a
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
⊢ x ≈ y
[PROOFSTEP]
intro γ tγ h₁ h₂ f hf
[GOAL]
case mk.mk.a
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f x = Ultrafilter.extend f y
[PROOFSTEP]
skip
[GOAL]
case mk.mk.a
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
⊢ Ultrafilter.extend f x = Ultrafilter.extend f y
[PROOFSTEP]
let ff := stoneCechExtend hf
[GOAL]
case mk.mk.a
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
ff : StoneCech α → γ := stoneCechExtend hf
⊢ Ultrafilter.extend f x = Ultrafilter.extend f y
[PROOFSTEP]
change ff ⟦x⟧ = ff ⟦y⟧
[GOAL]
case mk.mk.a
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
ff : StoneCech α → γ := stoneCechExtend hf
⊢ ff (Quotient.mk (stoneCechSetoid α) x) = ff (Quotient.mk (stoneCechSetoid α) y)
[PROOFSTEP]
have lim := fun (z : Ultrafilter α) (gz : (g : Filter (StoneCech α)) ≤ 𝓝 ⟦z⟧) =>
  ((continuous_stoneCechExtend hf).tendsto _).mono_left gz
[GOAL]
case mk.mk.a
α : Type u
inst✝ : TopologicalSpace α
x✝ : StoneCech α
x : Ultrafilter α
y✝ : StoneCech α
y : Ultrafilter α
g : Ultrafilter (StoneCech α)
gx : ↑g ≤ 𝓝 (Quot.mk Setoid.r x)
gy : ↑g ≤ 𝓝 (Quot.mk Setoid.r y)
γ : Type u
tγ : TopologicalSpace γ
h₁ : T2Space γ
h₂ : CompactSpace γ
f : α → γ
hf : Continuous f
ff : StoneCech α → γ := stoneCechExtend hf
lim :
  ∀ (z : Ultrafilter α),
    ↑g ≤ 𝓝 (Quotient.mk (stoneCechSetoid α) z) →
      Tendsto (stoneCechExtend hf) (↑g) (𝓝 (stoneCechExtend hf (Quotient.mk (stoneCechSetoid α) z)))
⊢ ff (Quotient.mk (stoneCechSetoid α) x) = ff (Quotient.mk (stoneCechSetoid α) y)
[PROOFSTEP]
exact tendsto_nhds_unique (lim x gx) (lim y gy)