Advertisement
Guest User

Untitled

a guest
Apr 24th, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. (*
  2. * Coq 8.8.1
  3. *)
  4.  
  5. Require Import Reals ZArith Omega.
  6. Open Scope R_scope.
  7.  
  8. Lemma q: forall x y,
  9. x * x <> y * y -> x <> y.
  10. Proof.
  11. intros x y H contra.
  12. rewrite contra in H.
  13. auto.
  14. Qed.
  15.  
  16. Lemma d: forall x y z,
  17. y <> 0 ->
  18. x / y = z -> x = z * y.
  19. Proof.
  20. intros.
  21. subst.
  22. unfold Rdiv.
  23. rewrite Rmult_assoc.
  24. field.
  25. auto.
  26. Qed.
  27.  
  28. Lemma w: forall x y,
  29. y <> 0 ->
  30. (x / y) * (x / y) = (x * x) / (y * y).
  31. Proof.
  32. intros.
  33. field.
  34. auto.
  35. Qed.
  36.  
  37. Lemma t: forall x y,
  38. exists z, x * y = z.
  39. Proof.
  40. intros.
  41. exists (x * y).
  42. auto.
  43. Qed.
  44.  
  45. Lemma a': IZR (1414213562370951 * 1414213562370951) <> IZR (2 * 1000000000000000 * 1000000000000000).
  46. Proof.
  47. intros contra.
  48. apply eq_IZR in contra.
  49. omega.
  50. Qed.
  51.  
  52. Lemma a: 1414213562370951 * 1414213562370951 <> 2 * 1000000000000000 * 1000000000000000.
  53. Proof.
  54. intros contra.
  55. apply a'.
  56. repeat rewrite mult_IZR.
  57. auto.
  58. Qed.
  59.  
  60. Lemma b: 1000000000000000 <> 0.
  61. Proof.
  62. intros contra.
  63. apply eq_IZR in contra.
  64. omega.
  65. Qed.
  66.  
  67.  
  68. Lemma _42: 1414213562370951 / 1000000000000000 <> sqrt 2.
  69. Proof.
  70. apply q.
  71. replace (sqrt 2 * sqrt 2) with 2.
  72. intros contra.
  73. remember 1414213562370951 as x.
  74. remember 1000000000000000 as y.
  75. rewrite w in contra.
  76. apply d with (x * x) (y * y) 2 in contra.
  77. subst.
  78. rewrite <- Rmult_assoc in contra.
  79. apply a.
  80. auto.
  81.  
  82. apply Rmult_integral_contrapositive.
  83. split; subst; apply b.
  84.  
  85. subst. apply b.
  86. rewrite sqrt_def; auto.
  87. apply Rlt_le.
  88. apply Rlt_0_2.
  89. Qed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement