I am trying to learn the idris paradigm and still struggling. Here i have a function isZero that takes some natural Nat and returns True or False.
My issue is with the non-relexive case.
namespace Numbers
data Nat : Type where
Zero : Numbers.Nat
Successor : Numbers.Nat -> Numbers.Nat
isZero: Numbers.Nat -> Prelude.Bool.Bool
isZero Zero = True
isZero _ = False
isNotZero: Numbers.Nat -> Prelude.Bool.Bool
isNotZero Zero = False
isNotZero _ = True
proofNIsZero : (n : Numbers.Nat) -> isZero n = Bool.True
proofNIsZero Zero = Refl
proofNIsZero (Successor _) = ?rhs
It seems obvious to reason that some Successor to any Nat cannot be Zero. But my struggle is in the proof. The Type of the ?rhs hole is
--------------------------------------
rhs : False = True
Trying to navigate what I think should be (and will one day be) simple has led to uninhabited
, Void
, absurd
and impossible
. None of which I can disambiguate.
Perhaps those are the keys - but I cannot decipher!