Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type level peano natural number, some arithmetic functions and their singletons.
- module Data.Singletons
- data Nat
- data SSym0 (l :: TyFun Nat Nat)
- type SSym1 (t :: Nat) = S t
- type ZSym0 = Z
- type SNat = (Sing :: Nat -> Type)
- data family Sing k (a :: k) :: *
- min :: Ord a => a -> a -> a
- type family Min a (arg :: a) (arg1 :: a) :: a
- sMin :: SOrd a => forall (t1 :: a) (t2 :: a). Sing a t1 -> Sing a t2 -> Sing a (Apply a a (Apply a (TyFun a a -> Type) (MinSym0 a) t1) t2)
- max :: Ord a => a -> a -> a
- type family Max a (arg :: a) (arg1 :: a) :: a
- sMax :: SOrd a => forall (t1 :: a) (t2 :: a). Sing a t1 -> Sing a t2 -> Sing a (Apply a a (Apply a (TyFun a a -> Type) (MaxSym0 a) t1) t2)
- data MinSym0 a6989586621679302787 (l :: TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type)) :: forall a6989586621679302787. TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type) -> *
- data MinSym1 a6989586621679302787 (l :: a6989586621679302787) (l1 :: TyFun a6989586621679302787 a6989586621679302787) :: forall a6989586621679302787. a6989586621679302787 -> TyFun a6989586621679302787 a6989586621679302787 -> *
- type MinSym2 a6989586621679302787 (t :: a6989586621679302787) (t1 :: a6989586621679302787) = Min a6989586621679302787 t t1
- data MaxSym0 a6989586621679302787 (l :: TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type)) :: forall a6989586621679302787. TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type) -> *
- data MaxSym1 a6989586621679302787 (l :: a6989586621679302787) (l1 :: TyFun a6989586621679302787 a6989586621679302787) :: forall a6989586621679302787. a6989586621679302787 -> TyFun a6989586621679302787 a6989586621679302787 -> *
- type MaxSym2 a6989586621679302787 (t :: a6989586621679302787) (t1 :: a6989586621679302787) = Max a6989586621679302787 t t1
- type (+) a b = (:+) a b
- type (+@#@$) = (:+$)
- type (+@#@$$) = (:+$$)
- type (+@#@$$$) a b = (:+$$$) a b
- (%+) :: forall nat (a :: nat) (b :: nat). SNum nat => Sing a -> Sing b -> Sing ((+) a b)
- type * a b = (:*) a b
- type (*@#@$) = (:*$)
- type (*@#@$$) = (:*$$)
- type (*@#@$$$) a b = (:*$$$) a b
- (%*) :: forall nat (a :: nat) (b :: nat). SNum nat => Sing a -> Sing b -> Sing (* a b)
- type (-) a b = (:-) a b
- type (**) a b = a :** b
- (%**) :: SNat n -> SNat m -> SNat (n ** m)
- type (-@#@$) = (:-$)
- type (-@#@$$) = (:-$$)
- type (-@#@$$$) a b = (:-$$$) a b
- (%-) :: forall nat (a :: nat) (b :: nat). SNum nat => Sing a -> Sing b -> Sing ((-) a b)
- data Leq (n :: Nat) (m :: Nat) where
- type (<=) a b = (:<=) a b
- type LeqInstance n m = IsTrue (n <= m)
- boolToPropLeq :: (n <= m) ~ True => SNat n -> SNat m -> Leq n m
- boolToClassLeq :: (n <= m) ~ True => SNat n -> SNat m -> LeqInstance n m
- propToClassLeq :: Leq n m -> LeqInstance n m
- propToBoolLeq :: forall n m. Leq n m -> LeqTrueInstance n m
- natToInt :: Integral n => Nat -> n
- intToNat :: (Integral a, Ord a) => a -> Nat
- sNatToInt :: Num n => SNat x -> n
- snat :: QuasiQuoter
- class (SDecide nat, SNum nat, SEnum nat, SingKind nat, SingKind nat) => IsPeano nat where
- plusCong :: (n :~: m) -> (n' :~: m') -> (n + n') :~: (m + m')
- plusCongR :: Sing k -> (n :~: m) -> (k + n) :~: (k + m)
- plusCongL :: (n :~: m) -> Sing k -> (n + k) :~: (m + k)
- snEqZAbsurd :: SingI n => (S n :~: Z) -> a
- plusInjectiveL :: SNat n -> SNat m -> SNat l -> ((n + m) :~: (n + l)) -> m :~: l
- plusInjectiveR :: SNat n -> SNat m -> SNat l -> ((n + l) :~: (m + l)) -> n :~: m
- multCongL :: (n :~: m) -> Sing k -> (n * k) :~: (m * k)
- multCongR :: Sing k -> (n :~: m) -> (k * n) :~: (k * m)
- multCong :: (n :~: m) -> (l :~: k) -> (n * l) :~: (m * k)
- plusMinusEqL :: SNat n -> SNat m -> ((n + m) - m) :~: n
- plusNeutralR :: SNat n -> SNat m -> ((n + m) :~: n) -> m :~: Z
- plusNeutralL :: SNat n -> SNat m -> ((n + m) :~: m) -> n :~: Z
- class (SOrd nat, IsPeano nat) => PeanoOrder nat where
- reflToSEqual :: SNat n -> SNat m -> (n :~: m) -> IsTrue (n == m)
- sLeqReflexive :: SNat n -> SNat m -> IsTrue (n == m) -> IsTrue (n <= m)
- nonSLeqToLT :: (n <= m) ~ False => SNat n -> SNat m -> Compare m n :~: LT
- zero :: Nat
- one :: Nat
- two :: Nat
- three :: Nat
- four :: Nat
- five :: Nat
- six :: Nat
- seven :: Nat
- eight :: Nat
- nine :: Nat
- ten :: Nat
- eleven :: Nat
- twelve :: Nat
- thirteen :: Nat
- fourteen :: Nat
- fifteen :: Nat
- sixteen :: Nat
- seventeen :: Nat
- eighteen :: Nat
- nineteen :: Nat
- twenty :: Nat
- type family Zero :: Nat where ...
- type family One :: Nat where ...
- type family Two :: Nat where ...
- type family Three :: Nat where ...
- type family Four :: Nat where ...
- type family Five :: Nat where ...
- type family Six :: Nat where ...
- type family Seven :: Nat where ...
- type family Eight :: Nat where ...
- type family Nine :: Nat where ...
- type family Ten :: Nat where ...
- type family Eleven :: Nat where ...
- type family Twelve :: Nat where ...
- type family Thirteen :: Nat where ...
- type family Fourteen :: Nat where ...
- type family Fifteen :: Nat where ...
- type family Sixteen :: Nat where ...
- type family Seventeen :: Nat where ...
- type family Eighteen :: Nat where ...
- type family Nineteen :: Nat where ...
- type family Twenty :: Nat where ...
- type ZeroSym0 = Zero
- type OneSym0 = One
- type TwoSym0 = Two
- type ThreeSym0 = Three
- type FourSym0 = Four
- type FiveSym0 = Five
- type SixSym0 = Six
- type SevenSym0 = Seven
- type EightSym0 = Eight
- type NineSym0 = Nine
- type TenSym0 = Ten
- type ElevenSym0 = Eleven
- type TwelveSym0 = Twelve
- type ThirteenSym0 = Thirteen
- type FourteenSym0 = Fourteen
- type FifteenSym0 = Fifteen
- type SixteenSym0 = Sixteen
- type SeventeenSym0 = Seventeen
- type EighteenSym0 = Eighteen
- type NineteenSym0 = Nineteen
- type TwentySym0 = Twenty
- sZero :: Sing (ZeroSym0 :: Nat)
- sOne :: Sing (OneSym0 :: Nat)
- sTwo :: Sing (TwoSym0 :: Nat)
- sThree :: Sing (ThreeSym0 :: Nat)
- sFour :: Sing (FourSym0 :: Nat)
- sFive :: Sing (FiveSym0 :: Nat)
- sSix :: Sing (SixSym0 :: Nat)
- sSeven :: Sing (SevenSym0 :: Nat)
- sEight :: Sing (EightSym0 :: Nat)
- sNine :: Sing (NineSym0 :: Nat)
- sTen :: Sing (TenSym0 :: Nat)
- sEleven :: Sing (ElevenSym0 :: Nat)
- sTwelve :: Sing (TwelveSym0 :: Nat)
- sThirteen :: Sing (ThirteenSym0 :: Nat)
- sFourteen :: Sing (FourteenSym0 :: Nat)
- sFifteen :: Sing (FifteenSym0 :: Nat)
- sSixteen :: Sing (SixteenSym0 :: Nat)
- sSeventeen :: Sing (SeventeenSym0 :: Nat)
- sEighteen :: Sing (EighteenSym0 :: Nat)
- sNineteen :: Sing (NineteenSym0 :: Nat)
- sTwenty :: Sing (TwentySym0 :: Nat)
- n0 :: Nat
- n1 :: Nat
- n2 :: Nat
- n3 :: Nat
- n4 :: Nat
- n5 :: Nat
- n6 :: Nat
- n7 :: Nat
- n8 :: Nat
- n9 :: Nat
- n10 :: Nat
- n11 :: Nat
- n12 :: Nat
- n13 :: Nat
- n14 :: Nat
- n15 :: Nat
- n16 :: Nat
- n17 :: Nat
- n18 :: Nat
- n19 :: Nat
- n20 :: Nat
- type family N0 :: Nat where ...
- type family N1 :: Nat where ...
- type family N2 :: Nat where ...
- type family N3 :: Nat where ...
- type family N4 :: Nat where ...
- type family N5 :: Nat where ...
- type family N6 :: Nat where ...
- type family N7 :: Nat where ...
- type family N8 :: Nat where ...
- type family N9 :: Nat where ...
- type family N10 :: Nat where ...
- type family N11 :: Nat where ...
- type family N12 :: Nat where ...
- type family N13 :: Nat where ...
- type family N14 :: Nat where ...
- type family N15 :: Nat where ...
- type family N16 :: Nat where ...
- type family N17 :: Nat where ...
- type family N18 :: Nat where ...
- type family N19 :: Nat where ...
- type family N20 :: Nat where ...
- type N0Sym0 = N0
- type N1Sym0 = N1
- type N2Sym0 = N2
- type N3Sym0 = N3
- type N4Sym0 = N4
- type N5Sym0 = N5
- type N6Sym0 = N6
- type N7Sym0 = N7
- type N8Sym0 = N8
- type N9Sym0 = N9
- type N10Sym0 = N10
- type N11Sym0 = N11
- type N12Sym0 = N12
- type N13Sym0 = N13
- type N14Sym0 = N14
- type N15Sym0 = N15
- type N16Sym0 = N16
- type N17Sym0 = N17
- type N18Sym0 = N18
- type N19Sym0 = N19
- type N20Sym0 = N20
- sN0 :: Sing (N0Sym0 :: Nat)
- sN1 :: Sing (N1Sym0 :: Nat)
- sN2 :: Sing (N2Sym0 :: Nat)
- sN3 :: Sing (N3Sym0 :: Nat)
- sN4 :: Sing (N4Sym0 :: Nat)
- sN5 :: Sing (N5Sym0 :: Nat)
- sN6 :: Sing (N6Sym0 :: Nat)
- sN7 :: Sing (N7Sym0 :: Nat)
- sN8 :: Sing (N8Sym0 :: Nat)
- sN9 :: Sing (N9Sym0 :: Nat)
- sN10 :: Sing (N10Sym0 :: Nat)
- sN11 :: Sing (N11Sym0 :: Nat)
- sN12 :: Sing (N12Sym0 :: Nat)
- sN13 :: Sing (N13Sym0 :: Nat)
- sN14 :: Sing (N14Sym0 :: Nat)
- sN15 :: Sing (N15Sym0 :: Nat)
- sN16 :: Sing (N16Sym0 :: Nat)
- sN17 :: Sing (N17Sym0 :: Nat)
- sN18 :: Sing (N18Sym0 :: Nat)
- sN19 :: Sing (N19Sym0 :: Nat)
- sN20 :: Sing (N20Sym0 :: Nat)
Re-exported modules.
module Data.Singletons
Natural Numbers
Peano natural numbers. It will be promoted to the type-level natural number.
Singleton type for Nat
.
data family Sing k (a :: k) :: * #
The singleton kind-indexed data family.
data Sing Bool | |
data Sing Ordering | |
data Sing Nat | |
data Sing Symbol | |
data Sing () | |
data Sing Nat # | |
data Sing [a] | |
data Sing (Maybe a) | |
data Sing (NonEmpty a) | |
data Sing (Either a b) | |
data Sing (a, b) | |
data Sing ((~>) k1 k2) | |
data Sing (a, b, c) | |
data Sing (a, b, c, d) | |
data Sing (a, b, c, d, e) | |
data Sing (a, b, c, d, e, f) | |
data Sing (a, b, c, d, e, f, g) | |
Arithmetic functions and their singletons.
type family Min a (arg :: a) (arg1 :: a) :: a #
type Min Bool arg1 arg2 | |
type Min Ordering arg1 arg2 | |
type Min Nat arg1 arg2 | |
type Min Symbol arg1 arg2 | |
type Min () arg1 arg2 | |
type Min Nat a1 a2 # | |
type Min [a] arg1 arg2 | |
type Min (Maybe a) arg1 arg2 | |
type Min (NonEmpty a) arg1 arg2 | |
type Min (Either a b) arg1 arg2 | |
type Min (a, b) arg1 arg2 | |
type Min (a, b, c) arg1 arg2 | |
type Min (a, b, c, d) arg1 arg2 | |
type Min (a, b, c, d, e) arg1 arg2 | |
type Min (a, b, c, d, e, f) arg1 arg2 | |
type Min (a, b, c, d, e, f, g) arg1 arg2 | |
sMin :: SOrd a => forall (t1 :: a) (t2 :: a). Sing a t1 -> Sing a t2 -> Sing a (Apply a a (Apply a (TyFun a a -> Type) (MinSym0 a) t1) t2) #
type family Max a (arg :: a) (arg1 :: a) :: a #
type Max Bool arg1 arg2 | |
type Max Ordering arg1 arg2 | |
type Max Nat arg1 arg2 | |
type Max Symbol arg1 arg2 | |
type Max () arg1 arg2 | |
type Max Nat a1 a2 # | |
type Max [a] arg1 arg2 | |
type Max (Maybe a) arg1 arg2 | |
type Max (NonEmpty a) arg1 arg2 | |
type Max (Either a b) arg1 arg2 | |
type Max (a, b) arg1 arg2 | |
type Max (a, b, c) arg1 arg2 | |
type Max (a, b, c, d) arg1 arg2 | |
type Max (a, b, c, d, e) arg1 arg2 | |
type Max (a, b, c, d, e, f) arg1 arg2 | |
type Max (a, b, c, d, e, f, g) arg1 arg2 | |
sMax :: SOrd a => forall (t1 :: a) (t2 :: a). Sing a t1 -> Sing a t2 -> Sing a (Apply a a (Apply a (TyFun a a -> Type) (MaxSym0 a) t1) t2) #
data MinSym0 a6989586621679302787 (l :: TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type)) :: forall a6989586621679302787. TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type) -> * #
data MinSym1 a6989586621679302787 (l :: a6989586621679302787) (l1 :: TyFun a6989586621679302787 a6989586621679302787) :: forall a6989586621679302787. a6989586621679302787 -> TyFun a6989586621679302787 a6989586621679302787 -> * #
type MinSym2 a6989586621679302787 (t :: a6989586621679302787) (t1 :: a6989586621679302787) = Min a6989586621679302787 t t1 #
data MaxSym0 a6989586621679302787 (l :: TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type)) :: forall a6989586621679302787. TyFun a6989586621679302787 (TyFun a6989586621679302787 a6989586621679302787 -> Type) -> * #
data MaxSym1 a6989586621679302787 (l :: a6989586621679302787) (l1 :: TyFun a6989586621679302787 a6989586621679302787) :: forall a6989586621679302787. a6989586621679302787 -> TyFun a6989586621679302787 a6989586621679302787 -> * #
type MaxSym2 a6989586621679302787 (t :: a6989586621679302787) (t1 :: a6989586621679302787) = Max a6989586621679302787 t t1 #
(%+) :: forall nat (a :: nat) (b :: nat). SNum nat => Sing a -> Sing b -> Sing ((+) a b) infixl 6 Source #
(%*) :: forall nat (a :: nat) (b :: nat). SNum nat => Sing a -> Sing b -> Sing (* a b) infixl 7 Source #
(%-) :: forall nat (a :: nat) (b :: nat). SNum nat => Sing a -> Sing b -> Sing ((-) a b) infixl 6 Source #
Type-level predicate & judgements
type LeqInstance n m = IsTrue (n <= m) Source #
boolToClassLeq :: (n <= m) ~ True => SNat n -> SNat m -> LeqInstance n m Source #
propToClassLeq :: Leq n m -> LeqInstance n m Source #
propToBoolLeq :: forall n m. Leq n m -> LeqTrueInstance n m Source #
Conversion functions
Quasi quotes for natural numbers
snat :: QuasiQuoter Source #
Properties of natural numbers
class (SDecide nat, SNum nat, SEnum nat, SingKind nat, SingKind nat) => IsPeano nat where Source #
succOneCong, succNonCyclic, predSucc, plusMinus, succInj, (plusZeroL, plusSuccL | plusZeroR, plusZeroL), (multZeroL, multSuccL | multZeroR, multSuccR), induction
succOneCong :: Succ (Zero nat) :~: One nat Source #
succInj :: (Succ n :~: Succ (m :: nat)) -> n :~: m Source #
succInj' :: proxy n -> proxy' m -> (Succ n :~: Succ (m :: nat)) -> n :~: m Source #
succNonCyclic :: Sing n -> (Succ n :~: Zero nat) -> Void Source #
induction :: p (Zero nat) -> (forall n. Sing n -> p n -> p (S n)) -> Sing k -> p k Source #
plusMinus :: Sing (n :: nat) -> Sing m -> ((n + m) - m) :~: n Source #
plusMinus' :: Sing (n :: nat) -> Sing m -> ((n + m) - n) :~: m Source #
plusZeroL :: Sing n -> (Zero nat + n) :~: n Source #
plusSuccL :: Sing n -> Sing m -> (S n + m) :~: S (n + m :: nat) Source #
plusZeroR :: Sing n -> (n + Zero nat) :~: n Source #
plusSuccR :: Sing n -> Sing m -> (n + S m) :~: S (n + m :: nat) Source #
plusComm :: Sing n -> Sing m -> (n + m) :~: ((m :: nat) + n) Source #
plusAssoc :: forall n m l. Sing (n :: nat) -> Sing m -> Sing l -> ((n + m) + l) :~: (n + (m + l)) Source #
multZeroL :: Sing n -> (Zero nat * n) :~: Zero nat Source #
multSuccL :: Sing (n :: nat) -> Sing m -> (S n * m) :~: ((n * m) + m) Source #
multZeroR :: Sing n -> (n * Zero nat) :~: Zero nat Source #
multSuccR :: Sing n -> Sing m -> (n * S m) :~: ((n * m) + (n :: nat)) Source #
multComm :: Sing (n :: nat) -> Sing m -> (n * m) :~: (m * n) Source #
multOneR :: Sing n -> (n * One nat) :~: n Source #
multOneL :: Sing n -> (One nat * n) :~: n Source #
plusMultDistrib :: Sing (n :: nat) -> Sing m -> Sing l -> ((n + m) * l) :~: ((n * l) + (m * l)) Source #
multPlusDistrib :: Sing (n :: nat) -> Sing m -> Sing l -> (n * (m + l)) :~: ((n * m) + (n * l)) Source #
minusNilpotent :: Sing n -> (n - n) :~: Zero nat Source #
multAssoc :: Sing (n :: nat) -> Sing m -> Sing l -> ((n * m) * l) :~: (n * (m * l)) Source #
plusEqCancelL :: Sing (n :: nat) -> Sing m -> Sing l -> ((n + m) :~: (n + l)) -> m :~: l Source #
plusEqCancelR :: forall n m l. Sing (n :: nat) -> Sing m -> Sing l -> ((n + l) :~: (m + l)) -> n :~: m Source #
succAndPlusOneL :: Sing n -> Succ n :~: (One nat + n) Source #
succAndPlusOneR :: Sing n -> Succ n :~: (n + One nat) Source #
predSucc :: Sing n -> Pred (Succ n) :~: (n :: nat) Source #
zeroOrSucc :: Sing (n :: nat) -> ZeroOrSucc n Source #
plusEqZeroL :: Sing n -> Sing m -> ((n + m) :~: Zero nat) -> n :~: Zero nat Source #
plusEqZeroR :: Sing n -> Sing m -> ((n + m) :~: Zero nat) -> m :~: Zero nat Source #
predUnique :: Sing (n :: nat) -> Sing m -> (Succ n :~: m) -> n :~: Pred m Source #
multEqSuccElimL :: Sing (n :: nat) -> Sing m -> Sing l -> ((n * m) :~: Succ l) -> n :~: Succ (Pred n) Source #
multEqSuccElimR :: Sing (n :: nat) -> Sing m -> Sing l -> ((n * m) :~: Succ l) -> m :~: Succ (Pred m) Source #
minusZero :: Sing n -> (n - Zero nat) :~: n Source #
multEqCancelR :: Sing (n :: nat) -> Sing m -> Sing l -> ((n * Succ l) :~: (m * Succ l)) -> n :~: m Source #
succPred :: Sing n -> ((n :~: Zero nat) -> Void) -> Succ (Pred n) :~: n Source #
multEqCancelL :: Sing (n :: nat) -> Sing m -> Sing l -> ((Succ n * m) :~: (Succ n * l)) -> m :~: l Source #
sPred' :: proxy n -> Sing (Succ n) -> Sing (n :: nat) Source #
toNatural :: Sing (n :: nat) -> Natural Source #
fromNatural :: Natural -> SomeSing nat Source #
Properties of ordering Leq
class (SOrd nat, IsPeano nat) => PeanoOrder nat where Source #
(succLeqToLT, cmpZero, leqRefl | leqZero, leqSucc, viewLeq | leqWitness, leqStep), eqlCmpEQ, ltToLeq, eqToRefl, flipCompare, leqToCmp, leqReversed, lneqSuccLeq, lneqReversed, (leqToMin, geqToMin | minLeqL, minLeqR, minLargest), (leqToMax, geqToMax | maxLeqL, maxLeqR, maxLeast)
leqToCmp :: Sing (a :: nat) -> Sing b -> IsTrue (a <= b) -> Either (a :~: b) (Compare a b :~: LT) Source #
eqlCmpEQ :: Sing (a :: nat) -> Sing b -> (a :~: b) -> Compare a b :~: EQ Source #
eqToRefl :: Sing (a :: nat) -> Sing b -> (Compare a b :~: EQ) -> a :~: b Source #
flipCompare :: Sing (a :: nat) -> Sing b -> FlipOrdering (Compare a b) :~: Compare b a Source #
ltToNeq :: Sing (a :: nat) -> Sing b -> (Compare a b :~: LT) -> (a :~: b) -> Void Source #
leqNeqToLT :: Sing (a :: nat) -> Sing b -> IsTrue (a <= b) -> ((a :~: b) -> Void) -> Compare a b :~: LT Source #
succLeqToLT :: Sing (a :: nat) -> Sing b -> IsTrue (S a <= b) -> Compare a b :~: LT Source #
ltToLeq :: Sing (a :: nat) -> Sing b -> (Compare a b :~: LT) -> IsTrue (a <= b) Source #
gtToLeq :: Sing (a :: nat) -> Sing b -> (Compare a b :~: GT) -> IsTrue (b <= a) Source #
ltToSuccLeq :: Sing (a :: nat) -> Sing b -> (Compare a b :~: LT) -> IsTrue (Succ a <= b) Source #
cmpZero :: Sing a -> Compare (Zero nat) (Succ a) :~: LT Source #
leqToGT :: Sing (a :: nat) -> Sing b -> IsTrue (Succ b <= a) -> Compare a b :~: GT Source #
cmpZero' :: Sing a -> Either (Compare (Zero nat) a :~: EQ) (Compare (Zero nat) a :~: LT) Source #
zeroNoLT :: Sing a -> (Compare a (Zero nat) :~: LT) -> Void Source #
ltRightPredSucc :: Sing (a :: nat) -> Sing b -> (Compare a b :~: LT) -> b :~: Succ (Pred b) Source #
cmpSucc :: Sing (n :: nat) -> Sing m -> Compare n m :~: Compare (Succ n) (Succ m) Source #
ltSucc :: Sing (a :: nat) -> Compare a (Succ a) :~: LT Source #
cmpSuccStepR :: Sing (n :: nat) -> Sing m -> (Compare n m :~: LT) -> Compare n (Succ m) :~: LT Source #
ltSuccLToLT :: Sing (n :: nat) -> Sing m -> (Compare (Succ n) m :~: LT) -> Compare n m :~: LT Source #
leqToLT :: Sing (a :: nat) -> Sing b -> IsTrue (Succ a <= b) -> Compare a b :~: LT Source #
leqZero :: Sing n -> IsTrue (Zero nat <= n) Source #
leqSucc :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> IsTrue (Succ n <= Succ m) Source #
fromLeqView :: LeqView (n :: nat) m -> IsTrue (n <= m) Source #
leqViewRefl :: Sing (n :: nat) -> LeqView n n Source #
viewLeq :: forall n m. Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> LeqView n m Source #
leqWitness :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> DiffNat n m Source #
leqStep :: Sing (n :: nat) -> Sing m -> Sing l -> ((n + l) :~: m) -> IsTrue (n <= m) Source #
leqNeqToSuccLeq :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> ((n :~: m) -> Void) -> IsTrue (Succ n <= m) Source #
leqRefl :: Sing (n :: nat) -> IsTrue (n <= n) Source #
leqSuccStepR :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> IsTrue (n <= Succ m) Source #
leqSuccStepL :: Sing (n :: nat) -> Sing m -> IsTrue (Succ n <= m) -> IsTrue (n <= m) Source #
leqReflexive :: Sing (n :: nat) -> Sing m -> (n :~: m) -> IsTrue (n <= m) Source #
leqTrans :: Sing (n :: nat) -> Sing m -> Sing l -> IsTrue (n <= m) -> IsTrue (m <= l) -> IsTrue (n <= l) Source #
leqAntisymm :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> IsTrue (m <= n) -> n :~: m Source #
plusMonotone :: Sing (n :: nat) -> Sing m -> Sing l -> Sing k -> IsTrue (n <= m) -> IsTrue (l <= k) -> IsTrue ((n + l) <= (m + k)) Source #
leqZeroElim :: Sing n -> IsTrue (n <= Zero nat) -> n :~: Zero nat Source #
plusMonotoneL :: Sing (n :: nat) -> Sing m -> Sing (l :: nat) -> IsTrue (n <= m) -> IsTrue ((n + l) <= (m + l)) Source #
plusMonotoneR :: Sing n -> Sing m -> Sing (l :: nat) -> IsTrue (m <= l) -> IsTrue ((n + m) <= (n + l)) Source #
plusLeqL :: Sing (n :: nat) -> Sing m -> IsTrue (n <= (n + m)) Source #
plusLeqR :: Sing (n :: nat) -> Sing m -> IsTrue (m <= (n + m)) Source #
plusCancelLeqR :: Sing (n :: nat) -> Sing m -> Sing l -> IsTrue ((n + l) <= (m + l)) -> IsTrue (n <= m) Source #
plusCancelLeqL :: Sing (n :: nat) -> Sing m -> Sing l -> IsTrue ((n + m) <= (n + l)) -> IsTrue (m <= l) Source #
succLeqZeroAbsurd :: Sing n -> IsTrue (S n <= Zero nat) -> Void Source #
succLeqZeroAbsurd' :: Sing n -> (S n <= Zero nat) :~: False Source #
succLeqAbsurd :: Sing (n :: nat) -> IsTrue (S n <= n) -> Void Source #
succLeqAbsurd' :: Sing (n :: nat) -> (S n <= n) :~: False Source #
notLeqToLeq :: (n <= m) ~ False => Sing (n :: nat) -> Sing m -> IsTrue (m <= n) Source #
leqSucc' :: Sing (n :: nat) -> Sing m -> (n <= m) :~: (Succ n <= Succ m) Source #
leqToMin :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> Min n m :~: n Source #
geqToMin :: Sing (n :: nat) -> Sing m -> IsTrue (m <= n) -> Min n m :~: m Source #
minComm :: Sing (n :: nat) -> Sing m -> Min n m :~: Min m n Source #
minLeqL :: Sing (n :: nat) -> Sing m -> IsTrue (Min n m <= n) Source #
minLeqR :: Sing (n :: nat) -> Sing m -> IsTrue (Min n m <= m) Source #
minLargest :: Sing (l :: nat) -> Sing n -> Sing m -> IsTrue (l <= n) -> IsTrue (l <= m) -> IsTrue (l <= Min n m) Source #
leqToMax :: Sing (n :: nat) -> Sing m -> IsTrue (n <= m) -> Max n m :~: m Source #
geqToMax :: Sing (n :: nat) -> Sing m -> IsTrue (m <= n) -> Max n m :~: n Source #
maxComm :: Sing (n :: nat) -> Sing m -> Max n m :~: Max m n Source #
maxLeqR :: Sing (n :: nat) -> Sing m -> IsTrue (m <= Max n m) Source #
maxLeqL :: Sing (n :: nat) -> Sing m -> IsTrue (n <= Max n m) Source #
maxLeast :: Sing (l :: nat) -> Sing n -> Sing m -> IsTrue (n <= l) -> IsTrue (m <= l) -> IsTrue (Max n m <= l) Source #
leqReversed :: Sing (n :: nat) -> Sing m -> (n <= m) :~: (m >= n) Source #
lneqSuccLeq :: Sing (n :: nat) -> Sing m -> (n < m) :~: (Succ n <= m) Source #
lneqReversed :: Sing (n :: nat) -> Sing m -> (n < m) :~: (m > n) Source #
lneqToLT :: Sing (n :: nat) -> Sing (m :: nat) -> IsTrue (n < m) -> Compare n m :~: LT Source #
ltToLneq :: Sing (n :: nat) -> Sing (m :: nat) -> (Compare n m :~: LT) -> IsTrue (n < m) Source #
lneqZero :: Sing (a :: nat) -> IsTrue (Zero nat < Succ a) Source #
lneqSucc :: Sing (n :: nat) -> IsTrue (n < Succ n) Source #
succLneqSucc :: Sing (n :: nat) -> Sing (m :: nat) -> (n < m) :~: (Succ n < Succ m) Source #
lneqRightPredSucc :: Sing (n :: nat) -> Sing (m :: nat) -> IsTrue (n < m) -> m :~: Succ (Pred m) Source #
lneqSuccStepL :: Sing (n :: nat) -> Sing m -> IsTrue (Succ n < m) -> IsTrue (n < m) Source #
lneqSuccStepR :: Sing (n :: nat) -> Sing m -> IsTrue (n < m) -> IsTrue (n < Succ m) Source #
plusStrictMonotone :: Sing (n :: nat) -> Sing m -> Sing l -> Sing k -> IsTrue (n < m) -> IsTrue (l < k) -> IsTrue ((n + l) < (m + k)) Source #
maxZeroL :: Sing n -> Max (Zero nat) n :~: n Source #
maxZeroR :: Sing n -> Max n (Zero nat) :~: n Source #
minZeroL :: Sing n -> Min (Zero nat) n :~: Zero nat Source #
minZeroR :: Sing n -> Min n (Zero nat) :~: Zero nat Source #
minusSucc :: Sing (n :: nat) -> Sing m -> IsTrue (m <= n) -> (Succ n - m) :~: Succ (n - m) Source #
lneqZeroAbsurd :: Sing n -> IsTrue (n < Zero nat) -> Void Source #
minusPlus :: forall (n :: nat) m. PeanoOrder nat => Sing (n :: nat) -> Sing m -> IsTrue (m <= n) -> ((n - m) + m) :~: n Source #
Useful type synonyms and constructors
type ElevenSym0 = Eleven Source #
type TwelveSym0 = Twelve Source #
type ThirteenSym0 = Thirteen Source #
type FourteenSym0 = Fourteen Source #
type FifteenSym0 = Fifteen Source #
type SixteenSym0 = Sixteen Source #
type SeventeenSym0 = Seventeen Source #
type EighteenSym0 = Eighteen Source #
type NineteenSym0 = Nineteen Source #
type TwentySym0 = Twenty Source #
sSeventeen :: Sing (SeventeenSym0 :: Nat) Source #