I have this Agda program:
data ℕ⁺ : ℕ → Set where
one : ℕ⁺ (suc zero)
suc⁺ : {n : ℕ} → ℕ⁺ (suc n)
lemma : ∀ (m n : ℕ) → m ≡ suc n → ℕ⁺ m
lemma m zero p = one
lemma m (suc n) p = suc⁺ {suc n}
The problem is in the second-last line: it complains one
is not ℕ⁺ m
, however I have p
there to prove that they actually are.
How can I do this? I know how do it if what I wanted to prove were in fact an equality (well, just pass p
in this case), but I don't know how to use p
to convert a generic ℕ⁺ m
to ℕ⁺ (suc zero)
.