Library rt.util.nat
Require Import rt.util.tactics rt.util.ssromega.
(* Additional lemmas about natural numbers. *)
Section NatLemmas.
Lemma addnb (b1 b2 : bool) : (b1 + b2) != 0 = b1 || b2.
Lemma subh1 :
∀ m n p,
m ≥ n →
m - n + p = m + p - n.
Lemma subh2 :
∀ m1 m2 n1 n2,
m1 ≥ m2 →
n1 ≥ n2 →
(m1 + n1) - (m2 + n2) = m1 - m2 + (n1 - n2).
Lemma subh3 :
∀ m n p,
m + p ≤ n →
n ≥ p →
m ≤ n - p.
Lemma subh4:
∀ m n p,
m ≤ n →
p ≤ n →
(m == n - p) = (p == n - m).
Lemma addmovr:
∀ m n p,
m ≥ n →
(m - n = p ↔ m = p + n).
Lemma addmovl:
∀ m n p,
m ≥ n →
(p = m - n ↔ p + n = m).
Lemma ltSnm : ∀ n m, n.+1 < m → n < m.
Lemma min_lt_same :
∀ x y z,
minn x z < minn y z → x < y.
Lemma add_subC:
∀ a b c,
a ≥ c →
b ≥c →
a + (b - c ) = a - c + b.
Lemma ltn_subLR:
∀ a b c,
a - c < b →
a < b + c.
End NatLemmas.
(* Additional lemmas about natural numbers. *)
Section NatLemmas.
Lemma addnb (b1 b2 : bool) : (b1 + b2) != 0 = b1 || b2.
Lemma subh1 :
∀ m n p,
m ≥ n →
m - n + p = m + p - n.
Lemma subh2 :
∀ m1 m2 n1 n2,
m1 ≥ m2 →
n1 ≥ n2 →
(m1 + n1) - (m2 + n2) = m1 - m2 + (n1 - n2).
Lemma subh3 :
∀ m n p,
m + p ≤ n →
n ≥ p →
m ≤ n - p.
Lemma subh4:
∀ m n p,
m ≤ n →
p ≤ n →
(m == n - p) = (p == n - m).
Lemma addmovr:
∀ m n p,
m ≥ n →
(m - n = p ↔ m = p + n).
Lemma addmovl:
∀ m n p,
m ≥ n →
(p = m - n ↔ p + n = m).
Lemma ltSnm : ∀ n m, n.+1 < m → n < m.
Lemma min_lt_same :
∀ x y z,
minn x z < minn y z → x < y.
Lemma add_subC:
∀ a b c,
a ≥ c →
b ≥c →
a + (b - c ) = a - c + b.
Lemma ltn_subLR:
∀ a b c,
a - c < b →
a < b + c.
End NatLemmas.