Theorem: RingOfIntegers.isPrincipalIdealRing_of_abs_discr_lt
File: Mathlib/NumberTheory/NumberField/ClassNumber.lean

tactic: have : 0 < finrank ℚ K := finrank_pos
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : ↑|discr K| < (2 * (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)) ^ 2
⊢ IsPrincipalIdealRing (𝓞 K)
state_after: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : ↑|discr K| < (2 * (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)) ^ 2
this : 0 < finrank ℚ K
⊢ IsPrincipalIdealRing (𝓞 K)

tactic: rw [← Real.sqrt_lt (by positivity) (by positivity), mul_assoc, ← inv_mul_lt_iff' (by positivity),
  mul_inv, ← inv_pow, inv_div, inv_div, mul_assoc, Int.cast_abs] at h
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : ↑|discr K| < (2 * (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)) ^ 2
this : 0 < finrank ℚ K
⊢ IsPrincipalIdealRing (𝓞 K)
state_after: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
⊢ IsPrincipalIdealRing (𝓞 K)

tactic: rw [← classNumber_eq_one_iff, classNumber, Fintype.card_eq_one_iff]
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
⊢ IsPrincipalIdealRing (𝓞 K)
state_after: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
⊢ ∃ x, ∀ (y : ClassGroup (𝓞 K)), y = x

tactic: refine ⟨1, fun C ↦ ?_⟩
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
⊢ ∃ x, ∀ (y : ClassGroup (𝓞 K)), y = x
state_after: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
C : ClassGroup (𝓞 K)
⊢ C = 1

tactic: obtain ⟨I, rfl, hI⟩ := exists_ideal_in_class_of_norm_le C
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
C : ClassGroup (𝓞 K)
⊢ C = 1
state_after: case intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
⊢ ClassGroup.mk0 I = 1

tactic: have : Ideal.absNorm I.1 = 1 := by
  refine le_antisymm (Nat.lt_succ.mp ?_) (Nat.one_le_iff_ne_zero.mpr
    (Ideal.absNorm_ne_zero_of_nonZeroDivisors I))
  exact Nat.cast_lt.mp <| lt_of_le_of_lt hI h
state_before: case intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
⊢ ClassGroup.mk0 I = 1
state_after: case intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this✝ : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
this : Ideal.absNorm ↑I = 1
⊢ ClassGroup.mk0 I = 1

tactic: rw [ClassGroup.mk0_eq_one_iff, Ideal.absNorm_eq_one_iff.mp this]
state_before: case intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this✝ : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
this : Ideal.absNorm ↑I = 1
⊢ ClassGroup.mk0 I = 1
state_after: case intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this✝ : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
this : Ideal.absNorm ↑I = 1
⊢ Submodule.IsPrincipal ⊤

tactic: exact top_isPrincipal
state_before: case intro.intro
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this✝ : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
this : Ideal.absNorm ↑I = 1
⊢ Submodule.IsPrincipal ⊤
state_after: no goals

tactic: positivity
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : ↑|discr K| < (2 * (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)) ^ 2
this : 0 < finrank ℚ K
⊢ 0 ≤ ↑|discr K|
state_after: no goals

tactic: positivity
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : ↑|discr K| < (2 * (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)) ^ 2
this : 0 < finrank ℚ K
⊢ 0 ≤ 2 * (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)
state_after: no goals

tactic: positivity
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : √↑|discr K| < 2 * ((π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial))
this : 0 < finrank ℚ K
⊢ 0 < (π / 4) ^ NrComplexPlaces K * (↑(finrank ℚ K) ^ finrank ℚ K / ↑(finrank ℚ K).factorial)
state_after: no goals

tactic: refine le_antisymm (Nat.lt_succ.mp ?_) (Nat.one_le_iff_ne_zero.mpr
  (Ideal.absNorm_ne_zero_of_nonZeroDivisors I))
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
⊢ Ideal.absNorm ↑I = 1
state_after: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
⊢ Ideal.absNorm ↑I < Nat.succ 1

tactic: exact Nat.cast_lt.mp <| lt_of_le_of_lt hI h
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
h : (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|) < 2
this : 0 < finrank ℚ K
I : ↥(Ideal (𝓞 K))⁰
hI :
  ↑(Ideal.absNorm ↑I) ≤
    (4 / π) ^ NrComplexPlaces K * (↑(finrank ℚ K).factorial / ↑(finrank ℚ K) ^ finrank ℚ K * √|↑(discr K)|)
⊢ Ideal.absNorm ↑I < Nat.succ 1
state_after: no goals