Theorem: AddSubgroup.cyclic_of_min
File: Mathlib/GroupTheory/Archimedean.lean

tactic: obtain ⟨⟨a_in, a_pos⟩, a_min⟩ := ha
state_before: G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
ha : IsLeast {g | g ∈ H ∧ 0 < g} a
⊢ H = closure {a}

tactic: refine' le_antisymm _ (H.closure_le.mpr <| by simp [a_in])
state_before: case intro.intro
G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
⊢ H = closure {a}

tactic: intro g g_in
state_before: case intro.intro
G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
⊢ H ≤ closure {a}

tactic: obtain ⟨k, ⟨nonneg, lt⟩, _⟩ := existsUnique_zsmul_near_of_pos' a_pos g
state_before: case intro.intro
G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
⊢ g ∈ closure {a}

tactic: simp [sub_eq_zero.mp h_zero, AddSubgroup.mem_closure_singleton]
state_before: case intro.intro.intro.intro.intro
G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
h_zero : g - k • a = 0
⊢ g ∈ closure {a}

tactic: simp [a_in]
state_before: G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
⊢ {a} ⊆ ↑H

tactic: by_contra h
state_before: G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
⊢ g - k • a = 0

tactic: have h' : ¬a ≤ g - k • a := not_le.mpr lt
state_before: G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
h✝ : ¬g - k • a = 0
h : a ≤ g - k • a
⊢ False

tactic: contradiction
state_before: G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
h✝ : ¬g - k • a = 0
h : a ≤ g - k • a
h' : ¬a ≤ g - k • a
⊢ False

tactic: refine' a_min ⟨_, _⟩
state_before: G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
h : ¬g - k • a = 0
⊢ a ≤ g - k • a

tactic: exact AddSubgroup.sub_mem H g_in (AddSubgroup.zsmul_mem H a_in k)
state_before: case refine'_1
G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
h : ¬g - k • a = 0
⊢ g - k • a ∈ H

tactic: exact lt_of_le_of_ne nonneg (Ne.symm h)
state_before: case refine'_2
G : Type u_1
inst✝¹ : LinearOrderedAddCommGroup G
inst✝ : Archimedean G
H : AddSubgroup G
a : G
a_min : a ∈ lowerBounds {g | g ∈ H ∧ 0 < g}
a_in : a ∈ H
a_pos : 0 < a
g : G
g_in : g ∈ H
k : ℤ
right✝ : ∀ (y : ℤ), (fun k => 0 ≤ g - k • a ∧ g - k • a < a) y → y = k
nonneg : 0 ≤ g - k • a
lt : g - k • a < a
h : ¬g - k • a = 0
⊢ 0 < g - k • a