File: Mathlib/Data/List/NodupEquivFin.lean

full_name: List.Nodup.getBijectionOfForallMemList
code: /-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
a bijection `Fin l.length → α`.  See `List.Nodup.getEquivOfForallMemList`
for a version giving an equivalence when there is decidable equality. -/
@[simps]
def getBijectionOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    { f : Fin l.length → α // Function.Bijective f } 
goal: { f // Function.Bijective f }

full_name: List.Nodup.getBijectionOfForallMemList_coe
code: /-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
a bijection `Fin l.length → α`.  See `List.Nodup.getEquivOfForallMemList`
for a version giving an equivalence when there is decidable equality. -/
@[simps]
def getBijectionOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    { f : Fin l.length → α // Function.Bijective f } 
goal: ↑(List.Nodup.getBijectionOfForallMemList l nd h) i = l.get i

full_name: List.Nodup.getEquiv_apply_coe
code: /-- If `l` has no duplicates, then `List.get` defines an equivalence between `Fin (length l)` and
the set of elements of `l`. -/
@[simps]
def getEquiv (l : List α) (H : Nodup l) : Fin (length l) ≃ { x // x ∈ l } 
goal: ↑((List.Nodup.getEquiv l H) i) = l.get i

full_name: List.Nodup.getEquiv_symm_apply_val
code: /-- If `l` has no duplicates, then `List.get` defines an equivalence between `Fin (length l)` and
the set of elements of `l`. -/
@[simps]
def getEquiv (l : List α) (H : Nodup l) : Fin (length l) ≃ { x // x ∈ l } 
goal: ↑((List.Nodup.getEquiv l H).symm x) = List.indexOf (↑x) l

full_name: List.Nodup.getEquiv
code: /-- If `l` has no duplicates, then `List.get` defines an equivalence between `Fin (length l)` and
the set of elements of `l`. -/
@[simps]
def getEquiv (l : List α) (H : Nodup l) : Fin (length l) ≃ { x // x ∈ l } 
goal: Fin l.length ≃ { x // x ∈ l }

full_name: List.Nodup.getEquivOfForallMemList
code: /-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
an equivalence between `Fin l.length` and `α`.

See `List.Nodup.getBijectionOfForallMemList` for a version without
decidable equality. -/
@[simps]
def getEquivOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    Fin l.length ≃ α 
goal: Fin l.length ≃ α

full_name: List.Nodup.getEquivOfForallMemList_apply
code: /-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
an equivalence between `Fin l.length` and `α`.

See `List.Nodup.getBijectionOfForallMemList` for a version without
decidable equality. -/
@[simps]
def getEquivOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    Fin l.length ≃ α 
goal: (List.Nodup.getEquivOfForallMemList l nd h) i = l.get i

full_name: List.Nodup.getEquivOfForallMemList_symm_apply_val
code: /-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
an equivalence between `Fin l.length` and `α`.

See `List.Nodup.getBijectionOfForallMemList` for a version without
decidable equality. -/
@[simps]
def getEquivOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    Fin l.length ≃ α 
goal: ↑((List.Nodup.getEquivOfForallMemList l nd h).symm a) = List.indexOf a l

full_name: List.Sorted.get_mono
code: theorem get_mono (h : l.Sorted (· ≤ ·)) : Monotone l.get 
goal: Monotone l.get

full_name: List.Sorted.get_strictMono
code: theorem get_strictMono (h : l.Sorted (· < ·)) : StrictMono l.get 
goal: StrictMono l.get

full_name: List.Sorted.getIso
code: /-- If `l` is a list sorted w.r.t. `(<)`, then `List.get` defines an order isomorphism between
`Fin (length l)` and the set of elements of `l`. -/
def getIso (l : List α) (H : Sorted (· < ·) l) : Fin (length l) ≃o { x // x ∈ l } 
goal: Fin l.length ≃o { x // x ∈ l }

full_name: List.Sorted.coe_getIso_apply
code: @[simp]
theorem coe_getIso_apply : (H.getIso l i : α) = get l i 
goal: ↑((List.Sorted.getIso l H) i) = l.get i

full_name: List.Sorted.coe_getIso_symm_apply
code: @[simp]
theorem coe_getIso_symm_apply : ((H.getIso l).symm x : ℕ) = indexOf (↑x) l 
goal: ↑((List.Sorted.getIso l H).symm x) = List.indexOf (↑x) l

full_name: List.sublist_of_orderEmbedding_get?_eq
code: /-- If there is `f`, an order-preserving embedding of `ℕ` into `ℕ` such that
any element of `l` found at index `ix` can be found at index `f ix` in `l'`,
then `Sublist l l'`.
-/
theorem sublist_of_orderEmbedding_get?_eq {l l' : List α} (f : ℕ ↪o ℕ)
    (hf : ∀ ix : ℕ, l.get? ix = l'.get? (f ix)) : l <+ l' 
goal: l.Sublist l'

full_name: List.sublist_iff_exists_orderEmbedding_get?_eq
code: /-- A `l : List α` is `Sublist l l'` for `l' : List α` iff
there is `f`, an order-preserving embedding of `ℕ` into `ℕ` such that
any element of `l` found at index `ix` can be found at index `f ix` in `l'`.
-/
theorem sublist_iff_exists_orderEmbedding_get?_eq {l l' : List α} :
    l <+ l' ↔ ∃ f : ℕ ↪o ℕ, ∀ ix : ℕ, l.get? ix = l'.get? (f ix) 
goal: l.Sublist l' ↔ ∃ f, ∀ (ix : ℕ), l.get? ix = l'.get? (f ix)

full_name: List.sublist_iff_exists_fin_orderEmbedding_get_eq
code: /-- A `l : List α` is `Sublist l l'` for `l' : List α` iff
there is `f`, an order-preserving embedding of `Fin l.length` into `Fin l'.length` such that
any element of `l` found at index `ix` can be found at index `f ix` in `l'`.
-/
theorem sublist_iff_exists_fin_orderEmbedding_get_eq {l l' : List α} :
    l <+ l' ↔
      ∃ f : Fin l.length ↪o Fin l'.length,
        ∀ ix : Fin l.length, l.get ix = l'.get (f ix) 
goal: l.Sublist l' ↔ ∃ f, ∀ (ix : Fin l.length), l.get ix = l'.get (f ix)

full_name: List.duplicate_iff_exists_distinct_get
code: /-- An element `x : α` of `l : List α` is a duplicate iff it can be found
at two distinct indices `n m : ℕ` inside the list `l`.
-/
theorem duplicate_iff_exists_distinct_get {l : List α} {x : α} :
    l.Duplicate x ↔
      ∃ (n m : Fin l.length) (_ : n < m),
        x = l.get n ∧ x = l.get m 
goal: List.Duplicate x l ↔ ∃ n m, ∃ (_ : n < m), x = l.get n ∧ x = l.get m

full_name: List.duplicate_iff_exists_distinct_nthLe
code: /-- An element `x : α` of `l : List α` is a duplicate iff it can be found
at two distinct indices `n m : ℕ` inside the list `l`.
-/
@[deprecated duplicate_iff_exists_distinct_get (since := "2023-01-19")]
theorem duplicate_iff_exists_distinct_nthLe {l : List α} {x : α} :
    l.Duplicate x ↔
      ∃ (n : ℕ) (hn : n < l.length) (m : ℕ) (hm : m < l.length) (_ : n < m),
        x = l.nthLe n hn ∧ x = l.nthLe m hm 
goal: List.Duplicate x l ↔
  ∃ n, ∃ (hn : n < l.length), ∃ m, ∃ (hm : m < l.length) (_ : n < m), x = l.nthLe n hn ∧ x = l.nthLe m hm