We've been trying out some AGDA by basically playing parts of the natural number from Lean in AGDA. However, for inequalities we came across an error that was not present in the Lean solution to this problem.
This is the code:
module minimalExample where
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
open import Agda.Builtin.Sigma
-- x ≤ x + 1
data _leq_ {x : Nat} {y : Nat} : Nat -> Nat -> Set where
leqpr : (k : Nat) -> x + k ≡ y -> x leq y
leqSuccOfLeq : {x y : Nat} -> x leq y -> x leq (suc y)
leqSuccOfLeq ineq = leqpr {! ineq !} {! !}
If we try and case-split on the variable ineq we get the following error:
Unbound variable i when checking that the expression ? has type Nat
We assume there is something wrong with our definition, but we don't know what. We already tried a definition using a $\Sigma$ as well, but that didn't fix the problem. Also, we are aware that it is more common to define this definition inductively, but made this an exercise where this is specifically not the case.
Does anyone know how to fix this?
EDIT: The mistake gallais highlighted was the essential mistake, however the error on unbounded variables still occurred on an automatic case split. But hard-coding the case split resolved that problem.