Module Type Version1.
Inductive comes_from_the_left (P Q:Prop): P \/ Q -> Prop :=
c1 : forall p, comes_from_the_left P Q (or_introl (A:=P) Q p).
Goal (comes_from_the_left _ _ (or_introl True I)).
split.
Qed.
Goal ~(comes_from_the_left _ _ (or_intror True I)).
red;inversion 1.
(* discriminate H0. *)
Abort.
End Version1.
Fail Definition comes_from_the_left (P Q:Prop)(H:P \/ Q): Prop :=
match H with
|  or_introl p => True
|  or_intror q => False
end.
(* Error: Incorrect elimination of "H" in the inductive type "or", the return type has sort "Type" while it should be "Prop"  Elimination of an inductive object of sort "Prop" is not allowed on a predicate in sort "Type" because proofs can be eliminated only to build proofs *)
Definition comes_from_the_left_sumbool
(P Q:Prop)(x:{P}+{Q}): Prop :=
match x with
|  left  p => True
|  right q => False
end.
Close Scope Z_scope.
Set Nested Proofs Allowed.
Definition Is_zero (x:nat):= match x with
| 0 => True
| _ => False
end.
red; intros n Hn.
apply O_is_zero with (m := S n).
assumption.
Qed.
intros n m eq_Sn_Sm.
apply inj_pred with (n:= S n) (m := S m); assumption.
Qed.
eapply not_le_Sn_0_with_constraints; eauto.
Qed.
Derive Inversion le_Sn_0_inv with (forall n :nat, S n <=  0).
Check le_Sn_0_inv.
Derive Inversion_clear le_Sn_0_inv' with (forall n :nat, S n <=  0).
Check le_Sn_0_inv'.

Theorem le_reverse_rules :
forall n m:nat, n <= m ->
n = m \/
exists p, n <=  p /\ m = S p.