Theorem: IsPrimitiveRoot.zeta_sub_one_prime_of_two_pow
File: Mathlib/NumberTheory/Cyclotomic/Rat.lean

tactic: letI := IsCyclotomicExtension.numberField {(2 : ℕ+) ^ (k + 1)} ℚ K
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
⊢ Prime (hζ.toInteger - 1)
state_after: p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
⊢ Prime (hζ.toInteger - 1)

tactic: refine Ideal.prime_of_irreducible_absNorm_span (fun h ↦ ?_) ?_
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
⊢ Prime (hζ.toInteger - 1)
state_after: case refine_1
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger - 1 = 0
⊢ False

case refine_2
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
⊢ Irreducible (Ideal.absNorm (Ideal.span {hζ.toInteger - 1}))

tactic: rw [Nat.irreducible_iff_prime, Ideal.absNorm_span_singleton, ← Nat.prime_iff,
  ← Int.prime_iff_natAbs_prime]
state_before: case refine_2
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
⊢ Irreducible (Ideal.absNorm (Ideal.span {hζ.toInteger - 1}))
state_after: case refine_2
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
⊢ Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))

tactic: cases k
state_before: case refine_2
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
⊢ Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))
state_after: case refine_2.zero
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))

case refine_2.succ
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))

tactic: convert Int.prime_two
state_before: case refine_2.succ
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))
state_after: case h.e'_3
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = 2

tactic: apply RingHom.injective_int (algebraMap ℤ ℚ)
state_before: case h.e'_3
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = 2
state_after: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (algebraMap ℤ ℚ) ((Algebra.norm ℤ) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) 2

tactic: rw [← Algebra.norm_localization (Sₘ := K) ℤ (nonZeroDivisors ℤ)]
state_before: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (algebraMap ℤ ℚ) ((Algebra.norm ℤ) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) 2
state_after: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) 2

tactic: simp only [PNat.pow_coe, id.map_eq_id, RingHomCompTriple.comp_eq, RingHom.coe_coe,
  Subalgebra.coe_val, algebraMap_int_eq, map_natCast]
state_before: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) 2
state_after: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = (Int.castRingHom ℚ) 2

tactic: exact hζ.norm_sub_one_two Nat.AtLeastTwo.prop (cyclotomic.irreducible_rat (by simp))
state_before: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = (Int.castRingHom ℚ) 2
state_after: no goals

tactic: apply hζ.pow_ne_one_of_pos_of_lt zero_lt_one (one_lt_pow (by decide) (by simp))
state_before: case refine_1
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger - 1 = 0
⊢ False
state_after: case refine_1
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger - 1 = 0
⊢ ζ ^ 1 = 1

tactic: rw [sub_eq_zero] at h
state_before: case refine_1
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger - 1 = 0
⊢ ζ ^ 1 = 1
state_after: case refine_1
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger = 1
⊢ ζ ^ 1 = 1

tactic: simpa using congrArg (algebraMap _ K) h
state_before: case refine_1
p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger = 1
⊢ ζ ^ 1 = 1
state_after: no goals

tactic: decide
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger - 1 = 0
⊢ 1 < ↑2
state_after: no goals

tactic: simp
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (k + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (k + 1))
this : NumberField K := numberField {2 ^ (k + 1)} ℚ K
h : hζ.toInteger - 1 = 0
⊢ k + 1 ≠ 0
state_after: no goals

tactic: convert Prime.neg Int.prime_two
state_before: case refine_2.zero
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))
state_after: case h.e'_3
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = -2

tactic: apply RingHom.injective_int (algebraMap ℤ ℚ)
state_before: case h.e'_3
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = -2
state_after: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (algebraMap ℤ ℚ) ((Algebra.norm ℤ) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) (-2)

tactic: rw [← Algebra.norm_localization (Sₘ := K) ℤ (nonZeroDivisors ℤ)]
state_before: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (algebraMap ℤ ℚ) ((Algebra.norm ℤ) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) (-2)
state_after: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) (-2)

tactic: simp only [Nat.zero_eq, PNat.pow_coe, id.map_eq_id, RingHomCompTriple.comp_eq, RingHom.coe_coe,
  Subalgebra.coe_val, algebraMap_int_eq, map_neg, map_ofNat]
state_before: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = (algebraMap ℤ ℚ) (-2)
state_after: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = -2

tactic: simpa only [zero_add, pow_one, AddSubgroupClass.coe_sub, OneMemClass.coe_one, Nat.zero_eq,
    pow_zero]
  using hζ.norm_pow_sub_one_two (cyclotomic.irreducible_rat
    (by simp only [Nat.zero_eq, zero_add, pow_one, Nat.ofNat_pos]))
state_before: case h.e'_3.a
p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℚ) ((algebraMap (𝓞 K) K) (hζ.toInteger - 1)) = -2
state_after: no goals

tactic: simp only [Nat.zero_eq, zero_add, pow_one, Nat.ofNat_pos]
state_before: p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
inst✝ : IsCyclotomicExtension {2 ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (0 + 1))
this : NumberField K := numberField {2 ^ (0 + 1)} ℚ K
⊢ 0 < 2 ^ (0 + 1)
state_after: no goals

tactic: simp
state_before: p : ℕ+
K : Type u
inst✝² : Field K
inst✝¹ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
n✝ : ℕ
inst✝ : IsCyclotomicExtension {2 ^ (n✝ + 1 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ ↑(2 ^ (n✝ + 1 + 1))
this : NumberField K := numberField {2 ^ (n✝ + 1 + 1)} ℚ K
⊢ 0 < 2 ^ (n✝ + 1 + 1)
state_after: no goals