mtonnberg / refinement-proofs / RefinementProofs.Proofs.NumberProofs

Some basic number proofs

Definition


type Even

An even Int


type alias Negative =
RefinementProofs.Theory.Not ZeroOrGreater

A negative number. Alias for Not ZeroOrGreater


type alias Odd =
RefinementProofs.Theory.Not Even

alias for Not Even


type Positive

A positive number


type Zero

A number that is Zero


type alias ZeroOrGreater =
RefinementProofs.Theory.Or Zero Positive

type alias for Or Zero Positive. If used with an Int this the number is 0,1,2,3,....

Proofs

proveEven : Basics.Int -> Maybe (RefinementProofs.Theory.Proven Basics.Int Even)

Prove that a number is even

proveNegative : number -> Maybe (RefinementProofs.Theory.Proven number Negative)

Prove a number is negative

proveOdd : Basics.Int -> Maybe (RefinementProofs.Theory.Proven Basics.Int Odd)

Prove that a number is odd

provePositive : number -> Maybe (RefinementProofs.Theory.Proven number Positive)

Prove that a number is positive (>0)

proveZeroOrGreater : number -> Maybe (RefinementProofs.Theory.Proven number ZeroOrGreater)

Prove that a number is either zero or greater

Implications

allPositivesAreZeroOrGreater : RefinementProofs.Theory.Implies Positive ZeroOrGreater

A simple implication. Note this is strictly not needed since this implication is clear in the types - ZeroOrGreater = Or Zero Positive. An alternative is to use introOrL or or.