0 | module Codec.Compression.Zlib.Proofs
 1 |
 2 | import Data.Array.Index
 3 |
 4 | %default total
 5 |
 6 | --------------------------------------------------------------------------------
 7 | --          Proofs
 8 | --------------------------------------------------------------------------------
 9 |
10 | ||| Every natural number is less than or equal to itself.
11 | |||
12 | export
13 | lteReflexive : (n : Nat) -> LTE n n
14 | lteReflexive 0     = LTEZero
15 | lteReflexive (S n) = LTESucc (lteReflexive n)
16 |
17 | ||| Proof that a full buffer range beginning at offset zero is in bounds.
18 | |||
19 | export
20 | zeroOffsetInBounds : (n : Nat) -> LTE (0 + n) n
21 | zeroOffsetInBounds n =
22 |   lteReflexive n
23 |
24 | ||| Zero is less than or equal to every natural number.
25 | |||
26 | export
27 | zeroLTE : (n : Nat) -> LTE 0 n
28 | zeroLTE _ = LTEZero
29 |