I don't know why, but in Coq, when trying to prove a program specification I get an error when trying to eliminate an OR hypothesis:
Error: Cannot find the elimination combinator or_rec, the elimination of the
inductive definition Logic.or on sort Set is probably not allowed.
This is the theorem I want to prove:
Definition nat_div_mod : forall a b:nat, not(b=0) -> {qr:nat*nat | P a b qr}.
This is the goal and context when the error happens:
a : nat
b : nat
H : b <> 0
IHa : {qr : nat * nat | P a b qr}
x : nat * nat
H2 : P a b x
H0 : snd x < b - 1 \/ snd x >= b - 1
______________________________________
{qr : nat * nat | P (S a) b qr}
Before this theorem, I have this definition and these imports:
Definition P (a b:nat) (qr:nat*nat) : Prop := ... (* specification of div/mod *)
Require Import Omega.
Require Import Mult.
I get the previous error when I try to use this tactic:
elim H0.
I don't really know what may be causing it.
You can't do case analysis on
H0
because{qr : nat * nat | P (S a) b qr}
is aSet
orType
. Onlyor_ind
is defined foror
, so it would need to be aProp
instead. If you usesum
you'll havesum_ind
,sum_rec
, andsum_rect
.Prop
is designed that way so that it's consistent with certain axioms.