getD and getI #
This file provides theorems for working with the getD and getI functions. These are used to
access an element of a list by numerical index, with a default value as a fallback when the index
is out of range.
@[instance_reducible]
An empty list can always be decidably checked for the presence of an element.
Not an instance because it would clash with DecidableEq α.
Equations
- List.decidableGetDNilNe a x✝ = isFalse ⋯
Instances For
theorem List.getD_surjective {α : Type u} {l : List α} (h : ∀ (x : α), x ∈ l) (d : α) :
Function.Surjective fun (x : ℕ) => l.getD x d