Documentation
Init
.
Data
.
Array
.
DecidableEq
Search
Google site search
return to top
source
Imports
Init.ByCases
Init.Data.BEq
Init.Data.Array.Basic
Init.Data.Nat.Lemmas
Init.Data.List.Nat.BEq
Imported by
Array
.
rel_of_isEqvAux
Array
.
isEqvAux_of_rel
Array
.
rel_of_isEqv
Array
.
isEqv_iff_rel
Array
.
isEqv_eq_decide
Array
.
isEqv_toList
Array
.
eq_of_isEqv
Array
.
isEqvAux_self
Array
.
isEqv_self_beq
Array
.
isEqv_self
Array
.
instDecidableEq
Array
.
beq_eq_decide
Array
.
beq_toList
List
.
isEqv_toArray
List
.
beq_toArray
source
theorem
Array
.
rel_of_isEqvAux
{α :
Type
u_1}
{r :
α
→
α
→
Bool
}
{a :
Array
α
}
{b :
Array
α
}
(hsz :
a
.size
=
b
.size
)
{i :
Nat
}
(hi :
i
≤
a
.size
)
(heqv :
a
.isEqvAux
b
hsz
r
i
hi
=
true
)
{j :
Nat
}
(hj :
j
<
i
)
:
r
a
[
j
]
b
[
j
]
=
true
source
theorem
Array
.
isEqvAux_of_rel
{α :
Type
u_1}
{r :
α
→
α
→
Bool
}
{a :
Array
α
}
{b :
Array
α
}
(hsz :
a
.size
=
b
.size
)
{i :
Nat
}
(hi :
i
≤
a
.size
)
(w :
∀ (
j
:
Nat
) (
hj
:
j
<
i
),
r
a
[
j
]
b
[
j
]
=
true
)
:
a
.isEqvAux
b
hsz
r
i
hi
=
true
source
theorem
Array
.
rel_of_isEqv
{α :
Type
u_1}
{r :
α
→
α
→
Bool
}
{a :
Array
α
}
{b :
Array
α
}
:
a
.isEqv
b
r
=
true
→
∃ (
h
:
a
.size
=
b
.size
),
∀ (
i
:
Nat
) (
h'
:
i
<
a
.size
),
r
a
[
i
]
b
[
i
]
=
true
source
theorem
Array
.
isEqv_iff_rel
{α :
Type
u_1}
(a :
Array
α
)
(b :
Array
α
)
(r :
α
→
α
→
Bool
)
:
a
.isEqv
b
r
=
true
↔
∃ (
h
:
a
.size
=
b
.size
),
∀ (
i
:
Nat
) (
h'
:
i
<
a
.size
),
r
a
[
i
]
b
[
i
]
=
true
source
theorem
Array
.
isEqv_eq_decide
{α :
Type
u_1}
(a :
Array
α
)
(b :
Array
α
)
(r :
α
→
α
→
Bool
)
:
a
.isEqv
b
r
=
if h :
a
.size
=
b
.size
then
decide
(∀ (
i
:
Nat
) (
h'
:
i
<
a
.size
),
r
a
[
i
]
b
[
i
]
=
true
)
else
false
source
@[simp]
theorem
Array
.
isEqv_toList
{α :
Type
u_1}
{r :
α
→
α
→
Bool
}
[
BEq
α
]
(a :
Array
α
)
(b :
Array
α
)
:
a
.toList
.isEqv
b
.toList
r
=
a
.isEqv
b
r
source
theorem
Array
.
eq_of_isEqv
{α :
Type
u_1}
[
DecidableEq
α
]
(a :
Array
α
)
(b :
Array
α
)
(h :
(
a
.isEqv
b
fun (
x
y
:
α
) =>
decide
(
x
=
y
)
)
=
true
)
:
a
=
b
source
theorem
Array
.
isEqvAux_self
{α :
Type
u_1}
(r :
α
→
α
→
Bool
)
(hr :
∀ (
a
:
α
),
r
a
a
=
true
)
(a :
Array
α
)
(i :
Nat
)
(h :
i
≤
a
.size
)
:
a
.isEqvAux
a
⋯
r
i
h
=
true
source
theorem
Array
.
isEqv_self_beq
{α :
Type
u_1}
[
BEq
α
]
[
ReflBEq
α
]
(a :
Array
α
)
:
(
a
.isEqv
a
fun (
x1
x2
:
α
) =>
x1
==
x2
)
=
true
source
theorem
Array
.
isEqv_self
{α :
Type
u_1}
[
DecidableEq
α
]
(a :
Array
α
)
:
(
a
.isEqv
a
fun (
x1
x2
:
α
) =>
decide
(
x1
=
x2
)
)
=
true
source
instance
Array
.
instDecidableEq
{α :
Type
u_1}
[
DecidableEq
α
]
:
DecidableEq
(
Array
α
)
Equations
a
.instDecidableEq
b
=
match h :
a
.isEqv
b
fun (
a
b
:
α
) =>
decide
(
a
=
b
)
with |
true
=>
isTrue
⋯
|
false
=>
isFalse
⋯
source
theorem
Array
.
beq_eq_decide
{α :
Type
u_1}
[
BEq
α
]
(a :
Array
α
)
(b :
Array
α
)
:
(
a
==
b
)
=
if h :
a
.size
=
b
.size
then
decide
(∀ (
i
:
Nat
) (
h'
:
i
<
a
.size
),
(
a
[
i
]
==
b
[
i
]
)
=
true
)
else
false
source
@[simp]
theorem
Array
.
beq_toList
{α :
Type
u_1}
[
BEq
α
]
(a :
Array
α
)
(b :
Array
α
)
:
(
a
.toList
==
b
.toList
)
=
(
a
==
b
)
source
@[simp]
theorem
List
.
isEqv_toArray
{α :
Type
u_1}
{r :
α
→
α
→
Bool
}
[
BEq
α
]
(a :
List
α
)
(b :
List
α
)
:
a
.toArray
.isEqv
b
.toArray
r
=
a
.isEqv
b
r
source
@[simp]
theorem
List
.
beq_toArray
{α :
Type
u_1}
[
BEq
α
]
(a :
List
α
)
(b :
List
α
)
:
(
a
.toArray
==
b
.toArray
)
=
(
a
==
b
)