Skip to content

Commit 34d23bd

Browse files
author
leanprover-community-mathlib4-bot
committed
Merge master into nightly-testing
2 parents 24e2fd2 + 955e8f9 commit 34d23bd

8 files changed

Lines changed: 33 additions & 31 deletions

File tree

Mathlib/Data/List/EditDistance/Bounds.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ theorem le_suffixLevenshtein_append_minimum (xs : List α) (ys₁ ys₂) :
7979
theorem suffixLevenshtein_minimum_le_levenshtein_append (xs ys₁ ys₂) :
8080
(suffixLevenshtein C xs ys₂).1.minimum ≤ levenshtein C xs (ys₁ ++ ys₂) := by
8181
cases ys₁ with
82-
| nil => exact List.minimum_le_of_mem' (List.get_mem _ _ _)
82+
| nil => exact List.minimum_le_of_mem' (List.getElem_mem _)
8383
| cons y ys₁ =>
8484
exact (le_suffixLevenshtein_append_minimum _ _ _).trans
8585
(suffixLevenshtein_minimum_le_levenshtein_cons _ _ _)

Mathlib/Data/List/MinMax.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ theorem minimum_of_length_pos_le_of_mem (h : a ∈ l) (w : 0 < l.length) :
427427
theorem getElem_le_maximum_of_length_pos {i : ℕ} (w : i < l.length) (h := (Nat.zero_lt_of_lt w)) :
428428
l[i] ≤ l.maximum_of_length_pos h := by
429429
apply le_maximum_of_length_pos_of_mem
430-
exact get_mem l i w
430+
exact getElem_mem _
431431

432432
theorem minimum_of_length_pos_le_getElem {i : ℕ} (w : i < l.length) (h := (Nat.zero_lt_of_lt w)) :
433433
l.minimum_of_length_pos h ≤ l[i] :=

Mathlib/Data/List/Nodup.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ theorem not_nodup_of_get_eq_of_ne (xs : List α) (n m : Fin xs.length)
122122

123123
theorem indexOf_getElem [DecidableEq α] {l : List α} (H : Nodup l) (i : Nat) (h : i < l.length) :
124124
indexOf l[i] l = i :=
125-
suffices (⟨indexOf l[i] l, indexOf_lt_length.2 (get_mem _ _ _)⟩ : Fin l.length) = ⟨i, h⟩
125+
suffices (⟨indexOf l[i] l, indexOf_lt_length.2 (getElem_mem _)⟩ : Fin l.length) = ⟨i, h⟩
126126
from Fin.val_eq_of_eq this
127127
nodup_iff_injective_get.1 H (by simp)
128128

Mathlib/Data/List/NodupEquivFin.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ theorem sublist_of_orderEmbedding_get?_eq {l l' : List α} (f : ℕ ↪o ℕ)
127127
rw [← List.take_append_drop (f 0 + 1) l', ← List.singleton_append]
128128
apply List.Sublist.append _ (IH _ this)
129129
rw [List.singleton_sublist, ← h, l'.getElem_take' _ (Nat.lt_succ_self _)]
130-
apply List.get_mem
130+
exact List.getElem_mem _
131131

132132
/-- A `l : List α` is `Sublist l l'` for `l' : List α` iff
133133
there is `f`, an order-preserving embedding of `ℕ` into `ℕ` such that

Mathlib/SetTheory/Nimber/Basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ noncomputable section
4444

4545
/-! ### Basic casts between `Ordinal` and `Nimber` -/
4646

47-
/-- A type synonym for ordinals with natural addition and multiplication. -/
47+
/-- A type synonym for ordinals with nimber addition and multiplication. -/
4848
def Nimber : Type _ :=
4949
Ordinal deriving Zero, Inhabited, One, Nontrivial, WellFoundedRelation
5050

51-
instance Nimber.linearOrder : LinearOrder Nimber := {Ordinal.linearOrder with}
52-
instance Nimber.succOrder : SuccOrder Nimber := {Ordinal.instSuccOrder with}
53-
instance Nimber.orderBot : OrderBot Nimber := {Ordinal.orderBot with}
54-
instance Nimber.noMaxOrder : NoMaxOrder Nimber := {Ordinal.noMaxOrder with}
55-
instance Nimber.zeroLEOneClass : ZeroLEOneClass Nimber := {Ordinal.zeroLEOneClass with}
56-
instance Nimber.instNeZeroOne : NeZero (1 : Nimber) := Ordinal.NeZero.one
51+
instance Nimber.instLinearOrder : LinearOrder Nimber := Ordinal.instLinearOrder
52+
instance Nimber.instSuccOrder : SuccOrder Nimber := Ordinal.instSuccOrder
53+
instance Nimber.instOrderBot : OrderBot Nimber := Ordinal.instOrderBot
54+
instance Nimber.instNoMaxOrder : NoMaxOrder Nimber := Ordinal.instNoMaxOrder
55+
instance Nimber.instZeroLEOneClass : ZeroLEOneClass Nimber := Ordinal.instZeroLEOneClass
56+
instance Nimber.instNeZeroOne : NeZero (1 : Nimber) := Ordinal.instNeZeroOne
5757

5858
/-- The identity function between `Ordinal` and `Nimber`. -/
5959
@[match_pattern]

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ instance partialOrder : PartialOrder Ordinal where
287287
Quotient.inductionOn₂ a b fun _ _ ⟨h₁⟩ ⟨h₂⟩ =>
288288
Quot.sound ⟨InitialSeg.antisymm h₁ h₂⟩
289289

290-
instance linearOrder : LinearOrder Ordinal :=
290+
instance : LinearOrder Ordinal :=
291291
{inferInstanceAs (PartialOrder Ordinal) with
292292
le_total := fun a b => Quotient.inductionOn₂ a b fun ⟨_, r, _⟩ ⟨_, s, _⟩ =>
293293
(InitialSeg.total r s).recOn (fun f => Or.inl ⟨f⟩) fun f => Or.inr ⟨f⟩
@@ -309,7 +309,7 @@ theorem _root_.PrincipalSeg.ordinal_type_lt {α β} {r : α → α → Prop} {s
309309
protected theorem zero_le (o : Ordinal) : 0 ≤ o :=
310310
inductionOn o fun _ r _ => (InitialSeg.ofIsEmpty _ r).ordinal_type_le
311311

312-
instance orderBot : OrderBot Ordinal where
312+
instance : OrderBot Ordinal where
313313
bot := 0
314314
bot_le := Ordinal.zero_le
315315

@@ -330,10 +330,10 @@ protected theorem not_lt_zero (o : Ordinal) : ¬o < 0 :=
330330
theorem eq_zero_or_pos : ∀ a : Ordinal, a = 00 < a :=
331331
eq_bot_or_bot_lt
332332

333-
instance zeroLEOneClass : ZeroLEOneClass Ordinal :=
333+
instance : ZeroLEOneClass Ordinal :=
334334
⟨Ordinal.zero_le _⟩
335335

336-
instance NeZero.one : NeZero (1 : Ordinal) :=
336+
instance instNeZeroOne : NeZero (1 : Ordinal) :=
337337
⟨Ordinal.one_ne_zero⟩
338338

339339
theorem type_le_iff {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r]
@@ -875,13 +875,13 @@ private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b := by
875875
· apply (RelEmbedding.ofMonotone (Sum.recOn · f fun _ ↦ f.top) ?_).ordinal_type_le
876876
simpa [f.map_rel_iff] using f.lt_top
877877

878-
instance noMaxOrder : NoMaxOrder Ordinal :=
878+
instance : NoMaxOrder Ordinal :=
879879
fun _ => ⟨_, succ_le_iff'.1 le_rfl⟩⟩
880880

881-
instance instSuccOrder : SuccOrder Ordinal.{u} :=
881+
instance : SuccOrder Ordinal.{u} :=
882882
SuccOrder.ofSuccLeIff (fun o => o + 1) succ_le_iff'
883883

884-
instance instSuccAddOrder : SuccAddOrder Ordinal := ⟨fun _ => rfl⟩
884+
instance : SuccAddOrder Ordinal := ⟨fun _ => rfl⟩
885885

886886
@[simp]
887887
theorem add_one_eq_succ (o : Ordinal) : o + 1 = succ o :=

Mathlib/SetTheory/Ordinal/NaturalOps.lean

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ def NatOrdinal : Type _ :=
5353
-- Porting note: used to derive LinearOrder & SuccOrder but need to manually define
5454
Ordinal deriving Zero, Inhabited, One, WellFoundedRelation
5555

56-
instance NatOrdinal.linearOrder : LinearOrder NatOrdinal := {Ordinal.linearOrder with}
57-
instance NatOrdinal.instSuccOrder : SuccOrder NatOrdinal := {Ordinal.instSuccOrder with}
58-
instance NatOrdinal.orderBot : OrderBot NatOrdinal := {Ordinal.orderBot with}
59-
instance NatOrdinal.noMaxOrder : NoMaxOrder NatOrdinal := {Ordinal.noMaxOrder with}
56+
instance NatOrdinal.instLinearOrder : LinearOrder NatOrdinal := Ordinal.instLinearOrder
57+
instance NatOrdinal.instSuccOrder : SuccOrder NatOrdinal := Ordinal.instSuccOrder
58+
instance NatOrdinal.instOrderBot : OrderBot NatOrdinal := Ordinal.instOrderBot
59+
instance NatOrdinal.instNoMaxOrder : NoMaxOrder NatOrdinal := Ordinal.instNoMaxOrder
60+
instance NatOrdinal.instZeroLEOneClass : ZeroLEOneClass NatOrdinal := Ordinal.instZeroLEOneClass
61+
instance NatOrdinal.instNeZeroOne : NeZero (1 : NatOrdinal) := Ordinal.instNeZeroOne
6062

6163
/-- The identity function between `Ordinal` and `NatOrdinal`. -/
6264
@[match_pattern]
@@ -316,19 +318,19 @@ open Ordinal NaturalOps
316318
instance : Add NatOrdinal := ⟨nadd⟩
317319
instance : SuccAddOrder NatOrdinal := ⟨fun x => (nadd_one x).symm⟩
318320

319-
instance addLeftStrictMono : AddLeftStrictMono NatOrdinal.{u} :=
321+
instance : AddLeftStrictMono NatOrdinal.{u} :=
320322
fun a _ _ h => nadd_lt_nadd_left h a⟩
321323

322-
instance addLeftMono : AddLeftMono NatOrdinal.{u} :=
324+
instance : AddLeftMono NatOrdinal.{u} :=
323325
fun a _ _ h => nadd_le_nadd_left h a⟩
324326

325-
instance addLeftReflectLE : AddLeftReflectLE NatOrdinal.{u} :=
327+
instance : AddLeftReflectLE NatOrdinal.{u} :=
326328
fun a b c h => by
327329
by_contra! h'
328330
exact h.not_lt (add_lt_add_left h' a)⟩
329331

330-
instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid NatOrdinal :=
331-
{ NatOrdinal.linearOrder with
332+
instance : OrderedCancelAddCommMonoid NatOrdinal :=
333+
{ NatOrdinal.instLinearOrder with
332334
add := (· + ·)
333335
add_assoc := nadd_assoc
334336
add_le_add_left := fun _ _ => add_le_add_left
@@ -339,7 +341,7 @@ instance orderedCancelAddCommMonoid : OrderedCancelAddCommMonoid NatOrdinal :=
339341
add_comm := nadd_comm
340342
nsmul := nsmulRec }
341343

342-
instance addMonoidWithOne : AddMonoidWithOne NatOrdinal :=
344+
instance : AddMonoidWithOne NatOrdinal :=
343345
AddMonoidWithOne.unary
344346

345347
@[deprecated Order.succ_eq_add_one (since := "2024-09-04")]
@@ -674,8 +676,8 @@ instance : Mul NatOrdinal :=
674676
-- Porting note: had to add universe annotations to ensure that the
675677
-- two sources lived in the same universe.
676678
instance : OrderedCommSemiring NatOrdinal.{u} :=
677-
{ NatOrdinal.orderedCancelAddCommMonoid.{u},
678-
NatOrdinal.linearOrder.{u} with
679+
{ NatOrdinal.instOrderedCancelAddCommMonoid.{u},
680+
NatOrdinal.instLinearOrder.{u} with
679681
mul := (· * ·)
680682
left_distrib := nmul_nadd
681683
right_distrib := nadd_nmul

lake-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"type": "git",
6666
"subDir": null,
6767
"scope": "leanprover-community",
68-
"rev": "23b4216d1e3a2064058bb415c11e5f6df0417c99",
68+
"rev": "922825a3fa019deafbf4f61ed7c70fbdeebc9206",
6969
"name": "batteries",
7070
"manifestFile": "lake-manifest.json",
7171
"inputRev": "nightly-testing",

0 commit comments

Comments
 (0)