Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. Theorem silly1 : forall (n m o p : nat),
  2. n = m ->
  3. [n;o] = [n;p] ->
  4. [n;o] = [m;p].
  5. Proof.
  6. intros n m o p eq1 eq2.
  7. rewrite <- eq1.
  8. apply eq2. Qed.
  9.  
  10. Theorem trans_eq : forall (X:Type) (n m o : X),
  11. n = m -> m = o -> n = o.
  12. Proof.
  13. intros X n m o eq1 eq2. rewrite -> eq1. rewrite -> eq2.
  14. reflexivity. Qed.
  15.  
  16. Theorem silly3' : forall (n : nat),
  17. (beq_nat n 5 = true -> beq_nat (S (S n)) 7 = true) ->
  18. true = beq_nat n 5 ->
  19. true = beq_nat (S (S n)) 7.
  20. Proof.
  21. intros n eq H.
  22. symmetry in H. apply eq in H. symmetry in H.
  23. apply H. Qed.
  24.  
  25. Theorem example_1 : forall A B, (A -> B) -> A -> B.
  26. Proof. intros ? ? H1. apply H1. Qed.
  27.  
  28. Theorem example_2 : forall A B, (A -> B) -> A -> B.
  29. Proof. intros ? ? H1 H2. apply H1. apply H2. Qed.
  30.  
  31. Print example_1.
  32. Print example_2.
  33.  
  34. Fixpoint reverse_helper {A : Type} (l1 l2 : list A) : list A :=
  35. match l1 with
  36. | nil => l2
  37. | cons x l1 => reverse_helper l1 (cons x l2)
  38. end.
  39.  
  40. Theorem example_3 : forall A (l1 l2 : list A), reverse_helper l1 l2 = app (reverse_helper l1 nil) l2.
  41. Proof. intros. induction l1. simpl. reflexivity. simpl. try rewrite IHl1. Abort.
  42.  
  43. Theorem example_4 : forall A (l1 l2 : list A), reverse_helper l1 l2 = app (reverse_helper l1 nil) l2.
  44. Proof. induction l1. intros. simpl. reflexivity. intros. simpl. rewrite (IHl1 (cons a l2)). rewrite (IHl1 (cons a nil)). Admitted.
  45.  
  46. H1 : A1
  47. ...
  48. Hn : An
  49. ___
  50. B
  51.  
  52. H1: A1, ..., Hn: An ⊢ B.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement