1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / Matita is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
15 include "nat/div_and_mod.ma".
16 include "nat/minimization.ma".
17 include "nat/sigma_and_pi.ma".
18 include "nat/factorial.ma".
20 inductive divides (n,m:nat) : Prop \def
21 witness : \forall p:nat.m = times n p \to divides n m.
23 interpretation "divides" 'divides n m = (cic:/matita/nat/primes/divides.ind#xpointer(1/1) n m).
24 interpretation "not divides" 'ndivides n m =
25 (cic:/matita/logic/connectives/Not.con (cic:/matita/nat/primes/divides.ind#xpointer(1/1) n m)).
27 theorem reflexive_divides : reflexive nat divides.
30 exact (witness x x (S O) (times_n_SO x)).
33 theorem divides_to_div_mod_spec :
34 \forall n,m. O < n \to n \divides m \to div_mod_spec m n (m / n) O.
35 intros.elim H1.rewrite > H2.
36 constructor 1.assumption.
37 apply (lt_O_n_elim n H).intros.
39 rewrite > div_times.apply sym_times.
42 theorem div_mod_spec_to_divides :
43 \forall n,m,p. div_mod_spec m n p O \to n \divides m.
45 apply (witness n m p).
47 rewrite > (plus_n_O (p*n)).assumption.
50 theorem divides_to_mod_O:
51 \forall n,m. O < n \to n \divides m \to (m \mod n) = O.
52 intros.apply (div_mod_spec_to_eq2 m n (m / n) (m \mod n) (m / n) O).
53 apply div_mod_spec_div_mod.assumption.
54 apply divides_to_div_mod_spec.assumption.assumption.
57 theorem mod_O_to_divides:
58 \forall n,m. O< n \to (m \mod n) = O \to n \divides m.
60 apply (witness n m (m / n)).
61 rewrite > (plus_n_O (n * (m / n))).
64 (* Andrea: perche' hint non lo trova ?*)
69 theorem divides_n_O: \forall n:nat. n \divides O.
70 intro. apply (witness n O O).apply times_n_O.
73 theorem divides_n_n: \forall n:nat. n \divides n.
74 intro. apply (witness n n (S O)).apply times_n_SO.
77 theorem divides_SO_n: \forall n:nat. (S O) \divides n.
78 intro. apply (witness (S O) n n). simplify.apply plus_n_O.
81 theorem divides_plus: \forall n,p,q:nat.
82 n \divides p \to n \divides q \to n \divides p+q.
84 elim H.elim H1. apply (witness n (p+q) (n2+n1)).
85 rewrite > H2.rewrite > H3.apply sym_eq.apply distr_times_plus.
88 theorem divides_minus: \forall n,p,q:nat.
89 divides n p \to divides n q \to divides n (p-q).
91 elim H.elim H1. apply (witness n (p-q) (n2-n1)).
92 rewrite > H2.rewrite > H3.apply sym_eq.apply distr_times_minus.
95 theorem divides_times: \forall n,m,p,q:nat.
96 n \divides p \to m \divides q \to n*m \divides p*q.
98 elim H.elim H1. apply (witness (n*m) (p*q) (n2*n1)).
99 rewrite > H2.rewrite > H3.
100 apply (trans_eq nat ? (n*(m*(n2*n1)))).
101 apply (trans_eq nat ? (n*(n2*(m*n1)))).
104 apply (trans_eq nat ? ((n2*m)*n1)).
105 apply sym_eq. apply assoc_times.
106 rewrite > (sym_times n2 m).apply assoc_times.
107 apply sym_eq. apply assoc_times.
110 theorem transitive_divides: transitive ? divides.
113 elim H.elim H1. apply (witness x z (n2*n)).
114 rewrite > H3.rewrite > H2.
118 variant trans_divides: \forall n,m,p.
119 n \divides m \to m \divides p \to n \divides p \def transitive_divides.
121 theorem eq_mod_to_divides:\forall n,m,p. O< p \to
122 mod n p = mod m p \to divides p (n-m).
124 cut (n \le m \or \not n \le m).
128 apply (witness p O O).
130 apply eq_minus_n_m_O.
132 apply (witness p (n-m) ((div n p)-(div m p))).
133 rewrite > distr_times_minus.
135 rewrite > (sym_times p).
136 cut ((div n p)*p = n - (mod n p)).
138 rewrite > eq_minus_minus_minus_plus.
141 rewrite < div_mod.reflexivity.
148 apply (decidable_le n m).
151 theorem antisymmetric_divides: antisymmetric nat divides.
152 unfold antisymmetric.intros.elim H. elim H1.
153 apply (nat_case1 n2).intro.
154 rewrite > H3.rewrite > H2.rewrite > H4.
155 rewrite < times_n_O.reflexivity.
157 apply (nat_case1 n).intro.
158 rewrite > H2.rewrite > H3.rewrite > H5.
159 rewrite < times_n_O.reflexivity.
161 apply antisymmetric_le.
162 rewrite > H2.rewrite > times_n_SO in \vdash (? % ?).
163 apply le_times_r.rewrite > H4.apply le_S_S.apply le_O_n.
164 rewrite > H3.rewrite > times_n_SO in \vdash (? % ?).
165 apply le_times_r.rewrite > H5.apply le_S_S.apply le_O_n.
169 theorem divides_to_le : \forall n,m. O < m \to n \divides m \to n \le m.
170 intros. elim H1.rewrite > H2.cut (O < n2).
171 apply (lt_O_n_elim n2 Hcut).intro.rewrite < sym_times.
172 simplify.rewrite < sym_plus.
174 elim (le_to_or_lt_eq O n2).
176 absurd (O<m).assumption.
177 rewrite > H2.rewrite < H3.rewrite < times_n_O.
178 apply (not_le_Sn_n O).
182 theorem divides_to_lt_O : \forall n,m. O < m \to n \divides m \to O < n.
184 elim (le_to_or_lt_eq O n (le_O_n n)).
186 rewrite < H3.absurd (O < m).assumption.
187 rewrite > H2.rewrite < H3.
188 simplify.exact (not_le_Sn_n O).
191 (*a variant of or_div_mod *)
192 theorem or_div_mod1: \forall n,q. O < q \to
193 (divides q (S n)) \land S n = (S (div n q)) * q \lor
194 (\lnot (divides q (S n)) \land S n= (div n q) * q + S (n\mod q)).
195 intros.elim (or_div_mod n q H);elim H1
197 [apply (witness ? ? (S (n/q))).
198 rewrite > sym_times.assumption
203 apply (not_eq_O_S (n \mod q)).
204 (* come faccio a fare unfold nelleipotesi ? *)
205 cut ((S n) \mod q = O)
207 apply (div_mod_spec_to_eq2 (S n) q (div (S n) q) (mod (S n) q) (div n q) (S (mod n q)))
208 [apply div_mod_spec_div_mod.
210 |apply div_mod_spec_intro;assumption
212 |apply divides_to_mod_O;assumption
219 theorem divides_to_div: \forall n,m.divides n m \to m/n*n = m.
221 elim (le_to_or_lt_eq O n (le_O_n n))
223 rewrite < (divides_to_mod_O ? ? H H1).
228 generalize in match H2.
237 theorem divides_div: \forall d,n. divides d n \to divides (n/d) n.
239 apply (witness ? ? d).
241 apply divides_to_div.
245 theorem div_div: \forall n,d:nat. O < n \to divides d n \to
248 apply (inj_times_l1 (n/d))
249 [apply (lt_times_n_to_lt d)
250 [apply (divides_to_lt_O ? ? H H1).
251 |rewrite > divides_to_div;assumption
253 |rewrite > divides_to_div
254 [rewrite > sym_times.
255 rewrite > divides_to_div
259 |apply (witness ? ? d).
261 apply divides_to_div.
267 theorem divides_to_eq_times_div_div_times: \forall a,b,c:nat.
268 O \lt b \to c \divides b \to a * (b /c) = (a*b)/c.
272 rewrite > (sym_times c n2).
274 [ rewrite > (lt_O_to_div_times n2 c)
275 [ rewrite < assoc_times.
276 rewrite > (lt_O_to_div_times (a *n2) c)
282 | apply (divides_to_lt_O c b);
287 theorem eq_div_plus: \forall n,m,d. O < d \to
288 divides d n \to divides d m \to
289 (n + m ) / d = n/d + m/d.
293 rewrite > H3.rewrite > H4.
294 rewrite < distr_times_plus.
296 rewrite > sym_times in ⊢ (? ? ? (? (? % ?) ?)).
297 rewrite > sym_times in ⊢ (? ? ? (? ? (? % ?))).
298 rewrite > lt_O_to_div_times
299 [rewrite > lt_O_to_div_times
300 [rewrite > lt_O_to_div_times
310 (* boolean divides *)
311 definition divides_b : nat \to nat \to bool \def
312 \lambda n,m :nat. (eqb (m \mod n) O).
314 theorem divides_b_to_Prop :
315 \forall n,m:nat. O < n \to
316 match divides_b n m with
317 [ true \Rightarrow n \divides m
318 | false \Rightarrow n \ndivides m].
319 intros.unfold divides_b.
321 intro.simplify.apply mod_O_to_divides.assumption.assumption.
322 intro.simplify.unfold Not.intro.apply H1.apply divides_to_mod_O.assumption.assumption.
325 theorem divides_b_true_to_divides1:
326 \forall n,m:nat. O < n \to
327 (divides_b n m = true ) \to n \divides m.
331 [ true \Rightarrow n \divides m
332 | false \Rightarrow n \ndivides m].
333 rewrite < H1.apply divides_b_to_Prop.
337 theorem divides_b_true_to_divides:
338 \forall n,m:nat. divides_b n m = true \to n \divides m.
339 intros 2.apply (nat_case n)
341 [intro.apply divides_n_n
342 |simplify.intros.apply False_ind.
343 apply not_eq_true_false.apply sym_eq.
347 apply divides_b_true_to_divides1
348 [apply lt_O_S|assumption]
352 theorem divides_b_false_to_not_divides1:
353 \forall n,m:nat. O < n \to
354 (divides_b n m = false ) \to n \ndivides m.
358 [ true \Rightarrow n \divides m
359 | false \Rightarrow n \ndivides m].
360 rewrite < H1.apply divides_b_to_Prop.
364 theorem divides_b_false_to_not_divides:
365 \forall n,m:nat. divides_b n m = false \to n \ndivides m.
366 intros 2.apply (nat_case n)
368 [simplify.unfold Not.intros.
369 apply not_eq_true_false.assumption
370 |unfold Not.intros.elim H1.
371 apply (not_eq_O_S m1).apply sym_eq.
375 apply divides_b_false_to_not_divides1
376 [apply lt_O_S|assumption]
380 theorem decidable_divides: \forall n,m:nat.O < n \to
381 decidable (n \divides m).
382 intros.unfold decidable.
384 (match divides_b n m with
385 [ true \Rightarrow n \divides m
386 | false \Rightarrow n \ndivides m] \to n \divides m \lor n \ndivides m).
387 apply Hcut.apply divides_b_to_Prop.assumption.
388 elim (divides_b n m).left.apply H1.right.apply H1.
391 theorem divides_to_divides_b_true : \forall n,m:nat. O < n \to
392 n \divides m \to divides_b n m = true.
394 cut (match (divides_b n m) with
395 [ true \Rightarrow n \divides m
396 | false \Rightarrow n \ndivides m] \to ((divides_b n m) = true)).
397 apply Hcut.apply divides_b_to_Prop.assumption.
398 elim (divides_b n m).reflexivity.
399 absurd (n \divides m).assumption.assumption.
402 theorem divides_to_divides_b_true1 : \forall n,m:nat.
403 O < m \to n \divides m \to divides_b n m = true.
405 elim (le_to_or_lt_eq O n (le_O_n n))
406 [apply divides_to_divides_b_true
407 [assumption|assumption]
412 apply (not_le_Sn_O O).
418 theorem not_divides_to_divides_b_false: \forall n,m:nat. O < n \to
419 \lnot(n \divides m) \to (divides_b n m) = false.
421 cut (match (divides_b n m) with
422 [ true \Rightarrow n \divides m
423 | false \Rightarrow n \ndivides m] \to ((divides_b n m) = false)).
424 apply Hcut.apply divides_b_to_Prop.assumption.
425 elim (divides_b n m).
426 absurd (n \divides m).assumption.assumption.
430 theorem divides_b_div_true:
431 \forall d,n. O < n \to
432 divides_b d n = true \to divides_b (n/d) n = true.
434 apply divides_to_divides_b_true1
437 apply divides_b_true_to_divides.
442 theorem divides_b_true_to_lt_O: \forall n,m. O < n \to divides_b m n = true \to O < m.
444 elim (le_to_or_lt_eq ? ? (le_O_n m))
450 apply (lt_to_not_eq O n H).
452 apply eqb_true_to_eq.
458 theorem divides_f_pi_f : \forall f:nat \to nat.\forall n,m,i:nat.
459 m \le i \to i \le n+m \to f i \divides pi n f m.
460 intros 5.elim n.simplify.
461 cut (i = m).rewrite < Hcut.apply divides_n_n.
462 apply antisymmetric_le.assumption.assumption.
464 cut (i < S n1+m \lor i = S n1 + m).
466 apply (transitive_divides ? (pi n1 f m)).
467 apply H1.apply le_S_S_to_le. assumption.
468 apply (witness ? ? (f (S n1+m))).apply sym_times.
470 apply (witness ? ? (pi n1 f m)).reflexivity.
471 apply le_to_or_lt_eq.assumption.
475 theorem mod_S_pi: \forall f:nat \to nat.\forall n,i:nat.
476 i < n \to (S O) < (f i) \to (S (pi n f)) \mod (f i) = (S O).
477 intros.cut (pi n f) \mod (f i) = O.
479 apply mod_S.apply trans_lt O (S O).apply le_n (S O).assumption.
480 rewrite > Hcut.assumption.
481 apply divides_to_mod_O.apply trans_lt O (S O).apply le_n (S O).assumption.
482 apply divides_f_pi_f.assumption.
486 (* divides and fact *)
487 theorem divides_fact : \forall n,i:nat.
488 O < i \to i \le n \to i \divides n!.
489 intros 3.elim n.absurd (O<i).assumption.apply (le_n_O_elim i H1).
490 apply (not_le_Sn_O O).
491 change with (i \divides (S n1)*n1!).
492 apply (le_n_Sm_elim i n1 H2).
494 apply (transitive_divides ? n1!).
495 apply H1.apply le_S_S_to_le. assumption.
496 apply (witness ? ? (S n1)).apply sym_times.
499 apply (witness ? ? n1!).reflexivity.
502 theorem mod_S_fact: \forall n,i:nat.
503 (S O) < i \to i \le n \to (S n!) \mod i = (S O).
504 intros.cut (n! \mod i = O).
506 apply mod_S.apply (trans_lt O (S O)).apply (le_n (S O)).assumption.
507 rewrite > Hcut.assumption.
508 apply divides_to_mod_O.apply (trans_lt O (S O)).apply (le_n (S O)).assumption.
509 apply divides_fact.apply (trans_lt O (S O)).apply (le_n (S O)).assumption.
513 theorem not_divides_S_fact: \forall n,i:nat.
514 (S O) < i \to i \le n \to i \ndivides S n!.
516 apply divides_b_false_to_not_divides.
518 rewrite > mod_S_fact[simplify.reflexivity|assumption|assumption].
522 definition prime : nat \to Prop \def
523 \lambda n:nat. (S O) < n \land
524 (\forall m:nat. m \divides n \to (S O) < m \to m = n).
526 theorem not_prime_O: \lnot (prime O).
527 unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_O (S O) H1).
530 theorem not_prime_SO: \lnot (prime (S O)).
531 unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_n (S O) H1).
534 theorem prime_to_lt_O: \forall p. prime p \to O < p.
535 intros.elim H.apply lt_to_le.assumption.
538 theorem prime_to_lt_SO: \forall p. prime p \to S O < p.
543 (* smallest factor *)
544 definition smallest_factor : nat \to nat \def
550 [ O \Rightarrow (S O)
551 | (S q) \Rightarrow min_aux q (S (S O)) (\lambda m.(eqb ((S(S q)) \mod m) O))]].
554 theorem example1 : smallest_factor (S(S(S O))) = (S(S(S O))).
555 normalize.reflexivity.
558 theorem example2: smallest_factor (S(S(S(S O)))) = (S(S O)).
559 normalize.reflexivity.
562 theorem example3 : smallest_factor (S(S(S(S(S(S(S O))))))) = (S(S(S(S(S(S(S O))))))).
563 simplify.reflexivity.
566 theorem lt_SO_smallest_factor:
567 \forall n:nat. (S O) < n \to (S O) < (smallest_factor n).
569 apply (nat_case n).intro.apply False_ind.apply (not_le_Sn_O (S O) H).
570 intro.apply (nat_case m).intro. apply False_ind.apply (not_le_Sn_n (S O) H).
573 (S O < min_aux m1 (S (S O)) (\lambda m.(eqb ((S(S m1)) \mod m) O))).
574 apply (lt_to_le_to_lt ? (S (S O))).
575 apply (le_n (S(S O))).
576 cut ((S(S O)) = (S(S m1)) - m1).
579 apply sym_eq.apply plus_to_minus.
580 rewrite < sym_plus.simplify.reflexivity.
583 theorem lt_O_smallest_factor: \forall n:nat. O < n \to O < (smallest_factor n).
585 apply (nat_case n).intro.apply False_ind.apply (not_le_Sn_n O H).
586 intro.apply (nat_case m).intro.
587 simplify.unfold lt.apply le_n.
588 intros.apply (trans_lt ? (S O)).
589 unfold lt.apply le_n.
590 apply lt_SO_smallest_factor.unfold lt. apply le_S_S.
591 apply le_S_S.apply le_O_n.
594 theorem divides_smallest_factor_n :
595 \forall n:nat. O < n \to smallest_factor n \divides n.
597 apply (nat_case n).intro.apply False_ind.apply (not_le_Sn_O O H).
598 intro.apply (nat_case m).intro. simplify.
599 apply (witness ? ? (S O)). simplify.reflexivity.
601 apply divides_b_true_to_divides.
603 (eqb ((S(S m1)) \mod (min_aux m1 (S (S O))
604 (\lambda m.(eqb ((S(S m1)) \mod m) O)))) O = true).
605 apply f_min_aux_true.
606 apply (ex_intro nat ? (S(S m1))).
608 apply (le_S_S_to_le (S (S O)) (S (S m1)) ?).
609 apply (minus_le_O_to_le (S (S (S O))) (S (S (S m1))) ?).
611 rewrite < sym_plus. simplify. apply le_n.
612 apply (eq_to_eqb_true (mod (S (S m1)) (S (S m1))) O ?).
613 apply (mod_n_n (S (S m1)) ?).
617 theorem le_smallest_factor_n :
618 \forall n:nat. smallest_factor n \le n.
619 intro.apply (nat_case n).simplify.apply le_n.
620 intro.apply (nat_case m).simplify.apply le_n.
621 intro.apply divides_to_le.
622 unfold lt.apply le_S_S.apply le_O_n.
623 apply divides_smallest_factor_n.
624 unfold lt.apply le_S_S.apply le_O_n.
627 theorem lt_smallest_factor_to_not_divides: \forall n,i:nat.
628 (S O) < n \to (S O) < i \to i < (smallest_factor n) \to i \ndivides n.
630 apply (nat_case n).intro.apply False_ind.apply (not_le_Sn_O (S O) H).
631 intro.apply (nat_case m).intro. apply False_ind.apply (not_le_Sn_n (S O) H).
633 apply divides_b_false_to_not_divides.
634 apply (lt_min_aux_to_false
635 (\lambda i:nat.eqb ((S(S m1)) \mod i) O) (S (S O)) m1 i).
640 theorem prime_smallest_factor_n :
641 \forall n:nat. (S O) < n \to prime (smallest_factor n).
642 intro.change with ((S(S O)) \le n \to (S O) < (smallest_factor n) \land
643 (\forall m:nat. m \divides smallest_factor n \to (S O) < m \to m = (smallest_factor n))).
645 apply lt_SO_smallest_factor.assumption.
647 cut (le m (smallest_factor n)).
648 elim (le_to_or_lt_eq m (smallest_factor n) Hcut).
649 absurd (m \divides n).
650 apply (transitive_divides m (smallest_factor n)).
652 apply divides_smallest_factor_n.
653 apply (trans_lt ? (S O)). unfold lt. apply le_n. exact H.
654 apply lt_smallest_factor_to_not_divides.
655 exact H.assumption.assumption.assumption.
657 apply (trans_lt O (S O)).
659 apply lt_SO_smallest_factor.
664 theorem prime_to_smallest_factor: \forall n. prime n \to
665 smallest_factor n = n.
666 intro.apply (nat_case n).intro.apply False_ind.apply (not_prime_O H).
667 intro.apply (nat_case m).intro.apply False_ind.apply (not_prime_SO H).
670 ((S O) < (S(S m1)) \land
671 (\forall m:nat. m \divides S(S m1) \to (S O) < m \to m = (S(S m1))) \to
672 smallest_factor (S(S m1)) = (S(S m1))).
673 intro.elim H.apply H2.
674 apply divides_smallest_factor_n.
675 apply (trans_lt ? (S O)).unfold lt. apply le_n.assumption.
676 apply lt_SO_smallest_factor.
680 (* a number n > O is prime iff its smallest factor is n *)
681 definition primeb \def \lambda n:nat.
683 [ O \Rightarrow false
686 [ O \Rightarrow false
687 | (S q) \Rightarrow eqb (smallest_factor (S(S q))) (S(S q))]].
690 theorem example4 : primeb (S(S(S O))) = true.
691 normalize.reflexivity.
694 theorem example5 : primeb (S(S(S(S(S(S O)))))) = false.
695 normalize.reflexivity.
698 theorem example6 : primeb (S(S(S(S((S(S(S(S(S(S(S O)))))))))))) = true.
699 normalize.reflexivity.
702 theorem example7 : primeb (S(S(S(S(S(S((S(S(S(S((S(S(S(S(S(S(S O))))))))))))))))))) = true.
703 normalize.reflexivity.
706 theorem primeb_to_Prop: \forall n.
708 [ true \Rightarrow prime n
709 | false \Rightarrow \lnot (prime n)].
711 apply (nat_case n).simplify.unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_O (S O) H1).
712 intro.apply (nat_case m).simplify.unfold Not.unfold prime.intro.elim H.apply (not_le_Sn_n (S O) H1).
715 match eqb (smallest_factor (S(S m1))) (S(S m1)) with
716 [ true \Rightarrow prime (S(S m1))
717 | false \Rightarrow \lnot (prime (S(S m1)))].
718 apply (eqb_elim (smallest_factor (S(S m1))) (S(S m1))).
721 apply prime_smallest_factor_n.
722 unfold lt.apply le_S_S.apply le_S_S.apply le_O_n.
724 change with (prime (S(S m1)) \to False).
726 apply prime_to_smallest_factor.
730 theorem primeb_true_to_prime : \forall n:nat.
731 primeb n = true \to prime n.
734 [ true \Rightarrow prime n
735 | false \Rightarrow \lnot (prime n)].
737 apply primeb_to_Prop.
740 theorem primeb_false_to_not_prime : \forall n:nat.
741 primeb n = false \to \lnot (prime n).
744 [ true \Rightarrow prime n
745 | false \Rightarrow \lnot (prime n)].
747 apply primeb_to_Prop.
750 theorem decidable_prime : \forall n:nat.decidable (prime n).
751 intro.unfold decidable.
754 [ true \Rightarrow prime n
755 | false \Rightarrow \lnot (prime n)] \to (prime n) \lor \lnot (prime n)).
756 apply Hcut.apply primeb_to_Prop.
757 elim (primeb n).left.apply H.right.apply H.
760 theorem prime_to_primeb_true: \forall n:nat.
761 prime n \to primeb n = true.
763 cut (match (primeb n) with
764 [ true \Rightarrow prime n
765 | false \Rightarrow \lnot (prime n)] \to ((primeb n) = true)).
766 apply Hcut.apply primeb_to_Prop.
767 elim (primeb n).reflexivity.
768 absurd (prime n).assumption.assumption.
771 theorem not_prime_to_primeb_false: \forall n:nat.
772 \lnot(prime n) \to primeb n = false.
774 cut (match (primeb n) with
775 [ true \Rightarrow prime n
776 | false \Rightarrow \lnot (prime n)] \to ((primeb n) = false)).
777 apply Hcut.apply primeb_to_Prop.
779 absurd (prime n).assumption.assumption.