Skip to content

Commit b1458bc

Browse files
Update lean-toolchain for leanprover/lean4#11438
2 parents 01958ce + 72824e4 commit b1458bc

File tree

1,333 files changed

+31812
-15011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,333 files changed

+31812
-15011
lines changed

.github/workflows/discover-lean-pr-testing.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ jobs:
1818
with:
1919
ref: nightly-testing
2020
fetch-depth: 0 # Fetch all branches
21+
token: ${{ secrets.NIGHTLY_TESTING }}
2122

2223
- name: Set up Git
2324
run: |
24-
git config --global user.name "github-actions"
25-
git config --global user.email "github-actions@github.com"
25+
git config --global user.name "leanprover-community-mathlib4-bot"
26+
git config --global user.email "[email protected].github.com"
2627
2728
- name: Configure Lean
2829
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0

Archive.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import Archive.Wiedijk100Theorems.FriendshipGraphs
7474
import Archive.Wiedijk100Theorems.HeronsFormula
7575
import Archive.Wiedijk100Theorems.InverseTriangleSum
7676
import Archive.Wiedijk100Theorems.Konigsberg
77-
import Archive.Wiedijk100Theorems.Partition
7877
import Archive.Wiedijk100Theorems.PerfectNumbers
7978
import Archive.Wiedijk100Theorems.SolutionOfCubicQuartic
8079
import Archive.Wiedijk100Theorems.SumOfPrimeReciprocalsDiverges

Archive/Examples/Kuratowski.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ complements of the closed sets, and `s` and `sᶜ` which are neither closed nor
2222
This reduces `14*13/2 = 91` inequalities to check down to `6*5/2 = 15` inequalities.
2323
We'll further show that the 15 inequalities follow from a subset of 6 by algebra.
2424
25-
There are charaterizations and criteria for a set to be a 14-set in the paper
25+
There are characterizations and criteria for a set to be a 14-set in the paper
2626
"Characterization of Kuratowski 14-Sets" by Eric Langford which we do not formalize.
2727
2828
## Main definitions
@@ -63,7 +63,7 @@ theorem sum_map_theClosedSix_add_compl (s : Set X) :
6363
((theClosedSix s).map fun t ↦ {t} + {tᶜ}).sum = theClosedSix s + theOpenSix s :=
6464
Multiset.sum_map_add
6565

66-
/-- `theFourteen s` can be splitted into 3 subsets. -/
66+
/-- `theFourteen s` can be split into 3 subsets. -/
6767
theorem theFourteen_eq_pair_add_theClosedSix_add_theOpenSix (s : Set X) :
6868
theFourteen s = {s, sᶜ} + theClosedSix s + theOpenSix s := by
6969
rw [add_assoc, ← sum_map_theClosedSix_add_compl]; rfl

Archive/Imo/Imo1960Q1.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ theorem ge_100 {n : ℕ} (h1 : ProblemPredicate n) : 100 ≤ n := by
4545
rw [← h1.left]
4646
refine Nat.base_pow_length_digits_le 10 n ?_ (not_zero h1)
4747
simp
48-
omega
48+
lia
4949

5050
theorem lt_1000 {n : ℕ} (h1 : ProblemPredicate n) : n < 1000 := by
5151
have h2 : n < 10 ^ 3 := by
5252
rw [← h1.left]
5353
refine Nat.lt_base_pow_length_digits ?_
5454
simp
55-
omega
55+
lia
5656

5757
/-
5858
We do an exhaustive search to show that all results are covered by `SolutionPredicate`.
@@ -70,7 +70,7 @@ theorem searchUpTo_step {c n} (H : SearchUpTo c n) {c' n'} (ec : c + 1 = c') (en
7070
refine ⟨by ring, fun m l p => ?_⟩
7171
obtain ⟨h₁, ⟨m, rfl⟩, h₂⟩ := id p
7272
by_cases h : 11 * m < c * 11; · exact H _ h p
73-
obtain rfl : m = c := by omega
73+
obtain rfl : m = c := by lia
7474
rw [Nat.mul_div_cancel_left _ (by simp : 11 > 0), mul_comm] at h₂
7575
refine (H' h₂).imp ?_ ?_ <;> · rintro rfl; norm_num
7676

Archive/Imo/Imo1962Q1.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ Now we can eliminate possibilities for `(digits 10 c).length` until we get to th
5353
lemma case_0_digits {c n : ℕ} (hc : (digits 10 c).length = 0) : ¬ProblemPredicate' c n := by
5454
intro hpp
5555
have hpow : 6 * 10 ^ 0 = 6 * 10 ^ (digits 10 c).length := by rw [hc]
56-
omega
56+
lia
5757

5858
lemma case_1_digits {c n : ℕ} (hc : (digits 10 c).length = 1) : ¬ProblemPredicate' c n := by
5959
intro hpp
6060
have hpow : 6 * 10 ^ 1 = 6 * 10 ^ (digits 10 c).length := by rw [hc]
61-
omega
61+
lia
6262

6363
lemma case_2_digits {c n : ℕ} (hc : (digits 10 c).length = 2) : ¬ProblemPredicate' c n := by
6464
intro hpp
6565
have hpow : 6 * 10 ^ 2 = 6 * 10 ^ (digits 10 c).length := by rw [hc]
66-
omega
66+
lia
6767

6868
lemma case_3_digits {c n : ℕ} (hc : (digits 10 c).length = 3) : ¬ProblemPredicate' c n := by
6969
intro hpp
7070
have hpow : 6 * 10 ^ 3 = 6 * 10 ^ (digits 10 c).length := by rw [hc]
71-
omega
71+
lia
7272

7373
lemma case_4_digits {c n : ℕ} (hc : (digits 10 c).length = 4) : ¬ProblemPredicate' c n := by
7474
intro hpp
7575
have hpow : 6 * 10 ^ 4 = 6 * 10 ^ (digits 10 c).length := by rw [hc]
76-
omega
76+
lia
7777

7878
/-- Putting this inline causes a deep recursion error, so we separate it out. -/
7979
private lemma helper_5_digits {c : ℤ} (hc : 6 * 10 ^ 5 + c = 4 * (10 * c + 6)) : c = 15384 := by
80-
omega
80+
lia
8181

8282
lemma case_5_digits {c n : ℕ} (hc : (digits 10 c).length = 5) (hpp : ProblemPredicate' c n) :
8383
c = 15384 := by

Archive/Imo/Imo1985Q2.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,22 @@ lemma C_mul_mod {n j : ℕ} (hn : 3 ≤ n) (hj : j ∈ Set.Ico 1 n) (cpj : Nat.C
5151
have nej : (k + 1) * j % n ≠ j := by
5252
by_contra! h; nth_rw 2 [← Nat.mod_eq_of_lt hj.2, ← one_mul j] at h
5353
replace h : (k + 1) % n = 1 % n := Nat.ModEq.cancel_right_of_coprime cpj h
54-
rw [Nat.mod_eq_of_lt hk.2, Nat.mod_eq_of_lt (by omega)] at h
55-
omega
54+
rw [Nat.mod_eq_of_lt hk.2, Nat.mod_eq_of_lt (by lia)] at h
55+
lia
5656
have b₁ : (k + 1) * j % n ∈ Set.Ico 1 n := by
57-
refine ⟨?_, Nat.mod_lt _ (by omega)⟩
57+
refine ⟨?_, Nat.mod_lt _ (by lia)⟩
5858
by_contra! h; rw [Nat.lt_one_iff, ← Nat.dvd_iff_mod_eq_zero] at h
5959
have ek := Nat.eq_zero_of_dvd_of_lt (cpj.dvd_of_dvd_mul_right h) hk.2
60-
omega
60+
lia
6161
rw [← ih ⟨hk₁, Nat.lt_of_succ_lt hk.2⟩, hC.2 _ b₁ nej]
6262
rcases nej.lt_or_gt with h | h
6363
· rw [Int.natAbs_natCast_sub_natCast_of_ge h.le]
6464
have b₂ : j - (k + 1) * j % n ∈ Set.Ico 1 n :=
6565
⟨Nat.sub_pos_iff_lt.mpr h, (Nat.sub_le ..).trans_lt hj.2
6666
have q : n - (j - (k + 1) * j % n) = (k + 1) * j % n + (n - j) % n := by
6767
rw [tsub_tsub_eq_add_tsub_of_le h.le, add_comm, Nat.add_sub_assoc hj.2.le,
68-
Nat.mod_eq_of_lt (show n - j < n by omega)]
69-
rw [hC.1 _ b₂, q, ← Nat.add_mod_of_add_mod_lt (by omega), ← Nat.add_sub_assoc hj.2.le,
68+
Nat.mod_eq_of_lt (show n - j < n by lia)]
69+
rw [hC.1 _ b₂, q, ← Nat.add_mod_of_add_mod_lt (by lia), ← Nat.add_sub_assoc hj.2.le,
7070
add_comm, Nat.add_sub_assoc (Nat.le_mul_of_pos_left _ hk.1), ← tsub_one_mul,
7171
Nat.add_mod_left, add_tsub_cancel_right]
7272
· rw [Int.natAbs_natCast_sub_natCast_of_le h.le, Nat.mod_sub_of_le h.le]
@@ -75,13 +75,13 @@ lemma C_mul_mod {n j : ℕ} (hn : 3 ≤ n) (hj : j ∈ Set.Ico 1 n) (cpj : Nat.C
7575
theorem result {n j : ℕ} (hn : 3 ≤ n) (hj : j ∈ Set.Ico 1 n) (cpj : Coprime n j)
7676
{C : ℕ → Fin 2} (hC : Condition n j C) {i : ℕ} (hi : i ∈ Set.Ico 1 n) :
7777
C i = C j := by
78-
obtain ⟨v, -, hv⟩ := exists_mul_mod_eq_one_of_coprime cpj.symm (by omega)
78+
obtain ⟨v, -, hv⟩ := exists_mul_mod_eq_one_of_coprime cpj.symm (by lia)
7979
have hvi : i = (v * i % n) * j % n := by
8080
rw [mod_mul_mod, ← mul_rotate, ← mod_mul_mod, hv, one_mul, mod_eq_of_lt hi.2]
8181
have vib : v * i % n ∈ Set.Ico 1 n := by
82-
refine ⟨(?_ : 0 < _), mod_lt _ (by omega)⟩
82+
refine ⟨(?_ : 0 < _), mod_lt _ (by lia)⟩
8383
by_contra! h; rw [le_zero, ← dvd_iff_mod_eq_zero] at h
84-
rw [mul_comm, ← mod_eq_of_lt (show 1 < n by omega)] at hv
84+
rw [mul_comm, ← mod_eq_of_lt (show 1 < n by lia)] at hv
8585
have i0 := eq_zero_of_dvd_of_lt
8686
((coprime_of_mul_modEq_one _ hv).symm.dvd_of_dvd_mul_left h) hi.2
8787
subst i; simp at hi

Archive/Imo/Imo1988Q6.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ theorem imo1988_q6 {a b : ℕ} (h : a * b + 1 ∣ a ^ 2 + b ^ 2) :
239239
· contrapose! hV₀ with x_lt_z
240240
apply ne_of_gt
241241
calc
242-
z * y > x * x := by apply mul_lt_mul' <;> omega
242+
z * y > x * x := by apply mul_lt_mul' <;> lia
243243
_ ≥ x * x - k := sub_le_self _ (Int.natCast_nonneg k)
244244
· -- There is no base case in this application of Vieta jumping.
245245
simp
@@ -276,16 +276,16 @@ example {a b : ℕ} (h : a * b ∣ a ^ 2 + b ^ 2 + 1) : 3 * a * b = a ^ 2 + b ^
276276
constructor
277277
· have zy_pos : z * y ≥ 0 := by rw [hV₀]; exact mod_cast Nat.zero_le _
278278
apply nonneg_of_mul_nonneg_left zy_pos
279-
omega
279+
lia
280280
· contrapose! hV₀ with x_lt_z
281281
apply ne_of_gt
282282
push_neg at h_base
283283
calc
284-
z * y > x * y := by apply mul_lt_mul_of_pos_right <;> omega
285-
_ ≥ x * (x + 1) := by apply mul_le_mul <;> omega
284+
z * y > x * y := by apply mul_lt_mul_of_pos_right <;> lia
285+
_ ≥ x * (x + 1) := by apply mul_le_mul <;> lia
286286
_ > x * x + 1 := by
287287
rw [mul_add]
288-
omega
288+
lia
289289
· -- Show the base case.
290290
intro x y h h_base
291291
obtain rfl | rfl : x = 0 ∨ x = 1 := by rwa [Nat.le_add_one_iff, Nat.le_zero] at h_base

Archive/Imo/Imo1994Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ theorem tedious (m : ℕ) (k : Fin (m + 1)) : m - ((m + 1 - ↑k) + m) % (m + 1)
3737
rcases hk with ⟨c, rfl⟩
3838
have : (k + c + 1 - k) + (k + c) = c + (k + c + 1) := by lia
3939
rw [Fin.val_mk, this, Nat.add_mod_right, Nat.mod_eq_of_lt, Nat.add_sub_cancel]
40-
omega
40+
lia
4141

4242
end Imo1994Q1
4343

Archive/Imo/Imo1997Q3.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ lemma sign_eq_of_contra
7474
| one => rfl
7575
| mul_right p s sform ih =>
7676
suffices |S x p - S x (p * s)| ≤ (n + 1 : ℕ) + 1 by
77-
rw [ih]; exact sign_eq_of_abs_sub_le (h _) (h _) (by norm_cast; omega) this
77+
rw [ih]; exact sign_eq_of_abs_sub_le (h _) (h _) (by norm_cast; lia) this
7878
rw [Set.mem_range] at sform; obtain ⟨i, hi⟩ := sform
7979
iterate 2 rw [S, ← sum_add_sum_compl {i.castSucc, i.succ}]
8080
have cg : ∑ j ∈ {i.castSucc, i.succ}ᶜ, (j + 1) * x ((p * s) j) =
@@ -99,16 +99,16 @@ lemma S_one_add_S_revPerm
9999
nth_rw 2 [S]; rw [← revPerm.sum_comp _ _ (by simp)]
100100
simp_rw [revPerm_apply, val_rev, rev_rev, S, Perm.one_apply, ← sum_add_distrib, ← add_mul]
101101
have cg : ∑ i : Fin n, (i + 1 + ((n - (i + 1) : ℕ) + 1)) * x i = ∑ i, (n + 1) * x i := by
102-
congr! 2 with i; norm_cast; omega
103-
rw [cg, ← mul_sum, abs_mul, hx₁, mul_one]; exact abs_of_nonneg (by norm_cast; omega)
102+
congr! 2 with i; norm_cast; lia
103+
rw [cg, ← mul_sum, abs_mul, hx₁, mul_one]; exact abs_of_nonneg (by norm_cast; lia)
104104

105105
theorem result {x : Fin n → ℝ} (hx₁ : |∑ i, x i| = 1) (hx₂ : ∀ i, |x i| ≤ (n + 1) / 2) :
106106
∃ p, |S x p| ≤ (n + 1) / 2 := by
107107
match n with
108108
| 0 => simp [S]
109109
| n + 1 =>
110110
by_contra! h
111-
exact (lt_abs_add_of_sign_eq (h _) (h _) (by norm_cast; omega)
111+
exact (lt_abs_add_of_sign_eq (h _) (h _) (by norm_cast; lia)
112112
(sign_eq_of_contra hx₂ h _)).ne' (S_one_add_S_revPerm hx₁)
113113

114114
end Imo1997Q3

Archive/Imo/Imo2001Q3.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ lemma card_not_easy_le_five {i : Fin 21} (hG : #(G i) ≤ 6) (hB : ∀ j, ¬Disj
6666
_ = #((G i).biUnion fun p ↦ {j | p ∈ B j}) := by congr 1; ext j; simp [not_disjoint_iff]
6767
_ ≤ ∑ p ∈ G i, #{j | p ∈ B j} := card_biUnion_le
6868
_ ≤ ∑ p ∈ G i, 2 := sum_le_sum fun p mp ↦ Nat.le_of_lt_succ (h p mp)
69-
_ ≤ _ := by rw [sum_const, smul_eq_mul]; omega
69+
_ ≤ _ := by rw [sum_const, smul_eq_mul]; lia
7070

7171
open Classical in
7272
/-- There are at most 210 girl-boy pairs who solved some problem in common that was not easy for

0 commit comments

Comments
 (0)