Documentation
Init
.
Data
.
List
.
Nat
.
Find
Search
Google site search
return to top
source
Imports
Init.Data.List.Find
Init.Data.List.Nat.Range
Imported by
List
.
find?_eq_some_iff_getElem
List
.
findIdx?_eq_some_le_of_findIdx?_eq_some
source
theorem
List
.
find?_eq_some_iff_getElem
{α :
Type
u_1}
{xs :
List
α
}
{p :
α
→
Bool
}
{b :
α
}
:
List.find?
p
xs
=
some
b
↔
p
b
=
true
∧
∃ (
i
:
Nat
),
∃ (
h
:
i
<
xs
.length
),
xs
[
i
]
=
b
∧
∀ (
j
:
Nat
) (
hj
:
j
<
i
),
(
!
p
xs
[
j
]
)
=
true
source
theorem
List
.
findIdx?_eq_some_le_of_findIdx?_eq_some
{α :
Type
u_1}
{xs :
List
α
}
{p q :
α
→
Bool
}
(w :
∀ (
x
:
α
),
x
∈
xs
→
p
x
=
true
→
q
x
=
true
)
{i :
Nat
}
(h :
List.findIdx?
p
xs
=
some
i
)
:
∃ (
j
:
Nat
),
j
≤
i
∧
List.findIdx?
q
xs
=
some
j