l3lab/ntp-mathlib huggingface dataset:
/-- Let `K` be a convex body that contains `0` and let `u n` be a sequence of nonnegative real
numbers that tends to `0`. Then the intersection of the dilated bodies `(1 + u n) • K` is equal
to `K`. -/
theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) (h_zero : 0 ∈ K)
    (hu : Tendsto u atTop (nhds 0)) :
    ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by
  ext x
  refine ⟨fun h => ?_, fun h => ?_⟩
  · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le
    rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff]
    rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu
    intro ε hε
    obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos)
    obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n)
    refine ⟨y, hyK, ?_⟩
    rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel'],
      norm_smul, Real.norm_eq_abs]
    specialize hn n le_rfl
    

Proof state:
case h.refine_1.intro.intro.intro.intro.intro
V : Type u_1
inst✝² : SeminormedAddCommGroup V
inst✝¹ : NormedSpace ℝ V
K✝ L : ConvexBody V
inst✝ : T2Space V
u : ℕ → ℝ≥0
K : ConvexBody V
h_zero : 0 ∈ K
hu : ∀ (ε : ℝ), 0 < ε → ∃ N, ∀ (n : ℕ), N ≤ n → ‖↑(u n) - ↑0‖ < ε
C : ℝ
hC_pos : C > 0
hC_bdd : ∀ x ∈ ↑K, ‖x‖ ≤ C
ε : ℝ
hε : 0 < ε
n : ℕ
y : V
hyK : y ∈ ↑K
h : (1 + ↑(u n)) • y ∈ ⋂ n, (1 + ↑(u n)) • ↑K
hn : ‖↑(u n) - ↑0‖ < ε / C
⊢ |↑(u n)| * ‖y‖ < ε

Next tactic:
rw [_root_.lt_div_iff' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn
/-- Let `K` be a convex body that contains `0` and let `u n` be a sequence of nonnegative real
numbers that tends to `0`. Then the intersection of the dilated bodies `(1 + u n) • K` is equal
to `K`. -/
theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) (h_zero : 0 ∈ K)
    (hu : Tendsto u atTop (nhds 0)) :
    ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by
  ext x
  refine ⟨fun h => ?_, fun h => ?_⟩
  · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le
    rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff]
    rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu
    intro ε hε
    obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos)
    obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n)
    refine ⟨y, hyK, ?_⟩
    rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel'],
      norm_smul, Real.norm_eq_abs]
    specialize hn n le_rfl
    rw [_root_.lt_div_iff' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn
    

Proof state:
case h.refine_1.intro.intro.intro.intro.intro
V : Type u_1
inst✝² : SeminormedAddCommGroup V
inst✝¹ : NormedSpace ℝ V
K✝ L : ConvexBody V
inst✝ : T2Space V
u : ℕ → ℝ≥0
K : ConvexBody V
h_zero : 0 ∈ K
hu : ∀ (ε : ℝ), 0 < ε → ∃ N, ∀ (n : ℕ), N ≤ n → ‖↑(u n) - ↑0‖ < ε
C : ℝ
hC_pos : C > 0
hC_bdd : ∀ x ∈ ↑K, ‖x‖ ≤ C
ε : ℝ
hε : 0 < ε
n : ℕ
y : V
hyK : y ∈ ↑K
h : (1 + ↑(u n)) • y ∈ ⋂ n, (1 + ↑(u n)) • ↑K
hn : |↑(u n)| * C < ε
⊢ |↑(u n)| * ‖y‖ < ε

Next tactic:
refine lt_of_le_of_lt ?_ hn
/-- Let `K` be a convex body that contains `0` and let `u n` be a sequence of nonnegative real
numbers that tends to `0`. Then the intersection of the dilated bodies `(1 + u n) • K` is equal
to `K`. -/
theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) (h_zero : 0 ∈ K)
    (hu : Tendsto u atTop (nhds 0)) :
    ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by
  ext x
  refine ⟨fun h => ?_, fun h => ?_⟩
  · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le
    rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff]
    rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu
    intro ε hε
    obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos)
    obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n)
    refine ⟨y, hyK, ?_⟩
    rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel'],
      norm_smul, Real.norm_eq_abs]
    specialize hn n le_rfl
    rw [_root_.lt_div_iff' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn
    refine lt_of_le_of_lt ?_ hn
    

Proof state:
case h.refine_1.intro.intro.intro.intro.intro
V : Type u_1
inst✝² : SeminormedAddCommGroup V
inst✝¹ : NormedSpace ℝ V
K✝ L : ConvexBody V
inst✝ : T2Space V
u : ℕ → ℝ≥0
K : ConvexBody V
h_zero : 0 ∈ K
hu : ∀ (ε : ℝ), 0 < ε → ∃ N, ∀ (n : ℕ), N ≤ n → ‖↑(u n) - ↑0‖ < ε
C : ℝ
hC_pos : C > 0
hC_bdd : ∀ x ∈ ↑K, ‖x‖ ≤ C
ε : ℝ
hε : 0 < ε
n : ℕ
y : V
hyK : y ∈ ↑K
h : (1 + ↑(u n)) • y ∈ ⋂ n, (1 + ↑(u n)) • ↑K
hn : |↑(u n)| * C < ε
⊢ |↑(u n)| * ‖y‖ ≤ |↑(u n)| * C

Next tactic:
exact mul_le_mul_of_nonneg_left (hC_bdd _ hyK) (abs_nonneg _)
/-- Let `K` be a convex body that contains `0` and let `u n` be a sequence of nonnegative real
numbers that tends to `0`. Then the intersection of the dilated bodies `(1 + u n) • K` is equal
to `K`. -/
theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) (h_zero : 0 ∈ K)
    (hu : Tendsto u atTop (nhds 0)) :
    ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by
  ext x
  refine ⟨fun h => ?_, fun h => ?_⟩
  · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le
    rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff]
    rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu
    intro ε hε
    obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos)
    obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n)
    refine ⟨y, hyK, ?_⟩
    rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel'],
      norm_smul, Real.norm_eq_abs]
    specialize hn n le_rfl
    rw [_root_.lt_div_iff' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn
    refine lt_of_le_of_lt ?_ hn
    exact mul_le_mul_of_nonneg_left (hC_bdd _ hyK) (abs_nonneg _)
  · 

Proof state:
case h.refine_2
V : Type u_1
inst✝² : SeminormedAddCommGroup V
inst✝¹ : NormedSpace ℝ V
K✝ L : ConvexBody V
inst✝ : T2Space V
u : ℕ → ℝ≥0
K : ConvexBody V
h_zero : 0 ∈ K
hu : Tendsto u atTop (nhds 0)
x : V
h : x ∈ ↑K
⊢ x ∈ ⋂ n, (1 + ↑(u n)) • ↑K

Next tactic:
refine Set.mem_iInter.mpr (fun n => Convex.mem_smul_of_zero_mem K.convex h_zero h ?_)
/-- Let `K` be a convex body that contains `0` and let `u n` be a sequence of nonnegative real
numbers that tends to `0`. Then the intersection of the dilated bodies `(1 + u n) • K` is equal
to `K`. -/
theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) (h_zero : 0 ∈ K)
    (hu : Tendsto u atTop (nhds 0)) :
    ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by
  ext x
  refine ⟨fun h => ?_, fun h => ?_⟩
  · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le
    rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff]
    rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu
    intro ε hε
    obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos)
    obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n)
    refine ⟨y, hyK, ?_⟩
    rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel'],
      norm_smul, Real.norm_eq_abs]
    specialize hn n le_rfl
    rw [_root_.lt_div_iff' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn
    refine lt_of_le_of_lt ?_ hn
    exact mul_le_mul_of_nonneg_left (hC_bdd _ hyK) (abs_nonneg _)
  · refine Set.mem_iInter.mpr (fun n => Convex.mem_smul_of_zero_mem K.convex h_zero h ?_)
    

Proof state:
case h.refine_2
V : Type u_1
inst✝² : SeminormedAddCommGroup V
inst✝¹ : NormedSpace ℝ V
K✝ L : ConvexBody V
inst✝ : T2Space V
u : ℕ → ℝ≥0
K : ConvexBody V
h_zero : 0 ∈ K
hu : Tendsto u atTop (nhds 0)
x : V
h : x ∈ ↑K
n : ℕ
⊢ 1 ≤ 1 + ↑(u n)

Next tactic:
exact (le_add_iff_nonneg_right _).mpr (by positivity)
/-- Let `K` be a convex body that contains `0` and let `u n` be a sequence of nonnegative real
numbers that tends to `0`. Then the intersection of the dilated bodies `(1 + u n) • K` is equal
to `K`. -/
theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) (h_zero : 0 ∈ K)
    (hu : Tendsto u atTop (nhds 0)) :
    ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by
  ext x
  refine ⟨fun h => ?_, fun h => ?_⟩
  · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le
    rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff]
    rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu
    intro ε hε
    obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos)
    obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n)
    refine ⟨y, hyK, ?_⟩
    rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel'],
      norm_smul, Real.norm_eq_abs]
    specialize hn n le_rfl
    rw [_root_.lt_div_iff' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn
    refine lt_of_le_of_lt ?_ hn
    exact mul_le_mul_of_nonneg_left (hC_bdd _ hyK) (abs_nonneg _)
  · refine Set.mem_iInter.mpr (fun n => Convex.mem_smul_of_zero_mem K.convex h_zero h ?_)
    exact (le_add_iff_nonneg_right _).mpr (by 

Proof state:
V : Type u_1
inst✝² : SeminormedAddCommGroup V
inst✝¹ : NormedSpace ℝ V
K✝ L : ConvexBody V
inst✝ : T2Space V
u : ℕ → ℝ≥0
K : ConvexBody V
h_zero : 0 ∈ K
hu : Tendsto u atTop (nhds 0)
x : V
h : x ∈ ↑K
n : ℕ
⊢ 0 ≤ ↑(u n)

Next tactic:
positivity
theorem coe_pnat_injective : Function.Injective ((↑) : Nat.Primes → ℕ+) := fun p q h =>
  Subtype.ext (by 

Proof state:
p q : Primes
h : ↑p = ↑q
⊢ ↑p = ↑q

Next tactic:
injection h
/-- The least common multiple (lcm) of two positive natural numbers,
  viewed as positive natural number. -/
def lcm (n m : ℕ+) : ℕ+ :=
  ⟨Nat.lcm (n : ℕ) (m : ℕ), by
    

Proof state:
n m : ℕ+
⊢ 0 < Nat.lcm ↑n ↑m

Next tactic:
let h := mul_pos n.pos m.pos
/-- The least common multiple (lcm) of two positive natural numbers,
  viewed as positive natural number. -/
def lcm (n m : ℕ+) : ℕ+ :=
  ⟨Nat.lcm (n : ℕ) (m : ℕ), by
    let h := mul_pos n.pos m.pos
    

Proof state:
n m : ℕ+
h : 0 < ↑n * ↑m := mul_pos (pos n) (pos m)
⊢ 0 < Nat.lcm ↑n ↑m

Next tactic:
rw [← gcd_mul_lcm (n : ℕ) (m : ℕ), mul_comm] at h
/-- The least common multiple (lcm) of two positive natural numbers,
  viewed as positive natural number. -/
def lcm (n m : ℕ+) : ℕ+ :=
  ⟨Nat.lcm (n : ℕ) (m : ℕ), by
    let h := mul_pos n.pos m.pos
    rw [← gcd_mul_lcm (n : ℕ) (m : ℕ), mul_comm] at h
    

Proof state:
n m : ℕ+
h : 0 < Nat.lcm ↑n ↑m * Nat.gcd ↑n ↑m
⊢ 0 < Nat.lcm ↑n ↑m

Next tactic:
exact pos_of_dvd_of_pos (Dvd.intro (Nat.gcd (n : ℕ) (m : ℕ)) rfl) h
theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1 := by
  

Proof state:
n : ℕ+
⊢ n < 2 → n = 1

Next tactic:
intro h
theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1 := by
  intro h; 

Proof state:
n : ℕ+
h : n < 2
⊢ n = 1

Next tactic:
apply le_antisymm
theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1 := by
  intro h; apply le_antisymm; 

Proof state:
case a
n : ℕ+
h : n < 2
⊢ n ≤ 1
case a n : ℕ+ h : n < 2 ⊢ 1 ≤ n

Next tactic:
swap
theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1 := by
  intro h; apply le_antisymm; swap; 

Proof state:
case a
n : ℕ+
h : n < 2
⊢ 1 ≤ n
case a n : ℕ+ h : n < 2 ⊢ n ≤ 1

Next tactic:
apply PNat.one_le
theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1 := by
  intro h; apply le_antisymm; swap; apply PNat.one_le
  

Proof state:
case a
n : ℕ+
h : n < 2
⊢ n ≤ 1

Next tactic:
exact PNat.lt_add_one_iff.1 h
theorem dvd_prime {p m : ℕ+} (pp : p.Prime) : m ∣ p ↔ m = 1 ∨ m = p := by
  

Proof state:
p m : ℕ+
pp : Prime p
⊢ m ∣ p ↔ m = 1 ∨ m = p

Next tactic:
rw [PNat.dvd_iff]
theorem dvd_prime {p m : ℕ+} (pp : p.Prime) : m ∣ p ↔ m = 1 ∨ m = p := by
  rw [PNat.dvd_iff]
  

Proof state:
p m : ℕ+
pp : Prime p
⊢ ↑m ∣ ↑p ↔ m = 1 ∨ m = p

Next tactic:
rw [Nat.dvd_prime pp]
theorem dvd_prime {p m : ℕ+} (pp : p.Prime) : m ∣ p ↔ m = 1 ∨ m = p := by
  rw [PNat.dvd_iff]
  rw [Nat.dvd_prime pp]
  

Proof state:
p m : ℕ+
pp : Prime p
⊢ ↑m = 1 ∨ ↑m = ↑p ↔ m = 1 ∨ m = p

Next tactic:
simp
theorem Prime.ne_one {p : ℕ+} : p.Prime → p ≠ 1 := by
  

Proof state:
p : ℕ+
⊢ Prime p → p ≠ 1

Next tactic:
intro pp
theorem Prime.ne_one {p : ℕ+} : p.Prime → p ≠ 1 := by
  intro pp
  

Proof state:
p : ℕ+
pp : Prime p
⊢ p ≠ 1

Next tactic:
intro contra
theorem Prime.ne_one {p : ℕ+} : p.Prime → p ≠ 1 := by
  intro pp
  intro contra
  

Proof state:
p : ℕ+
pp : Prime p
contra : p = 1
⊢ False

Next tactic:
apply Nat.Prime.ne_one pp
theorem Prime.ne_one {p : ℕ+} : p.Prime → p ≠ 1 := by
  intro pp
  intro contra
  apply Nat.Prime.ne_one pp
  

Proof state:
p : ℕ+
pp : Prime p
contra : p = 1
⊢ ↑p = 1

Next tactic:
rw [PNat.coe_eq_one_iff]
theorem Prime.ne_one {p : ℕ+} : p.Prime → p ≠ 1 := by
  intro pp
  intro contra
  apply Nat.Prime.ne_one pp
  rw [PNat.coe_eq_one_iff]
  

Proof state:
p : ℕ+
pp : Prime p
contra : p = 1
⊢ p = 1

Next tactic:
apply contra
theorem Prime.not_dvd_one {p : ℕ+} : p.Prime → ¬p ∣ 1 := fun pp : p.Prime => by
  

Proof state:
p : ℕ+
pp : Prime p
⊢ ¬p ∣ 1

Next tactic:
rw [dvd_iff]
theorem Prime.not_dvd_one {p : ℕ+} : p.Prime → ¬p ∣ 1 := fun pp : p.Prime => by
  rw [dvd_iff]
  

Proof state:
p : ℕ+
pp : Prime p
⊢ ¬↑p ∣ ↑1

Next tactic:
apply Nat.Prime.not_dvd_one pp
theorem exists_prime_and_dvd {n : ℕ+} (hn : n ≠ 1) : ∃ p : ℕ+, p.Prime ∧ p ∣ n := by
  

Proof state:
n : ℕ+
hn : n ≠ 1
⊢ ∃ p, Prime p ∧ p ∣ n

Next tactic:
obtain ⟨p, hp⟩ := Nat.exists_prime_and_dvd (mt coe_eq_one_iff.mp hn)
theorem exists_prime_and_dvd {n : ℕ+} (hn : n ≠ 1) : ∃ p : ℕ+, p.Prime ∧ p ∣ n := by
  obtain ⟨p, hp⟩ := Nat.exists_prime_and_dvd (mt coe_eq_one_iff.mp hn)
  

Proof state:
case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ ∃ p, Prime p ∧ p ∣ n

Next tactic:
exists (⟨p, Nat.Prime.pos hp.left⟩ : ℕ+)
theorem exists_prime_and_dvd {n : ℕ+} (hn : n ≠ 1) : ∃ p : ℕ+, p.Prime ∧ p ∣ n := by
  obtain ⟨p, hp⟩ := Nat.exists_prime_and_dvd (mt coe_eq_one_iff.mp hn)
  exists (⟨p, Nat.Prime.pos hp.left⟩ : ℕ+); 

Proof state:
case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ Prime { val := p, property := (_ : 0 < p) } ∧ { val := p, property := (_ : 0 < p) } ∣ n

Next tactic:
rw [dvd_iff]
theorem exists_prime_and_dvd {n : ℕ+} (hn : n ≠ 1) : ∃ p : ℕ+, p.Prime ∧ p ∣ n := by
  obtain ⟨p, hp⟩ := Nat.exists_prime_and_dvd (mt coe_eq_one_iff.mp hn)
  exists (⟨p, Nat.Prime.pos hp.left⟩ : ℕ+); rw [dvd_iff]; 

Proof state:
case intro
n : ℕ+
hn : n ≠ 1
p : ℕ
hp : Nat.Prime p ∧ p ∣ ↑n
⊢ Prime { val := p, property := (_ : 0 < p) } ∧ ↑{ val := p, property := (_ : 0 < p) } ∣ ↑n

Next tactic:
apply hp
@[simp, norm_cast]
theorem coprime_coe {m n : ℕ+} : Nat.Coprime ↑m ↑n ↔ m.Coprime n := by
  

Proof state:
m n : ℕ+
⊢ Nat.Coprime ↑m ↑n ↔ Coprime m n

Next tactic:
unfold Nat.Coprime Coprime
@[simp, norm_cast]
theorem coprime_coe {m n : ℕ+} : Nat.Coprime ↑m ↑n ↔ m.Coprime n := by
  unfold Nat.Coprime Coprime
  

Proof state:
m n : ℕ+
⊢ Nat.gcd ↑m ↑n = 1 ↔ gcd m n = 1

Next tactic:
rw [← coe_inj]
@[simp, norm_cast]
theorem coprime_coe {m n : ℕ+} : Nat.Coprime ↑m ↑n ↔ m.Coprime n := by
  unfold Nat.Coprime Coprime
  rw [← coe_inj]
  

Proof state:
m n : ℕ+
⊢ Nat.gcd ↑m ↑n = 1 ↔ ↑(gcd m n) = ↑1

Next tactic:
simp
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  

Proof state:
k m n : ℕ+
⊢ Coprime m k → Coprime n k → Coprime (m * n) k

Next tactic:
repeat' rw [← coprime_coe]
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Coprime m k → Coprime n k → Coprime (m * n) k

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑m ↑k → Coprime n k → Coprime (m * n) k

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑m ↑k → Nat.Coprime ↑n ↑k → Coprime (m * n) k

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑m ↑k → Nat.Coprime ↑n ↑k → Nat.Coprime ↑(m * n) ↑k

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  repeat' rw [← coprime_coe]
  

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑m ↑k → Nat.Coprime ↑n ↑k → Nat.Coprime ↑(m * n) ↑k

Next tactic:
rw [mul_coe]
theorem Coprime.mul {k m n : ℕ+} : m.Coprime k → n.Coprime k → (m * n).Coprime k := by
  repeat' rw [← coprime_coe]
  rw [mul_coe]
  

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑m ↑k → Nat.Coprime ↑n ↑k → Nat.Coprime (↑m * ↑n) ↑k

Next tactic:
apply Nat.Coprime.mul
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  

Proof state:
k m n : ℕ+
⊢ Coprime k m → Coprime k n → Coprime k (m * n)

Next tactic:
repeat' rw [← coprime_coe]
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Coprime k m → Coprime k n → Coprime k (m * n)

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑k ↑m → Coprime k n → Coprime k (m * n)

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑k ↑m → Nat.Coprime ↑k ↑n → Coprime k (m * n)

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  repeat' 

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑k ↑m → Nat.Coprime ↑k ↑n → Nat.Coprime ↑k ↑(m * n)

Next tactic:
rw [← coprime_coe]
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  repeat' rw [← coprime_coe]
  

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑k ↑m → Nat.Coprime ↑k ↑n → Nat.Coprime ↑k ↑(m * n)

Next tactic:
rw [mul_coe]
theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n) := by
  repeat' rw [← coprime_coe]
  rw [mul_coe]
  

Proof state:
k m n : ℕ+
⊢ Nat.Coprime ↑k ↑m → Nat.Coprime ↑k ↑n → Nat.Coprime (↑k) (↑m * ↑n)

Next tactic:
apply Nat.Coprime.mul_right
theorem gcd_comm {m n : ℕ+} : m.gcd n = n.gcd m := by
  

Proof state:
m n : ℕ+
⊢ gcd m n = gcd n m

Next tactic:
apply eq
theorem gcd_comm {m n : ℕ+} : m.gcd n = n.gcd m := by
  apply eq
  

Proof state:
case a
m n : ℕ+
⊢ ↑(gcd m n) = ↑(gcd n m)

Next tactic:
simp only [gcd_coe]
theorem gcd_comm {m n : ℕ+} : m.gcd n = n.gcd m := by
  apply eq
  simp only [gcd_coe]
  

Proof state:
case a
m n : ℕ+
⊢ Nat.gcd ↑m ↑n = Nat.gcd ↑n ↑m

Next tactic:
apply Nat.gcd_comm
theorem gcd_eq_left_iff_dvd {m n : ℕ+} : m ∣ n ↔ m.gcd n = m := by
  

Proof state:
m n : ℕ+
⊢ m ∣ n ↔ gcd m n = m

Next tactic:
rw [dvd_iff]
theorem gcd_eq_left_iff_dvd {m n : ℕ+} : m ∣ n ↔ m.gcd n = m := by
  rw [dvd_iff]
  

Proof state:
m n : ℕ+
⊢ ↑m ∣ ↑n ↔ gcd m n = m

Next tactic:
rw [Nat.gcd_eq_left_iff_dvd]
theorem gcd_eq_left_iff_dvd {m n : ℕ+} : m ∣ n ↔ m.gcd n = m := by
  rw [dvd_iff]
  rw [Nat.gcd_eq_left_iff_dvd]
  

Proof state:
m n : ℕ+
⊢ Nat.gcd ↑m ↑n = ↑m ↔ gcd m n = m

Next tactic:
rw [← coe_inj]
theorem gcd_eq_left_iff_dvd {m n : ℕ+} : m ∣ n ↔ m.gcd n = m := by
  rw [dvd_iff]
  rw [Nat.gcd_eq_left_iff_dvd]
  rw [← coe_inj]
  

Proof state:
m n : ℕ+
⊢ Nat.gcd ↑m ↑n = ↑m ↔ ↑(gcd m n) = ↑m

Next tactic:
simp
theorem gcd_eq_right_iff_dvd {m n : ℕ+} : m ∣ n ↔ n.gcd m = m := by
  

Proof state:
m n : ℕ+
⊢ m ∣ n ↔ gcd n m = m

Next tactic:
rw [gcd_comm]
theorem gcd_eq_right_iff_dvd {m n : ℕ+} : m ∣ n ↔ n.gcd m = m := by
  rw [gcd_comm]
  

Proof state:
m n : ℕ+
⊢ m ∣ n ↔ gcd m n = m

Next tactic:
apply gcd_eq_left_iff_dvd
theorem Coprime.gcd_mul_left_cancel (m : ℕ+) {n k : ℕ+} :
    k.Coprime n → (k * m).gcd n = m.gcd n := by
  

Proof state:
m n k : ℕ+
⊢ Coprime k n → gcd (k * m) n = gcd m n

Next tactic:
intro h
theorem Coprime.gcd_mul_left_cancel (m : ℕ+) {n k : ℕ+} :
    k.Coprime n → (k * m).gcd n = m.gcd n := by
  intro h; 

Proof state:
m n k : ℕ+
h : Coprime k n
⊢ gcd (k * m) n = gcd m n

Next tactic:
apply eq
theorem Coprime.gcd_mul_left_cancel (m : ℕ+) {n k : ℕ+} :
    k.Coprime n → (k * m).gcd n = m.gcd n := by
  intro h; apply eq; 

Proof state:
case a
m n k : ℕ+
h : Coprime k n
⊢ ↑(gcd (k * m) n) = ↑(gcd m n)

Next tactic:
simp only [gcd_coe, mul_coe]
theorem Coprime.gcd_mul_left_cancel (m : ℕ+) {n k : ℕ+} :
    k.Coprime n → (k * m).gcd n = m.gcd n := by
  intro h; apply eq; simp only [gcd_coe, mul_coe]
  

Proof state:
case a
m n k : ℕ+
h : Coprime k n
⊢ Nat.gcd (↑k * ↑m) ↑n = Nat.gcd ↑m ↑n

Next tactic:
apply Nat.Coprime.gcd_mul_left_cancel
theorem Coprime.gcd_mul_left_cancel (m : ℕ+) {n k : ℕ+} :
    k.Coprime n → (k * m).gcd n = m.gcd n := by
  intro h; apply eq; simp only [gcd_coe, mul_coe]
  apply Nat.Coprime.gcd_mul_left_cancel; 

Proof state:
case a.H
m n k : ℕ+
h : Coprime k n
⊢ Nat.Coprime ↑k ↑n

Next tactic:
simpa
theorem Coprime.gcd_mul_right_cancel (m : ℕ+) {n k : ℕ+} : k.Coprime n → (m * k).gcd n = m.gcd n :=
  by 

Proof state:
m n k : ℕ+
⊢ Coprime k n → gcd (m * k) n = gcd m n

Next tactic:
rw [mul_comm]
theorem Coprime.gcd_mul_right_cancel (m : ℕ+) {n k : ℕ+} : k.Coprime n → (m * k).gcd n = m.gcd n :=
  by rw [mul_comm]; 

Proof state:
m n k : ℕ+
⊢ Coprime k n → gcd (k * m) n = gcd m n

Next tactic:
apply Coprime.gcd_mul_left_cancel
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  

Proof state:
m n k : ℕ+
⊢ Coprime k m → gcd m (k * n) = gcd m n

Next tactic:
intro h
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  intro h; 

Proof state:
m n k : ℕ+
h : Coprime k m
⊢ gcd m (k * n) = gcd m n

Next tactic:
iterate 2 rw [gcd_comm]; symm;
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  intro h; iterate 2 

Proof state:
m n k : ℕ+
h : Coprime k m
⊢ gcd m (k * n) = gcd m n

Next tactic:
rw [gcd_comm]
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  intro h; iterate 2 rw [gcd_comm]; 

Proof state:
m n k : ℕ+
h : Coprime k m
⊢ gcd (k * n) m = gcd m n

Next tactic:
symm
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  intro h; iterate 2 

Proof state:
m n k : ℕ+
h : Coprime k m
⊢ gcd m n = gcd (k * n) m

Next tactic:
rw [gcd_comm]
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  intro h; iterate 2 rw [gcd_comm]; 

Proof state:
m n k : ℕ+
h : Coprime k m
⊢ gcd n m = gcd (k * n) m

Next tactic:
symm
theorem Coprime.gcd_mul_left_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (k * n) = m.gcd n := by
  intro h; iterate 2 rw [gcd_comm]; symm;
  

Proof state:
m n k : ℕ+
h : Coprime k m
⊢ gcd (k * n) m = gcd n m

Next tactic:
apply Coprime.gcd_mul_left_cancel _ h
theorem Coprime.gcd_mul_right_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (n * k) = m.gcd n := by
  

Proof state:
m n k : ℕ+
⊢ Coprime k m → gcd m (n * k) = gcd m n

Next tactic:
rw [mul_comm]
theorem Coprime.gcd_mul_right_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (n * k) = m.gcd n := by
  rw [mul_comm];
  

Proof state:
m n k : ℕ+
⊢ Coprime k m → gcd m (k * n) = gcd m n

Next tactic:
apply Coprime.gcd_mul_left_cancel_right
@[simp]
theorem one_gcd {n : ℕ+} : gcd 1 n = 1 := by
  

Proof state:
n : ℕ+
⊢ gcd 1 n = 1

Next tactic:
rw [← gcd_eq_left_iff_dvd]
@[simp]
theorem one_gcd {n : ℕ+} : gcd 1 n = 1 := by
  rw [← gcd_eq_left_iff_dvd]
  

Proof state:
n : ℕ+
⊢ 1 ∣ n

Next tactic:
apply one_dvd
@[simp]
theorem gcd_one {n : ℕ+} : gcd n 1 = 1 := by
  

Proof state:
n : ℕ+
⊢ gcd n 1 = 1

Next tactic:
rw [gcd_comm]
@[simp]
theorem gcd_one {n : ℕ+} : gcd n 1 = 1 := by
  rw [gcd_comm]
  

Proof state:
n : ℕ+
⊢ gcd 1 n = 1

Next tactic:
apply one_gcd
@[symm]
theorem Coprime.symm {m n : ℕ+} : m.Coprime n → n.Coprime m := by
  

Proof state:
m n : ℕ+
⊢ Coprime m n → Coprime n m

Next tactic:
unfold Coprime
@[symm]
theorem Coprime.symm {m n : ℕ+} : m.Coprime n → n.Coprime m := by
  unfold Coprime
  

Proof state:
m n : ℕ+
⊢ gcd m n = 1 → gcd n m = 1

Next tactic:
rw [gcd_comm]