include "Z/compare.ma".
include "Z/plus.ma".
-include "higher_order_defs/functions.ma".
(* a fraction is a list of Z-coefficients for primes, in natural
order. The last coefficient must eventually be different from 0 *)
set "baseuri" "cic:/matita/Z/compare".
-include "datatypes/bool.ma".
-include "datatypes/compare.ma".
include "Z/orders.ma".
include "nat/compare.ma".
set "baseuri" "cic:/matita/Z/plus".
include "Z/z.ma".
-include "nat/compare.ma".
include "nat/minus.ma".
definition Zplus :Z \to Z \to Z \def
include "nat/lt_arith.ma".
include "Z/plus.ma".
-include "higher_order_defs/functions.ma".
definition Ztimes :Z \to Z \to Z \def
\lambda x,y.
set "baseuri" "cic:/matita/Z/z".
+include "datatypes/bool.ma".
include "nat/nat.ma".
-include "higher_order_defs/functions.ma".
inductive Z : Set \def
OZ : Z
set "baseuri" "cic:/matita/higher_order_defs/functions/".
include "logic/equality.ma".
-include "logic/connectives.ma".
definition injective: \forall A,B:Type.\forall f:A \to B.Prop
\def \lambda A,B.\lambda f.
set "baseuri" "cic:/matita/logic/equality/".
include "higher_order_defs/relations.ma".
-include "logic/connectives.ma".
inductive eq (A:Type) (x:A) : A \to Prop \def
refl_eq : eq A x x.
set "baseuri" "cic:/matita/nat/div_and_mod".
include "nat/minus.ma".
-include "nat/le_arith.ma".
-include "nat/compare.ma".
let rec mod_aux p m n: nat \def
match (leb m n) with
set "baseuri" "cic:/matita/nat/exp".
-include "nat/times.ma".
-include "nat/orders.ma".
-include "higher_order_defs/functions.ma".
+include "nat/div_and_mod.ma".
let rec exp n m on m\def
match m with
intros 2.
apply nat_case n.
intros.apply False_ind.apply not_le_Sn_O O H3.
-intros.apply inj_times_r m1.assumption.
+intros.
+apply inj_times_r m1.assumption.
qed.
variant inj_exp_r: \forall p:nat. (S O) < p \to \forall n,m:nat.
(exp p n) = (exp p m) \to n = m \def
-injective_exp_r.
-
-
+injective_exp_r.
\ No newline at end of file
set "baseuri" "cic:/matita/nat/factorial".
-include "nat/lt_arith.ma".
+include "nat/le_arith.ma".
let rec fact n \def
match n with
set "baseuri" "cic:/matita/nat/gcd".
include "nat/primes.ma".
-include "higher_order_defs/functions.ma".
let rec gcd_aux p m n: nat \def
match divides_b n m with
set "baseuri" "cic:/matita/nat/le_arith".
-include "higher_order_defs/functions.ma".
include "nat/times.ma".
include "nat/orders.ma".
-include "nat/compare.ma".
(* plus *)
theorem monotonic_le_plus_r:
set "baseuri" "cic:/matita/nat/log".
include "datatypes/constructors.ma".
-include "nat/primes.ma".
include "nat/exp.ma".
+include "nat/lt_arith.ma".
+include "nat/primes.ma".
(* this definition of log is based on pairs, with a remainder *)
set "baseuri" "cic:/matita/nat/lt_arith".
-include "nat/exp.ma".
include "nat/div_and_mod.ma".
(* plus *)
set "baseuri" "cic:/matita/nat/nat".
-include "datatypes/bool.ma".
-include "logic/equality.ma".
-include "logic/connectives.ma".
include "higher_order_defs/functions.ma".
inductive nat : Set \def
set "baseuri" "cic:/matita/nat/nth_prime".
include "nat/primes.ma".
+include "nat/lt_arith.ma".
(* upper bound by Bertrand's conjecture. *)
(* Too difficult to prove.
set "baseuri" "cic:/matita/nat/orders".
-include "nat/plus.ma".
+include "nat/nat.ma".
include "higher_order_defs/ordering.ma".
(* definitions *)
include "datatypes/constructors.ma".
include "nat/primes.ma".
-include "nat/exp.ma".
(* p is just an upper bound, acc is an accumulator *)
let rec n_divides_aux p n m acc \def
let rec pi n f \def
match n with
[ O \Rightarrow (S O)
- | (S p) \Rightarrow (f p)*(pi p f)].
-
-
-
+ | (S p) \Rightarrow (f p)*(pi p f)].
\ No newline at end of file