Skip to content

Commit dcfea10

Browse files
committed
Update to leanprover/lean4:v4.26.0-rc1, fixing compilation
All the tests pass again!
1 parent 5b6da2f commit dcfea10

File tree

19 files changed

+55
-66
lines changed

19 files changed

+55
-66
lines changed

Interval/EulerMaclaurin/Bernoulli.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ lemma pres_eq_reflect {s : ℕ} {x y b : ℝ} :
434434
replace q := (q x).mp e
435435
have ne : x ≠ (1 + s) / 2 := by
436436
contrapose xh
437-
simp only [ne_eq, not_not] at xh
438437
simp only [xh, Real.sqrt_inv, not_lt, s]
439438
simp only [Real.sqrt_inv, s] at xh
440439
rw [le_div_iff₀]

Interval/EulerMaclaurin/LHopital.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ theorem lhopital_field {f g : 𝕜 → 𝕜} {a f' g' : 𝕜} (df : HasDerivAt f
5959
_ = 2⁻¹ * ‖g'‖ * ‖y‖ := by ring
6060
have dg0 : g x ≠ 0 := by
6161
contrapose lo
62-
simp only [ne_eq, not_not] at lo
6362
simp only [lo, norm_zero, ge_iff_le, not_le]
6463
bound
6564
calc ‖f x / g x - f' / g'‖

Interval/Fixed.lean

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ lemma Fixed.neg_def (x : Fixed s) : -x = x.neg := rfl
104104
/-- The contrapose of `-nan = nan` -/
105105
@[simp] lemma Fixed.ne_nan_of_neg {x : Fixed s} (h : -x ≠ nan) : x ≠ nan := by
106106
contrapose h
107-
simp only [ne_eq, not_not] at h
108-
simp only [h, neg_nan, ne_eq, not_true_eq_false, not_false_eq_true]
107+
simp only [h, neg_nan]
109108

110109
/-- `Fixed` addition saturates to `nan` -/
111110
@[irreducible] def Fixed.add (x y : Fixed s) :=
@@ -201,15 +200,15 @@ lemma Fixed.add_comm (x y : Fixed s) : x + y = y + x := by
201200
lemma Fixed.ne_nan_of_add {x y : Fixed s} (h : x + y ≠ nan) : x ≠ nan ∧ y ≠ nan := by
202201
contrapose h; simp only [not_and_or, not_not] at h
203202
cases' h with h h
204-
· simp only [h, nan_add, ne_eq, not_true, not_false_eq_true]
205-
· simp only [h, add_nan, ne_eq, not_true, not_false_eq_true]
203+
· simp only [h, nan_add]
204+
· simp only [h, add_nan]
206205

207206
/-- If `x - y ≠ nan`, neither `x` or `y` are `nan` -/
208207
lemma Fixed.ne_nan_of_sub {x y : Fixed s} (h : x - y ≠ nan) : x ≠ nan ∧ y ≠ nan := by
209208
contrapose h; simp only [not_and_or, not_not] at h
210209
cases' h with h h
211-
· simp only [h, nan_sub, ne_eq, not_true, not_false_eq_true]
212-
· simp only [h, sub_nan, ne_eq, not_true, not_false_eq_true]
210+
· simp only [h, nan_sub]
211+
· simp only [h, sub_nan]
213212

214213
/-- `Fixed.val` commutes with negation, except at `nan` -/
215214
lemma Fixed.val_neg {x : Fixed s} (xn : x ≠ nan) : (-x).val = -x.val := by
@@ -346,7 +345,6 @@ lemma Fixed.neg_add {x y : Fixed s} : -(x + y) = -y + -x := by
346345
· simp only [not_lt, xym, Int64.isNeg_min, iff_true, Int64.neg_min, ite_self]
347346
· have xy0 : x.n + y.n ≠ 0 := by
348347
contrapose xyn
349-
simp only [not_not] at xyn
350348
simp only [eq_neg_iff_add_eq_zero.mpr xyn, Int64.isNeg_neg y0 yn, ← not_le, iff_not_self,
351349
not_false_eq_true]
352350
simp only [Int64.isNeg_neg xy0 xym, ite_not, ← not_iff]
@@ -559,7 +557,7 @@ lemma Fixed.val_nan : (nan : Fixed s).val = -(2:ℝ) ^ (s + 63 : ℤ) := by
559557

560558
/-- Positive `Fixed`s are `≠ nan` -/
561559
lemma Fixed.ne_nan_of_pos {x : Fixed s} (h : 0 < x.val) : x ≠ nan := by
562-
contrapose h; rw [not_not] at h; simp only [not_lt, h, val_nan_neg.le]
560+
contrapose h; simp only [not_lt, h, val_nan_neg.le]
563561

564562
/-!
565563
### `Fixed` multiplication, rounding up or down
@@ -1109,8 +1107,7 @@ lemma Fixed.approx_two_pow (n : Fixed 0) (up : Bool) :
11091107
@[simp] lemma Fixed.ne_nan_of_two_pow {n : Fixed 0} {up : Bool}
11101108
(h : (two_pow n up : Fixed s) ≠ nan) : n ≠ nan := by
11111109
contrapose h
1112-
simp only [ne_eq, not_not] at h
1113-
simp only [h, two_pow_nan, ne_eq, not_true_eq_false, not_false_eq_true]
1110+
simp only [h, two_pow_nan]
11141111

11151112
/-- `Fixed.approx_two_pow`, down version -/
11161113
lemma Fixed.two_pow_le {n : Fixed 0} (h : (.two_pow n false : Fixed s) ≠ nan) :

Interval/Floating/Add.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ lemma add_n_norm (r : UInt128) (s : UInt64) (up : Bool) :
246246
rw [Nat.le_div_iff_mul_le (by positivity), ←pow_add]
247247
refine adjust_le_mul ?_ (UInt64.ne_zero_iff_toNat_ne_zero.mp s0)
248248
contrapose r0
249-
simp only [ne_eq, not_not, ←UInt128.eq_zero_iff] at r0 ⊢
249+
simp only [UInt128.eq_zero_iff] at r0 ⊢
250250
rw [add_n]
251251
simp only [r0, UInt128.log2_zero, UInt128.zero_lo, UInt64.zero_shiftLeft,
252252
UInt128.zero_shiftRightRound, ite_self]
@@ -264,7 +264,9 @@ lemma valid_small_shift1 {n s : UInt64} (n63 : n ≠ 2^63) (n0 : n ≠ 0)
264264
(n_le : n.toNat ≤ 2^63)
265265
: Valid n.toInt64 s where
266266
zero_same := by
267-
intro z; clear n63; contrapose n0; rw [Int64.ext_iff] at z; exact not_not.mpr z
267+
intro z
268+
contrapose n0
269+
simpa only [Int64.ext_iff, UInt64.toUInt64_toInt64, Int64.n_zero] using z
268270
nan_same := by
269271
intro m
270272
rw [Int64.ext_iff, UInt64.toUInt64_toInt64, Int64.n_min] at m

Interval/Floating/Basic.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,18 @@ lemma val_nan : (nan : Floating).val = -(2 ^ 63) * 2 ^ (2 ^ 63 - 1) := by
191191
/-- If we're not nan, `x.n ≠ .min` -/
192192
lemma n_ne_min {x : Floating} (n : x ≠ nan) : x.n ≠ .minValue := by
193193
contrapose n
194-
simp only [ne_eq, not_not, ext_iff, n_nan, s_nan, not_and, not_forall, exists_prop] at n ⊢
194+
simp only [ext_iff, n_nan, s_nan] at n ⊢
195195
exact ⟨n, x.nan_same n⟩
196196

197197
/-- If we're not zero, `x.n ≠ 0` -/
198198
lemma n_ne_zero {x : Floating} (n : x ≠ 0) : x.n ≠ 0 := by
199199
contrapose n
200-
simp only [ne_eq, not_not, ext_iff, not_and, not_forall, exists_prop] at n ⊢
200+
simp only [ext_iff] at n ⊢
201201
exact ⟨n, x.zero_same n⟩
202202

203203
/-- If `x.s ≠ 0`, `x.n ≠ 0` -/
204204
lemma n_ne_zero' {x : Floating} (n : x.s ≠ 0) : x.n ≠ 0 := by
205205
contrapose n
206-
simp only [ne_eq, not_not] at n ⊢
207206
simp only [x.zero_same n]
208207

209208
/-- `x.n = 0` exactly at 0 -/
@@ -271,8 +270,8 @@ lemma val_of_nonneg {x : Floating} (x0 : 0 ≤ x.val) :
271270
x.val = (x.n.toUInt64.toNat : ℝ) * 2^((x.s.toNat : ℤ) - 2^63) := by
272271
rw [val, UInt64.toInt, Int64.coe_of_nonneg, Int.cast_natCast]
273272
rw [val] at x0
274-
simpa only [Int64.isNeg_eq_le, decide_eq_false_iff_not, not_le, gt_iff_lt, two_zpow_pos,
275-
mul_nonneg_iff_of_pos_right, Int.cast_nonneg, Int64.coe_nonneg_iff] using x0
273+
simpa only [Int.reducePow, two_zpow_pos, mul_nonneg_iff_of_pos_right, Int.cast_nonneg_iff,
274+
Int64.coe_nonneg_iff] using x0
276275

277276
/-!
278277
### The smallest normalized value

Interval/Floating/Floor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace Floating
4343
rw [floor]; simp only [beq_self_eq_true, s_nan, Bool.true_or, n_nan, cond_true]
4444

4545
@[simp] lemma ne_nan_of_floor {x : Floating} (n : x.floor ≠ nan) : x ≠ nan := by
46-
contrapose n; simp only [not_not] at n; simp [n]
46+
contrapose n; simp [n]
4747

4848
lemma floor_mono {x y : Floating} (le : x ≤ y) (yn : y.floor ≠ nan) : x.floor ≤ y.floor := by
4949
by_cases xn : x.floor = nan

Interval/Floating/Mul.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ lemma mul_norm_correct (n : UInt128) (up : Bool) (n0 : n ≠ 0) (lo : n.toNat
129129
rw [Nat.one_le_iff_ne_zero]
130130
contrapose r_eq
131131
apply ne_of_lt
132-
simp only [ne_eq, not_not] at r_eq
133132
simp only [r_eq, pow_zero, mul_one, ← UInt128.eq_iff_toNat_eq] at hz
134133
simp only [UInt64.lt_iff_toNat_lt, ←hz, ←hr, UInt64.toNat_2_pow_63]
135134
simp only [UInt128.toNat_def, mul_n_max] at lo

Interval/Floating/Order.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ lemma isNeg_iff' {x : Floating} : x.n < 0 ↔ x < 0 := by
191191
· simp only [x0, s_zero, ne_eq, not_true_eq_false] at s0
192192
have xm : x.n ≠ .minValue := by
193193
contrapose xn
194-
simp only [ne_eq, not_not] at xn
195194
simp only [xn]
196195
decide
197196
have e : (2^62 : ℝ) = (2^62 : ℤ) := by norm_num
@@ -227,7 +226,7 @@ lemma isNeg_iff' {x : Floating} : x.n < 0 ↔ x < 0 := by
227226
UInt64.lt_iff_toNat_lt, UInt64.toNat_max, UInt64.toNat_2_pow_63, true_and, false_or]
228227
simp only [Int64.isNeg_eq_le] at xn
229228
contrapose n
230-
simp only [not_or, not_lt, tsub_le_iff_right, not_and, not_not] at n ⊢
229+
simp only [not_or, not_lt, tsub_le_iff_right, not_and] at n ⊢
231230
have se : x.s = .max := by
232231
simp only [UInt64.eq_iff_toNat_eq, UInt64.toNat_max]
233232
have h := x.s.toNat_le_pow_sub_one
@@ -283,7 +282,7 @@ lemma isNeg_iff' {x : Floating} : x.n < 0 ↔ x < 0 := by
283282
rw [val]; symm
284283
by_cases xn : x.n < 0
285284
· simp only [xn, ← not_le, mul_nonneg_iff_of_pos_right (two_zpow_pos (𝕜 := ℝ)), iff_true]
286-
simpa only [Int.cast_nonneg, not_le, Int64.coe_lt_zero_iff]
285+
simpa only [Int.cast_nonneg_iff, Int64.coe_nonneg_iff, not_le]
287286
· simp only [xn, not_lt, two_zpow_pos, mul_nonneg_iff_of_pos_right, Int.cast_nonneg,
288287
Int64.coe_nonneg_iff, iff_false, not_lt.mp xn]
289288

@@ -412,11 +411,11 @@ instance : LinearOrder Floating where
412411
simpa only [val_le_val, val_zero, not_lt] using nan_lt_zero.le
413412

414413
lemma ne_nan_of_nonneg {x : Floating} (n : 0 ≤ x.val) : x ≠ nan := by
415-
contrapose n; simp only [ne_eq, not_not] at n; simp only [n, not_nan_nonneg, not_false_eq_true]
414+
contrapose n; simp only [n, not_nan_nonneg, not_false_eq_true]
416415

417416
lemma ne_nan_of_le {x y : Floating} (n : x ≠ nan) (le : x.val ≤ y.val) : y ≠ nan := by
418417
contrapose n
419-
simp only [ne_eq, not_not, ←val_inj] at n ⊢
418+
simp only [val_inj] at n ⊢
420419
simp only [n] at le
421420
exact le_antisymm le (val_nan_le _)
422421

Interval/Floating/Scale.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ lemma val_scaleB {x : Floating} {t : Int64} (n : x.scaleB t ≠ nan) :
7474

7575
/-- `scaleB` propagates `nan` -/
7676
@[simp] lemma ne_nan_of_scaleB {x : Floating} {t : Int64} (n : x.scaleB t ≠ nan) : x ≠ nan := by
77-
contrapose n; simp only [ne_eq, not_not] at n
78-
simp only [n, nan_scaleB, ne_eq, not_true_eq_false, not_false_eq_true]
77+
contrapose n
78+
simp only [n, nan_scaleB]
7979

8080
/-!
8181
### Dividing by two

Interval/Int64.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ lemma Int64.toInt_ofInt' {n : ℤ} (h : |n| < 2^63) : ((n : Int64) : ℤ) = n :=
363363
· simp [n0]
364364
have d : ¬((2 * a : ℕ) : ℤ) ∣ n := by
365365
contrapose h
366-
simp only [Decidable.not_not, not_lt, Int.natCast_dvd, Int.natAbs_natCast] at h ⊢
366+
simp only [not_lt, Int.natCast_dvd, Int.natAbs_natCast] at h ⊢
367367
linarith [Nat.le_of_dvd (Nat.pos_iff_ne_zero.mpr n0) h]
368368
have lt : n < 2 * a := by omega
369369
simp only [Int.neg_emod, d, ite_false, Int.ofNat_mod_ofNat]
@@ -927,7 +927,6 @@ lemma Int64.abs_shiftRightRound_le (x : Int64) (s : UInt64) (up : Bool) :
927927
lemma Int64.shiftRightRound_ne_min {x : Int64} (n : x ≠ minValue) (s : UInt64) (up : Bool) :
928928
x.shiftRightRound s up ≠ minValue := by
929929
contrapose n
930-
simp only [ne_eq, Decidable.not_not] at n ⊢
931930
have h := abs_shiftRightRound_le x s up
932931
simp only [n, coe_min', _root_.abs_neg, abs_pow, abs_two, le_abs] at h
933932
rcases h with h | h

0 commit comments

Comments
 (0)