Is it possible to prove this forall (a b : nat), a <=? b = true -> a <=? S b = true. in Coq?
I tried this so far
Lemma leb_0_r : forall x, x <=? 0 = true -> x = 0.
intros. induction x. reflexivity. discriminate H.
Qed.
Lemma leb_S : forall a b, a <=? b = true -> a <=? S b = true.
intros a b Hab. induction b. apply leb_0_r in Hab. now rewrite Hab.
But here I got stuck on the induction hypothesis
1 subgoal
a, b : nat
Hab : (a <=? S b) = true
IHb : (a <=? b) = true -> (a <=? S b) = true
========================= (1 / 1)
(a <=? S (S b)) = true
I tried induction on a too
Lemma leb_S : forall a b, a <=? b = true -> a <=? S b = true.
intros a b Hab. induction a. reflexivity. simpl. destruct b.
discriminate Hab. simpl in Hab.
1 subgoal
a, b : nat
Hab : (a <=? b) = true
IHa : (a <=? S b) = true -> (a <=? S (S b)) = true
========================= (1 / 1)
(a <=? S b) = true
The problem is that I always get to S a <= b or a <= S b and I can't simplify that.
After posting here I realized that conclusion of IHa is equal to the goal of second try and vice versa :thinking: