Skip to content

Commit 103ba30

Browse files
committed
chore(Data/List/Nodup): golf nodup_iff_injective_get
1 parent 9bee9f3 commit 103ba30

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Mathlib/Data/List/Nodup.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,8 @@ theorem nodup_iff_injective_getElem {l : List α} :
8080
· exact (h j i hj hi hji hg.symm).elim,
8181
fun hinj i j hi hj hij h => Nat.ne_of_lt hij (Fin.val_eq_of_eq (@hinj ⟨i, hi⟩ ⟨j, hj⟩ h))⟩
8282

83-
theorem nodup_iff_injective_get {l : List α} :
84-
Nodup l ↔ Function.Injective l.get := by
85-
rw [nodup_iff_injective_getElem]
86-
change _ ↔ Injective (fun i => l.get i)
87-
simp
83+
theorem nodup_iff_injective_get {l : List α} : Nodup l ↔ Function.Injective l.get :=
84+
nodup_iff_injective_getElem
8885

8986
theorem Nodup.get_inj_iff {l : List α} (h : Nodup l) {i j : Fin l.length} :
9087
l.get i = l.get j ↔ i = j :=

0 commit comments

Comments
 (0)