跳到內容

nat

本頁內容尚未翻譯。

def Nat.mulComm (m : Nat) (n : Nat) : mul m n = mul n m

Commutativity of natural-number multiplication: m * n = n * m.

def Nat.mulDistribL (m : Nat) (n : Nat) (k : Nat) : mul (add m n) k = add (mul m k) (mul n k)

Multiplication distributes over addition on the left factor: (m + n) * k = m * k + n * k.

def Nat.mulDistribR (m : Nat) (n : Nat) (k : Nat) : mul m (add n k) = add (mul m n) (mul m k)

Multiplication distributes over addition on the right factor: m * (n + k) = m * n + m * k.

def Nat.mulAssoc (m : Nat) (n : Nat) (k : Nat) : mul (mul m n) k = mul m (mul n k)

Associativity of natural-number multiplication: (m * n) * k = m * (n * k).

def Nat.mulTwoR (n : Nat) : mul (succ (succ zero)) n = add n n

Doubling as multiplication: 2 * n = n + n.

def Nat.mulOneLNat (n : Nat) : mul (succ zero) n = n

One is a left identity for multiplication: 1 * n = n.

def Nat.subSelf (n : Nat) : sub n n = zero

Truncated subtraction of a number from itself is zero: n - n = 0.

def Nat.beqReflNat (n : Nat) : Nat.beq n n = true

Boolean equality is reflexive: Nat.beq n n = true.

def Nat.bltRefl (n : Nat) : Nat.blt n n = false

Strict less-than is irreflexive as a boolean test: Nat.blt n n = false.

def Nat.bltZeroSucc (n : Nat) : Nat.blt zero (succ n) = true

Zero is strictly less than every successor: Nat.blt 0 (n + 1) = true.

def Nat.maxZeroL (n : Nat) : max zero n = n

Zero is a left identity for max: max 0 n = n.

def Nat.minZeroL (n : Nat) : min zero n = zero

Zero absorbs min on the left: min 0 n = 0.

def Nat.subZeroL (n : Nat) : sub zero n = zero

Truncated subtraction from zero is zero: 0 - n = 0.

def Nat.addSuccRSym (m : Nat) (n : Nat) : succ (add m n) = add m (succ n)

Moving succ out of the right summand, in reverse direction: succ (m + n) = m + succ n.

def Nat.powSucc (b : Nat) (n : Nat) : Nat.pow b (succ n) = mul b (Nat.pow b n)

Unfolding of power at a successor exponent: b ^ (n + 1) = b * b ^ n.

def Nat.mulOneRNat (n : Nat) : mul n (succ zero) = n

One is a right identity for multiplication: n * 1 = n.

def Nat.powOneBase (n : Nat) : Nat.pow (succ zero) n = succ zero

Every power of one is one: 1 ^ n = 1.

def Nat.triple (n : Nat) : Nat

Triple a natural number: n + (n + n).

def Nat.succPred (n : Nat) : succ (pred (succ n)) = succ n

Taking the predecessor of a successor and then the successor gives it back: succ (pred (succ n)) = succ n.

def Nat.predSucc (n : Nat) : pred (succ n) = n

The predecessor of a successor: pred (succ n) = n.

def Nat.addCommNat (m : Nat) (n : Nat) : add m n = add n m

Commutativity of natural-number addition: m + n = n + m.

def Nat.addRightSucc (m : Nat) (n : Nat) : add m (succ n) = succ (add m n)

Moving succ out of the right summand: m + succ n = succ (m + n).

def Nat.mulZeroLNat (n : Nat) : mul zero n = zero

Zero absorbs multiplication on the left: 0 * n = 0.

def Nat.powZeroBase (n : Nat) : Nat.pow zero (succ n) = zero

Zero to any positive power is zero: 0 ^ (n + 1) = 0.

def Nat.factorialSucc (n : Nat) : factorial (succ n) = mul (succ n) (factorial n)

Unfolding of factorial at a successor: (n + 1)! = (n + 1) * n!.

def Nat.isEvenB (n : Nat) : Bool

Boolean test for whether a natural number is even.

def Nat.addAssocNat (m : Nat) (n : Nat) (o : Nat) : add m (add n o) = add (add m n) o

Associativity of natural-number addition, right-nested to left-nested: m + (n + o) = (m + n) + o.

def Nat.sumTo (n : Nat) : Nat

Sum of the natural numbers from 1 to n.

def Nat.subSuccSucc (m : Nat) (n : Nat) : sub (succ m) (succ n) = sub m n

Truncated subtraction cancels a common successor: (m + 1) - (n + 1) = m - n.

def Nat.isOddB (n : Nat) : Bool

Boolean test for whether a natural number is odd (the negation of isEvenB).

def Nat.powOneExp (n : Nat) : Nat.pow n (succ zero) = n

The first power of a number is the number itself: n ^ 1 = n.

def Nat.addLeftCancelZero (n : Nat) : add zero n = n

Zero is a left identity for addition: 0 + n = n.

def Nat.square (n : Nat) : Nat

The square of a natural number: n * n.

def Nat.cube (n : Nat) : Nat

The cube of a natural number: n * (n * n).

def Nat.predNat (n : Nat) : Nat

Predecessor of a natural number, sending zero to zero.

def Nat.absDiff (m : Nat) (n : Nat) : Nat

Absolute difference of two naturals, |m - n|, computed as (m - n) + (n - m) with truncated subtraction.

def Nat.predNatSucc (n : Nat) : predNat (succ n) = n

The predecessor of a successor: predNat (n + 1) = n.

def Nat.predNatZero : predNat zero = zero

The predecessor of zero is zero.

def Nat.powZero (b : Nat) : pow b zero = succ zero

Any base to the exponent zero is one: pow b 0 = 1.

def Nat.powOne (b : Nat) : pow b (succ zero) = b

Any base to the exponent one is itself: pow b 1 = b.

def Nat.absDiffSelf (n : Nat) : absDiff n n = zero

The absolute difference of a number with itself is zero.

def Nat.divMod (m : Nat) (n : Nat) : Nat × Nat

Quotient and remainder of m divided by n, as a pair.

def Nat.doubleNat (n : Nat) : Nat

Double a natural number: n + n.

def Nat.halve (n : Nat) : Nat

Halve a natural number, rounding down (division by 2).

def Nat.tripleNat (n : Nat) : Nat

Triple a natural number: n + (n + n).

def Nat.n0 : Nat

The natural number 0, as a named constant.

def Nat.n1 : Nat

The natural number 1, as a named constant.

def Nat.n2 : Nat

The natural number 2, as a named constant.

def Nat.n3 : Nat

The natural number 3, as a named constant.

def Nat.n4 : Nat

The natural number 4, as a named constant.

def Nat.n5 : Nat

The natural number 5, as a named constant.

def Nat.n6 : Nat

The natural number 6, as a named constant.

def Nat.n7 : Nat

The natural number 7, as a named constant.

def Nat.n8 : Nat

The natural number 8, as a named constant.

def Nat.n9 : Nat

The natural number 9, as a named constant.

def Nat.n10 : Nat

The natural number 10, as a named constant.

def Nat.n11 : Nat

The natural number 11, as a named constant.

def Nat.n12 : Nat

The natural number 12, as a named constant.

def Nat.n13 : Nat

The natural number 13, as a named constant.

def Nat.n14 : Nat

The natural number 14, as a named constant.

def Nat.n15 : Nat

The natural number 15, as a named constant.

def Nat.n16 : Nat

The natural number 16, as a named constant.

def Nat.n17 : Nat

The natural number 17, as a named constant.

def Nat.n18 : Nat

The natural number 18, as a named constant.

def Nat.n19 : Nat

The natural number 19, as a named constant.

def Nat.n20 : Nat

The natural number 20, as a named constant.

def Nat.quadruple (n : Nat) : Nat

Quadruple a natural number: (n + n) + (n + n).

def Nat.quintuple (n : Nat) : Nat

Quintuple a natural number: n + 4n.

def Nat.isNonZero (n : Nat) : Bool

Boolean test for whether a natural number is nonzero.

def Nat.saturatingSub (m : Nat) (n : Nat) : Nat

Saturating subtraction: m - n, or zero when n exceeds m (an explicit name for sub).

def Nat.n24 : Nat

The natural number 24, as a named constant.

def Nat.n21 : Nat

The natural number 21, as a named constant.

def Nat.divAux (fuel : Nat) (m : Nat) (n : Nat) : Nat

Division m / n by repeated subtraction, bounded by fuel; returns zero when n is zero or the fuel runs out.

def Nat.div2 (m : Nat) (n : Nat) : Nat

Division m / n by repeated subtraction, with enough fuel to finish; returns zero when n is zero.

def Nat.n22 : Nat

The natural number 22, as a named constant.

def Nat.n25 : Nat

The natural number 25, as a named constant.

def Nat.n27 : Nat

The natural number 27, as a named constant.

def Nat.n28 : Nat

The natural number 28, as a named constant.

-- T097: change proofs /-- Zero is a left identity for addition (proved with change): 0 + n = n. -/ -- =================================================================== -- Tactic 實戰驗證 (simp, injection, discriminate, conv, etc.) -- =================================================================== -- T009: simp with @[simp] lemma (NbE-solvable) /-- Adding zero twice on the left changes nothing: 0 + (0 + n) = n. -/ theorem Nat.simpAddZeroAddZero (n : Nat) : add zero (add zero n) = n

Zero is a left identity for addition, registered as a simp lemma: 0 + n = n.

theorem Nat.simpAddZeroSuccN (n : Nat) : add zero (succ n) = succ n

Zero is a left identity for addition at a successor: 0 + succ n = succ n.

theorem Nat.zeroNeqSucc (n : Nat) (h : zero = succ n) : Empty

Zero is not a successor: a proof of zero = succ n yields Empty.

theorem Nat.first_test : Nat

A natural number built with the first tactic, which picks the first alternative that succeeds (here one).

def Nat.gcdFuel (fuel : Nat) (m : Nat) (n : Nat) : Nat

Greatest common divisor by the Euclidean algorithm, bounded by fuel.

def Nat.gcdNat (m : Nat) (n : Nat) : Nat

Greatest common divisor of two natural numbers.

def Nat.lcmNat (m : Nat) (n : Nat) : Nat

Least common multiple of two natural numbers: m * n / gcd m n.

data Even : Nat -> Type

Proof-relevant evenness predicate: zero is even, and n + 2 is even when n is.

data Odd : Nat -> Type

Proof-relevant oddness predicate: one is odd, and n + 2 is odd when n is.

def Nat.even0 : Even n0

Evidence that 0 is even.

def Nat.even2 : Even n2

Evidence that 2 is even.

def Nat.even4 : Even n4

Evidence that 4 is even.

def Nat.even6 : Even n6

Evidence that 6 is even.

def Nat.even8 : Even n8

Evidence that 8 is even.

def Nat.even10 : Even n10

Evidence that 10 is even.

def Nat.odd1 : Odd n1

Evidence that 1 is odd.

def Nat.odd3 : Odd n3

Evidence that 3 is odd.

def Nat.odd5 : Odd n5

Evidence that 5 is odd.

def Nat.odd7 : Odd n7

Evidence that 7 is odd.

def Nat.odd9 : Odd n9

Evidence that 9 is odd.

def Nat.evenPlus2 (n : Nat) (ev : Even n) : Even (succ (succ n))

If n is even then n + 2 is even.

def Nat.oddPlus2 (n : Nat) (od : Odd n) : Odd (succ (succ n))

If n is odd then n + 2 is odd.

def Nat.bltSuccZero (n : Nat) : Nat.blt (succ n) zero = false

No successor is strictly less than zero: Nat.blt (n + 1) 0 = false.

def Nat.beqZeroSucc (n : Nat) : Nat.beq zero (succ n) = false

Zero is not boolean-equal to any successor: Nat.beq 0 (n + 1) = false.

def Nat.beqSuccZero (n : Nat) : Nat.beq (succ n) zero = false

No successor is boolean-equal to zero: Nat.beq (n + 1) 0 = false.

def Nat.maxZeroR (n : Nat) : max n zero = n

Zero is a right identity for max: max n 0 = n.

def Nat.minZeroR (n : Nat) : min n zero = zero

Zero absorbs min on the right: min n 0 = 0.

theorem Nat.succInjV2 (a : Nat) (b : Nat) (h : succ a = succ b) : a = b

The successor constructor is injective: succ a = succ b implies a = b.

def Nat.succSuccInj (a : Nat) (b : Nat) (h : succ (succ a) = succ (succ b)) : a = b

Applying succ twice is injective: succ (succ a) = succ (succ b) implies a = b.

theorem Nat.succNeqZero (n : Nat) (h : succ n = zero) : Empty

No successor is zero: a proof of succ n = zero yields Empty.

def Nat.n23 : Nat

The natural number 23, as a named constant.

def Nat.n26 : Nat

The natural number 26, as a named constant.

def Nat.n29 : Nat

The natural number 29, as a named constant.

def Nat.n30 : Nat

The natural number 30, as a named constant.

def Nat.subZeroR (n : Nat) : sub n zero = n

Zero is a right identity for truncated subtraction: n - 0 = n.

def Nat.isEvenBSS (n : Nat) : isEvenB (succ (succ n)) = isEvenB n

Adding two preserves evenness: isEvenB (n + 2) = isEvenB n.

def Nat.isOddBSS (n : Nat) : isOddB (succ (succ n)) = isOddB n

Adding two preserves oddness: isOddB (n + 2) = isOddB n.

def Nat.even12 : Even n12

Evidence that 12 is even.

def Nat.even14 : Even n14

Evidence that 14 is even.

def Nat.even16 : Even n16

Evidence that 16 is even.

def Nat.even18 : Even n18

Evidence that 18 is even.

def Nat.even20 : Even n20

Evidence that 20 is even.

def Nat.odd11 : Odd n11

Evidence that 11 is odd.

def Nat.odd13 : Odd n13

Evidence that 13 is odd.

def Nat.odd15 : Odd n15

Evidence that 15 is odd.

def Nat.odd17 : Odd n17

Evidence that 17 is odd.

def Nat.odd19 : Odd n19

Evidence that 19 is odd.

def Nat.n36 : Nat

The natural number 36, as 6 * 6.

def Nat.n49 : Nat

The natural number 49, as 7 * 7.

def Nat.Divides (m : Nat) (n : Nat) : Type

Divisibility: m divides n when m * k = n for some k.

def Nat.dividesRefl (n : Nat) : Divides n n

Every natural number divides itself.

def Nat.onesDivides (n : Nat) : Divides (succ zero) n

One divides every natural number.

def Nat.dividesZero (n : Nat) : Divides n zero

Every natural number divides zero.

def Nat.prime2 : Nat

The prime number 2, as a named constant.

def Nat.prime3 : Nat

The prime number 3, as a named constant.

def Nat.prime5 : Nat

The prime number 5, as a named constant.

def Nat.prime7 : Nat

The prime number 7, as a named constant.

def Nat.zeroBle (n : Nat) : Nat.ble zero n = true

Zero is below every natural number.

def Nat.bleAddSelf (x : Nat) (y : Nat) : Nat.ble x (add x y) = true

A number is at most itself plus anything: x <= x + y.

def Nat.bleTrans (a : Nat) (b : Nat) (c : Nat) : Nat.ble a b = true -> Nat.ble b c = true -> Nat.ble a c = true

Less-or-equal is transitive.

def Nat.bleAddLeft (k : Nat) (a : Nat) (b : Nat) (h : Nat.ble a b = true) : Nat.ble (add k a) (add k b) = true

Adding the same number on the left keeps the order: a <= b gives k + a <= k + b.

def Nat.bltFalseOfBle (a : Nat) (b : Nat) : Nat.ble a b = true -> Nat.blt b a = false

Less-or-equal rules out strictly greater: a <= b gives not (b < a).

def Nat.bleMulLeft (c : Nat) (a : Nat) (b : Nat) (h : Nat.ble a b = true) : Nat.ble (mul c a) (mul c b) = true

Multiplying on the left keeps the order: a <= b gives c * a <= c * b.

def Nat.bleMulRight (c : Nat) (a : Nat) (b : Nat) (h : Nat.ble a b = true) : Nat.ble (mul a c) (mul b c) = true

Multiplying on the right keeps the order: a <= b gives a * c <= b * c.

def Nat.bleMulBoth (a : Nat) (b : Nat) (c : Nat) (d : Nat) (hab : Nat.ble a b = true) (hcd : Nat.ble c d = true) : Nat.ble (mul a c) (mul b d) = true

Products are monotone in both factors: a <= b and c <= d give a * c <= b * d.

def Nat.squareDouble (x : Nat) : mul (mul 2 x) (mul 2 x) = mul 4 (mul x x)

The square of a double is four times the square: (2x)(2x) = 4(x x).

def Nat.bltAddLeft (k : Nat) (a : Nat) (b : Nat) (h : Nat.blt a b = true) : Nat.blt (add k a) (add k b) = true

Adding the same number on the left keeps a strict order.

def Nat.bltBleTrans (a : Nat) (b : Nat) (c : Nat) : Nat.blt a b = true -> Nat.ble b c = true -> Nat.blt a c = true

A strict order followed by an order is strict: a < b <= c gives a < c.

def Nat.bltOfBleFalse (a : Nat) (b : Nat) : Nat.ble a b = false -> Nat.blt b a = true

Not at most means strictly above: not (a <= b) gives b < a.

def Nat.sqrtStep (n : Nat) (r : Nat) : Nat

One digit of the square root: given 2 * sqrt (n / 4), take one more when it still fits.

def Nat.sqrtFuel (fuel : Nat) (n : Nat) : Nat

The square root by halving in base 4, with fuel bounding the depth (n itself is enough); stops at zero.

def Nat.sqrtDigits (n : Nat) : Nat

The integer square root digit by digit (the version the proofs are about).

def Nat.mulFourQuarterBle (n : Nat) : Nat.ble (mul 4 (Nat.div n 4)) n = true

Four times a quarter is at most the number: 4 * (n / 4) <= n.

def Nat.sqrtDoubleSquareLe (n : Nat) (r0 : Nat) (h : Nat.ble (mul r0 r0) (Nat.div n 4) = true) : Nat.ble (mul (mul 2 r0) (mul 2 r0)) n = true

Twice the square root of the quarter squares to at most n.

def Nat.sqrtStepSquareLeAt (n : Nat) (r : Nat) (b : Bool) (e : Nat.ble (mul (succ r) (succ r)) n = b) (low : Nat.ble (mul r r) n = true) : Nat.ble (mul (match b with | true => succ r | false => r) (match b with | true => succ r | false => r)) n = true

The step keeps the lower bound: either the candidate fits, or the doubled root does.

def Nat.sqrtFuelSquareLe (fuel : Nat) (n : Nat) : Nat.ble (mul (Nat.sqrtFuel fuel n) (Nat.sqrtFuel fuel n)) n = true

The fueled square root never overshoots: s * s <= n.

def Nat.bleSuccOfBlt (a : Nat) (b : Nat) : Nat.blt a b = true -> Nat.ble (succ a) b = true

Strictly below means one more is at most: a < b gives a + 1 <= b.

def Nat.bleOfMulFourBleSucc (q : Nat) (m : Nat) : Nat.ble (mul q 4) (succ m) = true -> Nat.ble q m = true

Four times q at most m + 1 gives q at most m.

def Nat.quarterBleFuel (m : Nat) (f : Nat) (h : Nat.ble m f = true) : Nat.ble (Nat.div (succ m) 4) f = true

The quarter of a positive number within the fuel fits the remaining fuel.

def Nat.bltMulFourSuccQuarter (n : Nat) : Nat.blt n (mul 4 (succ (Nat.div n 4))) = true

A number is below four times one more than its quarter: n < 4 * (n / 4 + 1).

def Nat.ltSuccSqrtStepSquareAt (n : Nat) (r : Nat) (b : Bool) (e : Nat.ble (mul (succ r) (succ r)) n = b) (top : Nat.blt n (mul (succ (succ r)) (succ (succ r))) = true) : Nat.blt n (mul (succ (match b with | true => succ r | false => r)) (succ (match b with | true => succ r | false => r))) = true

The step keeps the upper bound: either the candidate fits and the next one does not, or it does not fit.

def Nat.ltSuccSuccSqrtDoubleSquare (n : Nat) (r0 : Nat) (h : Nat.blt (Nat.div n 4) (mul (succ r0) (succ r0)) = true) : Nat.blt n (mul (succ (succ (mul 2 r0))) (succ (succ (mul 2 r0)))) = true

Twice the root of the quarter, plus two, squares above n.

def Nat.ltSuccSqrtFuelSquare (fuel : Nat) (n : Nat) : Nat.ble n fuel = true -> Nat.blt n (mul (succ (Nat.sqrtFuel fuel n)) (succ (Nat.sqrtFuel fuel n))) = true

The fueled square root is the largest such: n < (s + 1) * (s + 1), while n is within the fuel.

def Nat.sqrtDigitsSquareLe (n : Nat) : Nat.ble (mul (Nat.sqrtDigits n) (Nat.sqrtDigits n)) n = true

The digit-by-digit square root does not overshoot.

def Nat.ltSuccSqrtDigitsSquare (n : Nat) : Nat.blt n (mul (succ (Nat.sqrtDigits n)) (succ (Nat.sqrtDigits n))) = true

The digit-by-digit square root is the largest such.

def Nat.sqrtNewtonGo (n : Nat) (x : Nat) (fuel : Nat) : Nat

Newton’s method for the square root from a start above the root; fuel bounds the iterations.

def Nat.sqrtNewton (n : Nat) : Nat

A fast guess for the square root: Newton’s method from 2 to the half bit length (a few iterations).

def Nat.isSqrtOf (n : Nat) (r : Nat) : Bool

Whether r is the integer square root of n: r * r <= n < (r + 1) * (r + 1).

def Nat.sqrt (n : Nat) : Nat

The integer square root: the largest s with s * s <= n. Runs Newton’s method and checks the answer; the digit-by-digit version is the fallback, so the specification holds without proving that Newton converges.

def Nat.sqrtChecked (n : Nat) (r : Nat) : Nat

The candidate r when it is the square root of n, otherwise the digit-by-digit answer.

def Nat.sqrtSquareLeAt (n : Nat) (r : Nat) (b : Bool) (e : Nat.isSqrtOf n r = b) : Nat.ble (mul (match b with | true => r | false => Nat.sqrtDigits n) (match b with | true => r | false => Nat.sqrtDigits n)) n = true

The checked answer does not overshoot, whichever way the check went.

def Nat.ltSuccSqrtSquareAt (n : Nat) (r : Nat) (b : Bool) (e : Nat.isSqrtOf n r = b) : Nat.blt n (mul (succ (match b with | true => r | false => Nat.sqrtDigits n)) (succ (match b with | true => r | false => Nat.sqrtDigits n))) = true

The checked answer is the largest such, whichever way the check went.

def Nat.sqrtSquareLe (n : Nat) : Nat.ble (mul (Nat.sqrt n) (Nat.sqrt n)) n = true

The square root does not overshoot: sqrt n * sqrt n <= n.

def Nat.ltSuccSqrtSquare (n : Nat) : Nat.blt n (mul (succ (Nat.sqrt n)) (succ (Nat.sqrt n))) = true

The square root is the largest such: n < (sqrt n + 1) * (sqrt n + 1).

def Nat.bitLengthFuel (fuel : Nat) (n : Nat) : Nat

The number of binary digits, counting from the highest set bit; with fuel bounding the depth, stops at zero.

def Nat.bitLength (n : Nat) : Nat

The number of binary digits of n (zero has none).

def Nat.bltZeroFalse (m : Nat) : Nat.blt m zero = false

Nothing is below zero, as a boolean: m < 0 is false.

def Nat.halveStep (fuel : Nat) (q : Nat) (m : Nat) (b : Bool) : Nat

One step of halving: the division loop at m + 2 with m < 2 decided by b.

def Nat.halveDoubleAux (p : Nat) (fuel : Nat) (q : Nat) : Nat.ble (succ p) fuel = true -> Nat.divAuxFuel fuel q (add p p) 2 = add q p

The halving loop on p + p with enough fuel returns q + p.

def Nat.bleSuccSuccAdd (p : Nat) (r : Nat) : Nat.ble (succ p) (succ (add p r)) = true

One more than p is at most one more than p plus anything.

def Nat.halfDouble (p : Nat) : Nat.div (add p p) 2 = p

Half of a double is the number: (p + p) / 2 = p.

def Nat.halfPowTwo (k : Nat) : Nat.div (Nat.pow 2 (succ k)) 2 = Nat.pow 2 k

Half of a power of two is the next lower power: 2^(k+1) / 2 = 2^k.

def Nat.bltSubOfBltAdd (p : Nat) (q : Nat) (i : Nat) : Nat.blt i (add p q) = true -> Nat.blt i p = false -> Nat.blt (sub i p) q = true

Past the first part of a sum, the rest is below the second part: i < p + q and not i < p give i - p < q.

def Nat.bltDoubleOfBltPowSucc (k : Nat) (i : Nat) (h : Nat.blt i (Nat.pow 2 (succ k)) = true) : Nat.blt i (add (Nat.pow 2 k) (Nat.pow 2 k)) = true

Below the next power of two means below twice this one: i < 2^(k+1) gives i < 2^k + 2^k.

def Nat.bltSelfAddOfPos (p : Nat) (q : Nat) (h : Nat.blt zero q = true) : Nat.blt p (add p q) = true

A number is below itself plus something positive.

def Nat.bleBltTrans (a : Nat) (b : Nat) (c : Nat) (h1 : Nat.ble a b = true) (h2 : Nat.blt b c = true) : Nat.blt a c = true

An order followed by a strict order is strict: a <= b < c gives a < c.