Skip to content

Commit d41c868

Browse files
Merge pull request #103 from leanprover-community/v4.8.0
wip
2 parents fe2463d + a602a91 commit d41c868

25 files changed

+88
-125
lines changed

FltRegular/CaseI/AuxLemmas.lean

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ theorem auxf0k₁ (hp5 : 5 ≤ p) (b : ℤ) : ∃ i : Fin P, f0k₁ b p (i : ℕ
4646
intro h
4747
simp only [Fin.ext_iff, Fin.val_mk] at h
4848
replace h := h.symm
49-
rw [Nat.pred_eq_succ_iff] at h
50-
linarith
49+
rw [Nat.pred_eq_sub_one] at h
50+
omega
5151
simp only [f0k₁, OfNat.ofNat_ne_one, ite_false, ite_eq_right_iff, neg_eq_zero]
5252
intro h2
5353
exfalso
@@ -65,9 +65,9 @@ theorem aux0k₁ {a b c : ℤ} {ζ : R} (hp5 : 5 ≤ p) (hζ : IsPrimitiveRoot
6565
have key : ↑(p : ℤ) ∣ ∑ j in range p, f0k₁ b p j • ζ ^ j := by
6666
convert hdiv using 1
6767
have h : 1 ≠ p.pred := fun h => by linarith [pred_eq_succ_iff.1 h.symm]
68-
simp_rw [f0k₁, ite_smul, sum_ite, filter_filter, ← Ne.def, ne_and_eq_iff_right h,
68+
simp_rw [f0k₁, ite_smul, sum_ite, filter_filter, ← Ne.eq_def, ne_and_eq_iff_right h,
6969
Finset.range_filter_eq]
70-
simp [hpri.one_lt, pred_lt hpri.ne_zero, sub_eq_add_neg]
70+
simp [hpri.one_lt, Nat.sub_lt hpri.pos, sub_eq_add_neg]
7171
rw [sum_range] at key
7272
refine' caseI (Dvd.dvd.mul_right (Dvd.dvd.mul_left _ _) _)
7373
replace hpri : (P : ℕ).Prime := hpri
@@ -112,10 +112,10 @@ theorem aux0k₂ {a b : ℤ} {ζ : R} (hp5 : 5 ≤ p) (hζ : IsPrimitiveRoot ζ
112112
← sub_mul, add_sub_right_comm, show ζ = ζ ^ ((⟨1, hpri.one_lt⟩ : Fin p) : ℕ) by simp] at hdiv
113113
have key : ↑(p : ℤ) ∣ ∑ j in range p, f0k₂ a b j • ζ ^ j := by
114114
convert hdiv using 1
115-
simp_rw [f0k₂, ite_smul, sum_ite, filter_filter, ← Ne.def, ne_and_eq_iff_right zero_ne_one,
115+
simp_rw [f0k₂, ite_smul, sum_ite, filter_filter, ← Ne.eq_def, ne_and_eq_iff_right zero_ne_one,
116116
Finset.range_filter_eq]
117117
simp only [hpri.pos, hpri.one_lt, if_true, zsmul_eq_mul, Int.cast_sub, sum_singleton,
118-
_root_.pow_zero, mul_one, pow_one, Ne.def, zero_smul, sum_const_zero, add_zero, Fin.val_mk]
118+
_root_.pow_zero, mul_one, pow_one, Ne, zero_smul, sum_const_zero, add_zero, Fin.val_mk]
119119
rw [sum_range] at key
120120
refine' hab _
121121
symm
@@ -194,7 +194,7 @@ theorem aux1k₂ {a b c : ℤ} {ζ : R} (hp5 : 5 ≤ p) (hζ : IsPrimitiveRoot
194194
have key : ↑(p : ℤ) ∣ ∑ j in range p, f1k₂ a j • ζ ^ j := by
195195
suffices ∑ j in range p, f1k₂ a j • ζ ^ j = ↑a - ↑a * ζ ^ 2 by
196196
rwa [this]
197-
simp_rw [f1k₂, ite_smul, sum_ite, filter_filter, ← Ne.def, ne_and_eq_iff_right
197+
simp_rw [f1k₂, ite_smul, sum_ite, filter_filter, ← Ne.eq_def, ne_and_eq_iff_right
198198
(show 02 by norm_num), Finset.range_filter_eq]
199199
simp only [hpri.pos, ite_true, zsmul_eq_mul, sum_singleton, _root_.pow_zero, mul_one, two_lt hp5, neg_smul,
200200
sum_neg_distrib, ne_eq, mem_range, not_and, not_not, zero_smul, sum_const_zero, add_zero]

FltRegular/CaseI/Statement.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ theorem caseI_easier {a b c : ℤ} (hreg : IsRegularPrime p) (hp5 : 5 ≤ p)
237237
have h1k₁ := aux1k₁ hpri.out hp5 hζ hab hcong hdiv
238238
have h1k₂ := aux1k₂ hpri.out hp5 hζ caseI hcong hdiv
239239
have hk₁k₂ : (k₁ : ℕ) ≠ (k₂ : ℕ) := auxk₁k₂ hpri.out hcong
240-
simp_rw [f, ite_smul, sum_ite, filter_filter, ← Ne.def, ne_and_eq_iff_right h01, and_assoc,
240+
simp_rw [f, ite_smul, sum_ite, filter_filter, ← Ne.eq_def, ne_and_eq_iff_right h01, and_assoc,
241241
ne_and_eq_iff_right h1k₁, ne_and_eq_iff_right h0k₁, ne_and_eq_iff_right hk₁k₂,
242242
ne_and_eq_iff_right h1k₂, ne_and_eq_iff_right h0k₂, Finset.range_filter_eq]
243243
simp only [hpri.out.pos, hpri.out.one_lt, if_true, zsmul_eq_mul, sum_singleton, _root_.pow_zero,
244-
mul_one, pow_one, Fin.is_lt, neg_smul, sum_neg_distrib, Ne.def, zero_smul, sum_const_zero,
244+
mul_one, pow_one, Fin.is_lt, neg_smul, sum_neg_distrib, Ne, zero_smul, sum_const_zero,
245245
add_zero]
246246
ring
247247
rw [sum_range] at key

FltRegular/CaseII/AuxLemmas.lean

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ lemma WfDvdMonoid.multiplicity_finite_iff {M : Type*} [CancelCommMonoidWithZero
4444
{x y : M} :
4545
multiplicity.Finite x y ↔ ¬IsUnit x ∧ y ≠ 0 := by
4646
constructor
47-
· rw [← not_imp_not, Ne.def, ← not_or, not_not]
47+
· rw [← not_imp_not, Ne, ← not_or, not_not]
4848
rintro (hx|hy)
4949
· exact fun ⟨n, hn⟩ ↦ hn (hx.pow _).dvd
5050
· simp [hy]
@@ -135,7 +135,7 @@ theorem isPrincipal_of_isPrincipal_pow_of_Coprime'
135135
by_cases Izero : I = 0
136136
· rw [Izero, FractionalIdeal.coe_zero]
137137
exact bot_isPrincipal
138-
rw [← Ne.def, ← isUnit_iff_ne_zero] at Izero
138+
rw [← Ne, ← isUnit_iff_ne_zero] at Izero
139139
show Submodule.IsPrincipal (Izero.unit' : FractionalIdeal A⁰ K)
140140
rw [← ClassGroup.mk_eq_one_iff, ← orderOf_eq_one_iff, ← Nat.dvd_one, ← H, Nat.dvd_gcd_iff]
141141
refine ⟨?_, orderOf_dvd_card⟩
@@ -153,9 +153,9 @@ lemma exists_not_dvd_spanSingleton_eq {R : Type*} [CommRing R] [IsDomain R] [IsD
153153
∃ a b : R, ¬(x ∣ a) ∧ ¬(x ∣ b) ∧ spanSingleton R⁰ (algebraMap R K a / algebraMap R K b) = I / J := by
154154
by_contra H1
155155
have hI' : (I : FractionalIdeal R⁰ K) ≠ 0 :=
156-
by rw [← coeIdeal_bot, Ne.def, coeIdeal_inj]; rintro rfl; exact hI (dvd_zero _)
156+
by rw [← coeIdeal_bot, Ne, coeIdeal_inj]; rintro rfl; exact hI (dvd_zero _)
157157
have hJ' : (J : FractionalIdeal R⁰ K) ≠ 0 :=
158-
by rw [← coeIdeal_bot, Ne.def, coeIdeal_inj]; rintro rfl; exact hJ (dvd_zero _)
158+
by rw [← coeIdeal_bot, Ne, coeIdeal_inj]; rintro rfl; exact hJ (dvd_zero _)
159159
have : ∀ n : ℕ, (1 ≤ n) → ¬∃ a b : R, ¬(x ^ n ∣ a) ∧ ¬(x ^ n ∣ b) ∧
160160
spanSingleton R⁰ (algebraMap R K a / algebraMap R K b) = I / J := by
161161
intro n hn
@@ -169,7 +169,7 @@ lemma exists_not_dvd_spanSingleton_eq {R : Type*} [CommRing R] [IsDomain R] [IsD
169169
← mul_div_right_comm, eq_div_iff hJ', ← coeIdeal_span_singleton, ← coeIdeal_span_singleton,
170170
← coeIdeal_mul, ← coeIdeal_mul, coeIdeal_inj] at e
171171
on_goal 2 =>
172-
rw [Ne.def, spanSingleton_eq_zero_iff, ← (algebraMap R K).map_zero,
172+
rw [Ne, spanSingleton_eq_zero_iff, ← (algebraMap R K).map_zero,
173173
(IsFractionRing.injective R K).eq_iff]
174174
rintro rfl
175175
apply hb (dvd_zero _)
@@ -180,7 +180,7 @@ lemma exists_not_dvd_spanSingleton_eq {R : Type*} [CommRing R] [IsDomain R] [IsD
180180
rwa [Irreducible.gcd_eq_one_iff]
181181
· rwa [irreducible_iff_prime, Ideal.prime_iff_isPrime, Ideal.span_singleton_prime]
182182
· exact hx.ne_zero
183-
· rw [Ne.def, Ideal.span_singleton_eq_bot]
183+
· rw [Ne, Ideal.span_singleton_eq_bot]
184184
exact hx.ne_zero
185185
rw [← Ideal.mem_span_singleton, ← Ideal.dvd_span_singleton] at ha' ⊢
186186
replace h := ha'.trans (dvd_mul_right _ J)
@@ -190,7 +190,7 @@ lemma exists_not_dvd_spanSingleton_eq {R : Type*} [CommRing R] [IsDomain R] [IsD
190190
rw [pow_succ', mul_dvd_mul_iff_left hx.ne_zero] at ha hb
191191
rw [_root_.map_mul, _root_.map_mul, mul_div_mul_left] at e₀
192192
· exact IH ⟨a', b', ha, hb, e₀⟩
193-
· rw [Ne.def, ← (algebraMap R K).map_zero, (IsFractionRing.injective R K).eq_iff]
193+
· rw [Ne, ← (algebraMap R K).map_zero, (IsFractionRing.injective R K).eq_iff]
194194
exact hx.ne_zero
195195
· refine IH ⟨a, b, h, ?_, e₀⟩
196196
intro hb
@@ -202,7 +202,7 @@ lemma exists_not_dvd_spanSingleton_eq {R : Type*} [CommRing R] [IsDomain R] [IsD
202202
IsCoprime.pow_left_iff, Ideal.isCoprime_iff_gcd, Irreducible.gcd_eq_one_iff]
203203
· rwa [irreducible_iff_prime, Ideal.prime_iff_isPrime, Ideal.span_singleton_prime]
204204
· exact hx.ne_zero
205-
· rw [Ne.def, Ideal.span_singleton_eq_bot]
205+
· rw [Ne, Ideal.span_singleton_eq_bot]
206206
exact hx.ne_zero
207207
· rwa [Nat.pos_iff_ne_zero, ← Nat.one_le_iff_ne_zero]
208208
rwa [← e, mul_comm, ← dvd_gcd_mul_iff_dvd_mul, this, one_mul] at hb

FltRegular/CaseII/InductionStep.lean

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ attribute [local instance 2000] Algebra.toModule Module.toDistribMulAction AddMo
1717
Semiring.toNonUnitalSemiring NonUnitalSemiring.toNonUnitalNonAssocSemiring
1818
NonUnitalNonAssocSemiring.toAddCommMonoid NonUnitalNonAssocSemiring.toMulZeroClass
1919
MulZeroClass.toMul Submodule.idemSemiring IdemSemiring.toSemiring
20-
Submodule.instIdemCommSemiringSubmoduleToSemiringToAddCommMonoidToNonUnitalNonAssocSemiringToNonAssocSemiringToSemiringToModule
20+
Submodule.instIdemCommSemiring
2121
IdemCommSemiring.toCommSemiring CommSemiring.toCommMonoid
2222

2323
set_option quotPrecheck false
@@ -80,7 +80,7 @@ lemma div_zeta_sub_one_sub (η₁ η₂) (hη : η₁ ≠ η₂) :
8080
ring
8181
apply Associated.mul_left
8282
apply hζ.unit'_coe.associated_sub_one hpri.out η₁.prop η₂.prop
83-
rw [Ne.def, ← Subtype.ext_iff.not]
83+
rw [Ne, ← Subtype.ext_iff.not]
8484
exact hη
8585

8686
set_option synthInstance.maxHeartbeats 40000 in
@@ -98,7 +98,7 @@ lemma div_zeta_sub_one_Injective :
9898
instance : Finite (𝓞 K ⧸ 𝔭) := by
9999
haveI : Fact (Nat.Prime p) := hpri
100100
letI := IsCyclotomicExtension.numberField {p} ℚ K
101-
rw [← Ideal.absNorm_ne_zero_iff, Ne.def, Ideal.absNorm_eq_zero_iff, Ideal.span_singleton_eq_bot]
101+
rw [← Ideal.absNorm_ne_zero_iff, Ne, Ideal.absNorm_eq_zero_iff, Ideal.span_singleton_eq_bot]
102102
exact hζ.unit'_coe.sub_one_ne_zero hpri.out.one_lt
103103

104104
lemma div_zeta_sub_one_Bijective :
@@ -155,14 +155,14 @@ lemma m_mul_c_mul_p : 𝔪 * 𝔠 η * 𝔭 = 𝔦 η := by
155155

156156
set_option synthInstance.maxHeartbeats 40000 in
157157
lemma m_ne_zero : 𝔪 ≠ 0 := by
158-
simp_rw [Ne.def, gcd_eq_zero_iff, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
158+
simp_rw [Ne, gcd_eq_zero_iff, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
159159
rintro ⟨rfl, rfl⟩
160160
exact hy (dvd_zero _)
161161

162162
set_option synthInstance.maxHeartbeats 40000 in
163163
lemma p_ne_zero : 𝔭 ≠ 0 := by
164164
letI := IsCyclotomicExtension.numberField {p} ℚ K
165-
rw [Ne.def, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
165+
rw [Ne, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
166166
exact hζ.unit'_coe.sub_one_ne_zero hpri.out.one_lt
167167

168168
lemma coprime_c_aux (η₁ η₂ : nthRootsFinset p (𝓞 K)) (hη : η₁ ≠ η₂) : (𝔦 η₁) ⊔ (𝔦 η₂) ∣ 𝔪 * 𝔭 := by
@@ -232,7 +232,7 @@ lemma prod_c : ∏ η in Finset.attach (nthRootsFinset p (𝓞 K)), 𝔠 η = (
232232

233233
lemma exists_ideal_pow_eq_c : ∃ I : Ideal (𝓞 K), (𝔠 η) = I ^ (p : ℕ) := by
234234
letI inst1 : @IsDomain (Ideal (𝓞 K)) CommSemiring.toSemiring := @Ideal.isDomain (𝓞 K) _ _
235-
letI inst2 := @Ideal.instNormalizedGCDMonoidIdealToSemiringToCommSemiringCancelCommMonoidWithZero (𝓞 K) _ _
235+
letI inst2 := @Ideal.instNormalizedGCDMonoid (𝓞 K) _ _
236236
letI inst3 := @NormalizedGCDMonoid.toGCDMonoid _ _ inst2
237237
exact @Finset.exists_eq_pow_of_mul_eq_pow_of_coprime (nthRootsFinset p (𝓞 K)) (Ideal (𝓞 K)) _
238238
(by convert inst1) (by convert inst3) _ _ _ _ _
@@ -401,7 +401,7 @@ lemma a_mul_denom_eq_a_zero_mul_num (hη : η ≠ η₀) :
401401
apply not_p_div_a_zero hp hζ e hy hz
402402
rw [ha]
403403
exact dvd_zero _
404-
· rw [Ne.def, FractionalIdeal.spanSingleton_eq_zero_iff, ← (algebraMap (𝓞 K) K).map_zero,
404+
· rw [Ne, FractionalIdeal.spanSingleton_eq_zero_iff, ← (algebraMap (𝓞 K) K).map_zero,
405405
(IsFractionRing.injective (𝓞 K) K).eq_iff]
406406
intro hβ
407407
apply a_div_a_zero_denom_spec hp hreg hζ e hy hz η hη
@@ -469,20 +469,20 @@ lemma exists_solution :
469469
have hη₁ : η₁ ≠ η₀ := by
470470
rw [← Subtype.coe_injective.ne_iff]
471471
show (η₀ * hζ.unit' : 𝓞 K) ≠ η₀
472-
rw [Ne.def, mul_right_eq_self₀, not_or]
472+
rw [Ne, mul_right_eq_self₀, not_or]
473473
exact ⟨hζ.unit'_coe.ne_one hpri.out.one_lt,
474474
ne_zero_of_mem_nthRootsFinset (η₀ : _).prop⟩
475475
have hη₂ : η₂ ≠ η₀ := by
476476
rw [← Subtype.coe_injective.ne_iff]
477477
show (η₀ * hζ.unit' * hζ.unit' : 𝓞 K) ≠ η₀
478-
rw [Ne.def, mul_assoc, ← pow_two, mul_right_eq_self₀, not_or]
478+
rw [Ne, mul_assoc, ← pow_two, mul_right_eq_self₀, not_or]
479479
exact ⟨hζ.unit'_coe.pow_ne_one_of_pos_of_lt zero_lt_two
480480
(hpri.out.two_le.lt_or_eq.resolve_right (PNat.coe_injective.ne hp.symm)),
481481
ne_zero_of_mem_nthRootsFinset (η₀ : _).prop⟩
482482
have hη : η₂ ≠ η₁ := by
483483
rw [← Subtype.coe_injective.ne_iff]
484484
show (η₀ * hζ.unit' * hζ.unit' : 𝓞 K) ≠ η₀ * hζ.unit'
485-
rw [Ne.def, mul_right_eq_self₀, not_or]
485+
rw [Ne, mul_right_eq_self₀, not_or]
486486
exact ⟨hζ.unit'_coe.ne_one hpri.out.one_lt,
487487
mul_ne_zero (ne_zero_of_mem_nthRootsFinset (η₀ : _).prop)
488488
(hζ.unit'_coe.ne_zero hpri.out.ne_zero)⟩

FltRegular/FltThree/Edwards.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ theorem OddPrimeOrFour.factors' {a : ℤ√(-3)} (h2 : a.norm ≠ 1) (hcoprime :
198198
obtain ⟨u, huvcoprime, huv, huvdvd⟩ := step1_2 hcoprime hpdvd hp hd
199199
use u
200200
cases' huv with huv huv <;> [(use q'); (use star q')] <;>
201-
simp only [IsCoprime, Zsqrtd.star_re, Zsqrtd.star_im, Ne.def, neg_eq_zero, Zsqrtd.norm_conj] <;>
201+
simp only [IsCoprime, Zsqrtd.star_re, Zsqrtd.star_im, Ne, neg_eq_zero, Zsqrtd.norm_conj] <;>
202202
use hc, hd, hp, huv, huvcoprime <;>
203203
· rw [huvdvd, lt_mul_iff_one_lt_left (Spts.pos_of_coprime' huvcoprime), ← Zsqrt3.norm_natAbs,
204204
Nat.one_lt_cast]
@@ -324,7 +324,7 @@ theorem no_conj (s : Multiset (ℤ√(-3))) {p : ℤ√(-3)} (hp : ¬IsUnit p)
324324
rw [← Int.isUnit_iff_abs_eq]
325325
apply IsCoprime.isUnit_of_dvd' hcoprime <;> apply dvd_mul_right
326326
· have : star p ≠ p := by
327-
rw [Ne.def, Zsqrtd.ext_iff]
327+
rw [Ne, Zsqrtd.ext_iff]
328328
rintro ⟨-, H⟩
329329
apply him
330330
apply eq_zero_of_neg_eq

FltRegular/FltThree/FltThree.lean

+4-7
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ theorem gcd1or3 (p q : ℤ) (hp : p ≠ 0) (hcoprime : IsCoprime p q) (hparity :
212212
by
213213
intro d hdprime hdleft hdright
214214
by_contra hne3
215-
rw [← Ne.def] at hne3
215+
rw [← Ne] at hne3
216216
apply (Nat.prime_iff_prime_int.mp hdprime).not_unit
217217
have hne2 : d ≠ 2 := by
218218
rintro rfl
@@ -457,8 +457,7 @@ theorem descent_gcd1 (a b c p q : ℤ) (hp : p ≠ 0) (hcoprime : IsCoprime p q)
457457
simp only [‹¬ Even (3 : ℤ)›, false_or_iff, iff_not_self, parity_simps] at huvodd
458458
· intro H
459459
rw [add_eq_zero_iff_eq_neg] at H
460-
apply iff_not_self
461-
simpa [‹¬ Even (3 : ℤ)›, H, parity_simps] using huvodd
460+
simp [‹¬ Even (3 : ℤ)›, H, parity_simps] at huvodd
462461
· apply Int.gcd1_coprime12 u v <;> assumption
463462
· apply Int.gcd1_coprime13 u v <;> assumption
464463
· apply Int.gcd1_coprime23 u v <;> assumption
@@ -627,12 +626,10 @@ theorem descent_gcd3 (a b c p q : ℤ) (hp : p ≠ 0) (hq : q ≠ 0) (hcoprime :
627626
· exact mul_ne_zero two_ne_zero hv
628627
· intro H
629628
rw [sub_eq_zero] at H
630-
apply iff_not_self
631-
simpa [H, parity_simps] using huvodd
629+
simp [H, parity_simps] at huvodd
632630
· intro H
633631
rw [add_eq_zero_iff_eq_neg] at H
634-
apply iff_not_self
635-
simpa [H, parity_simps] using huvodd
632+
simp [H, parity_simps] at huvodd
636633
· exact hsubcoprime
637634
· exact haddcoprime
638635
· exact haddsubcoprime

FltRegular/FltThree/Spts.lean

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ theorem Zsqrtd.exists {d : ℤ} (a : ℤ√d) (him : a.im ≠ 0) :
1313
cases' le_or_lt a.re 0 with hre hre
1414
· use -a
1515
simp only [hre, him, Zsqrtd.norm_neg, eq_self_iff_true, Zsqrtd.neg_im, Zsqrtd.neg_re,
16-
and_self_iff, neg_nonneg, Ne.def, not_false_iff, neg_eq_zero]
16+
and_self_iff, neg_nonneg, Ne, not_false_iff, neg_eq_zero]
1717
· use a
18-
simp only [hre.le, him, eq_self_iff_true, and_self_iff, Ne.def, not_false_iff]
18+
simp only [hre.le, him, eq_self_iff_true, and_self_iff, Ne, not_false_iff]
1919

2020
-- Edwards p49 step (2')
2121
theorem factors2 {a : ℤ√(-3)} (heven : Even a.norm) : ∃ b : ℤ√(-3), a.norm = 4 * b.norm :=
@@ -248,7 +248,7 @@ theorem factors (a : ℤ√(-3)) (x : ℤ) (hcoprime : IsCoprime a.re a.im) (hod
248248
have hneg1 : 1 ≤ a.norm := by
249249
rw [← Int.sub_one_lt_iff, sub_self]
250250
apply lt_of_le_of_ne (Zsqrtd.norm_nonneg (by norm_num) a)
251-
rw [Ne.def, eq_comm, Zsqrtd.norm_eq_zero_iff (by norm_num : (-3 : ℤ) < 0)]
251+
rw [Ne, eq_comm, Zsqrtd.norm_eq_zero_iff (by norm_num : (-3 : ℤ) < 0)]
252252
rintro rfl
253253
rw [Zsqrtd.zero_im, Zsqrtd.zero_re] at hcoprime
254254
exact not_isCoprime_zero_zero hcoprime
@@ -261,7 +261,7 @@ theorem factors (a : ℤ√(-3)) (x : ℤ) (hcoprime : IsCoprime a.re a.im) (hod
261261
refine' ⟨⟨1, 0⟩, _⟩
262262
norm_num [Zsqrtd.norm_def]
263263
obtain ⟨c', m, rfl, -, h1, ⟨y, hy, h3⟩⟩ := Zqrtd.factor_div' a hodd h hcoprime hfactor
264-
have h4 : c'.norm ≠ 0 := by rwa [Ne.def, Zsqrtd.norm_eq_zero_iff (by norm_num) c']
264+
have h4 : c'.norm ≠ 0 := by rwa [Ne, Zsqrtd.norm_eq_zero_iff (by norm_num) c']
265265
set g := Int.gcd c'.re c'.im with hg
266266
have hgpos : 0 < g := by rwa [hg, Zsqrtd.gcd_pos_iff]
267267
obtain ⟨C', HC', HCDcoprime⟩ := Zsqrtd.exists_coprime_of_gcd_pos hgpos

FltRegular/MayAssume/Lemmas.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ theorem a_not_cong_b {p : ℕ} {a b c : ℤ} (hpri : p.Prime) (hp5 : 5 ≤ p) (h
8888
· simp only [mem_insert, mem_singleton] at hx
8989
rcases hx with (H | H | H) <;> simp [H]
9090
rw [this]
91-
simp only [gcd_insert, id.def, gcd_singleton, normalize_apply, neg_mul]
91+
simp only [gcd_insert, id, gcd_singleton, normalize_apply, neg_mul]
9292
congr 1
9393
rw [← coe_gcd, ← coe_gcd, Int.gcd_eq_natAbs, Int.gcd_eq_natAbs]
9494
simp only [natAbs_neg, Nat.cast_inj]

FltRegular/NumberTheory/Cyclotomic/CyclRat.lean

+7-6
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ lemma fltIdeals_coprime2_lemma [Fact (p : ℕ).Prime] (ph : 5 ≤ p) {x y : ℤ}
291291
rw [← eq_top_iff_one] at hone
292292
have hcontra := IsPrime.ne_top hPrime
293293
rw [hone] at hcontra
294-
simp only [Ne.def, eq_self_iff_true, not_true] at hcontra
294+
simp only [Ne, eq_self_iff_true, not_true] at hcontra
295295
apply HC hprime3
296296
apply HC hprime2
297297

@@ -349,9 +349,9 @@ theorem dvd_last_coeff_cycl_integer [hp : Fact (p : ℕ).Prime] {ζ : 𝓞 L}
349349
set b := hζ'.integralPowerBasis' with hb
350350
have hdim : b.dim = (p : ℕ).pred := by rw [hζ'.power_basis_int'_dim, totient_prime hp.out,
351351
pred_eq_sub_one]
352-
by_cases H : i = ⟨(p : ℕ).pred, pred_lt hp.out.ne_zero⟩
352+
by_cases H : i = ⟨(p : ℕ) - 1, pred_lt hp.out.ne_zero⟩
353353
· simp [H.symm, Hi]
354-
have hi : ↑i < (p : ℕ).pred := by
354+
have hi : ↑i < (p : ℕ) - 1 := by
355355
by_contra! habs
356356
simp [le_antisymm habs (le_pred_of_lt (Fin.is_lt i))] at H
357357
obtain ⟨y, hy⟩ := hdiv
@@ -383,7 +383,8 @@ theorem dvd_last_coeff_cycl_integer [hp : Fact (p : ℕ).Prime] {ζ : 𝓞 L}
383383
rw [hn] at hy
384384
simp only [Fin.castIso_apply, Fin.cast_mk, Fin.castSucc_mk, Fin.eta, Hi, zero_sub,
385385
neg_eq_iff_eq_neg] at hy
386-
simp [hy, dvd_neg]
386+
erw [hy] -- pred vs - 1
387+
simp [dvd_neg]
387388

388389
theorem dvd_coeff_cycl_integer (hp : (p : ℕ).Prime) {ζ : 𝓞 L} (hζ : IsPrimitiveRoot ζ p)
389390
{f : Fin p → ℤ} (hf : ∃ i, f i = 0) {m : ℤ} (hdiv : ↑m ∣ ∑ j, f j • ζ ^ (j : ℕ)) :
@@ -401,9 +402,9 @@ theorem dvd_coeff_cycl_integer (hp : (p : ℕ).Prime) {ζ : 𝓞 L} (hζ : IsPri
401402
pred_eq_sub_one]
402403
have last_dvd := dvd_last_coeff_cycl_integer hζ hf hdiv
403404
intro j
404-
by_cases H : j = ⟨(p : ℕ).pred, pred_lt hp.ne_zero⟩
405+
by_cases H : j = ⟨(p : ℕ) - 1, pred_lt hp.ne_zero⟩
405406
· simpa [H] using last_dvd
406-
have hj : ↑j < (p : ℕ).pred := by
407+
have hj : ↑j < (p : ℕ) - 1 := by
407408
by_contra! habs
408409
simp [le_antisymm habs (le_pred_of_lt (Fin.is_lt j))] at H
409410
obtain ⟨y, hy⟩ := hdiv

FltRegular/NumberTheory/Cyclotomic/Factoring.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ theorem pow_sub_pow_eq_prod_sub_zeta_runity_mul {K : Type _} [CommRing K] [IsDom
3636
-- the homogenization of the identity is also true
3737
have := congr_arg (homogenization 1) this
3838
-- simplify to get the result we want
39-
simpa [homogenization_prod, algebraMap_eq, hpos]
39+
simpa [homogenization_prod, Polynomial.algebraMap_eq, hpos]
4040

4141
/-- If there is a primitive `n`th root of unity in `K` and `n` is odd, then
4242
`X ^ n + Y ^ n = ∏ (X + μ Y)`, where `μ` varies over the `n`-th roots of unity. -/

FltRegular/NumberTheory/Cyclotomic/GaloisActionOnCyclo.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import FltRegular.NumberTheory.Cyclotomic.CyclotomicUnits
22
import Mathlib.NumberTheory.Cyclotomic.Gal
3-
import Mathlib.NumberTheory.NumberField.Units
3+
import Mathlib.NumberTheory.NumberField.Units.Basic
44

55
universe u
66

FltRegular/NumberTheory/Cyclotomic/MoreLemmas.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ lemma IsPrimitiveRoot.prime_span_sub_one : Prime (Ideal.span <| singleton <| (h
2424
rw [Ideal.prime_iff_isPrime,
2525
Ideal.span_singleton_prime (hζ.unit'_coe.sub_one_ne_zero hpri.out.one_lt)]
2626
exact hζ.zeta_sub_one_prime'
27-
· rw [Ne.def, Ideal.span_singleton_eq_bot]
27+
· rw [Ne, Ideal.span_singleton_eq_bot]
2828
exact hζ.unit'_coe.sub_one_ne_zero hpri.out.one_lt
2929

3030
lemma norm_Int_zeta_sub_one : Algebra.norm ℤ (↑(IsPrimitiveRoot.unit' hζ) - 1 : 𝓞 K) = p := by

0 commit comments

Comments
 (0)