Given a list, a "property" (a function to Bool
s), and a proof any f xs ≡ true
, I want to get a value of Any (λ x → T (f x)) ns
, i.e. I want a to convert a proof from any
to a proof of Any
.
So far, I have been able to sketch the proof, but I am stuck at a seemingly simple statement (please see the second to last line below):
open import Data.Bool
open import Data.Bool.Properties
open import Data.List
open import Data.List.Relation.Unary.Any using (Any; here; there)
open import Data.Unit
open import Relation.Binary.PropositionalEquality
≡→T : ∀ {b : Bool} → b ≡ true → T b
≡→T refl = tt
any-val : ∀ {a} {A : Set a} (f) (ns : List A)
→ any f ns ≡ true
→ Any (λ x → T (f x)) ns
any-val f [] ()
any-val f (n ∷ ns) any-f-⟨n∷ns⟩≡true with f n
... | true = here (≡→T ?)
... | false = there (any-val f ns any-f-⟨n∷ns⟩≡true)
Apparently, I need to prove that f n ≡ true
, which should be trivial to prove because we are in the true
branch of the with
statement f ≡ true
.
What is supposed to go in there? What am I understanding incorrectly?