Theorem: Rat.MulRingNorm.is_prime_of_minimal_nat_zero_lt_mulRingNorm_lt_one
File: Mathlib/NumberTheory/Ostrowski.lean

tactic: rw [← Nat.irreducible_iff_nat_prime]
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ Nat.Prime p
state_after: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ Irreducible p

tactic: constructor
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ Irreducible p
state_after: case not_unit
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ ¬IsUnit p

case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ ∀ (a b : ℕ), p = a * b → IsUnit a ∨ IsUnit b

tactic: rw [Nat.isUnit_iff]
state_before: case not_unit
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ ¬IsUnit p
state_after: case not_unit
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ ¬p = 1

tactic: rintro rfl
state_before: case not_unit
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ ¬p = 1
state_after: case not_unit
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
hp0 : 0 < f ↑1
hp1 : f ↑1 < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → 1 ≤ m
⊢ False

tactic: simp only [Nat.cast_one, map_one, lt_self_iff_false] at hp1
state_before: case not_unit
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
hp0 : 0 < f ↑1
hp1 : f ↑1 < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → 1 ≤ m
⊢ False
state_after: no goals

tactic: rintro a b rfl
state_before: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
p : ℕ
hp0 : 0 < f ↑p
hp1 : f ↑p < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m
⊢ ∀ (a b : ℕ), p = a * b → IsUnit a ∨ IsUnit b
state_after: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
⊢ IsUnit a ∨ IsUnit b

tactic: rw [Nat.isUnit_iff, Nat.isUnit_iff]
state_before: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
⊢ IsUnit a ∨ IsUnit b
state_after: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
⊢ a = 1 ∨ b = 1

tactic: by_contra! con
state_before: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
⊢ a = 1 ∨ b = 1
state_after: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
con : a ≠ 1 ∧ b ≠ 1
⊢ False

tactic: obtain ⟨ha₁, hb₁⟩ := con
state_before: case isUnit_or_isUnit'
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
con : a ≠ 1 ∧ b ≠ 1
⊢ False
state_after: case isUnit_or_isUnit'.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
⊢ False

tactic: obtain ⟨ha₀, hb₀⟩ : a ≠ 0 ∧ b ≠ 0 := by
  refine mul_ne_zero_iff.1 fun h ↦ ?_
  rwa [h, Nat.cast_zero, map_zero, lt_self_iff_false] at hp0
state_before: case isUnit_or_isUnit'.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
⊢ False
state_after: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
⊢ False

tactic: have hap : a < a * b := lt_mul_of_one_lt_right (by omega) (by omega)
state_before: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
⊢ False
state_after: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
⊢ False

tactic: have hbp : b < a * b := lt_mul_of_one_lt_left (by omega) (by omega)
state_before: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
⊢ False
state_after: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
⊢ False

tactic: have ha :=
  le_of_not_lt <| not_and.1 ((hmin a).mt hap.not_le) (map_pos_of_ne_zero f (mod_cast ha₀))
state_before: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
⊢ False
state_after: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
ha : 1 ≤ f ↑a
⊢ False

tactic: have hb :=
  le_of_not_lt <| not_and.1 ((hmin b).mt hbp.not_le) (map_pos_of_ne_zero f (mod_cast hb₀))
state_before: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
ha : 1 ≤ f ↑a
⊢ False
state_after: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
ha : 1 ≤ f ↑a
hb : 1 ≤ f ↑b
⊢ False

tactic: rw [Nat.cast_mul, map_mul] at hp1
state_before: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
ha : 1 ≤ f ↑a
hb : 1 ≤ f ↑b
⊢ False
state_after: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑a * f ↑b < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
ha : 1 ≤ f ↑a
hb : 1 ≤ f ↑b
⊢ False

tactic: exact ((one_le_mul_of_one_le_of_one_le ha hb).trans_lt hp1).false
state_before: case isUnit_or_isUnit'.intro.intro
f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑a * f ↑b < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
hbp : b < a * b
ha : 1 ≤ f ↑a
hb : 1 ≤ f ↑b
⊢ False
state_after: no goals

tactic: refine mul_ne_zero_iff.1 fun h ↦ ?_
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
⊢ a ≠ 0 ∧ b ≠ 0
state_after: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
h : a * b = 0
⊢ False

tactic: rwa [h, Nat.cast_zero, map_zero, lt_self_iff_false] at hp0
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
h : a * b = 0
⊢ False
state_after: no goals

tactic: omega
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
⊢ 0 < a
state_after: no goals

tactic: omega
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
⊢ 1 < b
state_after: no goals

tactic: omega
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
⊢ 0 < b
state_after: no goals

tactic: omega
state_before: f g : MulRingNorm ℚ
hf_nontriv : f ≠ 1
bdd : ∀ (n : ℕ), f ↑n ≤ 1
a b : ℕ
hp0 : 0 < f ↑(a * b)
hp1 : f ↑(a * b) < 1
hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → a * b ≤ m
ha₁ : a ≠ 1
hb₁ : b ≠ 1
ha₀ : a ≠ 0
hb₀ : b ≠ 0
hap : a < a * b
⊢ 1 < a
state_after: no goals