feat: sem7
This commit is contained in:
@@ -247,6 +247,28 @@ Proof.
|
||||
induction n as [ | [ | n''] IHn'].
|
||||
Abort.
|
||||
|
||||
Lemma nat_ind2 :
|
||||
forall P : nat -> Prop,
|
||||
P 0 ->
|
||||
P 1 ->
|
||||
(forall k : nat, P k -> P (S k) -> P (S (S k))) ->
|
||||
forall n : nat, P n.
|
||||
Proof.
|
||||
intros P H_P0 H_P1 H_PSS [ | [ | n'' ] ].
|
||||
- exact H_P0.
|
||||
- exact H_P1.
|
||||
- assert (both : forall m : nat, P m /\ P(S m)).
|
||||
{ intro m.
|
||||
induction m as [ | m' [ IHm' IHSm' ] ].
|
||||
- exact (conj H_P0 H_P1).
|
||||
- split.
|
||||
+ exact IHSm'.
|
||||
+ exact (H_PSS m' IHm' IHSm' ).
|
||||
}
|
||||
destruct (both n'') as [Pn'' PSn''].
|
||||
exact (H_PSS n'' Pn'' PSn'').
|
||||
Qed.
|
||||
|
||||
(* Thus equipped, the following theorem is proved pretty directly: *)
|
||||
|
||||
Theorem there_is_at_most_one_fibonacci_function :
|
||||
@@ -262,7 +284,18 @@ Proof.
|
||||
[H_fib2_0 [H_fib2_1 H_fib2_SS]]
|
||||
n.
|
||||
induction n as [ | | n'' IHn'' IHSn''] using nat_ind2.
|
||||
Abort.
|
||||
- rewrite -> H_fib1_0.
|
||||
rewrite -> H_fib2_0.
|
||||
reflexivity.
|
||||
- rewrite -> H_fib1_1.
|
||||
rewrite -> H_fib2_1.
|
||||
reflexivity.
|
||||
- rewrite -> (H_fib1_SS n'').
|
||||
rewrite -> (H_fib2_SS n'').
|
||||
rewrite -> IHn''.
|
||||
rewrite -> IHSn''.
|
||||
reflexivity.
|
||||
Qed.
|
||||
|
||||
(* ***** *)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user