I'm trying to write the following function:
justEq : ∀ {A} -> (x y : A) -> (just x ≡ just y) -> (x ≡ y)
justEq x y pf = {!!}
I don't know how to write this. To me, it is intuitive to the point of being axiomatic, but the compiler doesn't accept refl as a proof of it.
I'm routinely having to prove these sorts of things, for example, showing that if two non-empty lists are equal, then their heads are equal.
What is the general approach to this? Is this related to Conor McBride's "green-goo" of having functions in the return of Constructors?
pf
? – Vitusrefl
... I'm probably missing the obvious, but I don't see how that helps. – jmitecong
would be useful here, but I don't know how to write a function that takesjust x
tox
, since it would inherently be partial. – jmitejustEq
can be defined viacong
. – user3237465