Skip to content

Commit 955e8f9

Browse files
committed
chore: fix defeq abuse between List.get_mem and List.getElem_mem (leanprover-community#19224)
In all these places the goal state is about `getElem` not `List.get`. This will reduce the fallout of leanprover/lean4#6095.
1 parent b2244f6 commit 955e8f9

5 files changed

Lines changed: 6 additions & 6 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/Data/List/Permutation.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,13 @@ theorem nodup_permutations (s : List α) (hs : Nodup s) : Nodup s.permutations :
501501
rcases lt_trichotomy n m with (ht | ht | ht)
502502
· suffices x ∈ bs by exact h x (hb.subset this) rfl
503503
rw [← hx', getElem_insertIdx_of_lt _ _ _ _ ht (ht.trans_le hm)]
504-
exact get_mem _ _ _
504+
exact getElem_mem _
505505
· simp only [ht] at hm' hn'
506506
rw [← hm'] at hn'
507507
exact H (insertIdx_injective _ _ hn')
508508
· suffices x ∈ as by exact h x (ha.subset this) rfl
509509
rw [← hx, getElem_insertIdx_of_lt _ _ _ _ ht (ht.trans_le hn)]
510-
exact get_mem _ _ _
510+
exact getElem_mem _
511511

512512
lemma permutations_take_two (x y : α) (s : List α) :
513513
(x :: y :: s).permutations.take 2 = [x :: y :: s, y :: x :: s] := by

0 commit comments

Comments
 (0)