playground/coq/misc/ssreflect-stuff.v

39 lines
731 B
Coq

Require Import ssreflect.
Require Import Arith.
Goal forall a b:nat,
a - b < 0 -> a < b.
Proof.
elim => [|a'].
- case => [|b']; first by [].
rewrite //= => H.
by have HH := PeanoNat.Nat.lt_irrefl 0.
- move => IH.
case => [|b']; first by [].
rewrite //= => H.
have HH := IH b' H.
exact: iffLR (PeanoNat.Nat.succ_lt_mono a' b') HH.
Qed.
Goal forall n:nat,
S n - 1 = n.
Proof.
move => n.
by rewrite PeanoNat.Nat.sub_succ_r.
(* by rewrite (PeanoNat.Nat.sub_succ_r (S n) 0). *)
Qed.
Goal forall n:nat,
S (S n) < 2 -> False.
Proof.
elim.
- exact: PeanoNat.Nat.lt_irrefl 2.
- move => n IH H.
apply: IH.
have HH := PeanoNat.Nat.lt_succ_l (S (S n)) 2.
exact: HH H.
Qed.