Skip to content

Commit

Permalink
[ base ] Prove anyToFin preserves the property witnessed by Any
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd34df00d committed Oct 8, 2023
1 parent a9304c0 commit ea6aad0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libs/base/Data/Vect/Quantifiers.idr
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ namespace Any
anyToFin (Here _) = FZ
anyToFin (There later) = FS (anyToFin later)

||| `anyToFin`'s return type satisfies the predicate
export
anyToFinCorrect : {0 xs : Vect n a} ->
(witness : Any p xs) ->
p (anyToFin witness `index` xs)
anyToFinCorrect (Here prf) = prf
anyToFinCorrect (There later) = anyToFinCorrect later

namespace All
||| A proof that all elements of a vector satisfy a property. It is a list of
||| proofs, corresponding element-wise to the `Vect`.
Expand Down

0 comments on commit ea6aad0

Please sign in to comment.