Skip to content

Commit 9b48b5b

Browse files
committed
more deprecations for leanprover/lean4#10967
1 parent b773adb commit 9b48b5b

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

Archive/Imo/Imo1988Q6.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ theorem imo1988_q6 {a b : ℕ} (h : a * b + 1 ∣ a ^ 2 + b ^ 2) :
233233
rw [← sub_eq_zero, ← h_root]
234234
ring
235235
rw [hzx] at hpos
236-
replace hpos : z * x + 1 > 0 := pos_of_mul_pos_left hpos (Int.ofNat_zero_le k)
236+
replace hpos : z * x + 1 > 0 := pos_of_mul_pos_left hpos (Int.natCast_nonneg k)
237237
replace hpos : z * x ≥ 0 := Int.le_of_lt_add_one hpos
238238
apply nonneg_of_mul_nonneg_left hpos (mod_cast hx)
239239
· contrapose! hV₀ with x_lt_z
240240
apply ne_of_gt
241241
calc
242242
z * y > x * x := by apply mul_lt_mul' <;> omega
243-
_ ≥ x * x - k := sub_le_self _ (Int.ofNat_zero_le k)
243+
_ ≥ x * x - k := sub_le_self _ (Int.natCast_nonneg k)
244244
· -- There is no base case in this application of Vieta jumping.
245245
simp
246246

Archive/Imo/Imo2024Q5.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ lemma Path.findFstEq_fst_sub_one_mem (p : Path N) {r : Fin (N + 2)} (hr : r ≠
387387
rw [← cells.takeWhile_append_dropWhile (p := fun c ↦ ! decide (r ≤ c.1)),
388388
List.isChain_append] at valid_move_seq
389389
have ha := valid_move_seq.2.2
390-
simp only [List.head?_eq_head hd', List.getLast?_eq_getLast ht, Option.mem_def,
390+
simp only [List.head?_eq_some_head hd', List.getLast?_eq_some_getLast ht, Option.mem_def,
391391
Option.some.injEq, forall_eq'] at ha
392392
nth_rw 1 [← cells.takeWhile_append_dropWhile (p := fun c ↦ ! decide (r ≤ c.1))]
393393
refine List.mem_append_left _ ?_

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,17 @@ theorem counted_succ_succ (p q : ℕ) :
114114
obtain ⟨hl₀, hl₁, hl₂⟩ := hl
115115
obtain hlast | hlast := hl₂ (l.head hlnil) (List.head_mem hlnil)
116116
· refine Or.inl ⟨l.tail, ⟨?_, ?_, ?_⟩, ?_⟩
117-
· rw [List.count_tail, hl₀, List.head?_eq_head hlnil, hlast, beq_self_eq_true, if_pos rfl,
118-
Nat.add_sub_cancel]
119-
· rw [List.count_tail, hl₁, List.head?_eq_head hlnil, hlast, if_neg (by decide), Nat.sub_zero]
117+
· rw [List.count_tail, hl₀, List.head?_eq_some_head hlnil, hlast, beq_self_eq_true,
118+
if_pos rfl, Nat.add_sub_cancel]
119+
· rw [List.count_tail, hl₁, List.head?_eq_some_head hlnil, hlast, if_neg (by decide),
120+
Nat.sub_zero]
120121
· exact fun x hx => hl₂ x (List.mem_of_mem_tail hx)
121122
· rw [← hlast, List.cons_head_tail]
122123
· refine Or.inr ⟨l.tail, ⟨?_, ?_, ?_⟩, ?_⟩
123-
· rw [List.count_tail, hl₀, List.head?_eq_head hlnil, hlast, if_neg (by decide), Nat.sub_zero]
124-
· rw [List.count_tail, hl₁, List.head?_eq_head hlnil, hlast, beq_self_eq_true, if_pos rfl,
125-
Nat.add_sub_cancel]
124+
· rw [List.count_tail, hl₀, List.head?_eq_some_head hlnil, hlast, if_neg (by decide),
125+
Nat.sub_zero]
126+
· rw [List.count_tail, hl₁, List.head?_eq_some_head hlnil, hlast, beq_self_eq_true,
127+
if_pos rfl, Nat.add_sub_cancel]
126128
· exact fun x hx => hl₂ x (List.mem_of_mem_tail hx)
127129
· rw [← hlast, List.cons_head_tail]
128130
· rintro (⟨t, ⟨ht₀, ht₁, ht₂⟩, rfl⟩ | ⟨t, ⟨ht₀, ht₁, ht₂⟩, rfl⟩)

MathlibTest/ExtractGoal.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ example : ∀ n, n < n + 1 := by
164164

165165
-- Throwing metavariables into the terms
166166
/--
167-
info: theorem _example.extracted_1 (m : ℕ) (this : m < m.succ.succ) : m < m + 1 := sorry
167+
info: theorem _example.extracted_1 (m : ℕ) (this : m < (m + 1).succ) : m < m + 1 := sorry
168168
---
169169
warning: declaration uses 'sorry'
170170
-/
171171
#guard_msgs in
172172
example : ∀ n, n < n + 1 := by
173173
intro m
174174
show _
175-
have : m < _ := Nat.lt.step (Nat.lt.base m)
175+
have : m < _ := Nat.lt_succ_of_lt (Nat.lt_add_one m)
176176
extract_goal
177177
sorry

MathlibTest/Have.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ example : True := by
3333
have _h : Nat
3434
· exact this
3535
have _h' x : x < x + 1
36-
· exact Nat.lt.base x
36+
· exact Nat.lt_add_one x
3737
have _h'' (x : Nat) : x < x + 1
38-
· exact Nat.lt.base x
38+
· exact Nat.lt_add_one x
3939
let _m
4040
· exact 6
4141
let _m' x (y : Nat) : x + y = y + x

MathlibTest/lift.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ example (n : ℤ) (hn : 0 ≤ n) : 0 ≤ n + 1 := by
2121
example (n : ℤ) (hn : 0 ≤ n) : 0 ≤ n + 1 := by
2222
lift n to ℕ using hn
2323
guard_target =ₛ 0 ≤ (n : Int) + 1
24-
exact Int.le_add_one (Int.ofNat_zero_le _)
24+
exact Int.le_add_one (Int.natCast_nonneg _)
2525

2626
example (n : ℤ) (hn : 0 ≤ n) : 0 ≤ n + 1 := by
2727
have hn' := hn

0 commit comments

Comments
 (0)