Theorem: AddCircle.card_addOrderOf_eq_totient
File: Mathlib/Topology/Instances/AddCircle.lean

tactic: rcases n.eq_zero_or_pos with (rfl | hn)
state_before: 𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n : ℕ
⊢ Nat.card { u // addOrderOf u = n } = Nat.totient n

tactic: simp only [Nat.totient_zero, addOrderOf_eq_zero_iff]
state_before: case inl
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
⊢ Nat.card { u // addOrderOf u = 0 } = Nat.totient 0

tactic: rcases em (∃ u : AddCircle p, ¬IsOfFinAddOrder u) with (⟨u, hu⟩ | h)
state_before: case inl
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
⊢ Nat.card { u // ¬IsOfFinAddOrder u } = 0

tactic: have : Infinite { u : AddCircle p // ¬IsOfFinAddOrder u } := by
  erw [infinite_coe_iff]
  exact infinite_not_isOfFinAddOrder hu
state_before: case inl.inl.intro
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
u : AddCircle p
hu : ¬IsOfFinAddOrder u
⊢ Nat.card { u // ¬IsOfFinAddOrder u } = 0

tactic: exact Nat.card_eq_zero_of_infinite
state_before: case inl.inl.intro
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
u : AddCircle p
hu : ¬IsOfFinAddOrder u
this : Infinite { u // ¬IsOfFinAddOrder u }
⊢ Nat.card { u // ¬IsOfFinAddOrder u } = 0

tactic: erw [infinite_coe_iff]
state_before: 𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
u : AddCircle p
hu : ¬IsOfFinAddOrder u
⊢ Infinite { u // ¬IsOfFinAddOrder u }

tactic: exact infinite_not_isOfFinAddOrder hu
state_before: 𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
u : AddCircle p
hu : ¬IsOfFinAddOrder u
⊢ Set.Infinite fun u => IsOfFinAddOrder u → False

tactic: have : IsEmpty { u : AddCircle p // ¬IsOfFinAddOrder u } := by simpa using h
state_before: case inl.inr
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
h : ¬∃ u, ¬IsOfFinAddOrder u
⊢ Nat.card { u // ¬IsOfFinAddOrder u } = 0

tactic: exact Nat.card_of_isEmpty
state_before: case inl.inr
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
h : ¬∃ u, ¬IsOfFinAddOrder u
this : IsEmpty { u // ¬IsOfFinAddOrder u }
⊢ Nat.card { u // ¬IsOfFinAddOrder u } = 0

tactic: simpa using h
state_before: 𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
h : ¬∃ u, ¬IsOfFinAddOrder u
⊢ IsEmpty { u // ¬IsOfFinAddOrder u }

tactic: rw [← coe_setOf, Nat.card_congr (setAddOrderOfEquiv p hn),
  n.totient_eq_card_lt_and_coprime]
state_before: case inr
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n : ℕ
hn : n > 0
⊢ Nat.card { u // addOrderOf u = n } = Nat.totient n

tactic: simp only [Nat.gcd_comm]
state_before: case inr
𝕜 : Type u_1
B : Type ?u.287307
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : 𝕜
hp : Fact (0 < p)
n : ℕ
hn : n > 0
⊢ Nat.card ↑{m | m < n ∧ Nat.gcd m n = 1} = Nat.card ↑{m | m < n ∧ Nat.coprime n m}