Advertisement
tinyevil

Untitled

Nov 29th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. ge_dec =
  2. fun n m : nat => le_dec m n
  3. : forall n m : nat, {n >= m} + {~ n >= m}
  4.  
  5. le_dec =
  6. fun n m : nat =>
  7. let s := le_gt_dec n m in
  8. match s with
  9. | left l => left l
  10. | right g => right (gt_not_le n m g)
  11. end
  12. : forall n m : nat, {n <= m} + {~ n <= m}
  13.  
  14.  
  15. le_gt_dec =
  16. fun n m : nat => le_lt_dec n m
  17. : forall n m : nat, {n <= m} + {n > m}
  18.  
  19. le_lt_dec =
  20. fun n m : nat =>
  21. nat_rec (fun n0 : nat => forall m0 : nat, {n0 <= m0} + {m0 < n0})
  22. (fun m0 : nat => left (Nat.le_0_l m0))
  23. (fun (n0 : nat) (IHn : forall m0 : nat, {n0 <= m0} + {m0 < n0}) (m0 : nat)
  24. =>
  25. match m0 as n1 return ({S n0 <= n1} + {n1 < S n0}) with
  26. | 0 => right (gt_le_S 0 (S n0) (lt_le_S 0 (S n0) (Nat.lt_0_succ n0)))
  27. | S m1 =>
  28. sumbool_rec
  29. (fun _ : {n0 <= m1} + {m1 < n0} => {S n0 <= S m1} + {S m1 < S n0})
  30. (fun a : n0 <= m1 => left (gt_le_S n0 (S m1) (le_n_S n0 m1 a)))
  31. (fun b : m1 < n0 => right (gt_le_S (S m1) (S n0) (lt_n_S m1 n0 b)))
  32. (IHn m1)
  33. end) n m
  34. : forall n m : nat, {n <= m} + {m < n}
  35.  
  36. gt_not_le =
  37. fun n m : nat =>
  38. let H :=
  39. (fun n0 m0 : nat => match Nat.lt_nge n0 m0 with
  40. | conj x _ => x
  41. end)
  42. :
  43. forall n0 m0 : nat, n0 < m0 -> ~ m0 <= n0 in
  44. H m n
  45. : forall n m : nat, n > m -> ~ n <= m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement