Guest User

Untitled

a guest
Jun 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. (* ZADANIE 1: *)
  2.  
  3. Lemma jeden: forall A: Prop, A -> A.
  4. intros.
  5. assumption.
  6. Qed.
  7.  
  8. Lemma dwa: forall A B C: Prop, (A -> B) -> (B -> C) -> A -> C.
  9. intros.
  10. assert B.
  11. exact(H H1).
  12. clear H.
  13.  
  14. assert C.
  15. exact (H0 H2).
  16. clear H0.
  17. assumption.
  18. Qed.
  19.  
  20. Lemma trzy: forall A B: Prop, A /\ B <-> B /\ A.
  21. intros.
  22. split.
  23. intros.
  24. elim H.
  25. intros.
  26. clear H.
  27. split.
  28. assumption.
  29. assumption.
  30.  
  31. intros.
  32. elim H.
  33. intros.
  34. clear H.
  35. split.
  36. assumption.
  37. assumption.
  38. Qed.
  39.  
  40. Lemma cztery: forall A B: Prop, A \/ B <-> B \/ A.
  41. intros.
  42.  
  43. split.
  44. intros.
  45. elim H.
  46. intro.
  47. clear H.
  48. right.
  49. assumption.
  50.  
  51. intro.
  52. left.
  53. assumption.
  54.  
  55. intros.
  56. elim H.
  57. intro.
  58. clear H.
  59. right.
  60. assumption.
  61. intro.
  62. left.
  63. assumption.
  64. Qed.
  65.  
  66. Lemma piec: forall A: Prop, A -> ~~A.
  67. intros.
  68. intro.
  69. apply H0.
  70. assumption.
  71. Qed.
  72.  
  73. Lemma szesc: forall A B: Prop, (A -> B) -> ~B -> ~A.
  74. intros.
  75. unfold not at 1 in |- *.
  76. intro.
  77. unfold not at 1 in H0.
  78. assert B.
  79. exact (H H1).
  80. clear H.
  81. assert False.
  82. exact (H0 H2).
  83. clear H0.
  84. elimtype False.
  85. assumption.
  86. Qed.
  87.  
  88. Lemma siedem: forall A: Prop, ~~(A \/ ~ A).
  89. intros.
  90. intro.
  91. unfold not in H; cut ((A -> False) -> False).
  92. cut (A -> False).
  93. intro; intros; clear H; assert False.
  94. exact (H1 H0).
  95.  
  96. clear H1; elimtype False; assumption.
  97.  
  98. intro; cut (A \/ (A -> False)).
  99. exact H.
  100.  
  101. left; assumption.
  102.  
  103. intro; cut (A \/ (A -> False)).
  104. exact H.
  105.  
  106. right; assumption.
  107. Qed.
  108.  
  109. Lemma osiem: forall A B C : Prop, (A /\ B) \/ C <-> (A \/ C) /\ (B \/ C).
  110. intros; unfold iff in |- *; split.
  111. intro; elim H.
  112. intro; clear H; elim H0; intro; intro; clear H0;
  113. split.
  114.  
  115. left; assumption.
  116. left; assumption.
  117.  
  118. intro; clear H; split.
  119. right; assumption.
  120. right; assumption.
  121.  
  122. intro; elim H; intro; intro; clear H; elim H0.
  123. intro; clear H0; elim H1.
  124. intro; clear H1; left; split.
  125. assumption.
  126. assumption.
  127.  
  128. intro; clear H1; right; assumption.
  129.  
  130. intro; clear H0; elim H1.
  131. intro; clear H1; right; assumption.
  132. intro; clear H1; right; assumption.
  133. Qed.
  134.  
  135. (* Zadanie 2: *)
  136.  
  137. Parameter X Y : Set.
  138. Parameter A B : X -> Prop.
  139.  
  140. Lemma jeden : (forall x : X, A x /\ B x) <-> (forall x : X, A x) /\ (forall x : X, B x).
  141. unfold iff in |- *; split.
  142. intro; split.
  143. intro.
  144. auto with *.
  145. destruct (H x).
  146. assumption.
  147. intro; auto with *.
  148. destruct (H x).
  149. assumption.
  150. intro; elim H; intro; intro; clear H; intro;
  151. split.
  152. apply H0.
  153. apply H1.
  154. Qed.
  155.  
  156. (* brakuje B *)
  157.  
  158. (* Zadanie 3: *)
  159.  
  160. Axiom not_not_elim : forall A : Prop, ~~A -> A.
  161. Lemma jeden: forall A : Prop, A \/ ~A.
  162.  
  163. intro; unfold not, iff in |- *; auto with *.
  164. apply not_not_elim.
  165.  
  166. unfold not in |-*; intro; cut ((A -> False) -> False).
  167. cut (A -> False).
  168. intro; intros; clear H; assert False.
  169. exact (H1 H0).
  170.  
  171. clear H1; elimtype False; assumption.
  172.  
  173. intro; cut (A \/ (A -> False)).
  174. exact H.
  175.  
  176. left; assumption.
  177.  
  178. intro; cut (A \/ (A -> False)).
  179. exact H.
  180.  
  181. right; assumption.
  182. Qed.
  183.  
  184. (* Zadanie 4: *)
  185. Parameter E : Set.
  186. Parameter R : E -> E -> Prop.
  187. Axiom refl : forall (x : E), R x x.
  188. Axiom trans : forall (x y z : E), R x y -> R y z -> R x z.
  189. Axiom antisym : forall (x y : E), R x y -> R y x -> x = y.
  190. Definition smallest (x0 : E) := forall (x : E), R x0 x.
  191. Definition minimal (x0 : E) := forall (x : E), R x x0 -> x = x0.
  192. Lemma jeden: forall (x1 x2 : E), smallest x1 -> smallest x2 -> x1 = x2.
  193.  
  194. intros.
  195. apply antisym.
  196. apply H.
  197. apply H0.
  198. Qed.
  199.  
  200. (* ZADANIE 5: *)
  201. Lemma plus_n_0 : forall n, n + 0 = n.
  202.  
  203. Proof.
  204. intro.
  205. induction n.
  206. reflexivity.
  207. simpl.
  208. rewrite IHn.
  209. reflexivity.
  210. Qed.
  211.  
  212. Lemma plus_n_Sm : forall n m, S (n + m) = n + S m.
  213.  
  214. Proof.
  215. intros.
  216. induction n.
  217. reflexivity.
  218. simpl.
  219. rewrite IHn.
  220. reflexivity.
  221. Qed.
  222.  
  223. Lemma plus_commut : forall n m, n + m = m + n.
  224.  
  225. Proof.
  226. intros.
  227. induction n.
  228. apply plus_n_O.
  229. simpl.
  230. rewrite -> IHn.
  231. apply (plus_n_Sm m n).
  232. Qed.
Add Comment
Please, Sign In to add comment