{-# language DataKinds #-}
{-# language ExplicitForAll #-}
{-# language KindSignatures #-}
{-# language TypeFamilies #-}
{-# language TypeOperators #-}
module Arithmetic.Lt
(
zero
, substituteL
, substituteR
, incrementL
, incrementR
, weakenL
, weakenR
, plus
, transitive
, transitiveNonstrictL
, transitiveNonstrictR
, toLteL
, toLteR
, absurd
, constant
) where
import Arithmetic.Unsafe (type (<)(Lt),type (:=:)(Eq))
import Arithmetic.Unsafe (type (<=)(Lte))
import GHC.TypeNats (CmpNat,type (+))
import qualified GHC.TypeNats as GHC
toLteR :: (a < b) -> (a + 1 <= b)
toLteR Lt = Lte
toLteL :: (a < b) -> (1 + a <= b)
toLteL Lt = Lte
substituteL :: (b :=: c) -> (b < a) -> (c < a)
substituteL Eq Lt = Lt
substituteR :: (b :=: c) -> (a < b) -> (a < c)
substituteR Eq Lt = Lt
plus :: (a < b) -> (c <= d) -> (a + c < b + d)
plus Lt Lte = Lt
incrementL :: forall (c :: GHC.Nat) (a :: GHC.Nat) (b :: GHC.Nat).
(a < b) -> (c + a < c + b)
incrementL Lt = Lt
incrementR :: forall (c :: GHC.Nat) (a :: GHC.Nat) (b :: GHC.Nat).
(a < b) -> (a + c < b + c)
incrementR Lt = Lt
weakenL :: forall (c :: GHC.Nat) (a :: GHC.Nat) (b :: GHC.Nat).
(a < b) -> (a < c + b)
weakenL Lt = Lt
weakenR :: forall (c :: GHC.Nat) (a :: GHC.Nat) (b :: GHC.Nat).
(a < b) -> (a < b + c)
weakenR Lt = Lt
transitive :: (a < b) -> (b < c) -> (a < c)
transitive Lt Lt = Lt
transitiveNonstrictR :: (a < b) -> (b <= c) -> (a < c)
transitiveNonstrictR Lt Lte = Lt
transitiveNonstrictL :: (a <= b) -> (b < c) -> (a < c)
transitiveNonstrictL Lte Lt = Lt
zero :: 0 < 1
zero = Lt
absurd :: n < 0 -> void
absurd Lt = error "Arithmetic.Nat.absurd: n < 0"
constant :: forall a b. (CmpNat a b ~ 'LT) => (a < b)
constant = Lt