Skip to content

Commit 5342697

Browse files
committed
Merge remote-tracking branch 'upstream/master' into batteries-pr-testing-1545
2 parents 7c7ae20 + 43dc3a9 commit 5342697

File tree

1,084 files changed

+20779
-11967
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,084 files changed

+20779
-11967
lines changed

Archive/Imo/Imo1994Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ theorem tedious (m : ℕ) (k : Fin (m + 1)) : m - ((m + 1 - ↑k) + m) % (m + 1)
3535
obtain ⟨k, hk⟩ := k
3636
rw [Nat.lt_succ_iff, le_iff_exists_add] at hk
3737
rcases hk with ⟨c, rfl⟩
38-
have : (k + c + 1 - k) + (k + c) = c + (k + c + 1) := by cutsat
38+
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]
4040
omega
4141

Archive/Wiedijk100Theorems/Partition.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ theorem partialOddGF_prop [Field α] (n m : ℕ) :
269269
/-- If m is big enough, the partial product's coefficient counts the number of odd partitions -/
270270
theorem oddGF_prop [Field α] (n m : ℕ) (h : n < m * 2) :
271271
#(Nat.Partition.odds n) = coeff n (partialOddGF α m) := by
272-
rw [← partialOddGF_prop, Nat.Partition.odds]
272+
rw [← partialOddGF_prop, Nat.Partition.odds, Nat.Partition.restricted]
273273
congr with p
274274
apply forall₂_congr
275275
intro i hi

Counterexamples/AharoniKorman.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,8 @@ theorem scattered {f : ℚ → Hollom} (hf : StrictMono f) : False := by
322322
-- Take `x ≠ y` with `g x = g y`
323323
obtain ⟨x, y, hgxy, hxy'⟩ : ∃ x y, g x = g y ∧ x ≠ y := by simpa [Function.Injective] using hg''
324324
-- and wlog `x < y`
325-
wlog hxy : x < y generalizing x y
326-
· simp only [not_lt] at hxy
327-
exact this y x hgxy.symm hxy'.symm (lt_of_le_of_ne' hxy hxy')
325+
wlog! hxy : x < y generalizing x y
326+
· exact this y x hgxy.symm hxy'.symm (lt_of_le_of_ne' hxy hxy')
328327
-- Now `f '' [x, y]` is infinite, as it is the image of an infinite set of rationals,
329328
have h₁ : (f '' Set.Icc x y).Infinite := (Set.Icc_infinite hxy).image hf.injective.injOn
330329
-- but it is contained in `[f x, f y]` by monotonicity

Counterexamples/EulerSumOfPowers.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ theorem fermatLastTheoremWith_of_sumOfPowersConjectureWith (R : Type*) [Semiring
4646
∀ n ≥ 3, SumOfPowersConjectureWith R n → FermatLastTheoremWith R n := by
4747
intro n hn conj a b c ha hb hc hsum
4848
have : n ≤ 2 := conj [a, b] c (by simp) (by simp [ha.symm, hb.symm]) hc (by simpa)
49-
cutsat
49+
lia
5050

5151
/-- Euler's sum of powers conjecture over the naturals implies FLT. -/
5252
theorem fermatLastTheorem_of_sumOfPowersConjecture : SumOfPowersConjecture → FermatLastTheorem :=
@@ -58,7 +58,7 @@ theorem sumOfPowersConjectureWith_three_iff_fermatLastTheoremWith_three (R : Typ
5858
refine ⟨fermatLastTheoremWith_of_sumOfPowersConjectureWith R 3 (by rfl), ?_⟩
5959
intro FLT a b ha ha₀ hb₀ hsum
6060
contrapose! hsum
61-
have ⟨x, y, hxy⟩ := a.length_eq_two.mp <| by cutsat
61+
have ⟨x, y, hxy⟩ := a.length_eq_two.mp <| by lia
6262
simp [hxy, FLT x y b (by grind) (by grind) hb₀]
6363

6464
/-- Euler's sum of powers conjecture over the naturals is true for `n ≤ 3`. -/
@@ -67,7 +67,7 @@ theorem sumOfPowersConjectureFor_le_three : ∀ n ≤ 3, SumOfPowersConjectureFo
6767
by_cases h3 : n = 3
6868
· exact h3 ▸ (sumOfPowersConjectureWith_three_iff_fermatLastTheoremWith_three _).mpr
6969
fermatLastTheoremThree
70-
cutsat
70+
lia
7171

7272
/-- Given a ring homomorphism from `R` to `S` with no nontrivial zeros,
7373
the conjecture over `S` implies the conjecture over `R`. -/
@@ -96,7 +96,7 @@ theorem sumOfPowersConjectureFor_five_false : ¬SumOfPowersConjectureFor 5 := by
9696
let a := [27, 84, 110, 133]
9797
let b := 144
9898
have : 54 := conj a b (by simp [a]) (by simp [a]) (by simp) (by decide)
99-
cutsat
99+
lia
100100

101101
/--
102102
The first counterexample for `n = 4` was found by Noam D. Elkies in October 1988:
@@ -112,7 +112,7 @@ theorem sumOfPowersConjectureFor_four_false : ¬SumOfPowersConjectureFor 4 := by
112112
let a := [95_800, 217_519, 414_560]
113113
let b := 422_481
114114
have : 43 := conj a b (by simp [a]) (by simp [a]) (by simp) (by decide)
115-
cutsat
115+
lia
116116

117117
/--
118118
For all `(k, m, n)` we define the Diophantine equation `∑ x_i ^ k = ∑ y_i ^ k`
@@ -130,7 +130,7 @@ theorem existsEqualSumsOfLikePowersFor_of_sumOfPowersConjectureWith (R : Type*)
130130
intro conj ⟨x, y, hx, hy, hx₀, hy₀, hdisj, hsum⟩
131131
simp only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, add_zero,
132132
List.eq_cons_of_length_one hy] at hsum
133-
exact hx ▸ conj x (y.get ⟨0, _⟩) (by cutsat) hx₀ (by grind) hsum
133+
exact hx ▸ conj x (y.get ⟨0, _⟩) (by lia) hx₀ (by grind) hsum
134134

135135
/--
136136
After the first counterexample was found, Leon J. Lander, Thomas R. Parkin, and John Selfridge
@@ -149,6 +149,6 @@ theorem LanderParkinSelfridgeConjecture_of_sumOfPowersConjectureWith (R : Type*)
149149
SumOfPowersConjectureWith R k → LanderParkinSelfridgeConjecture R k m 1 := by
150150
intro conj hsum
151151
have := existsEqualSumsOfLikePowersFor_of_sumOfPowersConjectureWith R k m hm conj hsum
152-
cutsat
152+
lia
153153

154154
end Counterexample

0 commit comments

Comments
 (0)