Skip to content

Commit 0876dc6

Browse files
committed
bump mathlib
1 parent 57e5bef commit 0876dc6

5 files changed

+34
-25
lines changed

FormalBook/Ch01_Six_proofs_of_the_infinity_of_primes.lean

+11-5
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ lemma fermat_product (n : ℕ) : ∏ k in range n, F k = F n - 2 := by
9494
rw [prod_range_succ, hn]
9595
unfold F
9696
norm_num
97-
rw [succ_eq_add_one, mul_comm, ← Nat.sq_sub_sq]
97+
rw [mul_comm, (show 2 ^ 2 ^ n + 1 - 2 = 2 ^ 2 ^ n - 1 by aesop), ← Nat.sq_sub_sq]
9898
ring_nf
99+
omega
99100

100101
theorem infinity_of_primes₂ (k n : ℕ) (h : k < n): Coprime (F n) (F k) := by
101102
let m := (F n).gcd (F k)
@@ -132,6 +133,11 @@ lemma ZMod.two_ne_one (q : ℕ) [Fact (1 < q)] : (2 : ZMod q) ≠ 1 := by
132133
intro h1
133134
have h : (2 - 1 : ZMod q) = 0 := by exact Iff.mpr sub_eq_zero h1
134135
norm_num at h
136+
#check pred_le_pred
137+
138+
lemma sub_one_le_sub_one {n m : ℕ} : n ≤ m → n - 1 ≤ m - 1 := by
139+
intro h
140+
exact pred_le_pred h
135141

136142

137143
theorem infinity_of_primes₃:
@@ -143,7 +149,7 @@ theorem infinity_of_primes₃:
143149
-- This m has a prime factor;
144150
-- we pick the minimal one, the argument works with any prime factor
145151
let q := m.minFac
146-
have hq : q.Prime := minFac_prime <| Nat.ne_of_gt <| one_lt_mersenne <| Prime.one_lt hp
152+
have hq : q.Prime := minFac_prime <| Nat.ne_of_gt <| one_lt_mersenne.mpr <| Prime.one_lt hp
147153
have : Fact (Nat.Prime q) := by exact { out := hq }
148154
have h_mod_q : 2 ^ p ≡ 1 [MOD q] := by
149155
have : (2^p - 1) % q = 0 := mod_eq_zero_of_dvd (minFac_dvd m)
@@ -155,7 +161,7 @@ theorem infinity_of_primes₃:
155161
zero_sub, neg_sub] at hc
156162
simp [cast_one, cast_pow, cast_ofNat, hc.symm]
157163
have h_mod_q' : (2 : (ZMod q)) ^ p = 1 := by
158-
have := (ZMod.nat_cast_eq_nat_cast_iff _ _ _).mpr h_mod_q
164+
have := (ZMod.natCast_eq_natCast_iff _ _ _).mpr h_mod_q
159165
norm_cast at this
160166
rw [← this, cast_pow, cast_ofNat]
161167
have : (2 : (ZMod q)) * (2 ^ (p - 1)) = 1 := by
@@ -193,13 +199,13 @@ theorem infinity_of_primes₃:
193199
· refine' minFac_prime <| Nat.ne_of_gt _
194200
dsimp [mersenne]
195201
calc 1 < 2^2 - 1 := by norm_num
196-
_ ≤ 2^p - 1 := (pred_eq_sub_one 4).symm ▸ pred_le_pred <|
197-
pow_le_pow_of_le_right (succ_pos 1) (Prime.two_le hp)
202+
_ ≤ 2^p - 1 := sub_one_le_sub_one <| pow_le_pow_of_le_right (succ_pos 1) (Prime.two_le hp)
198203
· have h2q : 2 ≤ q := by
199204
exact Prime.two_le <| minFac_prime <| Nat.ne_of_gt <| lt_of_succ_lt <|
200205
Nat.sub_le_sub_right ((pow_le_pow_of_le_right (succ_pos 1) (Prime.two_le hp))) 1
201206
exact lt_of_le_of_lt (Nat.le_of_dvd (Nat.sub_pos_of_lt <| h2q) h_piv_div_q_sub_one)
202207
<| pred_lt <| Nat.ne_of_gt <| Nat.le_of_lt h2q
208+
203209
/-!
204210
### Fourth proof
205211

FormalBook/Ch02_Bertrand's_postulate.lean

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ theorem real_main_inequality {x : ℝ} (n_large : (512 : ℝ) ≤ x) :
9191
conv in 512 => equals 2 ^ 9 => norm_num1
9292
conv in 2 * 512 => equals 2 ^ 10 => norm_num1
9393
conv in 32 => rw [← Nat.cast_ofNat]
94-
rw [rpow_nat_cast, ← pow_mul, ← pow_add]
94+
rw [rpow_natCast, ← pow_mul, ← pow_add]
9595
conv in 4 => equals 2 ^ (2 : ℝ) => rw [rpow_two]; norm_num1
96-
rw [← rpow_mul, ← rpow_nat_cast]
96+
rw [← rpow_mul, ← rpow_natCast]
9797
apply rpow_le_rpow_of_exponent_le
9898
all_goals norm_num1
9999
end Bertrand
@@ -106,7 +106,7 @@ open Nat
106106
theorem bertrand_main_inequality {n : ℕ} (n_large : 512 ≤ n) :
107107
n * (2 * n) ^ Nat.sqrt (2 * n) * 4 ^ (2 * n / 3) ≤ 4 ^ n := by
108108
rw [← @cast_le ℝ]
109-
simp only [cast_add, cast_one, cast_mul, cast_pow, ← Real.rpow_nat_cast]
109+
simp only [cast_add, cast_one, cast_mul, cast_pow, ← Real.rpow_natCast]
110110
refine' _root_.trans ?_ (Bertrand.real_main_inequality (by exact_mod_cast n_large))
111111
gcongr
112112
· have n2_pos : 0 < 2 * n := by positivity

FormalBook/Ch06_Every_finite_division_ring_is_a_field.lean

+3
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,12 @@ theorem wedderburn (h: Fintype R): IsField R := by
283283
have h1 : (q ^ n - 1) = q - 1 + ∑ A : S', (q ^ n - 1) / (q ^ (n_k A) - 1) := by
284284
convert H1
285285
sorry
286+
have hZ : Nonempty <| @Subtype R fun x => x ∈ Z := by
287+
exact Zero.instNonempty
286288
have hq_pow_pos : ∀ m, 1 ≤ q ^ m := by
287289
intro m
288290
refine' one_le_pow m q _
291+
289292
exact Fintype.card_pos
290293

291294
have h_n_k_A_dvd: ∀ A : S', (n_k A ∣ n) := by sorry

lake-manifest.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{"version": 7,
22
"packagesDir": ".lake/packages",
33
"packages":
4-
[{"url": "https://github.com/leanprover/std4",
4+
[{"url": "https://github.com/leanprover-community/batteries",
55
"type": "git",
66
"subDir": null,
7-
"rev": "32983874c1b897d78f20d620fe92fc8fd3f06c3a",
8-
"name": "std",
7+
"rev": "14f258593e8c261d8834f13c6edc7b970c253ee8",
8+
"name": "batteries",
99
"manifestFile": "lake-manifest.json",
1010
"inputRev": "main",
1111
"inherited": true,
1212
"configFile": "lakefile.lean"},
1313
{"url": "https://github.com/leanprover-community/quote4",
1414
"type": "git",
1515
"subDir": null,
16-
"rev": "64365c656d5e1bffa127d2a1795f471529ee0178",
16+
"rev": "53156671405fbbd5402ed17a79bd129b961bd8d6",
1717
"name": "Qq",
1818
"manifestFile": "lake-manifest.json",
1919
"inputRev": "master",
@@ -22,25 +22,25 @@
2222
{"url": "https://github.com/leanprover-community/aesop",
2323
"type": "git",
2424
"subDir": null,
25-
"rev": "5fefb40a7c9038a7150e7edd92e43b1b94c49e79",
25+
"rev": "f617e0673845925e612b62141ff54c4b7980dc63",
2626
"name": "aesop",
2727
"manifestFile": "lake-manifest.json",
2828
"inputRev": "master",
2929
"inherited": true,
30-
"configFile": "lakefile.lean"},
30+
"configFile": "lakefile.toml"},
3131
{"url": "https://github.com/leanprover-community/ProofWidgets4",
3232
"type": "git",
3333
"subDir": null,
34-
"rev": "fb65c476595a453a9b8ffc4a1cea2db3a89b9cd8",
34+
"rev": "e6b6247c61280c77ade6bbf0bc3c66a44fe2e0c5",
3535
"name": "proofwidgets",
3636
"manifestFile": "lake-manifest.json",
37-
"inputRev": "v0.0.30",
37+
"inputRev": "v0.0.36",
3838
"inherited": true,
3939
"configFile": "lakefile.lean"},
4040
{"url": "https://github.com/leanprover/lean4-cli",
4141
"type": "git",
4242
"subDir": null,
43-
"rev": "be8fa79a28b8b6897dce0713ef50e89c4a0f6ef5",
43+
"rev": "a11566029bd9ec4f68a65394e8c3ff1af74c1a29",
4444
"name": "Cli",
4545
"manifestFile": "lake-manifest.json",
4646
"inputRev": "main",
@@ -49,16 +49,16 @@
4949
{"url": "https://github.com/leanprover-community/import-graph.git",
5050
"type": "git",
5151
"subDir": null,
52-
"rev": "61a79185b6582573d23bf7e17f2137cd49e7e662",
52+
"rev": "35e38eb320982cfd2fcc864e0e0467ca223c8cdb",
5353
"name": "importGraph",
5454
"manifestFile": "lake-manifest.json",
5555
"inputRev": "main",
5656
"inherited": true,
57-
"configFile": "lakefile.lean"},
57+
"configFile": "lakefile.toml"},
5858
{"url": "https://github.com/leanprover-community/mathlib4.git",
5959
"type": "git",
6060
"subDir": null,
61-
"rev": "9125a0936fd86f4bb74bebe27f0b1cd0c5a2b7cf",
61+
"rev": "aad19d883960cbdd1807a3c31ef7a351c3f0c733",
6262
"name": "mathlib",
6363
"manifestFile": "lake-manifest.json",
6464
"inputRev": null,
@@ -67,7 +67,7 @@
6767
{"url": "https://github.com/PatrickMassot/checkdecls.git",
6868
"type": "git",
6969
"subDir": null,
70-
"rev": "2ee81a0269048010900117b675876a1d8db5883c",
70+
"rev": "88ec21589a8eef430f4ea01147cde1aaa7963e16",
7171
"name": "checkdecls",
7272
"manifestFile": "lake-manifest.json",
7373
"inputRev": null,
@@ -76,7 +76,7 @@
7676
{"url": "https://github.com/xubaiw/CMark.lean",
7777
"type": "git",
7878
"subDir": null,
79-
"rev": "0077cbbaa92abf855fc1c0413e158ffd8195ec77",
79+
"rev": "ba7b47bd773954b912ecbf5b1c9993c71a166f05",
8080
"name": "CMark",
8181
"manifestFile": "lake-manifest.json",
8282
"inputRev": "main",
@@ -85,7 +85,7 @@
8585
{"url": "https://github.com/fgdorais/lean4-unicode-basic",
8686
"type": "git",
8787
"subDir": null,
88-
"rev": "6a350f4ec7323a4e8ad6bf50736f779853d441e9",
88+
"rev": "8b53cc65534bc2c6888c3d4c53a3439648213f74",
8989
"name": "UnicodeBasic",
9090
"manifestFile": "lake-manifest.json",
9191
"inputRev": "main",
@@ -103,7 +103,7 @@
103103
{"url": "https://github.com/leanprover/doc-gen4",
104104
"type": "git",
105105
"subDir": null,
106-
"rev": "a34d3c1f7b72654c08abe5741d94794db40dbb2e",
106+
"rev": "b91fea210b7b6b451f19c6344d1f82765b9607af",
107107
"name": "«doc-gen4»",
108108
"manifestFile": "lake-manifest.json",
109109
"inputRev": "main",

lean-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.7.0
1+
leanprover/lean4:v4.8.0-rc1

0 commit comments

Comments
 (0)