Skip to content

Commit b46f435

Browse files
committed
Update lean version
1 parent c39b9b7 commit b46f435

File tree

8 files changed

+46
-45
lines changed

8 files changed

+46
-45
lines changed

InferenceInLean/A_Syntax.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ lemma Term.freeVars_sub_freeVarsList [DecidableEq X] (t : Term sig X) :
324324
lemma Term.freeVarsList_sub_freeVars [DecidableEq X] (t : Term sig X) :
325325
↑(t.freeVarsList).toFinset ⊆ t.freeVars := by
326326
induction' t using Term.induction with x args ih f
327-
· simp_all only [freeVarsList, List.toFinset_cons, List.toFinset_nil, insert_emptyc_eq,
328-
Finset.coe_singleton, freeVars, subset_refl]
327+
· simp_all only [freeVarsList, List.toFinset_cons, List.toFinset_nil,
328+
LawfulSingleton.insert_empty_eq, Finset.coe_singleton, freeVars, subset_refl]
329329
· induction' args with arg args ih' generalizing f
330330
· simp_all only [List.not_mem_nil, List.coe_toFinset, IsEmpty.forall_iff, implies_true,
331331
freeVarsList, List.toFinset_nil, Finset.coe_empty, freeVars, subset_refl]

InferenceInLean/B_Semantics.lean

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def Formula.eval {sig : Signature} {X : Variables} {univ : Universes} [Decidable
8888

8989
lemma List.reduce_to_empty {α β: Type} {xs : List α} {as : List β}
9090
(hlen : xs.length = as.length) (hzero : as.length = 0 ∨ xs.length = 0) : xs = [] ∧ as = [] := by
91-
simp_all only [List.length_eq_zero, or_self, and_true, List.length_nil]
91+
simp_all only [List.length_eq_zero_iff, or_self, and_true, List.length_nil]
9292

9393
/-- This produces a modification β[x1 ↦ a1, ..., xn ↦ an] for an arbitrary amount of modified
9494
variables. -/
@@ -120,7 +120,7 @@ lemma Assignment.bigModify_single_eq {X : Variables} {univ : Universes} [Decidab
120120
rw [Assignment.bigModify]
121121
rw [Assignment.modify_comm x y a b (List.ne_of_not_mem_cons hx)]
122122
exact ih (β.modify y b) (List.Nodup.of_cons huniq) as
123-
(Nat.succ_inj'.mp hlen) x a (by exact List.not_mem_of_not_mem_cons hx)
123+
(Nat.succ_inj.mp hlen) x a (by exact List.not_mem_of_not_mem_cons hx)
124124

125125
/- β[x1 ↦ a1, ..., xn ↦ an, x ↦ a] = β[x1 ↦ a1, ..., xn ↦ an] [x ↦ a] -/
126126
@[simp]
@@ -159,7 +159,7 @@ lemma Assignment.bigModify_modify {X : Variables} {univ : Universes} [DecidableE
159159
(List.not_mem_of_not_mem_cons hxnotinxs)
160160
(by simp_all only [Assignment, List.nodup_cons, List.mem_cons, not_or, List.length_cons,
161161
Nat.add_right_cancel_iff])
162-
(by exact Nat.succ_inj'.mp hlen)
162+
(by exact Nat.succ_inj.mp hlen)
163163
rw [ih, modify_comm x y a b (Ne.symm (List.ne_of_not_mem_cons hxnotinxs))]
164164
| [], [] =>
165165
simp_all only [List.nodup_nil, List.not_mem_nil, not_false_eq_true, List.length_nil,
@@ -200,19 +200,19 @@ lemma Assignment.bigModify_sur {X : Variables} {univ : Universes} [DecidableEq X
200200
· match as with
201201
| [] => simp_all only [List.nodup_nil, List.not_mem_nil]
202202
| a' :: as' => simp_all only [List.nodup_nil, List.mem_cons, List.length_nil,
203-
List.length_cons, Nat.self_eq_add_left, Nat.add_one_ne_zero]
203+
List.length_cons, Nat.right_eq_add, Nat.add_one_ne_zero]
204204
· match as with
205205
| [] => simp_all only [Assignment, exists_prop, List.nodup_cons, List.not_mem_nil]
206206
| a' :: as' =>
207207
rw [Assignment.bigModify]
208208
apply List.mem_cons.mp at ha
209209
rcases ha with hfirst | has'
210210
· use x
211-
use (List.mem_cons_self x xs)
211+
use List.mem_cons_self
212212
rw [← hfirst]
213213
exact bigModify_single_eq
214-
β xs (List.Nodup.of_cons huniq) as' (Nat.succ_inj'.mp hlen) x a (List.Nodup.not_mem huniq)
215-
· specialize ih (β.modify x a') (List.Nodup.of_cons huniq) as' (has') (Nat.succ_inj'.mp hlen)
214+
β xs (List.Nodup.of_cons huniq) as' (Nat.succ_inj.mp hlen) x a (List.Nodup.not_mem huniq)
215+
· specialize ih (β.modify x a') (List.Nodup.of_cons huniq) as' (has') (Nat.succ_inj.mp hlen)
216216
rcases ih with ⟨x', ⟨hxinbounds, h⟩⟩
217217
use x'
218218
use (List.mem_cons_of_mem x hxinbounds)
@@ -221,7 +221,7 @@ lemma List.nodup_index_unique {α} [DecidableEq α] {l : List α} {a : α}
221221
(ha : a ∈ l) (huniq : l.Nodup) :
222222
∃ (i : ℕ) (hinbounds : i < l.length),
223223
l[i] = a ∧
224-
l[l.indexOf a]'(List.indexOf_lt_length.mpr ha) = a ∧
224+
l[l.idxOf a]'(List.idxOf_lt_length ha) = a ∧
225225
∀ (j : ℕ) (hjinbounds : j < l.length), l[j] = a → i = j := by
226226
have h := List.mem_iff_getElem.mp ha
227227
rcases h with ⟨i, ⟨hinbounds, hmem⟩⟩
@@ -230,7 +230,7 @@ lemma List.nodup_index_unique {α} [DecidableEq α] {l : List α} {a : α}
230230
subst hmem
231231
simp_all only [ne_eq, List.getElem_mem, true_and]
232232
split_ands
233-
· exact List.getElem_indexOf (List.indexOf_lt_length.mpr ha)
233+
· exact List.getElem_idxOf (List.idxOf_lt_length ha)
234234
· intro j hjinbounds heq
235235
exact (List.Nodup.getElem_inj_iff huniq).mp (id (Eq.symm heq))
236236

@@ -244,21 +244,22 @@ lemma Assignment.bigModify_single_index {X : Variables} {univ : Universes} [Deci
244244
induction' n using Nat.strong_induction_on with n ih generalizing β xs as i
245245
by_cases hnleone : n ≤ 1
246246
· by_cases hnzero : n = 0
247-
· have h : xs = [] := by rw [hnzero] at hn; exact List.length_eq_zero.mp (id (Eq.symm hn))
247+
· have h : xs = [] := by rw [hnzero] at hn; exact List.length_eq_zero_iff.mp (id (Eq.symm hn))
248248
exact False.elim (hnempty h)
249249
· simp at hnzero
250250
have hi : i = 0 := by omega
251251
subst i
252252
match xs, as with
253253
| x :: xs, a :: as =>
254-
have hlen : xs.length = as.length := Nat.succ_inj'.mp hlen
254+
have hlen : xs.length = as.length := Nat.succ_inj.mp hlen
255255
have hxs : xs.length = 0 := by
256256
clear ih huniq hnempty hiinbounds
257-
simp_all only [List.length_cons, Nat.reduceLeDiff, Nat.le_zero_eq, List.length_eq_zero,
258-
List.length_singleton, Nat.succ_ne_self, not_false_eq_true, List.length_nil]
257+
simp_all only [List.length_cons, Nat.reduceLeDiff, Nat.le_zero_eq,
258+
List.length_eq_zero_iff, List.length_singleton, Nat.succ_ne_self, not_false_eq_true,
259+
List.length_nil]
259260
have has : as.length = 0 := by rw [hlen] at hxs; exact hxs
260-
have hxempty : xs = [] := by exact List.length_eq_zero.mp hxs
261-
have haempty : as = [] := by exact List.length_eq_zero.mp has
261+
have hxempty : xs = [] := by exact List.length_eq_zero_iff.mp hxs
262+
have haempty : as = [] := by exact List.length_eq_zero_iff.mp has
262263
simp only [hxempty, haempty, bigModify, modify, List.getElem_cons_zero, ↓reduceIte]
263264
| [], [] => simp_all only [List.nodup_nil, ne_eq, not_true_eq_false]
264265
· apply not_le.mp at hnleone
@@ -278,7 +279,7 @@ lemma Assignment.bigModify_single_index {X : Variables} {univ : Universes} [Deci
278279
exact List.ne_nil_of_length_pos h2
279280
specialize ih (n - 1) (Nat.sub_one_lt_of_lt hnleone) (β.modify x a) xs
280281
(List.Nodup.of_cons huniq) as (Eq.symm (Nat.eq_sub_of_add_eq (id (Eq.symm hn))))
281-
(hxsnonempty) (Nat.succ_inj'.mp hlen) i (Nat.succ_lt_succ_iff.mp hiinbounds)
282+
(hxsnonempty) (Nat.succ_inj.mp hlen) i (Nat.succ_lt_succ_iff.mp hiinbounds)
282283
subst hn
283284
simp_all only [List.nodup_cons, ne_eq, reduceCtorEq, not_false_eq_true, List.length_cons,
284285
Nat.lt_add_left_iff_pos, bigModify, List.getElem_cons_succ]
@@ -301,14 +302,14 @@ lemma Assignment.bigModify_mem {X : Variables} {univ : Universes} [DecidableEq X
301302
(β : Assignment X univ) (xs : List X) (n : ℕ) (hn : n = xs.length) (hnempty : xs ≠ [])
302303
(as : List univ) (hlen : xs.length = as.length) (huniq : xs.Nodup) :
303304
∀ (x : X) (hmem : x ∈ xs),
304-
β.bigModify xs as x = as[List.indexOf x xs]'(by
305+
β.bigModify xs as x = as[List.idxOf x xs]'(by
305306
rw [← hlen]
306-
exact List.indexOf_lt_length.mpr hmem
307+
exact List.idxOf_lt_length hmem
307308
) := by
308309
intro y hmem
309310
have hindex := List.nodup_index_unique hmem huniq
310311
rcases hindex with ⟨i, hinbounds, heq, hindexOf, hiuniq⟩
311-
have h : List.indexOf xs[i] xs = i := by exact List.indexOf_getElem huniq i hinbounds
312+
have h : List.idxOf xs[i] xs = i := by exact List.idxOf_getElem huniq i hinbounds
312313
simp only [← heq, h]
313314
exact bigModify_single_index β xs huniq as n hn hnempty hlen i hinbounds
314315

@@ -318,7 +319,7 @@ def Assignment.modFn {X : Variables} {univ : Universes} [DecidableEq X]
318319
(β : Assignment X univ) (xs : List X) (as : List univ) (hlen : xs.length = as.length) :
319320
Assignment X univ :=
320321
fun x ↦ if hmem : x ∈ xs then by
321-
exact as[xs.indexOf x]'(by rw [← hlen]; exact List.indexOf_lt_length.mpr hmem)
322+
exact as[xs.idxOf x]'(by rw [← hlen]; exact List.idxOf_lt_length hmem)
322323
else β x
323324

324325
@[simp]
@@ -359,10 +360,10 @@ lemma Assignment.modFn_eq_id {X : Variables} {univ : Universes} [DecidableEq X]
359360
intro i
360361
by_cases hin : i < as.length
361362
· simp_all [↓reduceDIte]
362-
have h : List.indexOf xs[i] xs = i := by apply List.get_indexOf huniq
363+
have h : List.idxOf xs[i] xs = i := by apply List.get_idxOf huniq
363364
simp_all only
364365
· have hasnone : as[i]? = none := getElem?_neg as i hin
365-
have hxsnone : xs[i]? = none := by simp_all only [not_lt, getElem?_eq_none]
366+
have hxsnone : xs[i]? = none := by simp_all only [not_lt, getElem?_eq_none_iff]
366367
rw [hasnone, hxsnone, Option.map]
367368

368369
/- ### Evaluations with regards to free variables
@@ -525,7 +526,7 @@ lemma Formula.inductionStep_quantifier {univ : Universes} {sig : Signature} {X :
525526
simp_all only [List.coe_toFinset, Set.diff_singleton_subset_iff, List.toFinset_cons,
526527
Finset.coe_insert]
527528
specialize ih (y :: xs) (a :: as)
528-
(Nat.succ_inj'.mpr hlen) hfreevars β γ
529+
(Nat.succ_inj.mpr hlen) hfreevars β γ
529530
rw [Assignment.bigModify, Assignment.bigModify] at ih
530531
rw [Assignment.bigModify_modify γ xs as y a hxinxs xs.length rfl hlen]
531532
rw [← ih]

InferenceInLean/C_Models.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ theorem ClauseSatisfiable_imp_Satisfiable [inst : DecidableEq X]
104104
use I, β
105105
induction C with
106106
| nil =>
107-
exact False.elim (List.not_mem_nil L h_L_in_C)
107+
exact False.elim (List.not_mem_nil h_L_in_C)
108108
| cons head Ctail ih =>
109109
rw [Clause.toFormula.eq_def]
110110
split
@@ -277,12 +277,12 @@ lemma three_three_seven [DecidableEq X] (n : ℕ) (F : Formula sig X) (I : Inter
277277
Nat.add_right_cancel_iff, Formula.bigForall, Formula.eval, implies_true]
278278
| [], [] =>
279279
simp_all only [ValidIn, Assignment, EntailsInterpret, List.nodup_nil, List.length_nil,
280-
Nat.self_eq_add_left, Nat.add_one_ne_zero]
280+
Nat.right_eq_add, Nat.add_one_ne_zero]
281281
set as : List univ := List.map γ xs with has
282282
have hsubequal : γ = Assignment.bigModify γ xs as := by
283283
exact Assignment.substitute_equality γ xs
284284
rw [hsubequal]
285-
apply hlemma as (Eq.symm (List.length_map xs γ))
285+
apply hlemma as (Eq.symm (List.length_map γ))
286286
· intro hvalid β
287287
induction' xs with x xs ih generalizing β n
288288
· simp_all only [ValidIn, Valid, Assignment, List.nodup_nil, Formula.bigForall]

InferenceInLean/E_Inference.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ theorem generalSoundness_of_soundness [inst : DecidableEq X]
9999
have hlen : proof.clauses.length - 1 < proof.clauses.length := by
100100
have hlennonzero : proof.clauses.length ≠ 0 := by
101101
have hnonempty := proof.clauses_not_empty
102-
simp_all only [List.empty_eq, ne_eq, List.length_eq_zero, not_false_eq_true]
102+
simp_all only [List.empty_eq, ne_eq, List.length_eq_zero_iff, not_false_eq_true]
103103
exact Nat.sub_one_lt hlennonzero
104104
have hfconclusion := proof.is_valid (proof.clauses.length - 1) hlen
105105
have hfislast : proof.clauses[proof.clauses.length - 1] = F := by

InferenceInLean/Exercises/Exercise5.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ theorem task5_1_5 (S : Set <| GroundTerm sig5_1) (hall : ∀ t : GroundTerm sig
138138
have hS'encard3 : S'.encard = 3 := by
139139
have := hS'finite.cast_ncard_eq
140140
aesop
141-
have hle := Set.encard_le_card hsub
141+
have hle := Set.encard_le_encard hsub
142142
intro hSncard2
143143
rw [hS'encard3, hSncard2] at hle
144144
contradiction

InferenceInLean/G_Examples.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ lemma ex_peano_proof: @Formula.eval ex_sig_peano String ℕ instDecidableEqStrin
8787
· intro h
8888
obtain ⟨z, hz⟩ := h
8989
cases hz
90-
simp only [Nat.lt_add_right_iff_pos, Nat.self_eq_add_right]
90+
simp only [Nat.lt_add_right_iff_pos, Nat.left_eq_add]
9191
exact Or.symm (Nat.eq_zero_or_pos z)
9292

9393
def exa : Formula ex_sig_peano String := .and .falsum .verum

lake-manifest.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "",
8-
"rev": "62f729a9c6c3a553e81c3384877e573fa40f21d5",
8+
"rev": "2b3484b2d31396ff1b9800e93b37738f6a0e7685",
99
"name": "mathlib",
1010
"manifestFile": "lake-manifest.json",
1111
"inputRev": null,
@@ -15,17 +15,17 @@
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "leanprover-community",
18-
"rev": "1622a8693b31523c8f82db48e01b14c74bc1f155",
18+
"rev": "304c5e2f490d546134c06bf8919e13b175272084",
1919
"name": "plausible",
2020
"manifestFile": "lake-manifest.json",
21-
"inputRev": "v4.16.0-rc1",
21+
"inputRev": "main",
2222
"inherited": true,
2323
"configFile": "lakefile.toml"},
2424
{"url": "https://github.com/leanprover-community/LeanSearchClient",
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "leanprover-community",
28-
"rev": "003ff459cdd85de551f4dcf95cdfeefe10f20531",
28+
"rev": "25078369972d295301f5a1e53c3e5850cf6d9d4c",
2929
"name": "LeanSearchClient",
3030
"manifestFile": "lake-manifest.json",
3131
"inputRev": "main",
@@ -35,7 +35,7 @@
3535
"type": "git",
3636
"subDir": null,
3737
"scope": "leanprover-community",
38-
"rev": "18d461b4acad559d6ec11ae42eeed0fe767e523b",
38+
"rev": "f5e58ef1f58fc0cbd92296d18951f45216309e48",
3939
"name": "importGraph",
4040
"manifestFile": "lake-manifest.json",
4141
"inputRev": "main",
@@ -45,37 +45,37 @@
4545
"type": "git",
4646
"subDir": null,
4747
"scope": "leanprover-community",
48-
"rev": "07f60e90998dfd6592688a14cd67bd4e384b77b2",
48+
"rev": "632ca63a94f47dbd5694cac3fd991354b82b8f7a",
4949
"name": "proofwidgets",
5050
"manifestFile": "lake-manifest.json",
51-
"inputRev": "v0.0.50",
51+
"inputRev": "v0.0.59",
5252
"inherited": true,
5353
"configFile": "lakefile.lean"},
5454
{"url": "https://github.com/leanprover-community/aesop",
5555
"type": "git",
5656
"subDir": null,
5757
"scope": "leanprover-community",
58-
"rev": "79402ad9ab4be9a2286701a9880697e2351e4955",
58+
"rev": "9264d548cf1ccf0ba454b82f931f44c37c299fc1",
5959
"name": "aesop",
6060
"manifestFile": "lake-manifest.json",
61-
"inputRev": "v4.16.0-rc1",
61+
"inputRev": "master",
6262
"inherited": true,
6363
"configFile": "lakefile.toml"},
6464
{"url": "https://github.com/leanprover-community/quote4",
6565
"type": "git",
6666
"subDir": null,
6767
"scope": "leanprover-community",
68-
"rev": "f0c584bcb14c5adfb53079781eeea75b26ebbd32",
68+
"rev": "36ce5e17d6ab3c881e0cb1bb727982507e708130",
6969
"name": "Qq",
7070
"manifestFile": "lake-manifest.json",
71-
"inputRev": "v4.15.0",
71+
"inputRev": "master",
7272
"inherited": true,
7373
"configFile": "lakefile.toml"},
7474
{"url": "https://github.com/leanprover-community/batteries",
7575
"type": "git",
7676
"subDir": null,
7777
"scope": "leanprover-community",
78-
"rev": "8690c0b6e759ab1a0c7e4287909ae5f897d3ab66",
78+
"rev": "78e1181c4752c7e10874d2ed5a6a15063f4a35b6",
7979
"name": "batteries",
8080
"manifestFile": "lake-manifest.json",
8181
"inputRev": "main",
@@ -85,7 +85,7 @@
8585
"type": "git",
8686
"subDir": null,
8787
"scope": "leanprover",
88-
"rev": "0c8ea32a15a4f74143e4e1e107ba2c412adb90fd",
88+
"rev": "4f22c09e7ded721e6ecd3cf59221c4647ca49664",
8989
"name": "Cli",
9090
"manifestFile": "lake-manifest.json",
9191
"inputRev": "main",

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.16.0-rc1
1+
leanprover/lean4:v4.20.0-rc5

0 commit comments

Comments
 (0)