2 | module Data.Nat.Order.Relation
4 | import Control.Relation
6 | Adjacent : (a, b : Nat) -> Type
7 | Adjacent a b = Either (a = b) $
Either (a = S b) (b = S a)
9 | Reflexive Nat Adjacent where
10 | reflexive = Left Refl
12 | Symmetric Nat Adjacent where
13 | symmetric (Left x_eq_y) = Left $
sym x_eq_y
14 | symmetric (Right $
Left prf) = Right $
Right prf
15 | symmetric (Right $
Right prf) = Right $
Left prf
17 | Tolerance Nat Adjacent where