Advertisement
Guest User

exercise.v

a guest
Jun 15th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.56 KB | None | 0 0
  1. Require Import Arith.
  2.  
  3. Module Exercise.
  4.   (* Define a function that takes a natural number and returns it unchanged. *)
  5.   Definition f := fun n : nat => n.
  6.  
  7.   (* Now prove the following simple fact about your function. *)
  8.   Definition fact_1 := forall n, f n + 1 = f (n + 1).
  9.   Lemma proof_1 : fact_1.
  10.   Proof. unfold fact_1, f. reflexivity. Qed.
  11.  
  12.   (* Now prove another. *)
  13.   Definition fact_2 := forall n, f n < f (n + 1).
  14.   Lemma proof_2 : fact_2.
  15.   Proof.
  16.     unfold fact_2, f. intro n.
  17.     rewrite Nat.add_1_r. apply le_n.
  18.   Qed.
  19. End Exercise.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement