ring_theory.roots_of_unity.complex ⟷
Mathlib.RingTheory.RootsOfUnity.Complex
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -46,7 +46,7 @@ theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprim
mul_comm _ (i : ℂ), ← mul_assoc _ (i : ℂ), exists_imp, field_simps]
norm_cast
rintro l k hk
- have : n ∣ i * l := by rw [← Int.coe_nat_dvd, hk]; apply dvd_mul_left
+ have : n ∣ i * l := by rw [← Int.natCast_dvd_natCast, hk]; apply dvd_mul_left
exact hi.symm.dvd_of_dvd_mul_left this
#align complex.is_primitive_root_exp_of_coprime Complex.isPrimitiveRoot_exp_of_coprime
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -158,7 +158,7 @@ theorem IsPrimitiveRoot.arg_eq_pi_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoo
theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
∃ i : ℤ, ζ.arg = i / n * (2 * Real.pi) ∧ IsCoprime i n ∧ i.natAbs < n :=
by
- rw [Complex.isPrimitiveRoot_iff _ _ hn] at h
+ rw [Complex.isPrimitiveRoot_iff _ _ hn] at h
obtain ⟨i, h, hin, rfl⟩ := h
rw [mul_comm, ← mul_assoc, Complex.exp_mul_I]
refine' ⟨if i * 2 ≤ n then i else i - n, _, _, _⟩
@@ -188,7 +188,7 @@ theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn
· rw [neg_zero]
exact mul_nonneg (mul_nonneg i.cast_nonneg <| by simp [real.pi_pos.le]) (by simp)
rw [← mul_rotate', mul_div_assoc]
- rw [← mul_one n] at h₂
+ rw [← mul_one n] at h₂
exact
mul_le_of_le_one_right real.pi_pos.le
((div_le_iff' <| by exact_mod_cast pos_of_gt h).mpr <| by exact_mod_cast h₂)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -85,7 +85,7 @@ theorem mem_rootsOfUnity (n : ℕ+) (x : Units ℂ) :
have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast n.ne_zero
constructor
· intro h
- obtain ⟨i, hi, H⟩ : ∃ i < (n : ℕ), exp (2 * π * I / n) ^ i = x := by
+ obtain ⟨i, hi, H⟩ : ∃ i < (n : ℕ), NormedSpace.exp (2 * π * I / n) ^ i = x := by
simpa only using (is_primitive_root_exp n n.ne_zero).eq_pow_of_pow_eq_one h n.pos
refine' ⟨i, hi, _⟩
rw [← H, ← exp_nat_mul]
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2020 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
-import Mathbin.Analysis.SpecialFunctions.Complex.Log
-import Mathbin.RingTheory.RootsOfUnity.Basic
+import Analysis.SpecialFunctions.Complex.Log
+import RingTheory.RootsOfUnity.Basic
#align_import ring_theory.roots_of_unity.complex from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -33,7 +33,7 @@ open Polynomial Real
open scoped Nat Real
#print Complex.isPrimitiveRoot_exp_of_coprime /-
-theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.coprime n) :
+theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) :
IsPrimitiveRoot (exp (2 * π * I * (i / n))) n :=
by
rw [IsPrimitiveRoot.iff_def]
@@ -60,7 +60,7 @@ theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 *
#print Complex.isPrimitiveRoot_iff /-
theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
- IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ hi : i.coprime n, exp (2 * π * I * (i / n)) = ζ :=
+ IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ hi : i.Coprime n, exp (2 * π * I * (i / n)) = ζ :=
by
have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast hn
constructor; swap
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2020 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-
-! This file was ported from Lean 3 source module ring_theory.roots_of_unity.complex
-! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Analysis.SpecialFunctions.Complex.Log
import Mathbin.RingTheory.RootsOfUnity.Basic
+#align_import ring_theory.roots_of_unity.complex from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
+
/-!
# Complex roots of unity
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -35,6 +35,7 @@ open Polynomial Real
open scoped Nat Real
+#print Complex.isPrimitiveRoot_exp_of_coprime /-
theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.coprime n) :
IsPrimitiveRoot (exp (2 * π * I * (i / n))) n :=
by
@@ -51,12 +52,16 @@ theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.coprim
have : n ∣ i * l := by rw [← Int.coe_nat_dvd, hk]; apply dvd_mul_left
exact hi.symm.dvd_of_dvd_mul_left this
#align complex.is_primitive_root_exp_of_coprime Complex.isPrimitiveRoot_exp_of_coprime
+-/
+#print Complex.isPrimitiveRoot_exp /-
theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 * π * I / n)) n := by
simpa only [Nat.cast_one, one_div] using
is_primitive_root_exp_of_coprime 1 n h0 n.coprime_one_left
#align complex.is_primitive_root_exp Complex.isPrimitiveRoot_exp
+-/
+#print Complex.isPrimitiveRoot_iff /-
theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ hi : i.coprime n, exp (2 * π * I * (i / n)) = ζ :=
by
@@ -71,7 +76,9 @@ theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
congr 1
field_simp [hn0, mul_comm (i : ℂ)]
#align complex.is_primitive_root_iff Complex.isPrimitiveRoot_iff
+-/
+#print Complex.mem_rootsOfUnity /-
/-- The complex `n`-th roots of unity are exactly the
complex numbers of the form `e ^ (2 * real.pi * complex.I * (i / n))` for some `i < n`. -/
theorem mem_rootsOfUnity (n : ℕ+) (x : Units ℂ) :
@@ -92,10 +99,13 @@ theorem mem_rootsOfUnity (n : ℕ+) (x : Units ℂ) :
use i
field_simp [hn0, mul_comm ((n : ℕ) : ℂ), mul_comm (i : ℂ)]
#align complex.mem_roots_of_unity Complex.mem_rootsOfUnity
+-/
+#print Complex.card_rootsOfUnity /-
theorem card_rootsOfUnity (n : ℕ+) : Fintype.card (rootsOfUnity n ℂ) = n :=
(isPrimitiveRoot_exp n n.NeZero).card_rootsOfUnity
#align complex.card_roots_of_unity Complex.card_rootsOfUnity
+-/
#print Complex.card_primitiveRoots /-
theorem card_primitiveRoots (k : ℕ) : (primitiveRoots k ℂ).card = φ k :=
@@ -108,15 +118,19 @@ theorem card_primitiveRoots (k : ℕ) : (primitiveRoots k ℂ).card = φ k :=
end Complex
+#print IsPrimitiveRoot.norm'_eq_one /-
theorem IsPrimitiveRoot.norm'_eq_one {ζ : ℂ} {n : ℕ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
‖ζ‖ = 1 :=
Complex.norm_eq_one_of_pow_eq_one h.pow_eq_one hn
#align is_primitive_root.norm'_eq_one IsPrimitiveRoot.norm'_eq_one
+-/
+#print IsPrimitiveRoot.nnnorm_eq_one /-
theorem IsPrimitiveRoot.nnnorm_eq_one {ζ : ℂ} {n : ℕ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
‖ζ‖₊ = 1 :=
Subtype.ext <| h.norm'_eq_one hn
#align is_primitive_root.nnnorm_eq_one IsPrimitiveRoot.nnnorm_eq_one
+-/
#print IsPrimitiveRoot.arg_ext /-
theorem IsPrimitiveRoot.arg_ext {n m : ℕ} {ζ μ : ℂ} (hζ : IsPrimitiveRoot ζ n)
@@ -125,12 +139,15 @@ theorem IsPrimitiveRoot.arg_ext {n m : ℕ} {ζ μ : ℂ} (hζ : IsPrimitiveRoot
#align is_primitive_root.arg_ext IsPrimitiveRoot.arg_ext
-/
+#print IsPrimitiveRoot.arg_eq_zero_iff /-
theorem IsPrimitiveRoot.arg_eq_zero_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
ζ.arg = 0 ↔ ζ = 1 :=
⟨fun h => hζ.arg_ext IsPrimitiveRoot.one hn one_ne_zero (h.trans Complex.arg_one.symm), fun h =>
h.symm ▸ Complex.arg_one⟩
#align is_primitive_root.arg_eq_zero_iff IsPrimitiveRoot.arg_eq_zero_iff
+-/
+#print IsPrimitiveRoot.arg_eq_pi_iff /-
theorem IsPrimitiveRoot.arg_eq_pi_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
ζ.arg = Real.pi ↔ ζ = -1 :=
⟨fun h =>
@@ -138,7 +155,9 @@ theorem IsPrimitiveRoot.arg_eq_pi_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoo
(h.trans Complex.arg_neg_one.symm),
fun h => h.symm ▸ Complex.arg_neg_one⟩
#align is_primitive_root.arg_eq_pi_iff IsPrimitiveRoot.arg_eq_pi_iff
+-/
+#print IsPrimitiveRoot.arg /-
theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
∃ i : ℤ, ζ.arg = i / n * (2 * Real.pi) ∧ IsCoprime i n ∧ i.natAbs < n :=
by
@@ -197,4 +216,5 @@ theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn
exact_mod_cast not_le.mp h₂
· exact nat.cast_pos.mpr hn.bot_lt
#align is_primitive_root.arg IsPrimitiveRoot.arg
+-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
! This file was ported from Lean 3 source module ring_theory.roots_of_unity.complex
-! leanprover-community/mathlib commit 7fdeecc0d03cd40f7a165e6cf00a4d2286db599f
+! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.RingTheory.RootsOfUnity.Basic
/-!
# Complex roots of unity
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
In this file we show that the `n`-th complex roots of unity
are exactly the complex numbers `e ^ (2 * real.pi * complex.I * (i / n))` for `i ∈ finset.range n`.
mathlib commit https://github.com/leanprover-community/mathlib/commit/58a272265b5e05f258161260dd2c5d247213cbd3
@@ -94,12 +94,14 @@ theorem card_rootsOfUnity (n : ℕ+) : Fintype.card (rootsOfUnity n ℂ) = n :=
(isPrimitiveRoot_exp n n.NeZero).card_rootsOfUnity
#align complex.card_roots_of_unity Complex.card_rootsOfUnity
+#print Complex.card_primitiveRoots /-
theorem card_primitiveRoots (k : ℕ) : (primitiveRoots k ℂ).card = φ k :=
by
by_cases h : k = 0
· simp [h]
exact (is_primitive_root_exp k h).card_primitiveRoots
#align complex.card_primitive_roots Complex.card_primitiveRoots
+-/
end Complex
@@ -113,10 +115,12 @@ theorem IsPrimitiveRoot.nnnorm_eq_one {ζ : ℂ} {n : ℕ} (h : IsPrimitiveRoot
Subtype.ext <| h.norm'_eq_one hn
#align is_primitive_root.nnnorm_eq_one IsPrimitiveRoot.nnnorm_eq_one
+#print IsPrimitiveRoot.arg_ext /-
theorem IsPrimitiveRoot.arg_ext {n m : ℕ} {ζ μ : ℂ} (hζ : IsPrimitiveRoot ζ n)
(hμ : IsPrimitiveRoot μ m) (hn : n ≠ 0) (hm : m ≠ 0) (h : ζ.arg = μ.arg) : ζ = μ :=
Complex.ext_abs_arg ((hζ.norm'_eq_one hn).trans (hμ.norm'_eq_one hm).symm) h
#align is_primitive_root.arg_ext IsPrimitiveRoot.arg_ext
+-/
theorem IsPrimitiveRoot.arg_eq_zero_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
ζ.arg = 0 ↔ ζ = 1 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -3,13 +3,13 @@ Copyright (c) 2020 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-! This file was ported from Lean 3 source module analysis.complex.roots_of_unity
-! leanprover-community/mathlib commit 17ef379e997badd73e5eabb4d38f11919ab3c4b3
+! This file was ported from Lean 3 source module ring_theory.roots_of_unity.complex
+! leanprover-community/mathlib commit 7fdeecc0d03cd40f7a165e6cf00a4d2286db599f
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Analysis.SpecialFunctions.Complex.Log
-import Mathbin.RingTheory.RootsOfUnity
+import Mathbin.RingTheory.RootsOfUnity.Basic
/-!
# Complex roots of unity
coe_nat to natCast (#11637)
Reduce the diff of #11499
All in the Int namespace:
ofNat_eq_cast → ofNat_eq_natCastcast_eq_cast_iff_Nat → natCast_injnatCast_eq_ofNat → ofNat_eq_natCastcoe_nat_sub → natCast_subcoe_nat_nonneg → natCast_nonnegsign_coe_add_one → sign_natCast_add_onenat_succ_eq_int_succ → natCast_succsucc_neg_nat_succ → succ_neg_natCast_succcoe_pred_of_pos → natCast_pred_of_poscoe_nat_div → natCast_divcoe_nat_ediv → natCast_edivsign_coe_nat_of_nonzero → sign_natCast_of_ne_zerotoNat_coe_nat → toNat_natCasttoNat_coe_nat_add_one → toNat_natCast_add_onecoe_nat_dvd → natCast_dvd_natCastcoe_nat_dvd_left → natCast_dvdcoe_nat_dvd_right → dvd_natCastle_coe_nat_sub → le_natCast_subsucc_coe_nat_pos → succ_natCast_poscoe_nat_modEq_iff → natCast_modEq_iffcoe_natAbs → natCast_natAbscoe_nat_eq_zero → natCast_eq_zerocoe_nat_ne_zero → natCast_ne_zerocoe_nat_ne_zero_iff_pos → natCast_ne_zero_iff_posabs_coe_nat → abs_natCastcoe_nat_nonpos_iff → natCast_nonpos_iffAlso rename Nat.coe_nat_dvd to Nat.cast_dvd_cast
@@ -45,7 +45,7 @@ theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprim
have hz : 2 * ↑π * I ≠ 0 := by simp [pi_pos.ne.symm, I_ne_zero]
field_simp [hz] at hk
norm_cast at hk
- have : n ∣ i * l := by rw [← Int.coe_nat_dvd, hk, mul_comm]; apply dvd_mul_left
+ have : n ∣ i * l := by rw [← Int.natCast_dvd_natCast, hk, mul_comm]; apply dvd_mul_left
exact hi.symm.dvd_of_dvd_mul_left this
#align complex.is_primitive_root_exp_of_coprime Complex.isPrimitiveRoot_exp_of_coprime
@@ -37,7 +37,7 @@ theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprim
constructor
· use i
field_simp [hn0, mul_comm (i : ℂ), mul_comm (n : ℂ)]
- · simp only [hn0, mul_right_comm _ _ ↑n, mul_left_inj' two_pi_I_ne_zero, Ne.def, not_false_iff,
+ · simp only [hn0, mul_right_comm _ _ ↑n, mul_left_inj' two_pi_I_ne_zero, Ne, not_false_iff,
mul_comm _ (i : ℂ), ← mul_assoc _ (i : ℂ), exists_imp, field_simps]
norm_cast
rintro l k hk
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -129,6 +129,7 @@ theorem IsPrimitiveRoot.arg_eq_pi_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoo
fun h => h.symm ▸ Complex.arg_neg_one⟩
#align is_primitive_root.arg_eq_pi_iff IsPrimitiveRoot.arg_eq_pi_iff
+set_option tactic.skipAssignedInstances false in
theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
∃ i : ℤ, ζ.arg = i / n * (2 * Real.pi) ∧ IsCoprime i n ∧ i.natAbs < n := by
rw [Complex.isPrimitiveRoot_iff _ _ hn] at h
exact_mod_cast tactic with mod_cast elaborator where possible (#8404)
We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -33,7 +33,7 @@ theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprim
IsPrimitiveRoot (exp (2 * π * I * (i / n))) n := by
rw [IsPrimitiveRoot.iff_def]
simp only [← exp_nat_mul, exp_eq_one_iff]
- have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast h0
+ have hn0 : (n : ℂ) ≠ 0 := mod_cast h0
constructor
· use i
field_simp [hn0, mul_comm (i : ℂ), mul_comm (n : ℂ)]
@@ -56,7 +56,7 @@ theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 *
theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.Coprime n, exp (2 * π * I * (i / n)) = ζ := by
- have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast hn
+ have hn0 : (n : ℂ) ≠ 0 := mod_cast hn
constructor; swap
· rintro ⟨i, -, hi, rfl⟩; exact isPrimitiveRoot_exp_of_coprime i n hn hi
intro h
@@ -73,7 +73,7 @@ complex numbers of the form `exp (2 * Real.pi * Complex.I * (i / n))` for some `
nonrec theorem mem_rootsOfUnity (n : ℕ+) (x : Units ℂ) :
x ∈ rootsOfUnity n ℂ ↔ ∃ i < (n : ℕ), exp (2 * π * I * (i / n)) = x := by
rw [mem_rootsOfUnity, Units.ext_iff, Units.val_pow_eq_pow_val, Units.val_one]
- have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast n.ne_zero
+ have hn0 : (n : ℂ) ≠ 0 := mod_cast n.ne_zero
constructor
· intro h
obtain ⟨i, hi, H⟩ : ∃ i < (n : ℕ), exp (2 * π * I / n) ^ i = x := by
@@ -143,7 +143,7 @@ theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn
rw [mul_neg_one, sub_eq_add_neg]
on_goal 2 =>
split_ifs with h₂
- · exact_mod_cast h
+ · exact mod_cast h
suffices (i - n : ℤ).natAbs = n - i by
rw [this]
apply tsub_lt_self hn.bot_lt
@@ -164,24 +164,24 @@ theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn
rw [← mul_rotate', mul_div_assoc]
rw [← mul_one n] at h₂
exact mul_le_of_le_one_right Real.pi_pos.le
- ((div_le_iff' <| by exact_mod_cast pos_of_gt h).mpr <| by exact_mod_cast h₂)
+ ((div_le_iff' <| mod_cast pos_of_gt h).mpr <| mod_cast h₂)
rw [← Complex.cos_sub_two_pi, ← Complex.sin_sub_two_pi]
convert Complex.arg_cos_add_sin_mul_I _
· push_cast
rw [← sub_one_mul, sub_div, div_self]
- exact_mod_cast hn
+ exact mod_cast hn
· push_cast
rw [← sub_one_mul, sub_div, div_self]
- exact_mod_cast hn
+ exact mod_cast hn
field_simp [hn]
refine' ⟨_, le_trans _ Real.pi_pos.le⟩
on_goal 2 =>
rw [mul_div_assoc]
- exact mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr <| by exact_mod_cast h.le)
+ exact mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr <| mod_cast h.le)
(div_nonneg (by simp [Real.pi_pos.le]) <| by simp)
rw [← mul_rotate', mul_div_assoc, neg_lt, ← mul_neg, mul_lt_iff_lt_one_right Real.pi_pos, ←
neg_div, ← neg_mul, neg_sub, div_lt_iff, one_mul, sub_mul, sub_lt_comm, ← mul_sub_one]
norm_num
- exact_mod_cast not_le.mp h₂
+ exact mod_cast not_le.mp h₂
· exact Nat.cast_pos.mpr hn.bot_lt
#align is_primitive_root.arg IsPrimitiveRoot.arg
@@ -29,7 +29,7 @@ open Polynomial Real
open scoped Nat Real
-theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.coprime n) :
+theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) :
IsPrimitiveRoot (exp (2 * π * I * (i / n))) n := by
rw [IsPrimitiveRoot.iff_def]
simp only [← exp_nat_mul, exp_eq_one_iff]
@@ -55,7 +55,7 @@ theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 *
#align complex.is_primitive_root_exp Complex.isPrimitiveRoot_exp
theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
- IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.coprime n, exp (2 * π * I * (i / n)) = ζ := by
+ IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.Coprime n, exp (2 * π * I * (i / n)) = ζ := by
have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast hn
constructor; swap
· rintro ⟨i, -, hi, rfl⟩; exact isPrimitiveRoot_exp_of_coprime i n hn hi
@@ -29,7 +29,7 @@ open Polynomial Real
open scoped Nat Real
-theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) :
+theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.coprime n) :
IsPrimitiveRoot (exp (2 * π * I * (i / n))) n := by
rw [IsPrimitiveRoot.iff_def]
simp only [← exp_nat_mul, exp_eq_one_iff]
@@ -55,7 +55,7 @@ theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 *
#align complex.is_primitive_root_exp Complex.isPrimitiveRoot_exp
theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
- IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.Coprime n, exp (2 * π * I * (i / n)) = ζ := by
+ IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.coprime n, exp (2 * π * I * (i / n)) = ζ := by
have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast hn
constructor; swap
· rintro ⟨i, -, hi, rfl⟩; exact isPrimitiveRoot_exp_of_coprime i n hn hi
Some changes have already been review and delegated in #6910 and #7148.
The diff that needs looking at is https://github.com/leanprover-community/mathlib4/pull/7174/commits/64d6d07ee18163627c8f517eb31455411921c5ac
The std bump PR was insta-merged already!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -29,7 +29,7 @@ open Polynomial Real
open scoped Nat Real
-theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.coprime n) :
+theorem isPrimitiveRoot_exp_of_coprime (i n : ℕ) (h0 : n ≠ 0) (hi : i.Coprime n) :
IsPrimitiveRoot (exp (2 * π * I * (i / n))) n := by
rw [IsPrimitiveRoot.iff_def]
simp only [← exp_nat_mul, exp_eq_one_iff]
@@ -55,7 +55,7 @@ theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 *
#align complex.is_primitive_root_exp Complex.isPrimitiveRoot_exp
theorem isPrimitiveRoot_iff (ζ : ℂ) (n : ℕ) (hn : n ≠ 0) :
- IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.coprime n, exp (2 * π * I * (i / n)) = ζ := by
+ IsPrimitiveRoot ζ n ↔ ∃ i < (n : ℕ), ∃ _ : i.Coprime n, exp (2 * π * I * (i / n)) = ζ := by
have hn0 : (n : ℂ) ≠ 0 := by exact_mod_cast hn
constructor; swap
· rintro ⟨i, -, hi, rfl⟩; exact isPrimitiveRoot_exp_of_coprime i n hn hi
MulZeroClass. in mul_zero/zero_mul (#6682)
Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.
These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).
@@ -148,7 +148,7 @@ theorem IsPrimitiveRoot.arg {n : ℕ} {ζ : ℂ} (h : IsPrimitiveRoot ζ n) (hn
rw [this]
apply tsub_lt_self hn.bot_lt
contrapose! h₂
- rw [Nat.eq_zero_of_le_zero h₂, MulZeroClass.zero_mul]
+ rw [Nat.eq_zero_of_le_zero h₂, zero_mul]
exact zero_le _
rw [← Int.natAbs_neg, neg_sub, Int.natAbs_eq_iff]
exact Or.inl (Int.ofNat_sub h.le).symm
@@ -2,15 +2,12 @@
Copyright (c) 2020 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-
-! This file was ported from Lean 3 source module ring_theory.roots_of_unity.complex
-! leanprover-community/mathlib commit 7fdeecc0d03cd40f7a165e6cf00a4d2286db599f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Analysis.SpecialFunctions.Complex.Log
import Mathlib.RingTheory.RootsOfUnity.Basic
+#align_import ring_theory.roots_of_unity.complex from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f"
+
/-!
# Complex roots of unity
The unported dependencies are
algebra.order.moduleinit.corelinear_algebra.free_module.finite.rankalgebra.order.monoid.cancel.defsalgebra.absalgebra.group_power.lemmasinit.data.list.basiclinear_algebra.free_module.rankalgebra.order.monoid.cancel.basicinit.data.list.defaulttopology.subset_propertiesinit.logicThe following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file