feat(library/data/nat): add more basic theorems for definitional package

This commit is contained in:
Leonardo de Moura 2014-11-22 13:11:16 -08:00
parent faf736a9d2
commit 21b16fd97c
2 changed files with 10 additions and 5 deletions

View file

@ -314,4 +314,14 @@ namespace nat
(lt.trans (@ih b₁ bpos) (lt.base a₁)))),
λ h₁ h₂, aux h₁ h₂
definition sub_pred (a : nat) : pred a ≤ a :=
cases_on a
(le.refl zero)
(λ a₁, le.of_lt (lt.base a₁))
definition sub_le_self (a b : nat) : a - b ≤ a :=
induction_on b
(le.refl a)
(λ b₁ ih, le.trans !sub_pred ih)
end nat

View file

@ -222,11 +222,6 @@ or.elim !le_total
(assume H3 : n ≤ m, (le_imp_sub_eq_zero H3)⁻¹ ▸ (H1 H3))
(assume H3 : m ≤ n, H2 (n - m) (add_sub_le H3))
theorem sub_le_self (n m : ) : n - m ≤ n :=
sub_split
(assume H : n ≤ m, !zero_le)
(take k : , assume H : m + k = n, le_intro (!add.comm ▸ H))
theorem le_elim_sub {n m : } (H : n ≤ m) : ∃k, m - k = n :=
obtain (k : ) (Hk : n + k = m), from le_elim H,
exists_intro k