├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── Makefile ├── Makefile.coq.local-late ├── README.md ├── _CoqProject ├── coq-coqprime.opam ├── coqprime-generator.opam ├── gencertif ├── Makefile.in ├── README.md ├── certif.c ├── certif.h ├── configure.ac ├── factorize.c ├── factorize.h ├── firstprimes.c ├── parser.ml └── pocklington.c └── src └── Coqprime ├── List ├── .depend ├── Iterator.v ├── ListAux.v ├── Permutation.v ├── UList.v └── ZProgression.v ├── N ├── .depend ├── ChineseRem.v └── NatAux.v ├── PrimalityTest ├── .depend ├── Cyclic.v ├── EGroup.v ├── Euler.v ├── FGroup.v ├── IGroup.v ├── Lagrange.v ├── LucasLehmer.v ├── Makefile.bak ├── N ├── Note.pdf ├── PGroup.v ├── Pepin.v ├── Pocklington.v ├── PocklingtonCertificat.v ├── Proth.v ├── Root.v └── Zp.v ├── Tactic ├── .depend └── Tactic.v ├── Z ├── .depend ├── Pmod.v ├── Ppow.v ├── ZCAux.v ├── ZCmisc.v ├── ZSum.v └── Zmod.v ├── elliptic ├── .depend ├── GZnZ.v ├── SMain.v └── ZEll.v ├── examples ├── BasePrimes.v ├── Makefile ├── PocklingtonRefl.v ├── TestLucas.v ├── _CoqProject ├── b1.v ├── bbpp.v ├── mil2.v ├── prime21665NNNN21787.v ├── prime329719147332060395689499.v ├── russell1.v ├── russell2.v ├── t100 │ ├── .depend │ ├── Makefile │ ├── Makefile.bak │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ ├── prime9.v │ └── res ├── t125 │ ├── .depend │ ├── Makefile │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ └── prime9.v ├── t150 │ ├── .depend │ ├── Makefile │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ └── prime9.v ├── t175 │ ├── .depend │ ├── Makefile │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ └── prime9.v ├── t200 │ ├── .depend │ ├── Makefile │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ └── prime9.v ├── t225 │ ├── .depend │ ├── Makefile │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ └── prime9.v ├── t25 │ ├── .depend │ ├── Makefile │ ├── Makefile.bak │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ ├── prime9.v │ └── res ├── t250 │ ├── .depend │ ├── Makefile │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ └── prime9.v ├── t50 │ ├── .depend │ ├── Makefile │ ├── Makefile.bak │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ ├── prime9.v │ └── res └── t75 │ ├── .depend │ ├── Makefile │ ├── Makefile.bak │ ├── Makefile.coq.local │ ├── _CoqProject │ ├── prime1.v │ ├── prime2.v │ ├── prime3.v │ ├── prime4.v │ ├── prime5.v │ ├── prime6.v │ ├── prime7.v │ ├── prime8.v │ ├── prime9.v │ └── res └── num ├── .depend ├── Bits.v ├── Int63Compat.v.v811 ├── Int63Compat.v.v812 ├── Int63Compat.v.v813 ├── Int63Compat.v.v814 ├── Int63Compat.v.v815 ├── Int63Compat.v.v816 ├── Lucas.v ├── MEll.v ├── Mod_op.v ├── NEll.v ├── NMake.v ├── Nbasic.v ├── Pock.v ├── W.v ├── extraction ├── .depend ├── Makefile ├── coq_gc.h ├── extract.v ├── lucas.ml ├── lucas.mli ├── testlucas.ml ├── uint31C.c ├── uint64C.c ├── w31C.ml └── w64C.ml ├── genN.ml └── montgomery.v /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.sh text eol=lf 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | # Check for updates to GitHub Actions every weekday 9 | interval: "daily" 10 | labels: 11 | - "dependencies" 12 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | coq_version: ['8.19', '8.20', '9.0','dev'] 14 | ocaml_version: ['default'] 15 | fail-fast: false # don't stop jobs if one fails 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: coq-community/docker-coq-action@v1 19 | with: 20 | opam_file: 'coq-coqprime.opam' 21 | coq_version: ${{ matrix.coq_version }} 22 | ocaml_version: ${{ matrix.ocaml_version }} 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.vo 3 | *.vos 4 | *.vok 5 | *.glob 6 | *.aux 7 | *.v.timing 8 | .coq-native/ 9 | .csdp.cache 10 | .lia.cache 11 | .nia.cache 12 | .nlia.cache 13 | .nra.cache 14 | /Makefile.conf 15 | /Makefile.coq.conf 16 | /Makefile.coq 17 | /.coq-version 18 | *~ 19 | gencertif/autom4te.cache 20 | gencertif/aclocal.m4 21 | gencertif/config.log 22 | gencertif/config.status 23 | gencertif/configure 24 | gencertif/Makefile 25 | src/Coqprime/num/Int63Compat.v 26 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | 16 | include Makefile.coq.local-late 17 | -------------------------------------------------------------------------------- /Makefile.coq.local-late: -------------------------------------------------------------------------------- 1 | # We only want to inlcude this file once; in older versions of Coq it 2 | # gets included only in Makefile, while in newer versions it is also 3 | # included in Makefile.coq at the bottom 4 | ifndef MAKEFILE_COQ_LOCAL_LATE 5 | MAKEFILE_COQ_LOCAL_LATE:=yes 6 | 7 | # The list of files that depend on the version of Coq 8 | COMPATIBILITY_FILES := \ 9 | src/Coqprime/num/Int63Compat.v \ 10 | # 11 | 12 | # The file holding the version of Coq this project was last built with, locally 13 | COQ_VERSION_FILE := .coq-version 14 | # The version of Coq this project was last built with, locally 15 | COQ_EXTENDED_VERSION_OLD := $(shell cat $(COQ_VERSION_FILE) 2>/dev/null) 16 | # Parse the version of Coq 17 | # If we only care about supporting newer versions of Coq, we might 18 | # want to copy Makefile.coq and use 19 | # $(shell $(COQC) --print-version | cut -d " " -f 1) 20 | # instead of this $(firstword $(subst ...)) construct 21 | COQ_VERSION_PREFIX := The Coq Proof Assistant, version 22 | COQ_VERSION := $(firstword $(subst $(COQ_VERSION_PREFIX),,$(shell $(COQBIN)coqc --version 2>/dev/null))) 23 | COQ_EXTENDED_VERSION := $(shell (true | $(COQBIN)coqtop 2>/dev/null; $(COQBIN)coqc --version 2>/dev/null)) 24 | 25 | # Set up EXPECTED_EXT based on supported versions 26 | ifneq (,$(filter 8.11%,$(COQ_VERSION))) 27 | EXPECTED_EXT:=.v811 28 | else 29 | ifneq (,$(filter 8.12%,$(COQ_VERSION))) 30 | EXPECTED_EXT:=.v812 31 | else 32 | ifneq (,$(filter 8.13%,$(COQ_VERSION))) 33 | EXPECTED_EXT:=.v813 34 | else 35 | ifneq (,$(filter 8.14%,$(COQ_VERSION))) 36 | EXPECTED_EXT:=.v814 37 | else 38 | ifneq (,$(filter 8.15%,$(COQ_VERSION))) 39 | EXPECTED_EXT:=.v815 40 | else 41 | EXPECTED_EXT:=.v816 42 | endif 43 | endif 44 | endif 45 | endif 46 | endif 47 | 48 | # For ease of changing versions of Coq, invalidate the various build 49 | # outputs when the version of Coq changes 50 | .merlin: $(COQ_VERSION_FILE) 51 | 52 | $(VOFILES) $(CMOFILES) $(CMXFILES) $(OFILES) $(CMAFILES) $(CMIFILES) $(CMXSFILES): $(COQ_VERSION_FILE) 53 | 54 | # Copy the compatibility files when either the version changes or the 55 | # underlying contents changes 56 | $(COMPATIBILITY_FILES) : % : %$(EXPECTED_EXT) $(COQ_VERSION_FILE) 57 | $(SHOW)'CP $@{$(EXPECTED_EXT),}' 58 | $(HIDE)cp $< $@ 59 | 60 | # ensure that the compat files exist before we call coqdep 61 | $(ALLDFILES): $(COMPATIBILITY_FILES) $(COQ_VERSION_FILE) _CoqProject 62 | 63 | # The version file is generated and should be removed by clean 64 | clean:: 65 | rm -f $(COQ_VERSION_FILE) 66 | 67 | # If the version of Coq does not match the version the project was 68 | # last built with locally (or the version file does not exist), then 69 | # we record the version info 70 | ifneq ($(COQ_EXTENDED_VERSION),$(COQ_EXTENDED_VERSION_OLD)) 71 | $(COQ_VERSION_FILE): 72 | $(SHOW)'echo $$COQ_VERSION_INFO ($(COQ_VERSION)) > $@' 73 | $(HIDE)echo "$(COQ_EXTENDED_VERSION)" > $@ 74 | .PHONY: $(COQ_VERSION_FILE) 75 | endif 76 | 77 | endif 78 | -------------------------------------------------------------------------------- /_CoqProject: -------------------------------------------------------------------------------- 1 | -R src/Coqprime Coqprime 2 | 3 | src/Coqprime/Tactic/Tactic.v 4 | src/Coqprime/N/NatAux.v 5 | src/Coqprime/N/ChineseRem.v 6 | src/Coqprime/List/Iterator.v 7 | src/Coqprime/List/ListAux.v 8 | src/Coqprime/List/Permutation.v 9 | src/Coqprime/List/UList.v 10 | src/Coqprime/List/ZProgression.v 11 | src/Coqprime/Z/Pmod.v 12 | src/Coqprime/Z/ZCAux.v 13 | src/Coqprime/Z/Zmod.v 14 | src/Coqprime/Z/Ppow.v 15 | src/Coqprime/Z/ZCmisc.v 16 | src/Coqprime/Z/ZSum.v 17 | src/Coqprime/PrimalityTest/Cyclic.v 18 | src/Coqprime/PrimalityTest/EGroup.v 19 | src/Coqprime/PrimalityTest/Euler.v 20 | src/Coqprime/PrimalityTest/FGroup.v 21 | src/Coqprime/PrimalityTest/IGroup.v 22 | src/Coqprime/PrimalityTest/Lagrange.v 23 | src/Coqprime/PrimalityTest/LucasLehmer.v 24 | src/Coqprime/PrimalityTest/Pepin.v 25 | src/Coqprime/PrimalityTest/PGroup.v 26 | src/Coqprime/PrimalityTest/PocklingtonCertificat.v 27 | src/Coqprime/PrimalityTest/Pocklington.v 28 | src/Coqprime/PrimalityTest/Proth.v 29 | src/Coqprime/PrimalityTest/Root.v 30 | src/Coqprime/PrimalityTest/Zp.v 31 | src/Coqprime/elliptic/GZnZ.v 32 | src/Coqprime/elliptic/SMain.v 33 | src/Coqprime/elliptic/ZEll.v 34 | src/Coqprime/num/Bits.v 35 | src/Coqprime/num/Int63Compat.v 36 | src/Coqprime/num/Lucas.v 37 | src/Coqprime/num/NEll.v 38 | src/Coqprime/num/MEll.v 39 | src/Coqprime/num/Mod_op.v 40 | src/Coqprime/num/Pock.v 41 | src/Coqprime/num/montgomery.v 42 | src/Coqprime/num/W.v 43 | src/Coqprime/examples/BasePrimes.v 44 | src/Coqprime/examples/PocklingtonRefl.v 45 | -------------------------------------------------------------------------------- /coq-coqprime.opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "thery@sophia.inria.fr" 3 | homepage: "https://github.com/thery/coqprime" 4 | bug-reports: "https://github.com/thery/coqprime/issues" 5 | dev-repo: "git+https://github.com/thery/coqprime.git" 6 | license: "LGPL-2.1-only" 7 | authors: ["Laurent Théry"] 8 | build: [ 9 | [make "-j%{jobs}%"] 10 | ] 11 | install: [ 12 | [make "install"] 13 | ] 14 | depends: [ 15 | "ocaml" 16 | "coq" {>= "8.14~"} 17 | "coq-bignums" 18 | ] 19 | synopsis: "Certifying prime numbers in Coq" 20 | -------------------------------------------------------------------------------- /coqprime-generator.opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "thery@sophia.inria.fr" 3 | homepage: "https://github.com/thery/coqprime" 4 | bug-reports: "https://github.com/thery/coqprime/issues" 5 | dev-repo: "git+https://github.com/thery/coqprime.git" 6 | license: "LGPL-2.1-only" 7 | authors: ["Laurent Théry"] 8 | build: [ 9 | # cd to a subfolder in opam is tricky, so just move gencertif to the root folder 10 | [ "find" "gencertif" "-type" "f" "-exec" "mv" "{}" "." ";" ] 11 | [ "autoreconf" "-i" "-s" ] 12 | [ "./configure" "--prefix" prefix 13 | # Optiosn for finding opam local gmp-ecm 14 | "CPPFLAGS=-I%{prefix}%/include" 15 | "LDFLAGS=-L%{lib}%" 16 | # Options for homebrew on Intel silicon (overwriting the above) 17 | "CPPFLAGS=-I%{prefix}%/include -I/opt/local/include" { os-distribution = "macports" & os = "macos" } 18 | "LDFLAGS=-L%{lib}% -L/opt/local/lib" { os-distribution = "macports" & os = "macos" } 19 | # Options for homebrew on Apple silicon (overwriting the above) 20 | "CPPFLAGS=-I%{prefix}%/include -I/opt/homebrew/include" { os-distribution = "homebrew" & os = "macos" & arch = "arm64"} 21 | "LDFLAGS=-L%{lib}% -L/opt/homebrew/lib" { os-distribution = "homebrew" & os = "macos" & arch = "arm64"} 22 | # Options for Windows cygwin 23 | "--build=%{arch}%-pc-cygwin" { os = "win32" & os-distribution = "cygwinports" } 24 | "--host=%{arch}%-w64-mingw32" { os = "win32" & os-distribution = "cygwinports" } 25 | "--target=%{arch}%-w64-mingw32" { os = "win32" & os-distribution = "cygwinports" } 26 | ] 27 | [ make "-j" "%{jobs}%" ] 28 | ] 29 | install: [ 30 | [make "install"] 31 | ] 32 | depends: [ 33 | "ocaml" 34 | "num" 35 | "conf-gmp" 36 | "gmp-ecm" 37 | ] 38 | synopsis: "Certificate generator for prime numbers in Coq" 39 | url { 40 | src: "git+https://github.com/thery/coqprime.git#master" 41 | } 42 | -------------------------------------------------------------------------------- /gencertif/Makefile.in: -------------------------------------------------------------------------------- 1 | CFIRSTPRIMES=certif.c factorize.c firstprimes.c 2 | OFIRSTPRIMES=$(CFIRSTPRIMES:.c=.o) 3 | ZARITHIMPORT=$(shell ocamlfind query -i-format zarith) 4 | CPOCK=certif.c factorize.c pocklington.c 5 | OPOCK=$(CPOCK:.c=.o) 6 | 7 | prefix=@prefix@ 8 | exec_prefix=@exec_prefix@ 9 | 10 | all: pock first o2v 11 | 12 | pock: $(OPOCK) 13 | @CC@ @CPPFLAGS@ @LDFLAGS@ @CFLAGS@ -o pocklington $(OPOCK) @LIBS@ 14 | 15 | first: $(OFIRSTPRIMES) 16 | @CC@ @CPPFLAGS@ @LDFLAGS@ @CFLAGS@ -o firstprimes $(OFIRSTPRIMES) @LIBS@ 17 | 18 | clean: 19 | rm -f *~ *.o *.cmo *.cmi pocklington firstprimes o2v 20 | 21 | .SUFFIXES: .c .o 22 | 23 | .c.o: 24 | @CC@ @CPPFLAGS@ @CFLAGS@ -I$(GMPDIR) -I$(ECMDIR) -Wall -pedantic -c $< 25 | 26 | o2v: parser.ml 27 | ocamlc -o o2v -I +str $(ZARITHIMPORT) zarith.cma str.cma parser.ml 28 | 29 | install: pocklington firstprimes o2v 30 | cp pocklington firstprimes o2v @bindir@ 31 | -------------------------------------------------------------------------------- /gencertif/README.md: -------------------------------------------------------------------------------- 1 | 2 | # pocklington command 3 | 4 | `pocklington [-v] [-o file] numspec` 5 | 6 | options are: 7 | - `-v` : verbose mode 8 | - `-o file` : set the output in file "file" 9 | - `numspec`: 10 | 11 | * directly a prime number. 12 | 13 | * `-next num`: generate certificate for the next prime number following 14 | `num`. 15 | 16 | * `-size s` : generate certificate for a prime number with a least `s` 17 | digits (in base 10). 18 | 19 | * `-proth k n` : generate certificate for the Proth number : k*2^n + 1. 20 | 21 | * `-lucas n` : generate certificate for the Mersenne number 2^n - 1 22 | using Lucas test (more efficient). 23 | 24 | * `-mersenne n` : generate certificate for the Mersenne number 2^n - 1 25 | using Pocklington, 26 | 27 | * `-dec file` : generate certificate for the number given in file, 28 | the file should also contain a partial factorization of the 29 | predecessor. An example of such file for the prime 30 | 7237005577332262213973186563042994240857116359379907606001950938285454250989 31 | is the following. 32 | Its factors are 33 | 2 × 2 × 3 × 11 × 198211423230930754013084525763697 × 34 | 276602624281642239937218680557139826668747. 35 | In the `dec` file you need to give a big enough partial decomposition containing 36 | all the 2. For example the following one line is enough 37 | ``` 38 | 7237005577332262213973186563042994240857116359379907606001950938285454250989276602624281642239937218680557139826668747 2 2 39 | ``` 40 | 41 | 42 | # o2v command 43 | 44 | `o2v [-split] [-n name] [-o file] file.out` 45 | 46 | options are: 47 | 48 | - `-split` : generate one file per certificate 49 | - `-o file` : set the output in file "file" 50 | - `-n name` : set the name of the final theorem "name" 51 | 52 | # BUILD / INSTALL : 53 | 54 | The certificate generator is included in Coq Platform, which also contains 55 | opam files for the certificate generator and its dependencies. So installing 56 | Coq Platform might be the easiest way to install this. 57 | 58 | Otherwise please install dependencies: 59 | 60 | ``` 61 | gmp (version 6.2.1 or later) 62 | gmp-ecm (version 7.0 or later) 63 | ``` 64 | 65 | Please note that the gmp-ecm package provided by MacPorts is too old. 66 | 67 | After installing the dependencies, these commands should work: 68 | 69 | ``` 70 | cd gencertif 71 | autoreconf -i -s 72 | ./configure --prefix CPPFLAGS=-I% LDFLAGS=-L 73 | make -j 4 74 | make install 75 | ``` 76 | 77 | The `CPPFLAGS` and `LDFLAGS` options to configure are only required if the headers/library 78 | for gmp and gmp-ecm are not in the default system include / library path. 79 | This is e.g. the case for macOS MacPorts. 80 | -------------------------------------------------------------------------------- /gencertif/certif.h: -------------------------------------------------------------------------------- 1 | /* 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | */ 9 | 10 | #include 11 | #include "gmp.h" 12 | 13 | #ifndef __CERTIF_H__ 14 | 15 | extern int flag_verbose; 16 | void my_set_verbose(); 17 | 18 | /**********************************************/ 19 | /* Pocklington certificate */ 20 | /**********************************************/ 21 | 22 | 23 | typedef struct 24 | { 25 | mpz_ptr _N; /* the prime number to prove */ 26 | mpz_ptr _F1; /* product of the pseudo factorization */ 27 | mpz_ptr _R1; /* R1 = (N - 1)/F1 */ 28 | unsigned long int _a; /* the witness */ 29 | mpz_ptr _sqrt; /* The sqrt root needed by the certif ... */ 30 | int _pow2; /* Number of power of 2 in F1 */ 31 | int _allocated; /* allocated size in words of _dec */ 32 | int _used; /* used words in _dec */ 33 | mpz_ptr *_dec; /* pseudo factorization of N-1 */ 34 | /* increasing first */ 35 | /* F1 = 2^pow2 * PROD dec */ 36 | } __pock_struct; 37 | 38 | typedef __pock_struct *pock_certif_t; 39 | 40 | pock_certif_t pock_init (mpz_t N); 41 | void dec_add_ui (pock_certif_t c, unsigned long int ui); 42 | void dec_add_mpz (pock_certif_t c, mpz_t n); 43 | int check_pock (pock_certif_t c); 44 | 45 | void finalize_pock(pock_certif_t c); 46 | 47 | /**********************************************/ 48 | /* Proof certificate */ 49 | /**********************************************/ 50 | 51 | typedef struct 52 | { 53 | mpz_ptr _N; /* The prime number to prove */ 54 | char *_lemma; /* The name of the lemma */ 55 | } __proof_struct; 56 | 57 | typedef __proof_struct *proof_certif_t; 58 | 59 | /**********************************************/ 60 | /* Lucas certificate */ 61 | /**********************************************/ 62 | 63 | typedef struct 64 | { 65 | mpz_ptr _N; /* The prime number to prove */ 66 | unsigned long int _n; /* N = 2^n - 1 */ 67 | } __lucas_struct; 68 | 69 | typedef __lucas_struct *lucas_certif_t; 70 | 71 | 72 | 73 | /**********************************************/ 74 | /* Pre certificate */ 75 | /**********************************************/ 76 | 77 | 78 | typedef struct 79 | { 80 | int _kind; /* kind of certificate: */ 81 | /* 0 : proof; 1 : pock_cerif; 82 | 2: lucas_certif */ 83 | union { 84 | pock_certif_t _pock; 85 | proof_certif_t _proof; 86 | lucas_certif_t _lucas; 87 | } _certif; 88 | } __pre_struct; 89 | 90 | typedef __pre_struct *pre_certif_t; 91 | 92 | pre_certif_t mk_proof_certif(mpz_t N); 93 | pre_certif_t mk_pock_certif(pock_certif_t c); 94 | pre_certif_t mk_lucas_certif(mpz_t N, unsigned long int n); 95 | 96 | 97 | 98 | /**********************************************/ 99 | /* Certificate */ 100 | /**********************************************/ 101 | 102 | 103 | typedef struct 104 | { 105 | int _allocated; 106 | int _used; 107 | pre_certif_t *_list; 108 | } __certif_struct; 109 | 110 | typedef __certif_struct *certif_t; 111 | 112 | void set_proof_limit (unsigned int max); 113 | 114 | certif_t init_certif(); 115 | int _2_is_in (certif_t lc); 116 | int is_in (mpz_t t, certif_t lc); 117 | void add_pre(pre_certif_t, certif_t lc); 118 | 119 | 120 | void print_pock_certif(FILE *out, pock_certif_t c); 121 | void print_file(char *filename, char *name, pre_certif_t c, certif_t lc); 122 | pock_certif_t read_file(char * filename, certif_t lc); 123 | 124 | void print_lemma(FILE *out, char* name, pre_certif_t p, certif_t lc); 125 | void print_prelude(FILE *out); 126 | #define __CERTIF_H__ 127 | #endif /* __CERTIF_H__ */ 128 | 129 | -------------------------------------------------------------------------------- /gencertif/configure.ac: -------------------------------------------------------------------------------- 1 | # USAGE NOTES 2 | # OS specific include and library paths can be given on the configure command line with e.g. 3 | # ./configure CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib 4 | # We can't use automakes pkg-config interface because ecm usually doesn't have a pkgconfig gile. 5 | 6 | # Initialize autoconf(name, version, bugreports) 7 | AC_INIT([CoqPrime], [8.14], [https://github.com/thery/coqprime/issues]) 8 | 9 | # Find C compiler 10 | AC_PROG_CC 11 | 12 | # Check for libraries using the C compiler for checks 13 | AC_LANG(C) 14 | 15 | # GCC requires -lm for math functions like "log", other compilers don't. 16 | # So check for -lm but don't throw an error if it is not there. 17 | AC_CHECK_LIB(m, log) 18 | 19 | # Check for the GNU multiple precision arithmetic library. 20 | # Use th emethod recommended here: https://gmplib.org/manual/Autoconf 21 | AC_CHECK_LIB(gmp, __gmpz_init, , AC_MSG_ERROR([Unable to find library 'gmp'])) 22 | 23 | # Check for the availablitiy of the Elliptic Curve Method library from 24 | # https://gitlab.inria.fr/zimmerma/ecm 25 | AC_CHECK_LIB(ecm, ecm_init, , AC_MSG_ERROR([Unable to find library 'gmp-ecm'])) 26 | 27 | # Write make file 28 | AC_CONFIG_FILES([Makefile]) 29 | AC_OUTPUT 30 | -------------------------------------------------------------------------------- /gencertif/factorize.h: -------------------------------------------------------------------------------- 1 | /* 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | */ 9 | 10 | #include "gmp.h" 11 | #include "certif.h" 12 | 13 | #ifndef __FACTORIZE_H__ 14 | 15 | void set_verbose(); 16 | pock_certif_t mersenne_certif (mpz_t t, unsigned long int p); 17 | pock_certif_t pock_certif (mpz_t t); 18 | void extend_lc (certif_t lc, pock_certif_t c, unsigned long int min, 19 | unsigned long int max ); 20 | #define __FACTORIZE_H__ 21 | #endif /* __FACTORIZE_H__ */ 22 | -------------------------------------------------------------------------------- /src/Coqprime/List/.depend: -------------------------------------------------------------------------------- 1 | Iterator.vo: Iterator.v Permutation.vo 2 | Iterator.vi: Iterator.v Permutation.vo 3 | ListAux.vo: ListAux.v ../Tactic/Tactic.vo 4 | ListAux.vi: ListAux.v ../Tactic/Tactic.vo 5 | Permutation.vo: Permutation.v ListAux.vo 6 | Permutation.vi: Permutation.v ListAux.vo 7 | UList.vo: UList.v Permutation.vo 8 | UList.vi: UList.v Permutation.vo 9 | ZProgression.vo: ZProgression.v Iterator.vo UList.vo 10 | ZProgression.vi: ZProgression.v Iterator.vo UList.vo 11 | Iterator.html: Iterator.v Permutation.html 12 | ListAux.html: ListAux.v ../Tactic/Tactic.html 13 | Permutation.html: Permutation.v ListAux.html 14 | UList.html: UList.v Permutation.html 15 | ZProgression.html: ZProgression.v Iterator.html UList.html 16 | -------------------------------------------------------------------------------- /src/Coqprime/List/ZProgression.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | Require Export Iterator. 10 | Require Import ZArith. 11 | Require Import Lia. 12 | Require Export UList. 13 | Open Scope Z_scope. 14 | 15 | Theorem next_n_Z: forall n m, next_n Z.succ n m = n + Z_of_nat m. 16 | intros n m; generalize n; elim m; clear n m. 17 | intros n; simpl; auto with zarith. 18 | intros m H n. 19 | replace (n + Z_of_nat (S m)) with (Z.succ n + Z_of_nat m). 20 | rewrite <- H; auto with zarith. 21 | rewrite inj_S; auto with zarith. 22 | Qed. 23 | 24 | Theorem Zprogression_end: 25 | forall n m, 26 | progression Z.succ n (S m) = 27 | app (progression Z.succ n m) (cons (n + Z_of_nat m) nil). 28 | intros n m; generalize n; elim m; clear n m. 29 | simpl; intros; apply f_equal2 with ( f := @cons Z ); auto with zarith. 30 | intros m1 Hm1 n1. 31 | apply trans_equal with (cons n1 (progression Z.succ (Z.succ n1) (S m1))); auto. 32 | rewrite Hm1. 33 | replace (Z.succ n1 + Z_of_nat m1) with (n1 + Z_of_nat (S m1)). auto. 34 | replace (Z_of_nat (S m1)) with (1 + Z_of_nat m1). auto with zarith. 35 | rewrite inj_S; auto with zarith. 36 | Qed. 37 | 38 | Theorem Zprogression_pred_end: 39 | forall n m, 40 | progression Z.pred n (S m) = 41 | app (progression Z.pred n m) (cons (n - Z_of_nat m) nil). 42 | intros n m; generalize n; elim m; clear n m. 43 | simpl; intros; apply f_equal2 with ( f := @cons Z ); auto with zarith. 44 | intros m1 Hm1 n1. 45 | apply trans_equal with (cons n1 (progression Z.pred (Z.pred n1) (S m1))); auto. 46 | rewrite Hm1. 47 | replace (Z.pred n1 - Z_of_nat m1) with (n1 - Z_of_nat (S m1)). auto. 48 | replace (Z_of_nat (S m1)) with (1 + Z_of_nat m1). auto with zarith. 49 | rewrite inj_S; auto with zarith. 50 | Qed. 51 | 52 | Theorem Zprogression_opp: 53 | forall n m, 54 | rev (progression Z.succ n m) = progression Z.pred (n + Z_of_nat (pred m)) m. 55 | intros n m; generalize n; elim m; clear n m. 56 | simpl; auto. 57 | intros m Hm n. 58 | rewrite (Zprogression_end n); auto. 59 | rewrite distr_rev. 60 | rewrite Hm; simpl; auto. 61 | case m. 62 | simpl; auto. 63 | intros m1; 64 | replace (n + Z_of_nat (pred (S m1))) with (Z.pred (n + Z_of_nat (S m1))); auto. 65 | rewrite inj_S; simpl; (unfold Z.pred; unfold Z.succ); auto with zarith. 66 | Qed. 67 | 68 | Theorem Zprogression_le_init: 69 | forall n m p, In p (progression Z.succ n m) -> (n <= p). 70 | intros n m; generalize n; elim m; clear n m; simpl; auto. 71 | intros; contradiction. 72 | intros m H n p [H1|H1]; auto with zarith. 73 | generalize (H _ _ H1); auto with zarith. 74 | Qed. 75 | 76 | Theorem Zprogression_le_end: 77 | forall n m p, In p (progression Z.succ n m) -> (p < n + Z_of_nat m). 78 | intros n m; generalize n; elim m; clear n m; auto. 79 | intros; contradiction. 80 | intros m H n p H1; simpl in H1 |-; case H1; clear H1; intros H1. 81 | lia. 82 | apply Z.lt_le_trans with (Z.succ n + Z_of_nat m). 83 | apply H; assumption. 84 | lia. 85 | Qed. 86 | 87 | Theorem ulist_Zprogression: forall a n, ulist (progression Z.succ a n). 88 | intros a n; generalize a; elim n; clear a n; simpl; auto with zarith. 89 | intros n H1 a; apply ulist_cons; auto. 90 | intros H2; absurd (Z.succ a <= a); auto with zarith. 91 | apply Zprogression_le_init with ( 1 := H2 ). 92 | Qed. 93 | 94 | Theorem in_Zprogression: 95 | forall a b n, ( a <= b < a + Z_of_nat n ) -> In b (progression Z.succ a n). 96 | intros a b n; generalize a b; elim n; clear a b n; auto with zarith. 97 | simpl; auto with zarith. 98 | intros n H a b. 99 | replace (a + Z_of_nat (S n)) with (Z.succ a + Z_of_nat n). 100 | intros [H1 H2]; simpl; auto with zarith. 101 | case (Zle_lt_or_eq _ _ H1); auto with zarith. 102 | rewrite inj_S; auto with zarith. 103 | Qed. 104 | -------------------------------------------------------------------------------- /src/Coqprime/N/.depend: -------------------------------------------------------------------------------- 1 | NatAux.vo: NatAux.v 2 | NatAux.vi: NatAux.v 3 | NatAux.html: NatAux.v 4 | -------------------------------------------------------------------------------- /src/Coqprime/N/NatAux.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | (********************************************************************** 10 | Aux.v 11 | 12 | Auxillary functions & Theorems 13 | **********************************************************************) 14 | Require Export Arith. 15 | 16 | (************************************** 17 | Some properties of minus 18 | **************************************) 19 | 20 | Theorem minus_O : forall a b : nat, a <= b -> a - b = 0. 21 | intros a; elim a; simpl in |- *; auto with arith. 22 | intros a1 Rec b; case b; elim b; auto with arith. 23 | Qed. 24 | 25 | 26 | (************************************** 27 | Definitions and properties of the power for nat 28 | **************************************) 29 | 30 | Fixpoint pow (n m: nat) {struct m} : nat := match m with O => 1%nat | (S m1) => (n * pow n m1)%nat end. 31 | 32 | Theorem pow_add: forall n m p, pow n (m + p) = (pow n m * pow n p)%nat. 33 | intros n m; elim m; simpl. 34 | intros p; rewrite Nat.add_0_r; auto. 35 | intros m1 Rec p; rewrite Rec; auto with arith. 36 | Qed. 37 | 38 | 39 | Theorem pow_pos: forall p n, (0 < p)%nat -> (0 < pow p n)%nat. 40 | intros p1 n H; elim n; simpl; auto with arith. 41 | intros n1 H1; replace 0%nat with (p1 * 0)%nat; auto with arith. 42 | repeat rewrite (Nat.mul_comm p1); apply Nat.mul_lt_mono_pos_r; auto with arith. 43 | Qed. 44 | 45 | 46 | Theorem pow_monotone: forall n p q, (1 < n)%nat -> (p < q)%nat -> (pow n p < pow n q)%nat. 47 | intros n p1 q1 H H1; elim H1; simpl. 48 | pattern (pow n p1) at 1; rewrite <- (Nat.mul_1_l (pow n p1)). 49 | apply Nat.mul_lt_mono_pos_r; auto. 50 | apply pow_pos; auto with arith. 51 | intros n1 H2 H3. 52 | apply Nat.lt_trans with (1 := H3). 53 | pattern (pow n n1) at 1; rewrite <- (Nat.mul_1_l (pow n n1)). 54 | apply Nat.mul_lt_mono_pos_r; auto. 55 | apply pow_pos; auto with arith. 56 | Qed. 57 | 58 | (************************************ 59 | Definition of the divisibility for nat 60 | **************************************) 61 | 62 | Definition divide a b := exists c, b = a * c. 63 | 64 | 65 | Theorem divide_le: forall p q, (1 < q)%nat -> divide p q -> (p <= q)%nat. 66 | intros p1 q1 H (x, H1); subst. 67 | apply Nat.le_trans with (p1 * 1)%nat; auto with arith. 68 | rewrite Nat.mul_1_r; auto with arith. 69 | apply Nat.mul_le_mono_l. 70 | destruct x; auto with arith. 71 | rewrite Nat.mul_0_r in H; auto with arith. 72 | Qed. 73 | -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/.depend: -------------------------------------------------------------------------------- 1 | NCyclic.cmo: nIGroup.cmo nEGroup.cmo nFGroup.cmo 2 | NCyclic.cmx: nIGroup.cmx nEGroup.cmx nFGroup.cmx 3 | NEGroup.cmo: nFGroup.cmo 4 | NEGroup.cmx: nFGroup.cmx 5 | NEuler.cmo: ../Z/nZSum.cmo 6 | NEuler.cmx: ../Z/nZSum.cmx 7 | NFGroup.cmo: ../List/nUList.cmo 8 | NFGroup.cmx: ../List/nUList.cmx 9 | NIGroup.cmo: nFGroup.cmo 10 | NIGroup.cmx: nFGroup.cmx 11 | NLagrange.cmo: nFGroup.cmo 12 | NLagrange.cmx: nFGroup.cmx 13 | NLucasLehmer.cmo: nPGroup.cmo nEGroup.cmo ../Z/nZCAux.cmo 14 | NLucasLehmer.cmx: nPGroup.cmx nEGroup.cmx ../Z/nZCAux.cmx 15 | NPepin.cmo: 16 | NPepin.cmx: 17 | NPGroup.cmo: nIGroup.cmo 18 | NPGroup.cmx: nIGroup.cmx 19 | NPocklingtonCertificat.cmo: ../Z/nZCmisc.cmo ../Z/nPmod.cmo nLucasLehmer.cmo 20 | NPocklingtonCertificat.cmx: ../Z/nZCmisc.cmx ../Z/nPmod.cmx nLucasLehmer.cmx 21 | NPocklington.cmo: 22 | NPocklington.cmx: 23 | NProth.cmo: 24 | NProth.cmx: 25 | NRoot.cmo: 26 | NRoot.cmx: 27 | NZp.cmo: nIGroup.cmo ../List/nIterator.cmo nEGroup.cmo 28 | NZp.cmx: nIGroup.cmx ../List/nIterator.cmx nEGroup.cmx 29 | Cyclic.vo Cyclic.glob: Cyclic.v ../Z/ZCAux.vo Root.vo ../List/UList.vo IGroup.vo EGroup.vo FGroup.vo 30 | EGroup.vo EGroup.glob: EGroup.v ../Tactic/Tactic.vo ../Z/ZCAux.vo ../List/UList.vo FGroup.vo Lagrange.vo 31 | Euler.vo Euler.glob: Euler.v ../Tactic/Tactic.vo ../Z/ZSum.vo 32 | FGroup.vo FGroup.glob: FGroup.v ../List/UList.vo ../Tactic/Tactic.vo 33 | IGroup.vo IGroup.glob: IGroup.v ../Tactic/Tactic.vo ../List/UList.vo ../List/ListAux.vo FGroup.vo 34 | Lagrange.vo Lagrange.glob: Lagrange.v ../List/UList.vo ../List/ListAux.vo ../N/NatAux.vo FGroup.vo 35 | LucasLehmer.vo LucasLehmer.glob: LucasLehmer.v ../Z/ZCAux.vo ../Tactic/Tactic.vo ../N/NatAux.vo ../List/UList.vo ../List/ListAux.vo FGroup.vo EGroup.vo PGroup.vo IGroup.vo 36 | Pepin.vo Pepin.glob: Pepin.v ../Z/ZCAux.vo Pocklington.vo 37 | PGroup.vo PGroup.glob: PGroup.v ../Tactic/Tactic.vo ../List/ListAux.vo ../List/UList.vo FGroup.vo EGroup.vo IGroup.vo 38 | PocklingtonCertificat.vo PocklingtonCertificat.glob: PocklingtonCertificat.v ../Z/ZCAux.vo LucasLehmer.vo Pocklington.vo ../Z/ZCmisc.vo ../Z/Pmod.vo 39 | Pocklington.vo Pocklington.glob: Pocklington.v ../Tactic/Tactic.vo ../Z/ZCAux.vo Zp.vo FGroup.vo EGroup.vo Euler.vo 40 | Proth.vo Proth.glob: Proth.v ../Z/ZCAux.vo Pocklington.vo 41 | Root.vo Root.glob: Root.v ../List/UList.vo ../Tactic/Tactic.vo ../List/Permutation.vo 42 | Zp.vo Zp.glob: Zp.v ../Tactic/Tactic.vo ../List/UList.vo FGroup.vo EGroup.vo IGroup.vo Cyclic.vo Euler.vo ../List/ZProgression.vo 43 | Cyclic.html Cyclic.glob: Cyclic.v ../Z/ZCAux.html Root.html ../List/UList.html IGroup.html EGroup.html FGroup.html 44 | EGroup.html EGroup.glob: EGroup.v ../Tactic/Tactic.html ../Z/ZCAux.html ../List/UList.html FGroup.html Lagrange.html 45 | Euler.html Euler.glob: Euler.v ../Tactic/Tactic.html ../Z/ZSum.html 46 | FGroup.html FGroup.glob: FGroup.v ../List/UList.html ../Tactic/Tactic.html 47 | IGroup.html IGroup.glob: IGroup.v ../Tactic/Tactic.html ../List/UList.html ../List/ListAux.html FGroup.html 48 | Lagrange.html Lagrange.glob: Lagrange.v ../List/UList.html ../List/ListAux.html ../N/NatAux.html FGroup.html 49 | LucasLehmer.html LucasLehmer.glob: LucasLehmer.v ../Z/ZCAux.html ../Tactic/Tactic.html ../N/NatAux.html ../List/UList.html ../List/ListAux.html FGroup.html EGroup.html PGroup.html IGroup.html 50 | Pepin.html Pepin.glob: Pepin.v ../Z/ZCAux.html Pocklington.html 51 | PGroup.html PGroup.glob: PGroup.v ../Tactic/Tactic.html ../List/ListAux.html ../List/UList.html FGroup.html EGroup.html IGroup.html 52 | PocklingtonCertificat.html PocklingtonCertificat.glob: PocklingtonCertificat.v ../Z/ZCAux.html LucasLehmer.html Pocklington.html ../Z/ZCmisc.html ../Z/Pmod.html 53 | Pocklington.html Pocklington.glob: Pocklington.v ../Tactic/Tactic.html ../Z/ZCAux.html Zp.html FGroup.html EGroup.html Euler.html 54 | Proth.html Proth.glob: Proth.v ../Z/ZCAux.html Pocklington.html 55 | Root.html Root.glob: Root.v ../List/UList.html ../Tactic/Tactic.html ../List/Permutation.html 56 | Zp.html Zp.glob: Zp.v ../Tactic/Tactic.html ../List/UList.html FGroup.html EGroup.html IGroup.html Cyclic.html Euler.html ../List/ZProgression.html 57 | -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/Euler.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | (************************************************************************ 10 | 11 | Definition of the Euler Totient function 12 | 13 | *************************************************************************) 14 | Require Import ZArith. 15 | Require Export Znumtheory. 16 | Require Import Tactic. 17 | Require Export ZSum. 18 | 19 | Open Scope Z_scope. 20 | 21 | Definition phi n := Zsum 1 (n - 1) (fun x => if rel_prime_dec x n then 1 else 0). 22 | 23 | Theorem phi_def_with_0: 24 | forall n, 1< n -> phi n = Zsum 0 (n - 1) (fun x => if rel_prime_dec x n then 1 else 0). 25 | intros n H; rewrite Zsum_S_left; auto with zarith. 26 | case (rel_prime_dec 0 n); intros H2. 27 | contradict H2; apply not_rel_prime_0; auto. 28 | rewrite Zplus_0_l; auto. 29 | Qed. 30 | 31 | Theorem phi_pos: forall n, 1 < n -> 0 < phi n. 32 | intros n H; unfold phi. 33 | case (Zle_lt_or_eq 2 n); auto with zarith; intros H1; subst. 34 | rewrite Zsum_S_left; simpl; auto with zarith. 35 | case (rel_prime_dec 1 n); intros H2. 36 | apply Z.lt_le_trans with (1 + 0); auto with zarith. 37 | apply Zplus_le_compat_l. 38 | pattern 0 at 1; replace 0 with ((1 + (n - 1) - 2) * 0); auto with zarith. 39 | rewrite <- Zsum_c; auto with zarith. 40 | apply Zsum_le; auto with zarith. 41 | intros x H3; case (rel_prime_dec x n); auto with zarith. 42 | case H2; apply rel_prime_1; auto with zarith. 43 | rewrite Zsum_nn. 44 | case (rel_prime_dec (2 - 1) 2); auto with zarith. 45 | intros H1; contradict H1; apply rel_prime_1; auto with zarith. 46 | Qed. 47 | 48 | Theorem phi_le_n_minus_1: forall n, 1 < n -> phi n <= n - 1. 49 | intros n H; replace (n-1) with ((1 + (n - 1) - 1) * 1); auto with zarith. 50 | rewrite <- Zsum_c; auto with zarith. 51 | unfold phi; apply Zsum_le; auto with zarith. 52 | intros x H1; case (rel_prime_dec x n); auto with zarith. 53 | Qed. 54 | 55 | Theorem prime_phi_n_minus_1: forall n, prime n -> phi n = n - 1. 56 | intros n H; replace (n-1) with ((1 + (n - 1) - 1) * 1); auto with zarith. 57 | assert (Hu: 1 <= n - 1). 58 | assert (2 <= n); auto with zarith. 59 | apply prime_ge_2; auto. 60 | rewrite <- Zsum_c; auto with zarith; unfold phi; apply Zsum_ext; auto. 61 | intros x (H2, H3); case H; clear H; intros H H1. 62 | generalize (H1 x); case (rel_prime_dec x n); auto with zarith. 63 | intros H6 H7; contradict H6; apply H7; split; auto with zarith. 64 | Qed. 65 | 66 | Theorem phi_n_minus_1_prime: forall n, 1 < n -> phi n = n - 1 -> prime n. 67 | intros n H H1; case (prime_dec n); auto; intros H2. 68 | assert (H3: phi n < n - 1); auto with zarith. 69 | replace (n-1) with ((1 + (n - 1) - 1) * 1); auto with zarith. 70 | assert (Hu: 1 <= n - 1); auto with zarith. 71 | rewrite <- Zsum_c; auto with zarith; unfold phi; apply Zsum_lt; auto. 72 | intros x _; case (rel_prime_dec x n); auto with zarith. 73 | case not_prime_divide with n; auto. 74 | intros x (H3, H4); exists x; repeat split; auto with zarith. 75 | case (rel_prime_dec x n); auto with zarith. 76 | intros H5; absurd (x = 1 \/ x = -1); auto with zarith. 77 | case (Zis_gcd_unique x n x 1); auto. 78 | apply Zis_gcd_intro; auto; exists 1; auto with zarith. 79 | contradict H3; rewrite H1; auto with zarith. 80 | Qed. 81 | 82 | Theorem phi_divide_prime: forall n, 1 < n -> (n - 1 | phi n) -> prime n. 83 | intros n H1 H2; apply phi_n_minus_1_prime; auto. 84 | apply Zle_antisym. 85 | apply phi_le_n_minus_1; auto. 86 | apply Zdivide_le; auto; auto with zarith. 87 | apply phi_pos; auto. 88 | Qed. 89 | -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/FGroup.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | (********************************************************************** 10 | FGroup.v 11 | 12 | Defintion and properties of finite groups 13 | 14 | Definition: FGroup 15 | **********************************************************************) 16 | Require Import List. 17 | Require Import UList. 18 | Require Import Tactic. 19 | Require Import ZArith. 20 | 21 | Open Scope Z_scope. 22 | 23 | Set Implicit Arguments. 24 | 25 | (************************************** 26 | A finite group is defined for an operation op 27 | it has a support (s) 28 | op operates inside the group (internal) 29 | op is associative (assoc) 30 | it has an element (e) that is neutral (e_is_zero_l e_is_zero_r) 31 | it has an inverse operator (i) 32 | the inverse operates inside the group (i_internal) 33 | it gives an inverse (i_is_inverse_l is_is_inverse_r) 34 | **************************************) 35 | 36 | Record FGroup (A: Set) (op: A -> A -> A): Set := mkGroup 37 | {s : (list A); 38 | unique_s: ulist s; 39 | internal: forall a b, In a s -> In b s -> In (op a b) s; 40 | assoc: forall a b c, In a s -> In b s -> In c s -> op a (op b c) = op (op a b) c; 41 | e: A; 42 | e_in_s: In e s; 43 | e_is_zero_l: forall a, In a s -> op e a = a; 44 | e_is_zero_r: forall a, In a s -> op a e = a; 45 | i: A -> A; 46 | i_internal: forall a, In a s -> In (i a) s; 47 | i_is_inverse_l: forall a, (In a s) -> op (i a) a = e; 48 | i_is_inverse_r: forall a, (In a s) -> op a (i a) = e 49 | }. 50 | 51 | (************************************** 52 | The order of a group is the lengh of the support 53 | **************************************) 54 | 55 | Definition g_order (A: Set) (op: A -> A -> A) (g: FGroup op) := 56 | Z_of_nat (length g.(s)). 57 | 58 | Unset Implicit Arguments. 59 | 60 | Global Hint Resolve unique_s internal e_in_s e_is_zero_l e_is_zero_r 61 | i_internal i_is_inverse_l i_is_inverse_r assoc : core. 62 | 63 | 64 | Section FGroup. 65 | 66 | Variable A: Set. 67 | Variable op: A -> A -> A. 68 | 69 | (************************************** 70 | Some properties of a finite group 71 | **************************************) 72 | 73 | Theorem g_cancel_l: forall (g : FGroup op), forall a b c, In a g.(s) -> In b g.(s) -> In c g.(s) -> op a b = op a c -> b = c. 74 | intros g a b c H1 H2 H3 H4; apply trans_equal with (op g.(e) b); sauto. 75 | replace (g.(e)) with (op (g.(i) a) a); sauto. 76 | apply trans_equal with (op (i g a) (op a b)); sauto. 77 | apply sym_equal; apply assoc with g; auto. 78 | rewrite H4. 79 | apply trans_equal with (op (op (i g a) a) c); sauto. 80 | apply assoc with g; auto. 81 | replace (op (g.(i) a) a) with g.(e); sauto. 82 | Qed. 83 | 84 | Theorem g_cancel_r: forall (g : FGroup op), forall a b c, In a g.(s) -> In b g.(s) -> In c g.(s) -> op b a = op c a -> b = c. 85 | intros g a b c H1 H2 H3 H4; apply trans_equal with (op b g.(e)); sauto. 86 | replace (g.(e)) with (op a (g.(i) a)); sauto. 87 | apply trans_equal with (op (op b a) (i g a)); sauto. 88 | apply assoc with g; auto. 89 | rewrite H4. 90 | apply trans_equal with (op c (op a (i g a))); sauto. 91 | apply sym_equal; apply assoc with g; sauto. 92 | replace (op a (g.(i) a)) with g.(e); sauto. 93 | Qed. 94 | 95 | Theorem e_unique: forall (g : FGroup op), forall e1, In e1 g.(s) -> (forall a, In a g.(s) -> op e1 a = a) -> e1 = g.(e). 96 | intros g e1 He1 H2. 97 | apply trans_equal with (op e1 g.(e)); sauto. 98 | Qed. 99 | 100 | Theorem inv_op: forall (g: FGroup op) a b, In a g.(s) -> In b g.(s) -> g.(i) (op a b) = op (g.(i) b) (g.(i) a). 101 | intros g a1 b1 H1 H2; apply g_cancel_l with (g := g) (a := op a1 b1); sauto. 102 | repeat rewrite g.(assoc); sauto. 103 | apply trans_equal with g.(e); sauto. 104 | rewrite <- g.(assoc) with (a := a1); sauto. 105 | rewrite g.(i_is_inverse_r); sauto. 106 | rewrite g.(e_is_zero_r); sauto. 107 | Qed. 108 | 109 | Theorem i_e: forall (g: FGroup op), g.(i) g.(e) = g.(e). 110 | intro g; apply g_cancel_l with (g:= g) (a := g.(e)); sauto. 111 | apply trans_equal with g.(e); sauto. 112 | Qed. 113 | 114 | (************************************** 115 | A group has at least one element 116 | **************************************) 117 | 118 | Theorem g_order_pos: forall g: FGroup op, 0 < g_order g. 119 | intro g; generalize g.(e_in_s); unfold g_order; case g.(s); simpl; auto with zarith. 120 | Qed. 121 | 122 | 123 | 124 | End FGroup. 125 | -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/N: -------------------------------------------------------------------------------- 1 | (********************************************************************** 2 | Aux.v 3 | 4 | Auxillary functions & Theorems 5 | 6 | 7 | Laurent.Thery@inria.fr (2003) 8 | **********************************************************************) 9 | Require Export Arith. 10 | Require Export Tactic. 11 | 12 | (************************************** 13 | Some properties of minus 14 | **************************************) 15 | 16 | Theorem minus_O : forall a b : nat, a <= b -> a - b = 0. 17 | intros a; elim a; simpl in |- *; auto with arith. 18 | intros a1 Rec b; case b; elim b; auto with arith. 19 | Qed. 20 | 21 | 22 | (************************************** 23 | Definitions and properties of the power for nat 24 | **************************************) 25 | 26 | Fixpoint pow (n m: nat) {struct m} : nat := match m with O => 1%nat | (S m1) => (n * pow n m1)%nat end. 27 | 28 | Theorem pow_add: forall n m p, pow n (m + p) = (pow n m * pow n p)%nat. 29 | intros n m; elim m; simpl. 30 | intros p; rewrite plus_0_r; auto. 31 | intros m1 Rec p; rewrite Rec; auto with arith. 32 | Qed. 33 | 34 | 35 | Theorem pow_pos: forall p n, (0 < p)%nat -> (0 < pow p n)%nat. 36 | intros p1 n H; elim n; simpl; auto with arith. 37 | intros n1 H1; replace 0%nat with (p1 * 0)%nat; auto with arith. 38 | repeat rewrite (mult_comm p1); apply mult_lt_compat_r; auto with arith. 39 | Qed. 40 | 41 | 42 | Theorem pow_monotone: forall n p q, (1 < n)%nat -> (p < q)%nat -> (pow n p < pow n q)%nat. 43 | intros n p1 q1 H H1; elim H1; simpl. 44 | pattern (pow n p1) at 1; rewrite <- (mult_1_l (pow n p1)). 45 | apply mult_lt_compat_r; auto. 46 | apply pow_pos; auto with arith. 47 | intros n1 H2 H3. 48 | apply lt_trans with (1 := H3). 49 | pattern (pow n n1) at 1; rewrite <- (mult_1_l (pow n n1)). 50 | apply mult_lt_compat_r; auto. 51 | apply pow_pos; auto with arith. 52 | Qed. 53 | 54 | (************************************ 55 | Definition of the divisibility for nat 56 | **************************************) 57 | 58 | Definition divide a b := exists c, b = a * c. 59 | 60 | 61 | Theorem divide_le: forall p q, (1 < q)%nat -> divide p q -> (p <= q)%nat. 62 | intros p1 q1 H (x, H1); subst. 63 | apply le_trans with (p1 * 1)%nat; auto with arith. 64 | rewrite mult_1_r; auto with arith. 65 | apply mult_le_compat_l. 66 | case (le_lt_or_eq 0 x); auto with arith. 67 | intros H2; subst; contradict H; rewrite mult_0_r; auto with arith. 68 | Qed. 69 | -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/Note.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thery/coqprime/f23d095170211d1a51dbda2b32bcb47ab09aee7e/src/Coqprime/PrimalityTest/Note.pdf -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/Pepin.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | (********************************************************************** 10 | Pepin.v 11 | 12 | Pepin's Test for Fermat Number 13 | 14 | Definition: PepinTest 15 | **********************************************************************) 16 | Require Import ZArith. 17 | Require Import ZCAux. 18 | Require Import Pocklington. 19 | 20 | Open Scope Z_scope. 21 | 22 | Definition FermatNumber n := 2^(2^(Z_of_nat n)) + 1. 23 | 24 | Theorem Fermat_pos: forall n, 1 < FermatNumber n. 25 | unfold FermatNumber; intros n. 26 | solve [ auto with zarith (* 8.14 *) | 27 | (apply Z.le_lt_trans with (2 ^ 2 ^(Z_of_nat n)); auto with zarith; 28 | rewrite <- (Zpower_0_r 2); auto with zarith; 29 | apply Zpower_le_monotone; try split; auto with zarith)]. 30 | Qed. 31 | 32 | Theorem PepinTest: forall n, let Fn := FermatNumber n in (3 ^ ((Fn - 1) / 2) + 1) mod Fn = 0 -> prime Fn. 33 | intros n Fn H. 34 | assert (Hn: 1 < Fn). 35 | unfold Fn; apply Fermat_pos. 36 | apply PocklingtonCorollary1 with (F1 := 2^(2^(Z_of_nat n))) (R1 := 1). 2: auto with zarith. 37 | 2: unfold Fn, FermatNumber; auto with zarith. 38 | apply Z.lt_le_trans with (2 ^ 1). 39 | rewrite Zpower_1_r; auto with zarith. 40 | apply Zpower_le_monotone. 2: split. 1-2: auto with zarith. 41 | rewrite <- (Zpower_0_r 2); apply Zpower_le_monotone; try split; auto with zarith. 42 | unfold Fn, FermatNumber. 43 | assert (H1: 2 <= 2 ^ 2 ^ Z_of_nat n). 44 | pattern 2 at 1; rewrite <- (Zpower_1_r 2) by auto with zarith. 45 | apply Zpower_le_monotone; split. auto with zarith. 46 | rewrite <- (Zpower_0_r 2); apply Zpower_le_monotone; try split; auto with zarith. 47 | apply Z.lt_le_trans with (2 * 2 ^2 ^Z_of_nat n). 48 | assert (tmp: forall p, 2 * p = p + p); auto with zarith. 49 | apply Zmult_le_compat_r; auto with zarith. 50 | assert (Hd: (2 | Fn - 1)). 51 | exists (2 ^ (2^(Z_of_nat n) - 1)). 52 | pattern 2 at 3; rewrite <- (Zpower_1_r 2). 53 | rewrite <- Zpower_exp. 3: auto with zarith. 54 | assert (tmp: forall p, p = (p - 1) +1) by auto with zarith; rewrite <- tmp. 55 | unfold Fn, FermatNumber; ring. 56 | assert (0 < 2 ^ Z_of_nat n); auto with zarith. 57 | intros p Hp Hp1; exists 3; split. auto with zarith. split. 58 | rewrite (Zdivide_Zdiv_eq 2 (Fn -1)) by auto with zarith. 59 | rewrite Zmult_comm. rewrite Zpower_mult. 3: auto with zarith. 60 | rewrite Zpower_mod by auto with zarith. 61 | assert (tmp: forall p, p = (p + 1) -1) by auto with zarith; rewrite (fun x => (tmp (3 ^ x))). 62 | rewrite Zminus_mod by auto with zarith. 63 | rewrite H. 64 | rewrite (Zmod_small 1) by auto with zarith. 65 | rewrite <- Zpower_mod by auto with zarith. 66 | rewrite Zmod_small. auto with zarith. 67 | simpl; unfold Zpower_pos; simpl; auto with zarith. 68 | apply Z_div_pos; auto with zarith. 69 | apply Zis_gcd_gcd. auto with zarith. 70 | apply Zis_gcd_intro. 1-2: auto with zarith. 71 | intros x HD1 HD2. 72 | assert (Hd1: p = 2). 73 | apply prime_div_Zpower_prime with (4 := Hp1). 1-2: auto with zarith. 74 | apply prime_2. 75 | assert (Hd2: (x | 2)). 76 | replace 2 with ((3 ^ ((Fn - 1) / 2) + 1) - (3 ^ ((Fn - 1) / 2) - 1)) by auto with zarith. 77 | apply Zdivide_minus_l; auto. 78 | apply Z.divide_trans with (1 := HD2). 79 | apply Zmod_divide; auto with zarith. 80 | rewrite <- Hd1; auto. 81 | replace 1 with (Fn - (Fn - 1)) by auto with zarith. 82 | apply Zdivide_minus_l; auto. 83 | apply Z.divide_trans with (1 := Hd2); auto. 84 | Qed. 85 | 86 | (* An optimized version with Zpow_mod *) 87 | 88 | Definition pepin_test n := 89 | let Fn := FermatNumber n in if Z.eq_dec (Zpow_mod 3 ((Fn - 1) / 2) Fn) (Fn - 1) then true else false. 90 | 91 | Theorem PepinTestOp: forall n, pepin_test n = true -> prime (FermatNumber n). 92 | intros n; unfold pepin_test. 93 | match goal with |- context[if ?X then _ else _] => case X end; try (intros; discriminate). 94 | intros H1 _; apply PepinTest. 95 | generalize (Fermat_pos n); intros H2. 96 | rewrite Zplus_mod; auto with zarith. 97 | rewrite <- Zpow_mod_Zpower_correct; auto with zarith. 98 | rewrite H1. 99 | rewrite (Zmod_small 1); auto with zarith. 100 | replace (FermatNumber n - 1 + 1) with (FermatNumber n); auto with zarith. 101 | apply Zdivide_mod; auto with zarith. 102 | apply Z_div_pos; auto with zarith. 103 | Qed. 104 | 105 | Theorem prime5: prime 5. 106 | exact (PepinTestOp 1 (refl_equal _)). 107 | Qed. 108 | 109 | Theorem prime17: prime 17. 110 | exact (PepinTestOp 2 (refl_equal _)). 111 | Qed. 112 | 113 | Theorem prime257: prime 257. 114 | exact (PepinTestOp 3 (refl_equal _)). 115 | Qed. 116 | 117 | Theorem prime65537: prime 65537. 118 | exact (PepinTestOp 4 (refl_equal _)). 119 | Qed. 120 | 121 | (* Too tough !! 122 | Theorem prime4294967297: prime 4294967297. 123 | refine (PepinTestOp 5 (refl_equal _)). 124 | Qed. 125 | *) 126 | -------------------------------------------------------------------------------- /src/Coqprime/PrimalityTest/Proth.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | (********************************************************************** 10 | Proth.v 11 | 12 | Proth's Test 13 | 14 | Definition: ProthTest 15 | **********************************************************************) 16 | Require Import ZArith. 17 | Require Import ZCAux. 18 | Require Import Pocklington. 19 | 20 | Open Scope Z_scope. 21 | 22 | Theorem ProthTest: forall h k a, let n := h * 2 ^ k + 1 in 1 < a -> 0 < h < 2 ^k -> (a ^ ((n - 1) / 2) + 1) mod n = 0 -> prime n. 23 | intros h k a n; unfold n; intros H H1 H2. 24 | assert (Hu: 0 < h * 2 ^ k). 25 | apply Zmult_lt_O_compat; auto with zarith. 26 | assert (Hu1: 0 < k). 27 | case (Zle_or_lt k 0); intros Hv; auto. 28 | generalize H1 Hv; case k; simpl. 29 | intros (Hv1, Hv2); contradict Hv2; auto with zarith. 30 | intros p1 _ Hv1; contradict Hv1; auto with zarith. 31 | intros p (Hv1, Hv2); contradict Hv2; auto with zarith. 32 | apply PocklingtonCorollary1 with (F1 := 2 ^ k) (R1 := h). 1-2: auto with zarith. 33 | ring. 34 | apply Z.lt_le_trans with ((h + 1) * 2 ^ k). 2: auto with zarith. 35 | rewrite Zmult_plus_distr_l; apply Zplus_lt_compat_l. 36 | rewrite Zmult_1_l; apply Z.lt_le_trans with 2; auto with zarith. 37 | intros p H3 H4. 38 | generalize H2; replace (h * 2 ^ k + 1 - 1) with (h * 2 ^k) by auto with zarith; clear H2; intros H2. 39 | exists a; split; auto; split. 40 | pattern (h * 2 ^k) at 1; rewrite (Zdivide_Zdiv_eq 2 (h * 2 ^ k)). 2: auto with zarith. 41 | rewrite (Zmult_comm 2); rewrite Zpower_mult. 3: auto with zarith. 42 | rewrite Zpower_mod by auto with zarith. 43 | assert (tmp: forall p, p = (p + 1) -1) by auto with zarith; rewrite (fun x => (tmp (a ^ x))). 44 | rewrite Zminus_mod by auto with zarith. 45 | rewrite H2. 46 | rewrite (Zmod_small 1) by auto with zarith. 47 | rewrite <- Zpower_mod by auto with zarith. 48 | rewrite Zmod_small. auto with zarith. 49 | simpl; unfold Zpower_pos; simpl; auto with zarith. 50 | apply Z_div_pos; auto with zarith. 51 | apply Z.divide_trans with (2 ^ k). 52 | apply Zpower_divide; auto with zarith. 53 | apply Zdivide_factor_l; auto with zarith. 54 | apply Zis_gcd_gcd. auto with zarith. 55 | apply Zis_gcd_intro. 1-2: auto with zarith. 56 | intros x HD1 HD2. 57 | assert (Hd1: p = 2). 58 | apply prime_div_Zpower_prime with (4 := H4). 1-2: auto with zarith. 59 | apply prime_2. 60 | assert (Hd2: (x | 2)). 61 | replace 2 with ((a ^ (h * 2 ^ k / 2) + 1) - (a ^ (h * 2 ^ k/ 2) - 1)) by auto with zarith. 62 | apply Zdivide_minus_l; auto. 63 | apply Z.divide_trans with (1 := HD2). 64 | apply Zmod_divide; auto with zarith. 65 | pattern 2 at 2; rewrite <- Hd1; auto. 66 | replace 1 with ((h * 2 ^k + 1) - (h * 2 ^ k)) by auto with zarith. 67 | apply Zdivide_minus_l; auto. 68 | apply Z.divide_trans with (1 := Hd2); auto. 69 | apply Z.divide_trans with (2 ^ k). 70 | apply Zpower_divide; auto with zarith. 71 | apply Zdivide_factor_l; auto with zarith. 72 | Qed. 73 | 74 | 75 | Definition proth_test h k a := 76 | let n := h * 2 ^ k + 1 in 77 | if (Z_lt_dec 1 a) then 78 | if (Z_lt_dec 0 h) then 79 | if (Z_lt_dec h (2 ^k)) then 80 | if Z.eq_dec (Zpow_mod a ((n - 1) / 2) n) (n - 1) then true 81 | else false else false else false else false. 82 | 83 | 84 | Theorem ProthTestOp: forall h k a, proth_test h k a = true -> prime (h * 2 ^ k + 1). 85 | intros h k a; unfold proth_test. 86 | repeat match goal with |- context[if ?X then _ else _] => case X end; try (intros; discriminate). 87 | intros H1 H2 H3 H4 _. 88 | assert (Hu: 0 < h * 2 ^ k). 89 | apply Zmult_lt_O_compat; auto with zarith. 90 | apply ProthTest with (a := a); auto. 91 | rewrite Zplus_mod; auto with zarith. 92 | rewrite <- Zpow_mod_Zpower_correct; auto with zarith. 93 | rewrite H1. 94 | rewrite (Zmod_small 1); auto with zarith. 95 | replace (h * 2 ^ k + 1 - 1 + 1) with (h * 2 ^ k + 1); auto with zarith. 96 | apply Zdivide_mod; auto with zarith. 97 | apply Z_div_pos; auto with zarith. 98 | Qed. 99 | 100 | Theorem prime5: prime 5. 101 | exact (ProthTestOp 1 2 2 (refl_equal _)). 102 | Qed. 103 | 104 | Theorem prime17: prime 17. 105 | exact (ProthTestOp 1 4 3 (refl_equal _)). 106 | Qed. 107 | 108 | Theorem prime257: prime 257. 109 | exact (ProthTestOp 1 8 3 (refl_equal _)). 110 | Qed. 111 | 112 | Theorem prime65537: prime 65537. 113 | exact (ProthTestOp 1 16 3 (refl_equal _)). 114 | Qed. 115 | 116 | (* Too tough !! 117 | Theorem prime4294967297: prime 4294967297. 118 | exact (ProthTestOp 1 32 3 (refl_equal _)). 119 | Qed. 120 | *) 121 | -------------------------------------------------------------------------------- /src/Coqprime/Tactic/.depend: -------------------------------------------------------------------------------- 1 | Tactic.vo: Tactic.v 2 | Tactic.vi: Tactic.v 3 | Tactic.html: Tactic.v 4 | -------------------------------------------------------------------------------- /src/Coqprime/Tactic/Tactic.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | 10 | (********************************************************************** 11 | Tactic.v 12 | Useful tactics 13 | **********************************************************************) 14 | 15 | (************************************** 16 | A simple tactic to end a proof 17 | **************************************) 18 | Ltac finish := intros; auto; trivial; discriminate. 19 | 20 | 21 | (************************************** 22 | A tactic for proof by contradiction 23 | with contradict H 24 | H: ~A |- B gives |- A 25 | H: ~A |- ~ B gives H: B |- A 26 | H: A |- B gives |- ~ A 27 | H: A |- B gives |- ~ A 28 | H: A |- ~ B gives H: A |- ~ A 29 | **************************************) 30 | 31 | Ltac contradict name := 32 | let term := type of name in ( 33 | match term with 34 | (~_) => 35 | match goal with 36 | |- ~ _ => let x := fresh in 37 | (intros x; case name; 38 | generalize x; clear x name; 39 | intro name) 40 | | |- _ => case name; clear name 41 | end 42 | | _ => 43 | match goal with 44 | |- ~ _ => let x := fresh in 45 | (intros x; absurd term; 46 | [idtac | exact name]; generalize x; clear x name; 47 | intros name) 48 | | |- _ => generalize name; absurd term; 49 | [idtac | exact name]; clear name 50 | end 51 | end). 52 | 53 | 54 | (************************************** 55 | A tactic to do case analysis keeping the equality 56 | **************************************) 57 | 58 | Ltac case_eq name := 59 | generalize (refl_equal name); pattern name at -1 in |- *; case name. 60 | 61 | 62 | (************************************** 63 | A tactic to use f_equal? theorems 64 | **************************************) 65 | 66 | Ltac eq_tac := 67 | match goal with 68 | |- (?g _ = ?g _) => apply f_equal with (f := g) 69 | | |- (?g ?X _ = ?g ?X _) => apply f_equal with (f := g X) 70 | | |- (?g _ _ = ?g _ _) => apply f_equal2 with (f := g) 71 | | |- (?g ?X ?Y _ = ?g ?X ?Y _) => apply f_equal with (f := g X Y) 72 | | |- (?g ?X _ _ = ?g ?X _ _) => apply f_equal2 with (f := g X) 73 | | |- (?g _ _ _ = ?g _ _ _) => apply f_equal3 with (f := g) 74 | | |- (?g ?X ?Y ?Z _ = ?g ?X ?Y ?Z _) => apply f_equal with (f := g X Y Z) 75 | | |- (?g ?X ?Y _ _ = ?g ?X ?Y _ _) => apply f_equal2 with (f := g X Y) 76 | | |- (?g ?X _ _ _ = ?g ?X _ _ _) => apply f_equal3 with (f := g X) 77 | | |- (?g _ _ _ _ _ = ?g _ _ _ _) => apply f_equal4 with (f := g) 78 | end. 79 | 80 | (************************************** 81 | A stupid tactic that tries auto also after applying sym_equal 82 | **************************************) 83 | 84 | Ltac sauto := (intros; apply sym_equal; auto; fail) || auto. 85 | -------------------------------------------------------------------------------- /src/Coqprime/Z/.depend: -------------------------------------------------------------------------------- 1 | Pmod.vo: Pmod.v Zmisc.vo 2 | Pmod.vi: Pmod.v Zmisc.vo 3 | ZAux.vo: ZAux.v ../Tactic/Tactic.vo 4 | ZAux.vi: ZAux.v ../Tactic/Tactic.vo 5 | ZDivModAux.vo: ZDivModAux.v ../Tactic/Tactic.vo ZAux.vo ZPowerAux.vo 6 | ZDivModAux.vi: ZDivModAux.v ../Tactic/Tactic.vo ZAux.vo ZPowerAux.vo 7 | Zmisc.vo: Zmisc.v 8 | Zmisc.vi: Zmisc.v 9 | ZPowerAux.vo: ZPowerAux.v ../Tactic/Tactic.vo 10 | ZPowerAux.vi: ZPowerAux.v ../Tactic/Tactic.vo 11 | ZSum.vo: ZSum.v ../List/ListAux.vo ZAux.vo ../List/Iterator.vo ../List/ZProgression.vo 12 | ZSum.vi: ZSum.v ../List/ListAux.vo ZAux.vo ../List/Iterator.vo ../List/ZProgression.vo 13 | Ppow.vo: Ppow.v ZAux.vo 14 | Ppow.vi: Ppow.v ZAux.vo 15 | Zmod.vo: Zmod.v ZAux.vo 16 | Zmod.vi: Zmod.v ZAux.vo 17 | Pmod.html: Pmod.v Zmisc.html 18 | ZAux.html: ZAux.v ../Tactic/Tactic.html 19 | ZDivModAux.html: ZDivModAux.v ../Tactic/Tactic.html ZAux.html ZPowerAux.html 20 | Zmisc.html: Zmisc.v 21 | ZPowerAux.html: ZPowerAux.v ../Tactic/Tactic.html 22 | ZSum.html: ZSum.v ../List/ListAux.html ZAux.html ../List/Iterator.html ../List/ZProgression.html 23 | Ppow.html: Ppow.v ZAux.html 24 | Zmod.html: Zmod.v ZAux.html 25 | -------------------------------------------------------------------------------- /src/Coqprime/Z/Ppow.v: -------------------------------------------------------------------------------- 1 | (*************************************************************) 2 | (* This file is distributed under the terms of the *) 3 | (* GNU Lesser General Public License Version 2.1 *) 4 | (*************************************************************) 5 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 6 | (*************************************************************) 7 | 8 | Require Import ZArith Zpow_facts. 9 | 10 | Open Scope Z_scope. 11 | 12 | Fixpoint Ppow a z {struct z}:= 13 | match z with 14 | xH => a 15 | | xO z1 => let v := Ppow a z1 in (Pmult v v) 16 | | xI z1 => let v := Ppow a z1 in (Pmult a (Pmult v v)) 17 | end. 18 | 19 | Theorem Ppow_correct: forall a z, 20 | Zpos (Ppow a z) = (Zpos a) ^ (Zpos z). 21 | intros a z; elim z; simpl Ppow; auto; 22 | try (intros z1 Hrec; repeat rewrite Zpos_mult_morphism; rewrite Hrec). 23 | rewrite Zpos_xI; rewrite Zpower_exp. 3: auto with zarith. 24 | 2: rewrite <-Zpos_xO; red; simpl; intros; discriminate. 25 | rewrite Zpower_1_r; rewrite (Zmult_comm 2); 26 | try rewrite Zpower_mult by auto with zarith. 27 | change 2 with (1 + 1); rewrite Zpower_exp by auto with zarith. 28 | rewrite Zpower_1_r; rewrite Zmult_comm; auto. 29 | rewrite Zpos_xO; rewrite (Zmult_comm 2); 30 | rewrite Zpower_mult by auto with zarith. 31 | change 2 with (1 + 1); rewrite Zpower_exp by auto with zarith. 32 | rewrite Zpower_1_r; auto. 33 | rewrite Zpower_1_r; auto. 34 | Qed. 35 | 36 | Theorem Ppow_plus: forall a z1 z2, 37 | Ppow a (z1 + z2) = ((Ppow a z1) * (Ppow a z2))%positive. 38 | intros a z1 z2. 39 | assert (tmp: forall x y, Zpos x = Zpos y -> x = y). 40 | intros x y H; injection H; auto. 41 | apply tmp. 42 | rewrite Zpos_mult_morphism; repeat rewrite Ppow_correct. 43 | rewrite Zpos_plus_distr; rewrite Zpower_exp; auto; red; simpl; 44 | intros; discriminate. 45 | Qed. 46 | -------------------------------------------------------------------------------- /src/Coqprime/Z/Zmod.v: -------------------------------------------------------------------------------- 1 | (*************************************************************) 2 | (* This file is distributed under the terms of the *) 3 | (* GNU Lesser General Public License Version 2.1 *) 4 | (*************************************************************) 5 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 6 | (*************************************************************) 7 | 8 | Require Import ZArith Znumtheory. 9 | 10 | Set Implicit Arguments. 11 | 12 | Open Scope Z_scope. 13 | 14 | Lemma rel_prime_mod: forall a b, 1 < b -> 15 | rel_prime a b -> a mod b <> 0. 16 | Proof. 17 | intros a b H H1 H2. 18 | case (not_rel_prime_0 _ H). 19 | rewrite <- H2. 20 | apply rel_prime_mod; auto with zarith. 21 | Qed. 22 | 23 | Lemma Zmodpl: forall a b n, 0 < n -> 24 | (a mod n + b) mod n = (a + b) mod n. 25 | Proof. 26 | intros a b n H. 27 | rewrite Zplus_mod; auto. 28 | rewrite Zmod_mod; auto. 29 | apply sym_equal; apply Zplus_mod; auto. 30 | Qed. 31 | 32 | Lemma Zmodpr: forall a b n, 0 < n -> 33 | (b + a mod n) mod n = (b + a) mod n. 34 | Proof. 35 | intros a b n H; repeat rewrite (Zplus_comm b). 36 | apply Zmodpl; auto. 37 | Qed. 38 | 39 | Lemma Zmodml: forall a b n, 0 < n -> 40 | (a mod n * b) mod n = (a * b) mod n. 41 | Proof. 42 | intros a b n H. 43 | rewrite Zmult_mod; auto. 44 | rewrite Zmod_mod; auto. 45 | apply sym_equal; apply Zmult_mod; auto. 46 | Qed. 47 | 48 | Lemma Zmodmr: forall a b n, 0 < n -> 49 | (b * (a mod n)) mod n = (b * a) mod n. 50 | Proof. 51 | intros a b n H; repeat rewrite (Zmult_comm b). 52 | apply Zmodml; auto. 53 | Qed. 54 | 55 | 56 | Ltac is_ok t := 57 | match t with 58 | | (?x mod _ + ?y mod _) mod _ => constr:(false) 59 | | (?x mod _ * (?y mod _)) mod _ => constr:(false) 60 | | ?x mod _ => x 61 | end. 62 | 63 | Ltac rmod t := 64 | match t with 65 | (?x + ?y) mod _ => 66 | match (is_ok x) with 67 | | false => rmod x 68 | | ?x1 => match (is_ok y) with 69 | |false => rmod y 70 | | ?y1 => 71 | rewrite <- (Zplus_mod x1 y1) 72 | |false => rmod y 73 | end 74 | end 75 | | (?x * ?y) mod _ => 76 | match (is_ok x) with 77 | | false => rmod x 78 | | ?x1 => match (is_ok y) with 79 | |false => rmod y 80 | | ?y1 => rewrite <- (Zmult_mod x1 y1) 81 | end 82 | | false => rmod x 83 | end 84 | end. 85 | 86 | 87 | Lemma Zmod_div_mod: forall n m a, 0 < n -> 0 < m -> 88 | (n | m) -> a mod n = (a mod m) mod n. 89 | Proof. 90 | intros n m a H1 H2 H3. 91 | pattern a at 1; rewrite (Z_div_mod_eq_full a m). 92 | case H3; intros q Hq; pattern m at 1; rewrite Hq. 93 | rewrite (Zmult_comm q). 94 | rewrite Zplus_mod; auto. 95 | rewrite <- Zmult_assoc; rewrite Zmult_mod; auto. 96 | rewrite Z_mod_same; try rewrite Zmult_0_l; auto with zarith. 97 | rewrite (Zmod_small 0); auto with zarith. 98 | rewrite Zplus_0_l; rewrite Zmod_mod; auto with zarith. 99 | Qed. 100 | -------------------------------------------------------------------------------- /src/Coqprime/elliptic/.depend: -------------------------------------------------------------------------------- 1 | SMain.vo SMain.glob: SMain.v ../PrimalityTest/FGroup.vo ../List/UList.vo 2 | ZEll.vo ZEll.glob: ZEll.v ../Z/ZCAux.vo ../Z/Ppow.vo GZnZ.vo ../PrimalityTest/EGroup.vo SMain.vo ../Z/Zmod.vo 3 | GZnZ.vo GZnZ.glob: GZnZ.v ../List/UList.vo ../Z/Pmod.vo 4 | SMain.html SMain.glob: SMain.v ../PrimalityTest/FGroup.html ../List/UList.html 5 | ZEll.html ZEll.glob: ZEll.v ../Z/ZCAux.html ../Z/Ppow.html GZnZ.html ../PrimalityTest/EGroup.html SMain.html ../Z/Zmod.html 6 | GZnZ.html GZnZ.glob: GZnZ.v ../List/UList.html ../Z/Pmod.html 7 | -------------------------------------------------------------------------------- /src/Coqprime/examples/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/PocklingtonRefl.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | Require Export List. 10 | Require Export ZArith. 11 | Require Export Znumtheory. 12 | Require Export Pock. 13 | Require Export BasePrimes. 14 | -------------------------------------------------------------------------------- /src/Coqprime/examples/TestLucas.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | Require Import ZArith. 10 | From Coqprime Require Import Lucas. 11 | 12 | Eval native_compute in 2. 13 | 14 | Time Eval native_compute in lucas 2. 15 | 16 | Eval native_compute in 3. 17 | 18 | Time Eval native_compute in lucas 3. 19 | 20 | Eval native_compute in 5. 21 | 22 | Time Eval native_compute in lucas 5. 23 | 24 | Eval native_compute in 7. 25 | 26 | Time Eval native_compute in lucas 7. 27 | 28 | Eval native_compute in 13. 29 | 30 | Time Eval native_compute in lucas 13. 31 | 32 | Eval native_compute in 17. 33 | 34 | Time Eval native_compute in lucas 17. 35 | 36 | Eval native_compute in 19. 37 | 38 | Time Eval native_compute in lucas 19. 39 | 40 | Eval native_compute in 31. 41 | 42 | Time Eval native_compute in lucas 31. 43 | 44 | Eval native_compute in 61. 45 | 46 | Time Eval native_compute in lucas 61. 47 | 48 | Eval native_compute in 89. 49 | 50 | Time Eval native_compute in lucas 89. 51 | 52 | Eval native_compute in 107. 53 | 54 | Time Eval native_compute in lucas 107. 55 | 56 | Eval native_compute in 127. 57 | 58 | Time Eval native_compute in lucas 127. 59 | 60 | Eval native_compute in 521. 61 | 62 | Time Eval native_compute in lucas 521. 63 | 64 | Eval native_compute in 607. 65 | 66 | Time Eval native_compute in lucas 607. 67 | 68 | Eval native_compute in 1279. 69 | 70 | Time Eval native_compute in lucas 1279. 71 | 72 | Eval native_compute in 2203. 73 | 74 | Time Eval native_compute in lucas 2203. 75 | 76 | Eval native_compute in 2281. 77 | 78 | Time Eval native_compute in lucas 2281. 79 | 80 | Eval native_compute in 3217. 81 | 82 | Time Eval native_compute in lucas 3217. 83 | 84 | Eval native_compute in 4253. 85 | 86 | Time Eval native_compute in lucas 4253. 87 | 88 | Eval native_compute in 4423. 89 | 90 | Time Eval native_compute in lucas 4423. 91 | 92 | Time Eval native_compute in 9689. 93 | 94 | Time Eval native_compute in lucas 9689. 95 | 96 | Time Eval native_compute in 9941. 97 | 98 | (* 99 | Time Eval native_compute in lucas 9941. 100 | 101 | Time Eval native_compute in 11213. 102 | 103 | Time Eval native_compute in lucas 11213. 104 | 105 | Time Eval native_compute in 19937. 106 | 107 | Time Eval native_compute in lucas 19937. 108 | 109 | Time Eval native_compute in 21701. 110 | 111 | Time Eval native_compute in lucas 21701. 112 | 113 | Time Eval native_compute in 23209. 114 | 115 | Time Eval native_compute in lucas 23209. 116 | 117 | Time Eval native_compute in 44497. 118 | 119 | Time Eval native_compute in lucas 44497. 120 | 121 | Time Eval native_compute in 86243. 122 | 123 | Time Eval native_compute in lucas 86243. 124 | 125 | Time Eval native_compute in 110503. 126 | 127 | Time Eval native_compute in lucas 110503. 128 | 129 | Time Eval native_compute in 132049. 130 | 131 | Time Eval native_compute in lucas 132049. 132 | 133 | Time Eval native_compute in 216091. 134 | 135 | Time Eval native_compute in lucas 216091. 136 | *) 137 | 138 | (* 139 | = 3 140 | = 0 141 | Finished transaction in 0. secs (0.01u,0.s) 142 | = 5 143 | = 0 144 | Finished transaction in 0. secs (0.u,0.s) 145 | = 7 146 | = 0 147 | Finished transaction in 0. secs (0.u,0.s) 148 | = 13 149 | = 0 150 | Finished transaction in 0. secs (0.u,0.s) 151 | = 17 152 | = 0 153 | Finished transaction in 0. secs (0.u,0.s) 154 | = 19 155 | = 0 156 | Finished transaction in 0. secs (0.u,0.s) 157 | = 31 158 | = 0 159 | Finished transaction in 0. secs (0.u,0.s) 160 | = 61 161 | = 0 162 | Finished transaction in 0. secs (0.01u,0.s) 163 | = 89 164 | = 0 165 | Finished transaction in 0. secs (0.02u,0.s) 166 | = 107 167 | = 0 168 | Finished transaction in 0. secs (0.02u,0.s) 169 | = 127 170 | = 0 171 | Finished transaction in 0. secs (0.04u,0.s) 172 | = 521 173 | = 0 174 | Finished transaction in 2. secs (1.85u,0.01s) 175 | = 607 176 | = 0 177 | Finished transaction in 3. secs (2.78u,0.07s) 178 | = 1279 179 | = 0 180 | Finished transaction in 21. secs (20.21u,0.26s) 181 | = 2203 182 | = 0 183 | Finished transaction in 94. secs (89.1u,1.05s) 184 | = 2281 185 | = 0 186 | Finished transaction in 102. secs (97.59u,1.1s) 187 | = 3217 188 | = 0 189 | Finished transaction in 244. secs (237.65u,2.39s) 190 | = 4253 191 | = 0 192 | Finished transaction in 506. secs (494.09u,4.65s) 193 | = 4423 194 | = 0 195 | Finished transaction in 572. secs (563.27u,5.45s) 196 | 197 | *) 198 | -------------------------------------------------------------------------------- /src/Coqprime/examples/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../Coqprime Coqprime 2 | 3 | ../examples/BasePrimes.v 4 | ../examples/PocklingtonRefl.v 5 | ../examples/TestLucas.v 6 | ../examples/prime21665NNNN21787.v 7 | ../examples/prime329719147332060395689499.v 8 | ../examples/russell1.v 9 | ../examples/russell2.v 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Coqprime/examples/prime21665NNNN21787.v: -------------------------------------------------------------------------------- 1 | 2 | (*************************************************************) 3 | (* This file is distributed under the terms of the *) 4 | (* GNU Lesser General Public License Version 2.1 *) 5 | (*************************************************************) 6 | (* Benjamin.Gregoire@inria.fr Laurent.Thery@inria.fr *) 7 | (*************************************************************) 8 | 9 | Require Import PocklingtonRefl. 10 | 11 | Local Open Scope positive_scope. 12 | 13 | Lemma prime216656403549020227250327256032933021325435259861468456540459488823774358486649614451547405419273433458932168893949521787 : prime 216656403549020227250327256032933021325435259861468456540459488823774358486649614451547405419273433458932168893949521787. 14 | Proof. 15 | apply (Pocklington_refl 16 | (Pock_certif 216656403549020227250327256032933021325435259861468456540459488823774358486649614451547405419273433458932168893949521787 2 ((654898412672035770541549498678974366284701838721583240120874775390492750598525740460463, 1)::(2,1)::nil) 1) 17 | ((Pock_certif 654898412672035770541549498678974366284701838721583240120874775390492750598525740460463 5 ((933197156145546840982434002869386948167992766859866863595707, 1)::(2,1)::nil) 1) :: 18 | (Pock_certif 933197156145546840982434002869386948167992766859866863595707 2 ((663149843, 1)::(50782967, 1)::(547, 1)::(3, 1)::(2,1)::nil) 146915123513014632519) :: 19 | (Pock_certif 663149843 2 ((3659, 1)::(2,1)::nil) 2802) :: 20 | (Pock_certif 50782967 5 ((1093, 1)::(2,1)::nil) 1370) :: 21 | (Proof_certif 3659 prime3659) :: 22 | (Proof_certif 1093 prime1093) :: 23 | (Proof_certif 547 prime547) :: 24 | (Proof_certif 3 prime3) :: 25 | (Proof_certif 2 prime2) :: 26 | nil)). 27 | vm_cast_no_check (refl_equal true). 28 | Qed. 29 | -------------------------------------------------------------------------------- /src/Coqprime/examples/prime329719147332060395689499.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | Local Open Scope positive_scope. 4 | 5 | Lemma prime329719147332060395689499: prime 329719147332060395689499. 6 | Proof. 7 | apply (Pocklington_refl 8 | (Ell_certif 9 | 329719147332060395689499 10 | 8209062 11 | ((40165264598163841,1)::nil) 12 | 329719147332060395595419 13 | 9834496 14 | 0 15 | 3136) 16 | ((SPock_certif 17 | 40165264598163841 18 | 2 19 | ((303179835433, 1)::nil)) 20 | :: 21 | (Pock_certif 303179835433 5 ((7951, 1)::(2,3)::nil) 59386) :: 22 | (Proof_certif 7951 prime7951) :: 23 | (Proof_certif 2 prime2) :: 24 | nil)). 25 | vm_cast_no_check (refl_equal true). 26 | Time Qed. 27 | -------------------------------------------------------------------------------- /src/Coqprime/examples/russell1.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | Local Open Scope positive_scope. 4 | 5 | Lemma prime115792089237316195423570985008687907853269984665640564039457584007908834671663 : prime 115792089237316195423570985008687907853269984665640564039457584007908834671663. 6 | Proof. 7 | apply (Pocklington_refl 8 | (Pock_certif 115792089237316195423570985008687907853269984665640564039457584007908834671663 3 ((205115282021455665897114700593932402728804164701536103180137503955397371, 1)::(2,1)::nil) 1) 9 | ((Pock_certif 205115282021455665897114700593932402728804164701536103180137503955397371 2 ((255515944373312847190720520512484175977, 1)::(2,1)::nil) 1) :: 10 | (Pock_certif 255515944373312847190720520512484175977 3 ((4423, 1)::(2657, 1)::(1627, 1)::(7, 2)::(2,3)::nil) 11257515654800) :: 11 | (Proof_certif 4423 prime4423) :: 12 | (Proof_certif 2657 prime2657) :: 13 | (Proof_certif 1627 prime1627) :: 14 | (Proof_certif 7 prime7) :: 15 | (Proof_certif 2 prime2) :: 16 | nil)). 17 | vm_cast_no_check (refl_equal true). 18 | Qed. 19 | -------------------------------------------------------------------------------- /src/Coqprime/examples/russell2.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | Local Open Scope positive_scope. 4 | 5 | Lemma prime115792089237316195423570985008687907852837564279074904382605163141518161494337 : prime 115792089237316195423570985008687907852837564279074904382605163141518161494337. 6 | Proof. 7 | apply (Pocklington_refl 8 | (Pock_certif 115792089237316195423570985008687907852837564279074904382605163141518161494337 5 ((174723607534414371449, 1)::(631, 1)::(149, 1)::(2,6)::nil) 1122621917055392771987235982) 9 | ((Pock_certif 174723607534414371449 3 ((4051, 1)::(59, 1)::(17, 1)::(2,3)::nil) 53130590) :: 10 | (Proof_certif 4051 prime4051) :: 11 | (Proof_certif 631 prime631) :: 12 | (Proof_certif 149 prime149) :: 13 | (Proof_certif 59 prime59) :: 14 | (Proof_certif 17 prime17) :: 15 | (Proof_certif 2 prime2) :: 16 | nil)). 17 | vm_cast_no_check (refl_equal true). 18 | Qed. 19 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime3.vo: prime3.v ../PocklingtonRefl.vo 6 | prime3.vi: prime3.v ../PocklingtonRefl.vo 7 | prime4.vo: prime4.v ../PocklingtonRefl.vo 8 | prime4.vi: prime4.v ../PocklingtonRefl.vo 9 | prime5.vo: prime5.v ../PocklingtonRefl.vo 10 | prime5.vi: prime5.v ../PocklingtonRefl.vo 11 | prime6.vo: prime6.v ../PocklingtonRefl.vo 12 | prime6.vi: prime6.v ../PocklingtonRefl.vo 13 | prime7.vo: prime7.v ../PocklingtonRefl.vo 14 | prime7.vi: prime7.v ../PocklingtonRefl.vo 15 | prime8.vo: prime8.v ../PocklingtonRefl.vo 16 | prime8.vi: prime8.v ../PocklingtonRefl.vo 17 | prime9.vo: prime9.v ../PocklingtonRefl.vo 18 | prime9.vi: prime9.v ../PocklingtonRefl.vo 19 | prime1.html: prime1.v ../PocklingtonRefl.html 20 | prime2.html: prime2.v ../PocklingtonRefl.html 21 | prime3.html: prime3.v ../PocklingtonRefl.html 22 | prime4.html: prime4.v ../PocklingtonRefl.html 23 | prime5.html: prime5.v ../PocklingtonRefl.html 24 | prime6.html: prime6.v ../PocklingtonRefl.html 25 | prime7.html: prime7.v ../PocklingtonRefl.html 26 | prime8.html: prime8.v ../PocklingtonRefl.html 27 | prime9.html: prime9.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime1.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime128075015790613 : prime 128075015790613. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 128075015790613 2 ((109, 1)::(11, 1)::(3, 2)::(2,2)::nil) 78721) 10 | ((Proof_certif 109 prime109) :: 11 | (Proof_certif 11 prime11) :: 12 | (Proof_certif 3 prime3) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234568879: prime 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234568879. 19 | apply (Pocklington_refl 20 | 21 | (Ell_certif 22 | 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234568879 23 | 45778 24 | ((26968585130924391389146438876779994055881066380989693668522024489536889340134667337979154985461,1)::nil) 25 | 664753466826514960509717270307781155721127367875536470545870213790282393842578427358462455592108798 26 | 1066949536887837845474343287185140129923708065140764730961872063439158873937531814092465119792708646 27 | 258533591519361098489633299073314845579165628979065330956106901328389038713216847394515309740313464 28 | 527364786192333184836771194782614780529233253858047739523622800044730617492469808169610629001738520) 29 | ( 30 | (SPock_certif 31 | 26968585130924391389146438876779994055881066380989693668522024489536889340134667337979154985461 32 | 2 33 | ((246468517007168629036249669866386346699699016459419609472875383746453019010552616870582663, 1)::nil)) 34 | :: 35 | (SPock_certif 36 | 246468517007168629036249669866386346699699016459419609472875383746453019010552616870582663 37 | 2 38 | ((68577773235160998618878594843179284001029219938625378261790590914427662495980138250023, 1)::nil)) 39 | :: 40 | (Ell_certif 41 | 68577773235160998618878594843179284001029219938625378261790590914427662495980138250023 42 | 26002760010 43 | ((2637326699503734666006271956635240429657345180282035433909365188692640378079,1)::nil) 44 | 9574683878665620690738396565226734725608912102051371563961979234017062725086969019706 45 | 5989789951585473113280726171429669392308969092255867822149160098356694857390995803612 46 | 0 47 | 26433544158388942526079486972027982668405452614107071167901402917538854826350748466463) 48 | :: 49 | (Ell_certif 50 | 2637326699503734666006271956635240429657345180282035433909365188692640378079 51 | 14196 52 | ((185779564631145017329266832673657398539410161537008895262054635563546679,1)::nil) 53 | 0 54 | 5832 55 | 9 56 | 81) 57 | :: 58 | (Ell_certif 59 | 185779564631145017329266832673657398539410161537008895262054635563546679 60 | 33300992 61 | ((5578799713568443166175555150839272245207194761507009026976783873,1)::nil) 62 | 161576535781768262365025478016135538167000994582266455886427764978291880 63 | 116949320913430480919424492319827975683250152316577652210725576283843024 64 | 0 65 | 156005331631261073481675833374118458329410845179918881972015106727637130) 66 | :: 67 | (Ell_certif 68 | 5578799713568443166175555150839272245207194761507009026976783873 69 | 699497210 70 | ((7975442408938905083231933335144283914081779243572412457,1)::nil) 71 | 1042169188617401582708901827299147890907520705280177257176160553 72 | 0 73 | 4413979268123896499256304652092280090743143644524790856101962951 74 | 459758965895128249249276577925651813675495146789068171738750092) 75 | :: 76 | (Ell_certif 77 | 7975442408938905083231933335144283914081779243572412457 78 | 4062 79 | ((1963427476351281408968964384762463375267543044647701,1)::nil) 80 | 182261539303125828072434035369639915028261569276924030 81 | 1818896714813358048456218055302453781510211651997358610 82 | 0 83 | 2252225263348272691262486840529946391017117301334848852) 84 | :: 85 | (Ell_certif 86 | 1963427476351281408968964384762463375267543044647701 87 | 49844 88 | ((39391450853689138290846729696561934075372333141,1)::nil) 89 | 4624 90 | 0 91 | 272 92 | 4624) 93 | :: 94 | (Ell_certif 95 | 39391450853689138290846729696561934075372333141 96 | 7597610 97 | ((5184716095415418571214755401687864912827,1)::nil) 98 | 5185408785254035713743037011730102710849192973 99 | 16180129902632806607809003377724040331134923777 100 | 0 101 | 16152390643690358018742414050028510369692398625) 102 | :: 103 | (Ell_certif 104 | 5184716095415418571214755401687864912827 105 | 279 106 | ((18583211811524797746770253211537874669,1)::nil) 107 | 5184716095415418571214755401687107328923 108 | 8234810772496 109 | 0 110 | 2869636) 111 | :: 112 | (Ell_certif 113 | 18583211811524797746770253211537874669 114 | 1633802 115 | ((11374212916574222428711834302497,1)::nil) 116 | 254898 117 | 0 118 | 2499 119 | 127449) 120 | :: 121 | (Ell_certif 122 | 11374212916574222428711834302497 123 | 6670864 124 | ((1705058432696908381922029,1)::nil) 125 | 900 126 | 0 127 | 90 128 | 900) 129 | :: 130 | (Ell_certif 131 | 1705058432696908381922029 132 | 29743 133 | ((57326377053406663021,1)::nil) 134 | 0 135 | 19008 136 | 12 137 | 144) 138 | :: 139 | (Ell_certif 140 | 57326377053406663021 141 | 447600 142 | ((128075015790613,1)::nil) 143 | 0 144 | 152000 145 | 20 146 | 400) 147 | :: (Proof_certif 128075015790613 prime128075015790613) :: nil)). 148 | vm_cast_no_check (refl_equal true). 149 | Time Qed. 150 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime2.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime3496731851083 : prime 3496731851083. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 3496731851083 2 ((107, 1)::(19, 1)::(3, 1)::(2,1)::nil) 11354) 10 | ((Proof_certif 107 prime107) :: 11 | (Proof_certif 19 prime19) :: 12 | (Proof_certif 3 prime3) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime2345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345679083: prime 2345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345679083. 19 | apply (Pocklington_refl 20 | 21 | (Ell_certif 22 | 2345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345679083 23 | 661628 24 | ((3545313833807770968162557795335665478034839166253631953226810169610669323274281534339549613601,1)::nil) 25 | 1369389412186002820864171107727063082092121427444942295219566539095940031969074847272864708990665743 26 | 614481684194503446749248404078397348411519159332595447404428650603277601554767525555016575589782328 27 | 0 28 | 570556800706191009182318846023730975522705806222004467618408726124877673391667625867762857808873410) 29 | ( 30 | (Ell_certif 31 | 3545313833807770968162557795335665478034839166253631953226810169610669323274281534339549613601 32 | 33516 33 | ((105779742027920126750285171122319652644553024415812068972193204218349349574116385651474191,1)::nil) 34 | 0 35 | 221184 36 | 48 37 | 576) 38 | :: 39 | (Ell_certif 40 | 105779742027920126750285171122319652644553024415812068972193204218349349574116385651474191 41 | 118679506 42 | ((891305884167735975832972974477325955877782510407753918171114798868282921853494959,1)::nil) 43 | 103227062823669905639094925813080806685976235479131309684277153411291114948368452206968075 44 | 102443154496879002121694364425215745499133140164053319700207553228950425894418202536816913 45 | 0 46 | 98829346775369670287543903042792272350298112789739520335443292688535116989443420396187230) 47 | :: 48 | (SPock_certif 49 | 891305884167735975832972974477325955877782510407753918171114798868282921853494959 50 | 2 51 | ((7819126788712468305892863238240221125190680979397930855923008227528259, 1)::nil)) 52 | :: 53 | (SPock_certif 54 | 7819126788712468305892863238240221125190680979397930855923008227528259 55 | 2 56 | ((3909563394356234152946431619120110562595340489698965427961504113764129, 1)::nil)) 57 | :: 58 | (Ell_certif 59 | 3909563394356234152946431619120110562595340489698965427961504113764129 60 | 6027643088 61 | ((648605655192076985323061918346966085127845685200665315395593,1)::nil) 62 | 100 63 | 0 64 | 20 65 | 100) 66 | :: 67 | (Ell_certif 68 | 648605655192076985323061918346966085127845685200665315395593 69 | 19509351568 70 | ((33245884822535327091249531084803529535491053302969,1)::nil) 71 | 0 72 | 1080 73 | 6 74 | 36) 75 | :: 76 | (Ell_certif 77 | 33245884822535327091249531084803529535491053302969 78 | 248949 79 | ((133544962311699693878061530228299430325183229,1)::nil) 80 | 0 81 | 221184 82 | 48 83 | 576) 84 | :: 85 | (Ell_certif 86 | 133544962311699693878061530228299430325183229 87 | 190677 88 | ((700372684234069624957795706569199070529,1)::nil) 89 | 0 90 | 192 91 | 4 92 | 16) 93 | :: 94 | (Ell_certif 95 | 700372684234069624957795706569199070529 96 | 11037 97 | ((63456798426571498137075401715693481,1)::nil) 98 | 0 99 | 500 100 | 5 101 | 25) 102 | :: 103 | (Ell_certif 104 | 63456798426571498137075401715693481 105 | 8642054001 106 | ((7342791241437360423926971,1)::nil) 107 | 0 108 | 500 109 | 5 110 | 25) 111 | :: 112 | (SPock_certif 113 | 7342791241437360423926971 114 | 2 115 | ((2239195184644277257, 1)::nil)) 116 | :: 117 | (Ell_certif 118 | 2239195184644277257 119 | 640368 120 | ((3496731851083,1)::nil) 121 | 0 122 | 78608 123 | 17 124 | 289) 125 | :: (Proof_certif 3496731851083 prime3496731851083) :: nil)). 126 | vm_cast_no_check (refl_equal true). 127 | Time Qed. 128 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime3.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime612727419833 : prime 612727419833. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 612727419833 3 ((491, 1)::(11, 1)::(2,3)::nil) 8654) 10 | ((Proof_certif 491 prime491) :: 11 | (Proof_certif 11 prime11) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime3456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789041: prime 3456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789041. 18 | apply (Pocklington_refl 19 | 20 | (SPock_certif 21 | 3456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789041 22 | 2 23 | ((231068784247705808906054003350498448463392090835644021917789001122260183534685911401596933386149, 1)::nil)) 24 | ( 25 | (Ell_certif 26 | 231068784247705808906054003350498448463392090835644021917789001122260183534685911401596933386149 27 | 538 28 | ((429495881501311912464784392844792655136416525716417066486529413078647048781558015461346651739,1)::nil) 29 | 27703092998046380102635141614041981775575989823913652339793904096512820210365412401450571773903 30 | 45291317025356070551712898925739747197020283286149870656391777657046386131471849153744168166337 31 | 0 32 | 90216040561266267527350530712961712602235085303591617314568297050456514234771572583924221651056) 33 | :: 34 | (Ell_certif 35 | 429495881501311912464784392844792655136416525716417066486529413078647048781558015461346651739 36 | 971122 37 | ((442267687789291059686408497433682539512457266696748514291662598506448937949513665293881,1)::nil) 38 | 42885763611109322734090016092739131464478481601505828108704855281412916790285176735662777761 39 | 106937273390672141124734032201189050591863019058825939742980959625835809111812108256302483827 40 | 0 41 | 305326664276331208010344034199265332391653856989101774846198954917175109442099267826772832217) 42 | :: 43 | (Ell_certif 44 | 442267687789291059686408497433682539512457266696748514291662598506448937949513665293881 45 | 468 46 | ((945016426900194571979505336396757563060806070484792939866480683879480676590186828953,1)::nil) 47 | 286295102227592824863584198203084357233268770915387610534190572090721045270963390463025 48 | 9640154121510942035174478587498144385545615400437581123600118220268155228227485144738 49 | 143422586930223302548342723918716817235571315418030579255202575661703790387307267192458 50 | 299776915331549502398286782415289774296482631864386254968519373556549039218489681301209) 51 | :: 52 | (Ell_certif 53 | 945016426900194571979505336396757563060806070484792939866480683879480676590186828953 54 | 2416 55 | ((391149183319616958600788632614551971465564858236815945361745535691106241094122263,1)::nil) 56 | 699519108252021823780147065603059031317632422531760576836360673512832118616197488207 57 | 899006380990363516030801126434416775767353309917067969422081815819351300715488877666 58 | 350450716025824549856026268101635270150729953895801472197626334215426373337206161439 59 | 12292888354593493077880967783463667234812916743547627485702900869491407902415376001) 60 | :: 61 | (SPock_certif 62 | 391149183319616958600788632614551971465564858236815945361745535691106241094122263 63 | 2 64 | ((376829656377280306937175946642150261527519131249340987824417664442298883520349, 1)::nil)) 65 | :: 66 | (Ell_certif 67 | 376829656377280306937175946642150261527519131249340987824417664442298883520349 68 | 3519628034 69 | ((107065193462793150072169230438102102447543282514321361052908766326221,1)::nil) 70 | 2178 71 | 0 72 | 99 73 | 1089) 74 | :: 75 | (Ell_certif 76 | 107065193462793150072169230438102102447543282514321361052908766326221 77 | 266905812400 78 | ((401134739255281763478633148110873011248993806368608794451,1)::nil) 79 | 0 80 | 5832 81 | 9 82 | 81) 83 | :: 84 | (SPock_certif 85 | 401134739255281763478633148110873011248993806368608794451 86 | 2 87 | ((2674231595035211756524220987405820074993292042457391963, 1)::nil)) 88 | :: 89 | (Ell_certif 90 | 2674231595035211756524220987405820074993292042457391963 91 | 11478 92 | ((232987593224883407956457657234247386929140401267093,1)::nil) 93 | 2014449673400301209814187787791087333948773329098850508 94 | 907153499333720329129673222443621415887586846010332627 95 | 1930986266765197201373003375394781686436589330138106132 96 | 126177363413918616656360213554523579624863158572203108) 97 | :: 98 | (Ell_certif 99 | 232987593224883407956457657234247386929140401267093 100 | 3305009570957066 101 | ((70495285481855584176562627716184379,1)::nil) 102 | 173664129972327489696592152760910383575122096542281 103 | 30112501639483819573311503297311132787718197474904 104 | 0 105 | 195548504574578868153040795582601884730047020068747) 106 | :: 107 | (Ell_certif 108 | 70495285481855584176562627716184379 109 | 5524001 110 | ((12761635177447575531543334009,1)::nil) 111 | 70495285481855584176562627688600027 112 | 55816936272 113 | 852 114 | 181476) 115 | :: 116 | (Ell_certif 117 | 12761635177447575531543334009 118 | 9992368 119 | ((1277138229641600515759,1)::nil) 120 | 0 121 | 19008 122 | 12 123 | 144) 124 | :: 125 | (SPock_certif 126 | 1277138229641600515759 127 | 2 128 | ((612727419833, 1)::nil)) 129 | :: (Proof_certif 612727419833 prime612727419833) :: nil)). 130 | vm_cast_no_check (refl_equal true). 131 | Time Qed. 132 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime4.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime42840479569 : prime 42840479569. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 42840479569 7 ((521, 1)::(2,4)::nil) 4236) 10 | ((Proof_certif 521 prime521) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890239: prime 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890239. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890239 21 | 7618 22 | ((599618026182303624618755434659302689698537252430077490522024068238073122348000087593175360630901,1)::nil) 23 | 871400685165731416231513877124017495316108653755817704570562543188943238287851964623125666818661857 24 | 2008935613392676773366952987331049430637654273381654367424070507546524834378681020949888156881572357 25 | 0 26 | 20130470422235619769597782490716796967970720545153164582682757586975435850340647377010312905749240) 27 | ( 28 | (Ell_certif 29 | 599618026182303624618755434659302689698537252430077490522024068238073122348000087593175360630901 30 | 2164 31 | ((277087812468717016921790866293577952725756586151202234109523286737782463415947853033504993861,1)::nil) 32 | 900 33 | 0 34 | 90 35 | 900) 36 | :: 37 | (Ell_certif 38 | 277087812468717016921790866293577952725756586151202234109523286737782463415947853033504993861 39 | 9073596 40 | ((30537816811407188166829431935649102376362864974828023817652653039822986376045395337161,1)::nil) 41 | 0 42 | 10985 43 | 26 44 | 169) 45 | :: 46 | (Ell_certif 47 | 30537816811407188166829431935649102376362864974828023817652653039822986376045395337161 48 | 79694115249 49 | ((383187851649941944972899035736794899822915964934902812170581284902428178277,1)::nil) 50 | 0 51 | 500 52 | 5 53 | 25) 54 | :: 55 | (Ell_certif 56 | 383187851649941944972899035736794899822915964934902812170581284902428178277 57 | 73200 58 | ((5234806716529261543345615242305941253878393251829286963430133802493067,1)::nil) 59 | 134873771665060964171667255761499886057521204732937938682953663357304664619 60 | 107606320033212628836516569664611958895320118476181591944113333506144459036 61 | 0 62 | 20149493193722666245133160920949153674738372800898865078439692673726936380) 63 | :: 64 | (Ell_certif 65 | 5234806716529261543345615242305941253878393251829286963430133802493067 66 | 188164551250564 67 | ((27820366172789258873882399782254796647501876113590203667,1)::nil) 68 | 0 69 | 192 70 | 4 71 | 16) 72 | :: 73 | (Ell_certif 74 | 27820366172789258873882399782254796647501876113590203667 75 | 2041597 76 | ((13626766777571312494034033059776386859404818685401,1)::nil) 77 | 0 78 | 1080 79 | 6 80 | 36) 81 | :: 82 | (Ell_certif 83 | 13626766777571312494034033059776386859404818685401 84 | 307208268 85 | ((44356770949834307499933655928993749761353,1)::nil) 86 | 13626766777571312494034033059776386859404818663531 87 | 1102248 88 | 27 89 | 729) 90 | :: 91 | (Ell_certif 92 | 44356770949834307499933655928993749761353 93 | 127081027716746 94 | ((349043218699035039042583253,1)::nil) 95 | 1215036004390870672549860025967940731859 96 | 0 97 | 29976192634686495224139057294651813418188 98 | 15595614319538682948344458660309877075024) 99 | :: 100 | (Ell_certif 101 | 349043218699035039042583253 102 | 584 103 | ((597676744347601583736317,1)::nil) 104 | 349043218699035039042583217 105 | 0 106 | 12 107 | 36) 108 | :: 109 | (Ell_certif 110 | 597676744347601583736317 111 | 3393250 112 | ((176136961423159237,1)::nil) 113 | 36450 114 | 0 115 | 675 116 | 18225) 117 | :: 118 | (Ell_certif 119 | 176136961423159237 120 | 4111461 121 | ((42840479569,1)::nil) 122 | 0 123 | 78608 124 | 17 125 | 289) 126 | :: (Proof_certif 42840479569 prime42840479569) :: nil)). 127 | vm_cast_no_check (refl_equal true). 128 | Time Qed. 129 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime5.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime172779892108321 : prime 172779892108321. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 172779892108321 17 ((29, 1)::(7, 1)::(5, 1)::(3, 1)::(2,5)::nil) 174412) 10 | ((Proof_certif 29 prime29) :: 11 | (Proof_certif 7 prime7) :: 12 | (Proof_certif 5 prime5) :: 13 | (Proof_certif 3 prime3) :: 14 | (Proof_certif 2 prime2) :: 15 | nil)). 16 | vm_cast_no_check (refl_equal true). 17 | Qed. 18 | 19 | Lemma prime5678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901283: prime 5678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901283. 20 | apply (Pocklington_refl 21 | 22 | (Ell_certif 23 | 5678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901283 24 | 8613 25 | ((659340675092057369494576687837649936286377323827160029599474171252548335017794784969008387843487,1)::nil) 26 | 1068370684844652260561789543542317206494058914638487074483065066870522241572631928238294289071616672 27 | 2822867551543524372833926155064065135726625003423672416040767219112868011384344197573385301080637618 28 | 0 29 | 1485199565862283195881180229577224102904204817342168821758275109328053353215060809132405108152024908) 30 | ( 31 | (Ell_certif 32 | 659340675092057369494576687837649936286377323827160029599474171252548335017794784969008387843487 33 | 784 34 | ((840995759045991542722674346731696347304052708961154473076562011004759456840821740229534724691,1)::nil) 35 | 659340675092057369494576687837649936286377323827160029599474171252548335017794784969008387829487 36 | 784000 37 | 60 38 | 400) 39 | :: 40 | (Ell_certif 41 | 840995759045991542722674346731696347304052708961154473076562011004759456840821740229534724691 42 | 1238998 43 | ((678770876987688069490567657681203962640821622719712124274147234798329001767408254730013,1)::nil) 44 | 348502809392728702382143600736008759783891417410604315630621259828045668880210579001104142401 45 | 251006917402217510235095378496438958480085365875972945273933630548402752573471274670116690452 46 | 0 47 | 715846432454144902090661893282057846625308601853694686281147014129806416784517730436789754527) 48 | :: 49 | (Ell_certif 50 | 678770876987688069490567657681203962640821622719712124274147234798329001767408254730013 51 | 1227312638091 52 | ((553054581140359855568272010920571331757971842220703771483940258670602561773,1)::nil) 53 | 678770876987688069490567657681203962640821622719712124274147234798329001767407714121109 54 | 4964006108754 55 | 1431 56 | 2047761) 57 | :: 58 | (SPock_certif 59 | 553054581140359855568272010920571331757971842220703771483940258670602561773 60 | 2 61 | ((1245618425991801476505117141712998494950387032028612097936802384393249013, 1)::nil)) 62 | :: 63 | (Ell_certif 64 | 1245618425991801476505117141712998494950387032028612097936802384393249013 65 | 2216 66 | ((562102177794134240300143114491425312602019857606760176090665010402453,1)::nil) 67 | 1245618425991801476505117141712998494950387032028612097936802384393234613 68 | 0 69 | 600 70 | 14400) 71 | :: 72 | (SPock_certif 73 | 562102177794134240300143114491425312602019857606760176090665010402453 74 | 2 75 | ((13574054106151981879085738582925082441400445206162064838440283, 1)::nil)) 76 | :: 77 | (Ell_certif 78 | 13574054106151981879085738582925082441400445206162064838440283 79 | 65053 80 | ((208661462286934989609791071632731304020957206302253936841,1)::nil) 81 | 13574054106151981879085738582925082441400445206162064788882051 82 | 134414314742 83 | 571 84 | 326041) 85 | :: 86 | (Ell_certif 87 | 208661462286934989609791071632731304020957206302253936841 88 | 2864 89 | ((72856655826443781288334871374370203901835514626114347,1)::nil) 90 | 208661462286934989609791071631883471778573702718360406921 91 | 9501955807025115933281263315351902213136 92 | 0 93 | 97477976010097357444) 94 | :: 95 | (Ell_certif 96 | 72856655826443781288334871374370203901835514626114347 97 | 193909 98 | ((375726014916500942650082621555351061909959757389,1)::nil) 99 | 42468594832879496729329998977535240386338594816577001 100 | 7601203492123761869110523573895967176903156129914483 101 | 63698057858557777145788663331134240544889144218776424 102 | 68232934711282586914658866416333435773712638774607916) 103 | :: 104 | (SPock_certif 105 | 375726014916500942650082621555351061909959757389 106 | 2 107 | ((500887618743807484206232002262750205251, 1)::nil)) 108 | :: 109 | (Ell_certif 110 | 500887618743807484206232002262750205251 111 | 87943750 112 | ((5695545376946144372855130269723,1)::nil) 113 | 62004971613157849451395456945007846064 114 | 396441284199113617890290527436816450668 115 | 0 116 | 242419420997785707670081855384920877972) 117 | :: 118 | (SPock_certif 119 | 5695545376946144372855130269723 120 | 2 121 | ((42732959595582599647, 1)::nil)) 122 | :: 123 | (SPock_certif 124 | 42732959595582599647 125 | 2 126 | ((172779892108321, 1)::nil)) 127 | :: (Proof_certif 172779892108321 prime172779892108321) :: nil)). 128 | vm_cast_no_check (refl_equal true). 129 | Time Qed. 130 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime8.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime4819935037 : prime 4819935037. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 4819935037 2 ((57380179, 1)::(2,2)::nil) 1) 10 | ((Pock_certif 57380179 2 ((9563363, 1)::(2,1)::nil) 1) :: 11 | (Pock_certif 9563363 2 ((241, 1)::(2,1)::nil) 560) :: 12 | (Proof_certif 241 prime241) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime8901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901235157: prime 8901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901235157. 19 | apply (Pocklington_refl 20 | 21 | (Ell_certif 22 | 8901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901235157 23 | 1156922 24 | ((7693893424007948208080590001468466529781515195887854519148778478161861100744009274334848368093,1)::nil) 25 | 2178 26 | 0 27 | 99 28 | 1089) 29 | ( 30 | (Ell_certif 31 | 7693893424007948208080590001468466529781515195887854519148778478161861100744009274334848368093 32 | 174332609734004 33 | ((44133415060712164411292774692094034654673959380256317749993959868864621180235993,1)::nil) 34 | 6716617511956399606093670966280919847801782173513907580606549278856961954869757947286792229898 35 | 417422542823734559743201794605126495092036298685024850169386231229230783225870256079931728488 36 | 0 37 | 1375044944850795009802581112964584671990051818335005208014191429090934977392459228110871146792) 38 | :: 39 | (SPock_certif 40 | 44133415060712164411292774692094034654673959380256317749993959868864621180235993 41 | 2 42 | ((324510404858177679494799813912456137166720289560708218749955587271063391031147, 1)::nil)) 43 | :: 44 | (Ell_certif 45 | 324510404858177679494799813912456137166720289560708218749955587271063391031147 46 | 8138719 47 | ((39872417865536048055572358980873542527651362892785238594902199452149867,1)::nil) 48 | 0 49 | 711828 50 | 117 51 | 1521) 52 | :: 53 | (Ell_certif 54 | 39872417865536048055572358980873542527651362892785238594902199452149867 55 | 15961253415843 56 | ((2498075610149703917611545457586296308821537391558714609661,1)::nil) 57 | 0 58 | 119164 59 | 93 60 | 961) 61 | :: 62 | (Ell_certif 63 | 2498075610149703917611545457586296308821537391558714609661 64 | 606 65 | ((4122236980445055969656015606671113389530388835354169943,1)::nil) 66 | 1941535761979114296033961579264838036574568272261525721170 67 | 758577932551736704163510333117507469761998748606800467748 68 | 585616937911092920306132184545790765370916652261595391410 69 | 44885468115159188225229075154418382392705680871468124775) 70 | :: 71 | (Ell_certif 72 | 4122236980445055969656015606671113389530388835354169943 73 | 17040853965493 74 | ((241903192691657908686211093523780482135679,1)::nil) 75 | 4122236980445055969656015606671113389418495002906369463 76 | 14406462054002124060149776 77 | 0 78 | 3795584547076) 79 | :: 80 | (SPock_certif 81 | 241903192691657908686211093523780482135679 82 | 2 83 | ((13661701613075547282997699307, 1)::nil)) 84 | :: 85 | (SPock_certif 86 | 13661701613075547282997699307 87 | 2 88 | ((764676011030759391189841, 1)::nil)) 89 | :: 90 | (SPock_certif 91 | 764676011030759391189841 92 | 2 93 | ((3186150045961497463291, 1)::nil)) 94 | :: 95 | (SPock_certif 96 | 3186150045961497463291 97 | 2 98 | ((15100952869621771, 1)::nil)) 99 | :: 100 | (SPock_certif 101 | 15100952869621771 102 | 2 103 | ((503365095654059, 1)::nil)) 104 | :: 105 | (SPock_certif 106 | 503365095654059 107 | 2 108 | ((4819935037, 1)::nil)) 109 | :: (Proof_certif 4819935037 prime4819935037) :: nil)). 110 | vm_cast_no_check (refl_equal true). 111 | Time Qed. 112 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/prime9.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime8725915592549 : prime 8725915592549. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 8725915592549 3 ((1493, 1)::(7, 1)::(2,2)::nil) 48418) 10 | ((Proof_certif 1493 prime1493) :: 11 | (Proof_certif 7 prime7) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012346103: prime 9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012346103. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012346103 22 | 13986778 23 | ((644347517269612384488416378438909400412225119649982232019901316388005468995251584871148108053,1)::nil) 24 | 6876185946935048040751473751022855964435207604826800480584663082562294790804494778730289090926002123 25 | 1287604209866173807929447190325501394628999764593900337993219613475043207272374348910703520783514130 26 | 6516846521636749360666474081337202009939996170296211414189696691120500897237814287101042700085704070 27 | 2998572055249888636204342756351637531949479794472452565652191467026302998735989403985748205493541627) 28 | ( 29 | (Ell_certif 30 | 644347517269612384488416378438909400412225119649982232019901316388005468995251584871148108053 31 | 1497 32 | ((430425863239554031054386358342624849974766278957837438467999123730922152371746873570509403,1)::nil) 33 | 0 34 | 16099776 35 | 660 36 | 17424) 37 | :: 38 | (Ell_certif 39 | 430425863239554031054386358342624849974766278957837438467999123730922152371746873570509403 40 | 1293660 41 | ((332719465114136659597101524622099199151837638944376508147884923943200404443549457431,1)::nil) 42 | 289975626511744866140091265861677492458656809520477876988840499632959965536640266414272794 43 | 297185428712726663958979141683738649218638291445691368309364200908337676579577162068480917 44 | 89556275673284803859411324942479193383687199311131908539246861667374500136391048012989360 45 | 395257953085467719995030050059258928938403275170021505221014856868895404968479220279853944) 46 | :: 47 | (Ell_certif 48 | 332719465114136659597101524622099199151837638944376508147884923943200404443549457431 49 | 397 50 | ((838084294997825339035520213153902264866089168032090424648531533231662847138518037,1)::nil) 51 | 0 52 | 3584 53 | 8 54 | 64) 55 | :: 56 | (SPock_certif 57 | 838084294997825339035520213153902264866089168032090424648531533231662847138518037 58 | 2 59 | ((6026435233107726716681912540296130417249756723560347633161701708744375752427, 1)::nil)) 60 | :: 61 | (Ell_certif 62 | 6026435233107726716681912540296130417249756723560347633161701708744375752427 63 | 799153074 64 | ((7541027406606367776646896236923103442102559577407705771339962284857,1)::nil) 65 | 6026435233107726716681912540296130417249756723560347633161701708744375658347 66 | 9834496 67 | 0 68 | 3136) 69 | :: 70 | (Ell_certif 71 | 7541027406606367776646896236923103442102559577407705771339962284857 72 | 99586 73 | ((75723770475833628990489589268803847236986538662715608142908101,1)::nil) 74 | 180 75 | 0 76 | 6 77 | 36) 78 | :: 79 | (Ell_certif 80 | 75723770475833628990489589268803847236986538662715608142908101 81 | 2626 82 | ((28836165451574116142608373674330220327400147348020509034137,1)::nil) 83 | 254898 84 | 0 85 | 2499 86 | 127449) 87 | :: 88 | (SPock_certif 89 | 28836165451574116142608373674330220327400147348020509034137 90 | 2 91 | ((2497935330177937988791439160978016313877351641373917969, 1)::nil)) 92 | :: 93 | (Ell_certif 94 | 2497935330177937988791439160978016313877351641373917969 95 | 15130 96 | ((165098171194840580885091814858811065991152869408649,1)::nil) 97 | 2475075068971992147402876221557265554480685179579767469 98 | 0 99 | 2219116945646725665515247979790417236813386655566029846 100 | 267388253928239402581909711477223697365631754910812929) 101 | :: 102 | (Ell_certif 103 | 165098171194840580885091814858811065991152869408649 104 | 74515521 105 | ((2215621242114653950887518255254509324788641,1)::nil) 106 | 0 107 | 192 108 | 4 109 | 16) 110 | :: 111 | (Ell_certif 112 | 2215621242114653950887518255254509324788641 113 | 2575 114 | ((860435433830933573161222805912158029721,1)::nil) 115 | 0 116 | 233678802879279908882667940983886400695947 117 | 553905310528663487721879563813627331197494 118 | 2077144914482488078957048364301102492100740) 119 | :: 120 | (Ell_certif 121 | 860435433830933573161222805912158029721 122 | 126423675 123 | ((6805967583452494741774641449143,1)::nil) 124 | 0 125 | 221184 126 | 48 127 | 576) 128 | :: 129 | (SPock_certif 130 | 6805967583452494741774641449143 131 | 2 132 | ((87255994659647368484290274989, 1)::nil)) 133 | :: 134 | (SPock_certif 135 | 87255994659647368484290274989 136 | 2 137 | ((3511025054709776616943919, 1)::nil)) 138 | :: 139 | (SPock_certif 140 | 3511025054709776616943919 141 | 2 142 | ((1709359812419560183517, 1)::nil)) 143 | :: 144 | (Ell_certif 145 | 1709359812419560183517 146 | 581 147 | ((2942099505078979841,1)::nil) 148 | 1709359812419559033029 149 | 475439166 150 | 435 151 | 7569) 152 | :: 153 | (Ell_certif 154 | 2942099505078979841 155 | 337168 156 | ((8725915592549,1)::nil) 157 | 100 158 | 0 159 | 20 160 | 100) 161 | :: (Proof_certif 8725915592549 prime8725915592549) :: nil)). 162 | vm_cast_no_check (refl_equal true). 163 | Time Qed. 164 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t100/res: -------------------------------------------------------------------------------- 1 | COQDEP VFILES 2 | COQC prime1.v 3 | Finished transaction in 3.043 secs (3.027u,0.s) (successful) 4 | COQNATIVE prime1.vo 5 | COQC prime2.v 6 | Finished transaction in 2.792 secs (2.773u,0.002s) (successful) 7 | COQNATIVE prime2.vo 8 | COQC prime3.v 9 | Finished transaction in 3.938 secs (3.913u,0.s) (successful) 10 | COQNATIVE prime3.vo 11 | COQC prime4.v 12 | Finished transaction in 2.921 secs (2.899u,0.001s) (successful) 13 | COQNATIVE prime4.vo 14 | COQC prime5.v 15 | Finished transaction in 4.797 secs (4.755u,0.001s) (successful) 16 | COQNATIVE prime5.vo 17 | COQC prime6.v 18 | Finished transaction in 4.292 secs (4.259u,0.s) (successful) 19 | COQNATIVE prime6.vo 20 | COQC prime7.v 21 | Finished transaction in 3.235 secs (3.206u,0.001s) (successful) 22 | COQNATIVE prime7.vo 23 | COQC prime8.v 24 | Finished transaction in 1.606 secs (1.58u,0.002s) (successful) 25 | COQNATIVE prime8.vo 26 | COQC prime9.v 27 | Finished transaction in 2.498 secs (2.476u,0.s) (successful) 28 | COQNATIVE prime9.vo 29 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t125/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime4.vo: prime4.v ../PocklingtonRefl.vo 6 | prime4.vi: prime4.v ../PocklingtonRefl.vo 7 | prime5.vo: prime5.v ../PocklingtonRefl.vo 8 | prime5.vi: prime5.v ../PocklingtonRefl.vo 9 | prime6.vo: prime6.v ../PocklingtonRefl.vo 10 | prime6.vi: prime6.v ../PocklingtonRefl.vo 11 | prime7.vo: prime7.v ../PocklingtonRefl.vo 12 | prime7.vi: prime7.v ../PocklingtonRefl.vo 13 | prime8.vo: prime8.v ../PocklingtonRefl.vo 14 | prime8.vi: prime8.v ../PocklingtonRefl.vo 15 | prime9.vo: prime9.v ../PocklingtonRefl.vo 16 | prime9.vi: prime9.v ../PocklingtonRefl.vo 17 | prime1.html: prime1.v ../PocklingtonRefl.html 18 | prime2.html: prime2.v ../PocklingtonRefl.html 19 | prime4.html: prime4.v ../PocklingtonRefl.html 20 | prime5.html: prime5.v ../PocklingtonRefl.html 21 | prime6.html: prime6.v ../PocklingtonRefl.html 22 | prime7.html: prime7.v ../PocklingtonRefl.html 23 | prime8.html: prime8.v ../PocklingtonRefl.html 24 | prime9.html: prime9.v ../PocklingtonRefl.html 25 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t125/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t125/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t125/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t150/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime3.vo: prime3.v ../PocklingtonRefl.vo 6 | prime3.vi: prime3.v ../PocklingtonRefl.vo 7 | prime4.vo: prime4.v ../PocklingtonRefl.vo 8 | prime4.vi: prime4.v ../PocklingtonRefl.vo 9 | prime5.vo: prime5.v ../PocklingtonRefl.vo 10 | prime5.vi: prime5.v ../PocklingtonRefl.vo 11 | prime6.vo: prime6.v ../PocklingtonRefl.vo 12 | prime6.vi: prime6.v ../PocklingtonRefl.vo 13 | prime7.vo: prime7.v ../PocklingtonRefl.vo 14 | prime7.vi: prime7.v ../PocklingtonRefl.vo 15 | prime8.vo: prime8.v ../PocklingtonRefl.vo 16 | prime8.vi: prime8.v ../PocklingtonRefl.vo 17 | prime9.vo: prime9.v ../PocklingtonRefl.vo 18 | prime9.vi: prime9.v ../PocklingtonRefl.vo 19 | prime1.html: prime1.v ../PocklingtonRefl.html 20 | prime2.html: prime2.v ../PocklingtonRefl.html 21 | prime3.html: prime3.v ../PocklingtonRefl.html 22 | prime4.html: prime4.v ../PocklingtonRefl.html 23 | prime5.html: prime5.v ../PocklingtonRefl.html 24 | prime6.html: prime6.v ../PocklingtonRefl.html 25 | prime7.html: prime7.v ../PocklingtonRefl.html 26 | prime8.html: prime8.v ../PocklingtonRefl.html 27 | prime9.html: prime9.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t150/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t150/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t150/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t175/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime3.vo: prime3.v ../PocklingtonRefl.vo 6 | prime3.vi: prime3.v ../PocklingtonRefl.vo 7 | prime4.vo: prime4.v ../PocklingtonRefl.vo 8 | prime4.vi: prime4.v ../PocklingtonRefl.vo 9 | prime5.vo: prime5.v ../PocklingtonRefl.vo 10 | prime5.vi: prime5.v ../PocklingtonRefl.vo 11 | prime6.vo: prime6.v ../PocklingtonRefl.vo 12 | prime6.vi: prime6.v ../PocklingtonRefl.vo 13 | prime7.vo: prime7.v ../PocklingtonRefl.vo 14 | prime7.vi: prime7.v ../PocklingtonRefl.vo 15 | prime8.vo: prime8.v ../PocklingtonRefl.vo 16 | prime8.vi: prime8.v ../PocklingtonRefl.vo 17 | prime9.vo: prime9.v ../PocklingtonRefl.vo 18 | prime9.vi: prime9.v ../PocklingtonRefl.vo 19 | prime1.html: prime1.v ../PocklingtonRefl.html 20 | prime2.html: prime2.v ../PocklingtonRefl.html 21 | prime3.html: prime3.v ../PocklingtonRefl.html 22 | prime4.html: prime4.v ../PocklingtonRefl.html 23 | prime5.html: prime5.v ../PocklingtonRefl.html 24 | prime6.html: prime6.v ../PocklingtonRefl.html 25 | prime7.html: prime7.v ../PocklingtonRefl.html 26 | prime8.html: prime8.v ../PocklingtonRefl.html 27 | prime9.html: prime9.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t175/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t175/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t175/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t200/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime3.vo: prime3.v ../PocklingtonRefl.vo 6 | prime3.vi: prime3.v ../PocklingtonRefl.vo 7 | prime4.vo: prime4.v ../PocklingtonRefl.vo 8 | prime4.vi: prime4.v ../PocklingtonRefl.vo 9 | prime5.vo: prime5.v ../PocklingtonRefl.vo 10 | prime5.vi: prime5.v ../PocklingtonRefl.vo 11 | prime6.vo: prime6.v ../PocklingtonRefl.vo 12 | prime6.vi: prime6.v ../PocklingtonRefl.vo 13 | prime7.vo: prime7.v ../PocklingtonRefl.vo 14 | prime7.vi: prime7.v ../PocklingtonRefl.vo 15 | prime8.vo: prime8.v ../PocklingtonRefl.vo 16 | prime8.vi: prime8.v ../PocklingtonRefl.vo 17 | prime9.vo: prime9.v ../PocklingtonRefl.vo 18 | prime9.vi: prime9.v ../PocklingtonRefl.vo 19 | prime1.html: prime1.v ../PocklingtonRefl.html 20 | prime2.html: prime2.v ../PocklingtonRefl.html 21 | prime3.html: prime3.v ../PocklingtonRefl.html 22 | prime4.html: prime4.v ../PocklingtonRefl.html 23 | prime5.html: prime5.v ../PocklingtonRefl.html 24 | prime6.html: prime6.v ../PocklingtonRefl.html 25 | prime7.html: prime7.v ../PocklingtonRefl.html 26 | prime8.html: prime8.v ../PocklingtonRefl.html 27 | prime9.html: prime9.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t200/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t200/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t200/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t225/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime3.vo: prime3.v ../PocklingtonRefl.vo 6 | prime3.vi: prime3.v ../PocklingtonRefl.vo 7 | prime4.vo: prime4.v ../PocklingtonRefl.vo 8 | prime4.vi: prime4.v ../PocklingtonRefl.vo 9 | prime5.vo: prime5.v ../PocklingtonRefl.vo 10 | prime5.vi: prime5.v ../PocklingtonRefl.vo 11 | prime6.vo: prime6.v ../PocklingtonRefl.vo 12 | prime6.vi: prime6.v ../PocklingtonRefl.vo 13 | prime7.vo: prime7.v ../PocklingtonRefl.vo 14 | prime7.vi: prime7.v ../PocklingtonRefl.vo 15 | prime8.vo: prime8.v ../PocklingtonRefl.vo 16 | prime8.vi: prime8.v ../PocklingtonRefl.vo 17 | prime9.vo: prime9.v ../PocklingtonRefl.vo 18 | prime9.vi: prime9.v ../PocklingtonRefl.vo 19 | prime1.html: prime1.v ../PocklingtonRefl.html 20 | prime2.html: prime2.v ../PocklingtonRefl.html 21 | prime3.html: prime3.v ../PocklingtonRefl.html 22 | prime4.html: prime4.v ../PocklingtonRefl.html 23 | prime5.html: prime5.v ../PocklingtonRefl.html 24 | prime6.html: prime6.v ../PocklingtonRefl.html 25 | prime7.html: prime7.v ../PocklingtonRefl.html 26 | prime8.html: prime8.v ../PocklingtonRefl.html 27 | prime9.html: prime9.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t225/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t225/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t225/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/.depend: -------------------------------------------------------------------------------- 1 | prime1234567890123456789012353.vo: prime1234567890123456789012353.v 2 | prime1234567890123456789012353.vi: prime1234567890123456789012353.v 3 | prime2345678901234567890123567.vo: prime2345678901234567890123567.v 4 | prime2345678901234567890123567.vi: prime2345678901234567890123567.v 5 | prime3456789012345678901234573.vo: prime3456789012345678901234573.v 6 | prime3456789012345678901234573.vi: prime3456789012345678901234573.v 7 | prime4567890123456789012345689.vo: prime4567890123456789012345689.v 8 | prime4567890123456789012345689.vi: prime4567890123456789012345689.v 9 | prime5678901234567890123456797.vo: prime5678901234567890123456797.v 10 | prime5678901234567890123456797.vi: prime5678901234567890123456797.v 11 | prime6789012345678901234567903.vo: prime6789012345678901234567903.v 12 | prime6789012345678901234567903.vi: prime6789012345678901234567903.v 13 | prime7890123456789012345678973.vo: prime7890123456789012345678973.v 14 | prime7890123456789012345678973.vi: prime7890123456789012345678973.v 15 | prime8901234567890123456789017.vo: prime8901234567890123456789017.v 16 | prime8901234567890123456789017.vi: prime8901234567890123456789017.v 17 | prime9012345678901234567890149.vo: prime9012345678901234567890149.v 18 | prime9012345678901234567890149.vi: prime9012345678901234567890149.v 19 | prime1234567890123456789012353.html: prime1234567890123456789012353.v 20 | prime2345678901234567890123567.html: prime2345678901234567890123567.v 21 | prime3456789012345678901234573.html: prime3456789012345678901234573.v 22 | prime4567890123456789012345689.html: prime4567890123456789012345689.v 23 | prime5678901234567890123456797.html: prime5678901234567890123456797.v 24 | prime6789012345678901234567903.html: prime6789012345678901234567903.v 25 | prime7890123456789012345678973.html: prime7890123456789012345678973.v 26 | prime8901234567890123456789017.html: prime8901234567890123456789017.v 27 | prime9012345678901234567890149.html: prime9012345678901234567890149.v 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime1.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime2166990353233 : prime 2166990353233. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 2166990353233 5 ((2383, 1)::(2,4)::nil) 23898) 10 | ((Proof_certif 2383 prime2383) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime1234567890123456789012353: prime 1234567890123456789012353. 17 | apply (Pocklington_refl 18 | 19 | (SPock_certif 20 | 1234567890123456789012353 21 | 2 22 | ((14246767565124824467, 1)::nil)) 23 | ( 24 | (Ell_certif 25 | 14246767565124824467 26 | 6574449 27 | ((2166990353233,1)::nil) 28 | 0 29 | 2058 30 | 7 31 | 49) 32 | :: (Proof_certif 2166990353233 prime2166990353233) :: nil)). 33 | vm_cast_no_check (refl_equal true). 34 | Time Qed. 35 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime2.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime5846725286581 : prime 5846725286581. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 5846725286581 2 ((10267, 1)::(2,2)::nil) 25246) 10 | ((Proof_certif 10267 prime10267) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime2345678901234567890123567: prime 2345678901234567890123567. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 2345678901234567890123567 21 | 77361229 22 | ((30321117329139797,1)::nil) 23 | 2345678901215618787857727 24 | 31749105730618655022 25 | 74219 26 | 5508459961) 27 | ( 28 | (Ell_certif 29 | 30321117329139797 30 | 5186 31 | ((5846725286581,1)::nil) 32 | 11370418998427425 33 | 0 34 | 15160558664569900 35 | 22740837996854850) 36 | :: (Proof_certif 5846725286581 prime5846725286581) :: nil)). 37 | vm_cast_no_check (refl_equal true). 38 | Time Qed. 39 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime3.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime793415879 : prime 793415879. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 793415879 7 ((396707939, 1)::(2,1)::nil) 1) 10 | ((Pock_certif 396707939 2 ((43, 1)::(11, 1)::(2,1)::nil) 1220) :: 11 | (Proof_certif 43 prime43) :: 12 | (Proof_certif 11 prime11) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime3456789012345678901234573: prime 3456789012345678901234573. 19 | apply (Pocklington_refl 20 | 21 | (SPock_certif 22 | 3456789012345678901234573 23 | 2 24 | ((52460968938504569, 1)::nil)) 25 | ( 26 | (SPock_certif 27 | 52460968938504569 28 | 2 29 | ((793415879, 1)::nil)) 30 | :: (Proof_certif 793415879 prime793415879) :: nil)). 31 | vm_cast_no_check (refl_equal true). 32 | Time Qed. 33 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime4.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime174550993 : prime 174550993. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 174550993 5 ((11, 1)::(3, 1)::(2,4)::nil) 34) 10 | ((Proof_certif 11 prime11) :: 11 | (Proof_certif 3 prime3) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime4567890123456789012345689: prime 4567890123456789012345689. 18 | apply (Pocklington_refl 19 | 20 | (SPock_certif 21 | 4567890123456789012345689 22 | 2 23 | ((570986265432098626543211, 1)::nil)) 24 | ( 25 | (Ell_certif 26 | 570986265432098626543211 27 | 4566 28 | ((125051744509636077691,1)::nil) 29 | 570986265432098626449131 30 | 9834496 31 | 0 32 | 3136) 33 | :: 34 | (Ell_certif 35 | 125051744509636077691 36 | 138775 37 | ((901111472016823,1)::nil) 38 | 0 39 | 192 40 | 4 41 | 16) 42 | :: 43 | (SPock_certif 44 | 901111472016823 45 | 2 46 | ((174550993, 1)::nil)) 47 | :: (Proof_certif 174550993 prime174550993) :: nil)). 48 | vm_cast_no_check (refl_equal true). 49 | Time Qed. 50 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime5.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime7376765261 : prime 7376765261. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 7376765261 2 ((461, 1)::(2,2)::nil) 2621) 10 | ((Proof_certif 461 prime461) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime5678901234567890123456797: prime 5678901234567890123456797. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 5678901234567890123456797 21 | 4116859400 22 | ((1379425596745957,1)::nil) 23 | 5678901234567890123442397 24 | 0 25 | 600 26 | 14400) 27 | ( 28 | (SPock_certif 29 | 1379425596745957 30 | 2 31 | ((7376765261, 1)::nil)) 32 | :: (Proof_certif 7376765261 prime7376765261) :: nil)). 33 | vm_cast_no_check (refl_equal true). 34 | Time Qed. 35 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime6.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime14139308836963 : prime 14139308836963. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 14139308836963 2 ((10607, 1)::(2,1)::nil) 6921) 10 | ((Proof_certif 10607 prime10607) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime6789012345678901234567903: prime 6789012345678901234567903. 17 | apply (Pocklington_refl 18 | 19 | (SPock_certif 20 | 6789012345678901234567903 21 | 2 22 | ((14139308836963, 1)::nil)) 23 | ( (Proof_certif 14139308836963 prime14139308836963) :: nil)). 24 | vm_cast_no_check (refl_equal true). 25 | Time Qed. 26 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime7.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime439901929 : prime 439901929. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 439901929 7 ((3, 4)::(2,3)::nil) 1051) 10 | ((Proof_certif 3 prime3) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime7890123456789012345678973: prime 7890123456789012345678973. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 7890123456789012345678973 21 | 6605516421 22 | ((1194474883403587,1)::nil) 23 | 0 24 | 1272112 25 | 129 26 | 1849) 27 | ( 28 | (Ell_certif 29 | 1194474883403587 30 | 2715321 31 | ((439901929,1)::nil) 32 | 0 33 | 9000 34 | 10 35 | 100) 36 | :: (Proof_certif 439901929 prime439901929) :: nil)). 37 | vm_cast_no_check (refl_equal true). 38 | Time Qed. 39 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime8.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime142948719999101 : prime 142948719999101. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 142948719999101 2 ((7256280203, 1)::(2,2)::nil) 1) 10 | ((Pock_certif 7256280203 2 ((33285689, 1)::(2,1)::nil) 1) :: 11 | (Pock_certif 33285689 3 ((4160711, 1)::(2,3)::nil) 1) :: 12 | (Pock_certif 4160711 7 ((416071, 1)::(2,1)::nil) 1) :: 13 | (Pock_certif 416071 13 ((3, 3)::(2,1)::nil) 28) :: 14 | (Proof_certif 3 prime3) :: 15 | (Proof_certif 2 prime2) :: 16 | nil)). 17 | vm_cast_no_check (refl_equal true). 18 | Qed. 19 | 20 | Lemma prime8901234567890123456789017: prime 8901234567890123456789017. 21 | apply (Pocklington_refl 22 | 23 | (SPock_certif 24 | 8901234567890123456789017 25 | 2 26 | ((11521380934487542399, 1)::nil)) 27 | ( 28 | (SPock_certif 29 | 11521380934487542399 30 | 2 31 | ((142948719999101, 1)::nil)) 32 | :: (Proof_certif 142948719999101 prime142948719999101) :: nil)). 33 | vm_cast_no_check (refl_equal true). 34 | Time Qed. 35 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/prime9.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime621072748687 : prime 621072748687. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 621072748687 3 ((7962471137, 1)::(2,1)::nil) 1) 10 | ((Pock_certif 7962471137 3 ((248827223, 1)::(2,5)::nil) 1) :: 11 | (Pock_certif 248827223 5 ((601, 1)::(2,1)::nil) 265) :: 12 | (Proof_certif 601 prime601) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime9012345678901234567890149: prime 9012345678901234567890149. 19 | apply (Pocklington_refl 20 | 21 | (SPock_certif 22 | 9012345678901234567890149 23 | 2 24 | ((28519720253228549537, 1)::nil)) 25 | ( 26 | (Ell_certif 27 | 28519720253228549537 28 | 5204 29 | ((5480345934414089,1)::nil) 30 | 10368 31 | 0 32 | 288 33 | 5184) 34 | :: 35 | (SPock_certif 36 | 5480345934414089 37 | 2 38 | ((621072748687, 1)::nil)) 39 | :: (Proof_certif 621072748687 prime621072748687) :: nil)). 40 | vm_cast_no_check (refl_equal true). 41 | Time Qed. 42 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t25/res: -------------------------------------------------------------------------------- 1 | Finished transaction in 0. secs (0.043994u,0.s) 2 | Finished transaction in 0. secs (0.099984u,0.001s) 3 | Finished transaction in 0. secs (0.007998u,0.s) 4 | Finished transaction in 0. secs (0.118982u,0.s) 5 | Finished transaction in 1. secs (0.077988u,0.s) 6 | Finished transaction in 0. secs (0.006999u,0.s) 7 | Finished transaction in 0. secs (0.06499u,0.s) 8 | Finished transaction in 0. secs (0.009998u,0.s) 9 | Finished transaction in 0. secs (0.051992u,0.s) 10 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t250/.depend: -------------------------------------------------------------------------------- 1 | prime1.vo: prime1.v ../PocklingtonRefl.vo 2 | prime1.vi: prime1.v ../PocklingtonRefl.vo 3 | prime2.vo: prime2.v ../PocklingtonRefl.vo 4 | prime2.vi: prime2.v ../PocklingtonRefl.vo 5 | prime3.vo: prime3.v ../PocklingtonRefl.vo 6 | prime3.vi: prime3.v ../PocklingtonRefl.vo 7 | prime4.vo: prime4.v ../PocklingtonRefl.vo 8 | prime4.vi: prime4.v ../PocklingtonRefl.vo 9 | prime5.vo: prime5.v ../PocklingtonRefl.vo 10 | prime5.vi: prime5.v ../PocklingtonRefl.vo 11 | prime6.vo: prime6.v ../PocklingtonRefl.vo 12 | prime6.vi: prime6.v ../PocklingtonRefl.vo 13 | prime7.vo: prime7.v ../PocklingtonRefl.vo 14 | prime7.vi: prime7.v ../PocklingtonRefl.vo 15 | prime8.vo: prime8.v ../PocklingtonRefl.vo 16 | prime8.vi: prime8.v ../PocklingtonRefl.vo 17 | prime9.vo: prime9.v ../PocklingtonRefl.vo 18 | prime9.vi: prime9.v ../PocklingtonRefl.vo 19 | prime1.html: prime1.v ../PocklingtonRefl.html 20 | prime2.html: prime2.v ../PocklingtonRefl.html 21 | prime3.html: prime3.v ../PocklingtonRefl.html 22 | prime4.html: prime4.v ../PocklingtonRefl.html 23 | prime5.html: prime5.v ../PocklingtonRefl.html 24 | prime6.html: prime6.v ../PocklingtonRefl.html 25 | prime7.html: prime7.v ../PocklingtonRefl.html 26 | prime8.html: prime8.v ../PocklingtonRefl.html 27 | prime9.html: prime9.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t250/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t250/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t250/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/.depend: -------------------------------------------------------------------------------- 1 | prime12345678901234567890123456789012345678901234568119.vo: prime12345678901234567890123456789012345678901234568119.v ../PocklingtonRefl.vo 2 | prime12345678901234567890123456789012345678901234568119.vi: prime12345678901234567890123456789012345678901234568119.v ../PocklingtonRefl.vo 3 | prime23456789012345678901234567890123456789012345678921.vo: prime23456789012345678901234567890123456789012345678921.v ../PocklingtonRefl.vo 4 | prime23456789012345678901234567890123456789012345678921.vi: prime23456789012345678901234567890123456789012345678921.v ../PocklingtonRefl.vo 5 | prime34567890123456789012345678901234567890123456789133.vo: prime34567890123456789012345678901234567890123456789133.v ../PocklingtonRefl.vo 6 | prime34567890123456789012345678901234567890123456789133.vi: prime34567890123456789012345678901234567890123456789133.v ../PocklingtonRefl.vo 7 | prime45678901234567890123456789012345678901234567890173.vo: prime45678901234567890123456789012345678901234567890173.v ../PocklingtonRefl.vo 8 | prime45678901234567890123456789012345678901234567890173.vi: prime45678901234567890123456789012345678901234567890173.v ../PocklingtonRefl.vo 9 | prime56789012345678901234567890123456789012345678901251.vo: prime56789012345678901234567890123456789012345678901251.v ../PocklingtonRefl.vo 10 | prime56789012345678901234567890123456789012345678901251.vi: prime56789012345678901234567890123456789012345678901251.v ../PocklingtonRefl.vo 11 | prime67890123456789012345678901234567890123456789012361.vo: prime67890123456789012345678901234567890123456789012361.v ../PocklingtonRefl.vo 12 | prime67890123456789012345678901234567890123456789012361.vi: prime67890123456789012345678901234567890123456789012361.v ../PocklingtonRefl.vo 13 | prime78901234567890123456789012345678901234567890123491.vo: prime78901234567890123456789012345678901234567890123491.v ../PocklingtonRefl.vo 14 | prime78901234567890123456789012345678901234567890123491.vi: prime78901234567890123456789012345678901234567890123491.v ../PocklingtonRefl.vo 15 | prime89012345678901234567890123456789012345678901234671.vo: prime89012345678901234567890123456789012345678901234671.v ../PocklingtonRefl.vo 16 | prime89012345678901234567890123456789012345678901234671.vi: prime89012345678901234567890123456789012345678901234671.v ../PocklingtonRefl.vo 17 | prime90123456789012345678901234567890123456789012345767.vo: prime90123456789012345678901234567890123456789012345767.v ../PocklingtonRefl.vo 18 | prime90123456789012345678901234567890123456789012345767.vi: prime90123456789012345678901234567890123456789012345767.v ../PocklingtonRefl.vo 19 | prime12345678901234567890123456789012345678901234568119.html: prime12345678901234567890123456789012345678901234568119.v ../PocklingtonRefl.html 20 | prime23456789012345678901234567890123456789012345678921.html: prime23456789012345678901234567890123456789012345678921.v ../PocklingtonRefl.html 21 | prime34567890123456789012345678901234567890123456789133.html: prime34567890123456789012345678901234567890123456789133.v ../PocklingtonRefl.html 22 | prime45678901234567890123456789012345678901234567890173.html: prime45678901234567890123456789012345678901234567890173.v ../PocklingtonRefl.html 23 | prime56789012345678901234567890123456789012345678901251.html: prime56789012345678901234567890123456789012345678901251.v ../PocklingtonRefl.html 24 | prime67890123456789012345678901234567890123456789012361.html: prime67890123456789012345678901234567890123456789012361.v ../PocklingtonRefl.html 25 | prime78901234567890123456789012345678901234567890123491.html: prime78901234567890123456789012345678901234567890123491.v ../PocklingtonRefl.html 26 | prime89012345678901234567890123456789012345678901234671.html: prime89012345678901234567890123456789012345678901234671.v ../PocklingtonRefl.html 27 | prime90123456789012345678901234567890123456789012345767.html: prime90123456789012345678901234567890123456789012345767.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime1.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime781254495361 : prime 781254495361. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 781254495361 22 ((5, 1)::(3, 3)::(2,7)::nil) 7006) 10 | ((Proof_certif 5 prime5) :: 11 | (Proof_certif 3 prime3) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime12345678901234567890123456789012345678901234568119: prime 12345678901234567890123456789012345678901234568119. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 12345678901234567890123456789012345678901234568119 22 | 15065364 23 | ((819474318790741988718191592468617421805573,1)::nil) 24 | 0 25 | 10985 26 | 26 27 | 169) 28 | ( 29 | (Ell_certif 30 | 819474318790741988718191592468617421805573 31 | 2974490 32 | ((275500781240058628106524320054131689,1)::nil) 33 | 409737159395370994359095796234308710902827 34 | 0 35 | 18 36 | 81) 37 | :: 38 | (Ell_certif 39 | 275500781240058628106524320054131689 40 | 128968646599974823 41 | ((2136184169588024581,1)::nil) 42 | 0 43 | 512169 44 | 58 45 | 841) 46 | :: 47 | (Ell_certif 48 | 2136184169588024581 49 | 2734300 50 | ((781254495361,1)::nil) 51 | 0 52 | 5832 53 | 9 54 | 81) 55 | :: (Proof_certif 781254495361 prime781254495361) :: nil)). 56 | vm_cast_no_check (refl_equal true). 57 | Time Qed. 58 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime2.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime12758741597671 : prime 12758741597671. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 12758741597671 11 ((1277, 1)::(5, 1)::(3, 1)::(2,1)::nil) 48936) 10 | ((Proof_certif 1277 prime1277) :: 11 | (Proof_certif 5 prime5) :: 12 | (Proof_certif 3 prime3) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime23456789012345678901234567890123456789012345678921: prime 23456789012345678901234567890123456789012345678921. 19 | apply (Pocklington_refl 20 | 21 | (Ell_certif 22 | 23456789012345678901234567890123456789012345678921 23 | 985748 24 | ((23795928586561351279672456893295268820653753,1)::nil) 25 | 10368 26 | 0 27 | 288 28 | 5184) 29 | ( 30 | (SPock_certif 31 | 23795928586561351279672456893295268820653753 32 | 2 33 | ((4776647834905838370780687325926589, 1)::nil)) 34 | :: 35 | (SPock_certif 36 | 4776647834905838370780687325926589 37 | 2 38 | ((3373243986825092585447171, 1)::nil)) 39 | :: 40 | (SPock_certif 41 | 3373243986825092585447171 42 | 2 43 | ((43583861297644259, 1)::nil)) 44 | :: 45 | (SPock_certif 46 | 43583861297644259 47 | 2 48 | ((357244764734789, 1)::nil)) 49 | :: 50 | (SPock_certif 51 | 357244764734789 52 | 2 53 | ((12758741597671, 1)::nil)) 54 | :: (Proof_certif 12758741597671 prime12758741597671) :: nil)). 55 | vm_cast_no_check (refl_equal true). 56 | Time Qed. 57 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime3.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime3147895291 : prime 3147895291. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 3147895291 3 ((89, 1)::(5, 1)::(3, 1)::(2,1)::nil) 4186) 10 | ((Proof_certif 89 prime89) :: 11 | (Proof_certif 5 prime5) :: 12 | (Proof_certif 3 prime3) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime34567890123456789012345678901234567890123456789133: prime 34567890123456789012345678901234567890123456789133. 19 | apply (Pocklington_refl 20 | 21 | (Ell_certif 22 | 34567890123456789012345678901234567890123456789133 23 | 43963888 24 | ((786279187215125036537844201647371988901943,1)::nil) 25 | 0 26 | 16464 27 | 28 28 | 196) 29 | ( 30 | (Ell_certif 31 | 786279187215125036537844201647371988901943 32 | 1340508 33 | ((586553147922373485678237978786893227,1)::nil) 34 | 0 35 | 5832 36 | 9 37 | 81) 38 | :: 39 | (Ell_certif 40 | 586553147922373485678237978786893227 41 | 3141 42 | ((186740893958094074246932344443953,1)::nil) 43 | 0 44 | 221184 45 | 48 46 | 576) 47 | :: 48 | (Ell_certif 49 | 186740893958094074246932344443953 50 | 64934242 51 | ((2875846213128877353059789,1)::nil) 52 | 102754353218657969830473362907022 53 | 0 54 | 68502902145771979886982241938015 55 | 43635357312496922650498311654053) 56 | :: 57 | (Ell_certif 58 | 2875846213128877353059789 59 | 559008136 60 | ((5144551622636221,1)::nil) 61 | 2875846213128877353059753 62 | 0 63 | 12 64 | 36) 65 | :: 66 | (Ell_certif 67 | 5144551622636221 68 | 1634283 69 | ((3147895291,1)::nil) 70 | 0 71 | 8192000 72 | 320 73 | 6400) 74 | :: (Proof_certif 3147895291 prime3147895291) :: nil)). 75 | vm_cast_no_check (refl_equal true). 76 | Time Qed. 77 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime4.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime409355789 : prime 409355789. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 409355789 2 ((2069, 1)::(2,2)::nil) 16358) 10 | ((Proof_certif 2069 prime2069) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime45678901234567890123456789012345678901234567890173: prime 45678901234567890123456789012345678901234567890173. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 45678901234567890123456789012345678901234567890173 21 | 4681 22 | ((9758363861262100005011065186172171907551501609,1)::nil) 23 | 9781366845776061026631943744091905444389216947450 24 | 40534976206835742715124580184913825944485873842245 25 | 44725954163382645029460350557081647367325232751881 26 | 23944982921609000437359567501588754878872290232176) 27 | ( 28 | (Ell_certif 29 | 9758363861262100005011065186172171907551501609 30 | 360866384 31 | ((27041487636216345396724441079320271749,1)::nil) 32 | 100 33 | 0 34 | 20 35 | 100) 36 | :: 37 | (Ell_certif 38 | 27041487636216345396724441079320271749 39 | 17640 40 | ((1532964151712944749995301930939497,1)::nil) 41 | 27041487636216345396724441079320268149 42 | 0 43 | 240 44 | 3600) 45 | :: 46 | (Ell_certif 47 | 1532964151712944749995301930939497 48 | 11198922432 49 | ((136884969158517056128193,1)::nil) 50 | 1532964151712944749995301173355593 51 | 8234810772496 52 | 0 53 | 2869636) 54 | :: 55 | (SPock_certif 56 | 136884969158517056128193 57 | 2 58 | ((2268109907849235421, 1)::nil)) 59 | :: 60 | (SPock_certif 61 | 2268109907849235421 62 | 2 63 | ((12600610599162419, 1)::nil)) 64 | :: 65 | (SPock_certif 66 | 12600610599162419 67 | 2 68 | ((409355789, 1)::nil)) 69 | :: (Proof_certif 409355789 prime409355789) :: nil)). 70 | vm_cast_no_check (refl_equal true). 71 | Time Qed. 72 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime5.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime296193496741 : prime 296193496741. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 296193496741 2 ((2467, 1)::(2,2)::nil) 16834) 10 | ((Proof_certif 2467 prime2467) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime56789012345678901234567890123456789012345678901251: prime 56789012345678901234567890123456789012345678901251. 17 | apply (Pocklington_refl 18 | 19 | (SPock_certif 20 | 56789012345678901234567890123456789012345678901251 21 | 2 22 | ((64809143903770500695655224106655394022648421, 1)::nil)) 23 | ( 24 | (SPock_certif 25 | 64809143903770500695655224106655394022648421 26 | 2 27 | ((143528628977580537977599369933230499, 1)::nil)) 28 | :: 29 | (Ell_certif 30 | 143528628977580537977599369933230499 31 | 147984 32 | ((969892886917373085790177496509,1)::nil) 33 | 80956800083162715589327371358432158 34 | 51310268889317992145811050312666099 35 | 0 36 | 128485858476228824601322735963624700) 37 | :: 38 | (Ell_certif 39 | 969892886917373085790177496509 40 | 18103449 41 | ((53575033515291555240277,1)::nil) 42 | 0 43 | 500 44 | 5 45 | 25) 46 | :: 47 | (SPock_certif 48 | 53575033515291555240277 49 | 2 50 | ((296193496741, 1)::nil)) 51 | :: (Proof_certif 296193496741 prime296193496741) :: nil)). 52 | vm_cast_no_check (refl_equal true). 53 | Time Qed. 54 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime6.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime100243289 : prime 100243289. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 100243289 3 ((737083, 1)::(2,3)::nil) 1) 10 | ((Pock_certif 737083 2 ((40949, 1)::(2,1)::nil) 1) :: 11 | (Proof_certif 40949 prime40949) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime67890123456789012345678901234567890123456789012361: prime 67890123456789012345678901234567890123456789012361. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 67890123456789012345678901234567890123456789012361 22 | 97937504772156721 23 | ((693198418876707274707103954283743,1)::nil) 24 | 0 25 | 35801432291666080729166608072916660807291736736560 26 | 33945061728394506172839450617283945061728394506368 27 | 29701929012345192901234519290123451929012345201697) 28 | ( 29 | (SPock_certif 30 | 693198418876707274707103954283743 31 | 2 32 | ((7920276260559713840029980511, 1)::nil)) 33 | :: 34 | (Ell_certif 35 | 7920276260559713840029980511 36 | 21958 37 | ((360701168620087663742953,1)::nil) 38 | 1452905144058057364936825490 39 | 3500075254047258054579801239 40 | 0 41 | 4612259265333956674606288033) 42 | :: 43 | (Ell_certif 44 | 360701168620087663742953 45 | 425220397 46 | ((848268735846901,1)::nil) 47 | 0 48 | 348020268160787708704086 49 | 180350584310043831871555 50 | 338157345581332184760559) 51 | :: 52 | (SPock_certif 53 | 848268735846901 54 | 2 55 | ((100243289, 1)::nil)) 56 | :: (Proof_certif 100243289 prime100243289) :: nil)). 57 | vm_cast_no_check (refl_equal true). 58 | Time Qed. 59 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime7.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime95422040797 : prime 95422040797. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 95422040797 2 ((16229, 1)::(2,2)::nil) 41778) 10 | ((Proof_certif 16229 prime16229) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime78901234567890123456789012345678901234567890123491: prime 78901234567890123456789012345678901234567890123491. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 78901234567890123456789012345678901234567890123491 21 | 460 22 | ((171524422973674181427802224787765088631887619361,1)::nil) 23 | 12031785075378784600176523961181540716182791851940 24 | 73848434268762360911557659986696456107315395586738 25 | 0 26 | 4522103279540963399034683202559513404643865562567) 27 | ( 28 | (Ell_certif 29 | 171524422973674181427802224787765088631887619361 30 | 5247525 31 | ((32686728119194130838405191918476602246283,1)::nil) 32 | 0 33 | 1080 34 | 6 35 | 36) 36 | :: 37 | (Ell_certif 38 | 32686728119194130838405191918476602246283 39 | 33594709625459073 40 | ((972972485358919527820537,1)::nil) 41 | 0 42 | 78608 43 | 17 44 | 289) 45 | :: 46 | (SPock_certif 47 | 972972485358919527820537 48 | 2 49 | ((743194563113683361, 1)::nil)) 50 | :: 51 | (Ell_certif 52 | 743194563113683361 53 | 7788500 54 | ((95422040797,1)::nil) 55 | 900 56 | 0 57 | 10 58 | 100) 59 | :: (Proof_certif 95422040797 prime95422040797) :: nil)). 60 | vm_cast_no_check (refl_equal true). 61 | Time Qed. 62 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime8.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime6186655106941 : prime 6186655106941. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 6186655106941 2 ((1339102837, 1)::(2,2)::nil) 1) 10 | ((Pock_certif 1339102837 2 ((599, 1)::(2,2)::nil) 3018) :: 11 | (Proof_certif 599 prime599) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime89012345678901234567890123456789012345678901234671: prime 89012345678901234567890123456789012345678901234671. 18 | apply (Pocklington_refl 19 | 20 | (SPock_certif 21 | 89012345678901234567890123456789012345678901234671 22 | 2 23 | ((9434440862093035546786759640267923465041649, 1)::nil)) 24 | ( 25 | (Ell_certif 26 | 9434440862093035546786759640267923465041649 27 | 19763113 28 | ((477376254545173907915829899446234441,1)::nil) 29 | 0 30 | 19008 31 | 12 32 | 144) 33 | :: 34 | (Ell_certif 35 | 477376254545173907915829899446234441 36 | 65611 37 | ((7275857013994206904573583733469,1)::nil) 38 | 0 39 | 400921463778173399226185393785663489 40 | 2453 41 | 447540238636100538671090530731220864) 42 | :: 43 | (SPock_certif 44 | 7275857013994206904573583733469 45 | 2 46 | ((55120128893895506852830179799, 1)::nil)) 47 | :: 48 | (Ell_certif 49 | 55120128893895506852830179799 50 | 15841 51 | ((3479586446177328425306107,1)::nil) 52 | 0 53 | 13134093212998538742179185769 54 | 41340096670421630139622641408 55 | 3445008055868469178302417314) 56 | :: 57 | (Ell_certif 58 | 3479586446177328425306107 59 | 562434204919 60 | ((6186655106941,1)::nil) 61 | 0 62 | 75449 63 | 38 64 | 361) 65 | :: (Proof_certif 6186655106941 prime6186655106941) :: nil)). 66 | vm_cast_no_check (refl_equal true). 67 | Time Qed. 68 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/prime9.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime8172363812299 : prime 8172363812299. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 8172363812299 2 ((2344338443, 1)::(2,1)::nil) 1) 10 | ((Pock_certif 2344338443 2 ((17495063, 1)::(2,1)::nil) 1) :: 11 | (Pock_certif 17495063 5 ((29, 1)::(13, 1)::(2,1)::nil) 582) :: 12 | (Proof_certif 29 prime29) :: 13 | (Proof_certif 13 prime13) :: 14 | (Proof_certif 2 prime2) :: 15 | nil)). 16 | vm_cast_no_check (refl_equal true). 17 | Qed. 18 | 19 | Lemma prime90123456789012345678901234567890123456789012345767: prime 90123456789012345678901234567890123456789012345767. 20 | apply (Pocklington_refl 21 | 22 | (Ell_certif 23 | 90123456789012345678901234567890123456789012345767 24 | 17158 25 | ((5252561883029044508619956759449886145396761249,1)::nil) 26 | 65136860129970470133208885679531502916987918440833 27 | 3287854945502081538460645485015755534450769431644 28 | 0 29 | 63991231585988043203870358151771006401958544985177) 30 | ( 31 | (SPock_certif 32 | 5252561883029044508619956759449886145396761249 33 | 2 34 | ((473738743619720656436859847011961, 1)::nil)) 35 | :: 36 | (Ell_certif 37 | 473738743619720656436859847011961 38 | 399 39 | ((1187315146916593223665588678129,1)::nil) 40 | 0 41 | 9000 42 | 10 43 | 100) 44 | :: 45 | (Ell_certif 46 | 1187315146916593223665588678129 47 | 202027 48 | ((5877012215776086373849771,1)::nil) 49 | 0 50 | 511758 51 | 27 52 | 729) 53 | :: 54 | (SPock_certif 55 | 5877012215776086373849771 56 | 2 57 | ((113302722494237254171, 1)::nil)) 58 | :: 59 | (Ell_certif 60 | 113302722494237254171 61 | 13864131 62 | ((8172363812299,1)::nil) 63 | 0 64 | 78608 65 | 17 66 | 289) 67 | :: (Proof_certif 8172363812299 prime8172363812299) :: nil)). 68 | vm_cast_no_check (refl_equal true). 69 | Time Qed. 70 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t50/res: -------------------------------------------------------------------------------- 1 | COQDEP VFILES 2 | COQC prime1.v 3 | Finished transaction in 0.379 secs (0.256u,0.s) (successful) 4 | COQNATIVE prime1.vo 5 | COQC prime2.v 6 | Finished transaction in 0.19 secs (0.124u,0.s) (successful) 7 | COQNATIVE prime2.vo 8 | COQC prime3.v 9 | Finished transaction in 0.386 secs (0.278u,0.s) (successful) 10 | COQNATIVE prime3.vo 11 | COQC prime4.v 12 | Finished transaction in 0.477 secs (0.457u,0.s) (successful) 13 | COQNATIVE prime4.vo 14 | COQC prime5.v 15 | Finished transaction in 0.142 secs (0.11u,0.s) (successful) 16 | COQNATIVE prime5.vo 17 | COQC prime6.v 18 | Finished transaction in 0.228 secs (0.178u,0.s) (successful) 19 | COQNATIVE prime6.vo 20 | COQC prime7.v 21 | Finished transaction in 0.407 secs (0.404u,0.s) (successful) 22 | COQNATIVE prime7.vo 23 | COQC prime8.v 24 | Finished transaction in 0.126 secs (0.125u,0.s) (successful) 25 | COQNATIVE prime8.vo 26 | COQC prime9.v 27 | Finished transaction in 0.268 secs (0.26u,0.001s) (successful) 28 | COQNATIVE prime9.vo 29 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/.depend: -------------------------------------------------------------------------------- 1 | prime123456789012345678901234567890123456789012345678901234567890123456789012517.vo: prime123456789012345678901234567890123456789012345678901234567890123456789012517.v ../PocklingtonRefl.vo 2 | prime123456789012345678901234567890123456789012345678901234567890123456789012517.vi: prime123456789012345678901234567890123456789012345678901234567890123456789012517.v ../PocklingtonRefl.vo 3 | prime234567890123456789012345678901234567890123456789012345678901234567890123737.vo: prime234567890123456789012345678901234567890123456789012345678901234567890123737.v ../PocklingtonRefl.vo 4 | prime234567890123456789012345678901234567890123456789012345678901234567890123737.vi: prime234567890123456789012345678901234567890123456789012345678901234567890123737.v ../PocklingtonRefl.vo 5 | prime345678901234567890123456789012345678901234567890123456789012345678901234867.vo: prime345678901234567890123456789012345678901234567890123456789012345678901234867.v ../PocklingtonRefl.vo 6 | prime345678901234567890123456789012345678901234567890123456789012345678901234867.vi: prime345678901234567890123456789012345678901234567890123456789012345678901234867.v ../PocklingtonRefl.vo 7 | prime456789012345678901234567890123456789012345678901234567890123456789012345719.vo: prime456789012345678901234567890123456789012345678901234567890123456789012345719.v ../PocklingtonRefl.vo 8 | prime456789012345678901234567890123456789012345678901234567890123456789012345719.vi: prime456789012345678901234567890123456789012345678901234567890123456789012345719.v ../PocklingtonRefl.vo 9 | prime567890123456789012345678901234567890123456789012345678901234567890123457001.vo: prime567890123456789012345678901234567890123456789012345678901234567890123457001.v ../PocklingtonRefl.vo 10 | prime567890123456789012345678901234567890123456789012345678901234567890123457001.vi: prime567890123456789012345678901234567890123456789012345678901234567890123457001.v ../PocklingtonRefl.vo 11 | prime678901234567890123456789012345678901234567890123456789012345678901234568009.vo: prime678901234567890123456789012345678901234567890123456789012345678901234568009.v ../PocklingtonRefl.vo 12 | prime678901234567890123456789012345678901234567890123456789012345678901234568009.vi: prime678901234567890123456789012345678901234567890123456789012345678901234568009.v ../PocklingtonRefl.vo 13 | prime789012345678901234567890123456789012345678901234567890123456789012345678959.vo: prime789012345678901234567890123456789012345678901234567890123456789012345678959.v ../PocklingtonRefl.vo 14 | prime789012345678901234567890123456789012345678901234567890123456789012345678959.vi: prime789012345678901234567890123456789012345678901234567890123456789012345678959.v ../PocklingtonRefl.vo 15 | prime890123456789012345678901234567890123456789012345678901234567890123456789173.vo: prime890123456789012345678901234567890123456789012345678901234567890123456789173.v ../PocklingtonRefl.vo 16 | prime890123456789012345678901234567890123456789012345678901234567890123456789173.vi: prime890123456789012345678901234567890123456789012345678901234567890123456789173.v ../PocklingtonRefl.vo 17 | prime901234567890123456789012345678901234567890123456789012345678901234567890211.vo: prime901234567890123456789012345678901234567890123456789012345678901234567890211.v ../PocklingtonRefl.vo 18 | prime901234567890123456789012345678901234567890123456789012345678901234567890211.vi: prime901234567890123456789012345678901234567890123456789012345678901234567890211.v ../PocklingtonRefl.vo 19 | prime123456789012345678901234567890123456789012345678901234567890123456789012517.html: prime123456789012345678901234567890123456789012345678901234567890123456789012517.v ../PocklingtonRefl.html 20 | prime234567890123456789012345678901234567890123456789012345678901234567890123737.html: prime234567890123456789012345678901234567890123456789012345678901234567890123737.v ../PocklingtonRefl.html 21 | prime345678901234567890123456789012345678901234567890123456789012345678901234867.html: prime345678901234567890123456789012345678901234567890123456789012345678901234867.v ../PocklingtonRefl.html 22 | prime456789012345678901234567890123456789012345678901234567890123456789012345719.html: prime456789012345678901234567890123456789012345678901234567890123456789012345719.v ../PocklingtonRefl.html 23 | prime567890123456789012345678901234567890123456789012345678901234567890123457001.html: prime567890123456789012345678901234567890123456789012345678901234567890123457001.v ../PocklingtonRefl.html 24 | prime678901234567890123456789012345678901234567890123456789012345678901234568009.html: prime678901234567890123456789012345678901234567890123456789012345678901234568009.v ../PocklingtonRefl.html 25 | prime789012345678901234567890123456789012345678901234567890123456789012345678959.html: prime789012345678901234567890123456789012345678901234567890123456789012345678959.v ../PocklingtonRefl.html 26 | prime890123456789012345678901234567890123456789012345678901234567890123456789173.html: prime890123456789012345678901234567890123456789012345678901234567890123456789173.v ../PocklingtonRefl.html 27 | prime901234567890123456789012345678901234567890123456789012345678901234567890211.html: prime901234567890123456789012345678901234567890123456789012345678901234567890211.v ../PocklingtonRefl.html 28 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/Makefile: -------------------------------------------------------------------------------- 1 | ifeq "$(COQBIN)" "" 2 | COQBIN=$(dir $(shell which coqtop))/ 3 | endif 4 | 5 | %: Makefile.coq 6 | 7 | Makefile.coq: _CoqProject 8 | $(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq 9 | 10 | tests: all 11 | @$(MAKE) -C tests -s clean 12 | @$(MAKE) -C tests -s all 13 | 14 | -include Makefile.coq 15 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | 2 | res : 3 | make clean; make -s all > res 4 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/_CoqProject: -------------------------------------------------------------------------------- 1 | -R ../../../Coqprime Coqprime 2 | 3 | prime1.v 4 | prime2.v 5 | prime3.v 6 | prime4.v 7 | prime5.v 8 | prime6.v 9 | prime7.v 10 | prime8.v 11 | prime9.v 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime1.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime250292848634953 : prime 250292848634953. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 250292848634953 5 ((5515001953, 1)::(2,3)::nil) 1) 10 | ((Pock_certif 5515001953 5 ((173, 1)::(2,5)::nil) 10798) :: 11 | (Proof_certif 173 prime173) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime123456789012345678901234567890123456789012345678901234567890123456789012517: prime 123456789012345678901234567890123456789012345678901234567890123456789012517. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 123456789012345678901234567890123456789012345678901234567890123456789012517 22 | 386804746624 23 | ((319170822203880316003188985442628281207410404831346658084563687,1)::nil) 24 | 123456789012345678901234567890123456789012345678901234567890123456788869157 25 | 25690112 26 | 64 27 | 4096) 28 | ( 29 | (Ell_certif 30 | 319170822203880316003188985442628281207410404831346658084563687 31 | 26762294 32 | ((11926138402181827761222150292595409964961572248030502423,1)::nil) 33 | 104103958272786094797916337926444355433917598794896872682241060 34 | 159829671526420700078538713203296037933776980221892644309666459 35 | 157104402592595980307913399135326776342954969785951541253102834 36 | 266946987538985664411434248829708867398374209207893105508462563) 37 | :: 38 | (SPock_certif 39 | 11926138402181827761222150292595409964961572248030502423 40 | 2 41 | ((220854414855219032615225005418433517869658745333898193, 1)::nil)) 42 | :: 43 | (Ell_certif 44 | 220854414855219032615225005418433517869658745333898193 45 | 364 46 | ((606742897953898441250618149323080160408998218247431,1)::nil) 47 | 0 48 | 126818746030145303884523733580116121589218107673247541 49 | 165640811141414274461418754063825138402244059000423677 50 | 207051013926767843076773442579781423002805073750530596) 51 | :: 52 | (Ell_certif 53 | 606742897953898441250618149323080160408998218247431 54 | 52300 55 | ((11601202637741844000967841405861262324265654981,1)::nil) 56 | 0 57 | 552230840715852878169507924969834677247252284576647 58 | 303371448976949220625309074661540080204499109123731 59 | 341292880099067873203472708994232590230061497764240) 60 | :: 61 | (Ell_certif 62 | 11601202637741844000967841405861262324265654981 63 | 3150 64 | ((3682921472298998095545378139088228136413449,1)::nil) 65 | 1886815219304717717044917638260558285648943686 66 | 5340589639749335260549658728180276666816252326 67 | 0 68 | 6672977350652300057857130174792665118861290892) 69 | :: 70 | (SPock_certif 71 | 3682921472298998095545378139088228136413449 72 | 2 73 | ((153455061345791587314390755795342839017227, 1)::nil)) 74 | :: 75 | (SPock_certif 76 | 153455061345791587314390755795342839017227 77 | 2 78 | ((37409815052606432792391700583945109463, 1)::nil)) 79 | :: 80 | (Ell_certif 81 | 37409815052606432792391700583945109463 82 | 32314679 83 | ((1157672494676689587528802518017,1)::nil) 84 | 19155572044270759185424729103693377770 85 | 27994334197828200959203470384324369949 86 | 0 87 | 22074521957674884925381819683630513704) 88 | :: 89 | (SPock_certif 90 | 1157672494676689587528802518017 91 | 2 92 | ((1130539545582704675321096209, 1)::nil)) 93 | :: 94 | (Ell_certif 95 | 1130539545582704675321096209 96 | 14536636 97 | ((77771744823399134707,1)::nil) 98 | 0 99 | 1015808 100 | 32 101 | 1024) 102 | :: 103 | (Ell_certif 104 | 77771744823399134707 105 | 310723 106 | ((250292848634953,1)::nil) 107 | 0 108 | 51341503418571599664 109 | 58328808617549351654 110 | 63189542669011812512) 111 | :: (Proof_certif 250292848634953 prime250292848634953) :: nil)). 112 | vm_cast_no_check (refl_equal true). 113 | Time Qed. 114 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime2.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime846065480749 : prime 846065480749. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 846065480749 2 ((239, 1)::(101, 1)::(2,2)::nil) 72392) 10 | ((Proof_certif 239 prime239) :: 11 | (Proof_certif 101 prime101) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime234567890123456789012345678901234567890123456789012345678901234567890123737: prime 234567890123456789012345678901234567890123456789012345678901234567890123737. 18 | apply (Pocklington_refl 19 | 20 | (SPock_certif 21 | 234567890123456789012345678901234567890123456789012345678901234567890123737 22 | 2 23 | ((15781610878736016561814635747512580452164237391485721518763528869627, 1)::nil)) 24 | ( 25 | (Ell_certif 26 | 15781610878736016561814635747512580452164237391485721518763528869627 27 | 24472980 28 | ((644858569685261727906231106612786078795446164661545894408647,1)::nil) 29 | 15781610878736016561814635747512580452164237391485721518763479311395 30 | 134414314742 31 | 571 32 | 326041) 33 | :: 34 | (Ell_certif 35 | 644858569685261727906231106612786078795446164661545894408647 36 | 199593 37 | ((3230867664122798534548962672109500545444193073958610013,1)::nil) 38 | 0 39 | 78608 40 | 17 41 | 289) 42 | :: 43 | (SPock_certif 44 | 3230867664122798534548962672109500545444193073958610013 45 | 2 46 | ((98154929642811961798182120309560716534335674868107, 1)::nil)) 47 | :: 48 | (Ell_certif 49 | 98154929642811961798182120309560716534335674868107 50 | 804144582 51 | ((122061295741978849517613364696232539466089,1)::nil) 52 | 98154929642811961798182120309560716534335674839277 53 | 1668296 54 | 155 55 | 961) 56 | :: 57 | (Ell_certif 58 | 122061295741978849517613364696232539466089 59 | 11628 60 | ((10497187456310530574230993942383491833,1)::nil) 61 | 122061295741978849517613364696232539444219 62 | 1102248 63 | 27 64 | 729) 65 | :: 66 | (Ell_certif 67 | 10497187456310530574230993942383491833 68 | 10227 69 | ((1026419033569035942160253106332683,1)::nil) 70 | 0 71 | 3584 72 | 8 73 | 64) 74 | :: 75 | (SPock_certif 76 | 1026419033569035942160253106332683 77 | 2 78 | ((4797166187239533134835349, 1)::nil)) 79 | :: 80 | (Ell_certif 81 | 4797166187239533134835349 82 | 796747 83 | ((6020940382886741341,1)::nil) 84 | 0 85 | 15145569 86 | 348 87 | 7569) 88 | :: 89 | (Ell_certif 90 | 6020940382886741341 91 | 7116400 92 | ((846065480749,1)::nil) 93 | 0 94 | 5832 95 | 9 96 | 81) 97 | :: (Proof_certif 846065480749 prime846065480749) :: nil)). 98 | vm_cast_no_check (refl_equal true). 99 | Time Qed. 100 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime3.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime2364816956681 : prime 2364816956681. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 2364816956681 3 ((137, 1)::(71, 1)::(2,3)::nil) 41614) 10 | ((Proof_certif 137 prime137) :: 11 | (Proof_certif 71 prime71) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime345678901234567890123456789012345678901234567890123456789012345678901234867: prime 345678901234567890123456789012345678901234567890123456789012345678901234867. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 345678901234567890123456789012345678901234567890123456789012345678901234867 22 | 1411371 23 | ((244924191608420387072893512061921124139552809881227346027983516310153,1)::nil) 24 | 0 25 | 221184 26 | 48 27 | 576) 28 | ( 29 | (Ell_certif 30 | 244924191608420387072893512061921124139552809881227346027983516310153 31 | 198457 32 | ((1234142366398869211329877565729206534556712063187094448285343321,1)::nil) 33 | 0 34 | 3584 35 | 8 36 | 64) 37 | :: 38 | (Ell_certif 39 | 1234142366398869211329877565729206534556712063187094448285343321 40 | 6464400 41 | ((190913675886218243198112363982624337051242242430488723943,1)::nil) 42 | 280120286059203341420141182543512307820207837035157399901023459 43 | 229081674606460389541462454361558765656911902473492210381286539 44 | 659217991305228829812191135366836900663879886034496438707371790 45 | 381667883141002426290615343870262269768390903304738380192888616) 46 | :: 47 | (Ell_certif 48 | 190913675886218243198112363982624337051242242430488723943 49 | 259 50 | ((737118439715128352116263953568149199484378845031173121,1)::nil) 51 | 0 52 | 163840 53 | 96 54 | 1024) 55 | :: 56 | (Ell_certif 57 | 737118439715128352116263953568149199484378845031173121 58 | 146982189 59 | ((5015018790576920528216272196550135572327274421,1)::nil) 60 | 0 61 | 500 62 | 5 63 | 25) 64 | :: 65 | (Ell_certif 66 | 5015018790576920528216272196550135572327274421 67 | 621712 68 | ((8066466129939458347621035472426050852343,1)::nil) 69 | 0 70 | 5832 71 | 9 72 | 81) 73 | :: 74 | (Ell_certif 75 | 8066466129939458347621035472426050852343 76 | 63859722214917 77 | ((126315396468405112769531077,1)::nil) 78 | 0 79 | 61440 80 | 16 81 | 256) 82 | :: 83 | (Ell_certif 84 | 126315396468405112769531077 85 | 1502431642 86 | ((84073972443922913,1)::nil) 87 | 63157698234202556384765579 88 | 0 89 | 18 90 | 81) 91 | :: 92 | (SPock_certif 93 | 84073972443922913 94 | 2 95 | ((2364816956681, 1)::nil)) 96 | :: (Proof_certif 2364816956681 prime2364816956681) :: nil)). 97 | vm_cast_no_check (refl_equal true). 98 | Time Qed. 99 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime4.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime2487334028981 : prime 2487334028981. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 2487334028981 2 ((379, 1)::(31, 1)::(2,2)::nil) 9008) 10 | ((Proof_certif 379 prime379) :: 11 | (Proof_certif 31 prime31) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime456789012345678901234567890123456789012345678901234567890123456789012345719: prime 456789012345678901234567890123456789012345678901234567890123456789012345719. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 456789012345678901234567890123456789012345678901234567890123456789012345719 22 | 120374 23 | ((3794748137851021825598284431218176591087303254928343022645607860922259,1)::nil) 24 | 246963818571832597245629546866271265884277149277950832642753103119424699973 25 | 115706626755254436293181523932784492184736521000726766656540962256102729132 26 | 0 27 | 194880594014284907056814023349881406580036080549641945352434457136224622870) 28 | ( 29 | (Ell_certif 30 | 3794748137851021825598284431218176591087303254928343022645607860922259 31 | 2338 32 | ((1623074481544491798801661433369622196057562304312441684816529340543,1)::nil) 33 | 260937662969224746687791422043055176699299051182173658257535865039214 34 | 2406768493081104712184738096874684989631960420819057746909314164946576 35 | 3137449062497646937119646401027656691273727581269488912842330388090489 36 | 2955929133447540224352983867452447284191321347104163341335686455922360) 37 | :: 38 | (Ell_certif 39 | 1623074481544491798801661433369622196057562304312441684816529340543 40 | 8994 41 | ((180461917005169201556778011270805498355305081567302630307971021,1)::nil) 42 | 1335331925045624323819777246276569837381807370360471662556654584334 43 | 390277261854246710071669354089870287237505990331202882151305934020 44 | 1250474251050274576856232841465984634682677860340021134368849210696 45 | 1495261323307087204001754181798907291261277441151714942120953942655) 46 | :: 47 | (Ell_certif 48 | 180461917005169201556778011270805498355305081567302630307971021 49 | 45037837 50 | ((4006895735360674660214654874984062879040384232852775309,1)::nil) 51 | 180461917005169201556778011270805498355305081567283681205705181 52 | 31749105730618655022 53 | 74219 54 | 5508459961) 55 | :: 56 | (Ell_certif 57 | 4006895735360674660214654874984062879040384232852775309 58 | 3023877893853 59 | ((1325085164154932698927766288385561275311697,1)::nil) 60 | 4006895735360674660214654874984062879040384232312166405 61 | 4964006108754 62 | 1431 63 | 2047761) 64 | :: 65 | (Ell_certif 66 | 1325085164154932698927766288385561275311697 67 | 402290 68 | ((3293855587150892885554067514512669357,1)::nil) 69 | 656208365428440560451347803258941149529709 70 | 0 71 | 257303547660735480957480370467534720859168 72 | 733343217130951148732076675354716491561591) 73 | :: 74 | (SPock_certif 75 | 3293855587150892885554067514512669357 76 | 2 77 | ((646868732747622326306768954146243, 1)::nil)) 78 | :: 79 | (Ell_certif 80 | 646868732747622326306768954146243 81 | 441755076 82 | ((1464315336464005611820747,1)::nil) 83 | 0 84 | 9000 85 | 10 86 | 100) 87 | :: 88 | (SPock_certif 89 | 1464315336464005611820747 90 | 2 91 | ((9342426612852643, 1)::nil)) 92 | :: 93 | (SPock_certif 94 | 9342426612852643 95 | 2 96 | ((1557071102142107, 1)::nil)) 97 | :: 98 | (SPock_certif 99 | 1557071102142107 100 | 2 101 | ((2487334028981, 1)::nil)) 102 | :: (Proof_certif 2487334028981 prime2487334028981) :: nil)). 103 | vm_cast_no_check (refl_equal true). 104 | Time Qed. 105 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime5.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime36381236858437 : prime 36381236858437. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 36381236858437 2 ((1583, 1)::(31, 1)::(2,2)::nil) 42784) 10 | ((Proof_certif 1583 prime1583) :: 11 | (Proof_certif 31 prime31) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime567890123456789012345678901234567890123456789012345678901234567890123457001: prime 567890123456789012345678901234567890123456789012345678901234567890123457001. 18 | apply (Pocklington_refl 19 | 20 | (Ell_certif 21 | 567890123456789012345678901234567890123456789012345678901234567890123457001 22 | 28677 23 | ((19802982301384001546384869450589946303889376491014415575248444876236177,1)::nil) 24 | 0 25 | 192 26 | 4 27 | 16) 28 | ( 29 | (Ell_certif 30 | 19802982301384001546384869450589946303889376491014415575248444876236177 31 | 893575372 32 | ((22161513087654794436730368449086963097397182116939446309026837,1)::nil) 33 | 8446351099326273315371371081831452751213667519396316913430917507164525 34 | 10797632546788407783012824472292622442457505180638213964525714401661221 35 | 0 36 | 7957382745923967674847550991125140250542629463592365827276261999280239) 37 | :: 38 | (Ell_certif 39 | 22161513087654794436730368449086963097397182116939446309026837 40 | 4357311677780 41 | ((5086051842622795697587778457413138845532724941909,1)::nil) 42 | 100 43 | 0 44 | 20 45 | 100) 46 | :: 47 | (SPock_certif 48 | 5086051842622795697587778457413138845532724941909 49 | 2 50 | ((514574245510197864992693085533502513712335587, 1)::nil)) 51 | :: 52 | (Ell_certif 53 | 514574245510197864992693085533502513712335587 54 | 1229 55 | ((418693446306100785185294426399856051702167,1)::nil) 56 | 514574245510197864992693085424969239038070267 57 | 13762346127466829996235398 58 | 1918747 59 | 3681590050009) 60 | :: 61 | (Ell_certif 62 | 418693446306100785185294426399856051702167 63 | 16657 64 | ((25136185766110391137927288668886636721,1)::nil) 65 | 418693446306100785185294426380906949436327 66 | 31749105730618655022 67 | 74219 68 | 5508459961) 69 | :: 70 | (Ell_certif 71 | 25136185766110391137927288668886636721 72 | 151479924640 73 | ((165937406067819596064291379,1)::nil) 74 | 22999174035389941984992140154319855469 75 | 226581753138899745779479119277070072 76 | 1051450546243441357795046507597738599 77 | 5853847509957483966356781753592071450) 78 | :: 79 | (SPock_certif 80 | 165937406067819596064291379 81 | 2 82 | ((10319756122316805673, 1)::nil)) 83 | :: 84 | (SPock_certif 85 | 10319756122316805673 86 | 2 87 | ((36381236858437, 1)::nil)) 88 | :: (Proof_certif 36381236858437 prime36381236858437) :: nil)). 89 | vm_cast_no_check (refl_equal true). 90 | Time Qed. 91 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime6.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime3421288327 : prime 3421288327. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 3421288327 3 ((570214721, 1)::(2,1)::nil) 1) 10 | ((Pock_certif 570214721 3 ((1781921, 1)::(2,6)::nil) 1) :: 11 | (Pock_certif 1781921 3 ((5, 1)::(2,5)::nil) 256) :: 12 | (Proof_certif 5 prime5) :: 13 | (Proof_certif 2 prime2) :: 14 | nil)). 15 | vm_cast_no_check (refl_equal true). 16 | Qed. 17 | 18 | Lemma prime678901234567890123456789012345678901234567890123456789012345678901234568009: prime 678901234567890123456789012345678901234567890123456789012345678901234568009. 19 | apply (Pocklington_refl 20 | 21 | (Ell_certif 22 | 678901234567890123456789012345678901234567890123456789012345678901234568009 23 | 260 24 | ((2611158594491885090218419278252611158563837190503948396276492024847644113,1)::nil) 25 | 900 26 | 0 27 | 10 28 | 100) 29 | ( 30 | (Ell_certif 31 | 2611158594491885090218419278252611158563837190503948396276492024847644113 32 | 1117789 33 | ((2336003122675106921090133538845534494933789237251785382341823297633,1)::nil) 34 | 0 35 | 1621774283297694255252846348602207711764258255039561699249852468559606057 36 | 1305579297245942545109209639126305579281918595251974198138246012423822135 37 | 1142381885090199726970558434235517381871678770845477423370965260870845840) 38 | :: 39 | (SPock_certif 40 | 2336003122675106921090133538845534494933789237251785382341823297633 41 | 2 42 | ((37378442183101429228912787039899105461690175967290472707722467, 1)::nil)) 43 | :: 44 | (Ell_certif 45 | 37378442183101429228912787039899105461690175967290472707722467 46 | 6726 47 | ((5557306301382906516341478893829939337927637259654768631777,1)::nil) 48 | 37378442183101429228912787039899105461690175967290472707700597 49 | 1102248 50 | 27 51 | 729) 52 | :: 53 | (Ell_certif 54 | 5557306301382906516341478893829939337927637259654768631777 55 | 1899772 56 | ((2925249083249414412014430623242669214975289035495359,1)::nil) 57 | 0 58 | 13310 59 | 11 60 | 121) 61 | :: 62 | (SPock_certif 63 | 2925249083249414412014430623242669214975289035495359 64 | 2 65 | ((162513837958300800667468367957926067498627168638631, 1)::nil)) 66 | :: 67 | (SPock_certif 68 | 162513837958300800667468367957926067498627168638631 69 | 2 70 | ((39929689916044422768419746427008861793274488609, 1)::nil)) 71 | :: 72 | (Ell_certif 73 | 39929689916044422768419746427008861793274488609 74 | 1469500298 75 | ((27172291132154927108711465018614587973,1)::nil) 76 | 48 77 | 0 78 | 4 79 | 16) 80 | :: 81 | (Ell_certif 82 | 27172291132154927108711465018614587973 83 | 655606476 84 | ((41446038327655151348947203829,1)::nil) 85 | 0 86 | 78608 87 | 17 88 | 289) 89 | :: 90 | (Ell_certif 91 | 41446038327655151348947203829 92 | 701827 93 | ((59054493953147091155017,1)::nil) 94 | 0 95 | 2058 96 | 7 97 | 49) 98 | :: 99 | (Ell_certif 100 | 59054493953147091155017 101 | 6068 102 | ((9732118318000285237,1)::nil) 103 | 48 104 | 0 105 | 4 106 | 16) 107 | :: 108 | (SPock_certif 109 | 9732118318000285237 110 | 2 111 | ((3421288327, 1)::nil)) 112 | :: (Proof_certif 3421288327 prime3421288327) :: nil)). 113 | vm_cast_no_check (refl_equal true). 114 | Time Qed. 115 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime7.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime27748957772981 : prime 27748957772981. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 27748957772981 2 ((69001, 1)::(2,2)::nil) 72788) 10 | ((Pock_certif 69001 19 ((5, 1)::(2,3)::nil) 43) :: 11 | (Proof_certif 5 prime5) :: 12 | (Proof_certif 2 prime2) :: 13 | nil)). 14 | vm_cast_no_check (refl_equal true). 15 | Qed. 16 | 17 | Lemma prime789012345678901234567890123456789012345678901234567890123456789012345678959: prime 789012345678901234567890123456789012345678901234567890123456789012345678959. 18 | apply (Pocklington_refl 19 | 20 | (SPock_certif 21 | 789012345678901234567890123456789012345678901234567890123456789012345678959 22 | 2 23 | ((394506172839450617283945061728394506172839450617283945061728394506172839479, 1)::nil)) 24 | ( 25 | (Ell_certif 26 | 394506172839450617283945061728394506172839450617283945061728394506172839479 27 | 239 28 | ((1650653442842889612066715739449349398249814414659252768600365116539773821,1)::nil) 29 | 99732839895929658721858427128528143209595282124976935293626830813033217768 30 | 202446870946127498356534994784223914312700292280139740154553523474271118842 31 | 0 32 | 133651010739828353241318700256601626348201888236269242108007321549960096204) 33 | :: 34 | (Ell_certif 35 | 1650653442842889612066715739449349398249814414659252768600365116539773821 36 | 736 37 | ((2242735656036534799003689863382268201911807580302126684830278105025551,1)::nil) 38 | 1650653442842889612066715739449349398249814414659252768600365116539630461 39 | 25690112 40 | 64 41 | 4096) 42 | :: 43 | (Ell_certif 44 | 2242735656036534799003689863382268201911807580302126684830278105025551 45 | 163806000 46 | ((13691413355045204687274519024835893004331196287838640974928381,1)::nil) 47 | 458780045235945239011361112474093385500753683290864974888776245978629 48 | 2148718638500306357536058174389106709980712320000391528056236970099338 49 | 691035487657762580526860539770008202621674112218820028822675362393602 50 | 1635814914901580201052657899191945983097162084387463291852340377921058) 51 | :: 52 | (Ell_certif 53 | 13691413355045204687274519024835893004331196287838640974928381 54 | 1675 55 | ((8173978122415047574492250164085331908882575606588834294477,1)::nil) 56 | 0 57 | 13310 58 | 11 59 | 121) 60 | :: 61 | (Ell_certif 62 | 8173978122415047574492250164085331908882575606588834294477 63 | 9529488 64 | ((857756274252619613403390629583497819082400600470199,1)::nil) 65 | 0 66 | 44851536 67 | 705 68 | 19881) 69 | :: 70 | (Ell_certif 71 | 857756274252619613403390629583497819082400600470199 72 | 1512783 73 | ((567005495337149884288355096629900853318519383,1)::nil) 74 | 0 75 | 78608 76 | 17 77 | 289) 78 | :: 79 | (Ell_certif 80 | 567005495337149884288355096629900853318519383 81 | 19857 82 | ((28554439005748596680683507904331946271827,1)::nil) 83 | 0 84 | 8586756 85 | 645 86 | 16641) 87 | :: 88 | (SPock_certif 89 | 28554439005748596680683507904331946271827 90 | 2 91 | ((4759073167624766113447251317388657711971, 1)::nil)) 92 | :: 93 | (Ell_certif 94 | 4759073167624766113447251317388657711971 95 | 490 96 | ((9712394219642379823093313355477936401,1)::nil) 97 | 4586890095725857294196229219405635523022 98 | 2692812102149550361966369771669339085991 99 | 0 100 | 2142676368960249273201468743722821448455) 101 | :: 102 | (SPock_certif 103 | 9712394219642379823093313355477936401 104 | 2 105 | ((7790709714827945424165198499, 1)::nil)) 106 | :: 107 | (Ell_certif 108 | 7790709714827945424165198499 109 | 19812 110 | ((393231865274990771473861,1)::nil) 111 | 0 112 | 1080 113 | 6 114 | 36) 115 | :: 116 | (Ell_certif 117 | 393231865274990771473861 118 | 525 119 | ((749013076712203103083,1)::nil) 120 | 0 121 | 500 122 | 5 123 | 25) 124 | :: 125 | (SPock_certif 126 | 749013076712203103083 127 | 2 128 | ((61769180002655707, 1)::nil)) 129 | :: 130 | (SPock_certif 131 | 61769180002655707 132 | 2 133 | ((27748957772981, 1)::nil)) 134 | :: (Proof_certif 27748957772981 prime27748957772981) :: nil)). 135 | vm_cast_no_check (refl_equal true). 136 | Time Qed. 137 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime8.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime1428863796293 : prime 1428863796293. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 1428863796293 2 ((5521, 1)::(2,2)::nil) 39360) 10 | ((Proof_certif 5521 prime5521) :: 11 | (Proof_certif 2 prime2) :: 12 | nil)). 13 | vm_cast_no_check (refl_equal true). 14 | Qed. 15 | 16 | Lemma prime890123456789012345678901234567890123456789012345678901234567890123456789173: prime 890123456789012345678901234567890123456789012345678901234567890123456789173. 17 | apply (Pocklington_refl 18 | 19 | (Ell_certif 20 | 890123456789012345678901234567890123456789012345678901234567890123456789173 21 | 8157 22 | ((109123876031508194885239822798564438326984028833593131325708554662494431,1)::nil) 23 | 0 24 | 6912 25 | 24 26 | 144) 27 | ( 28 | (Ell_certif 29 | 109123876031508194885239822798564438326984028833593131325708554662494431 30 | 23126 31 | ((4718666264442973055662017763494094857332768848910597827514106537269,1)::nil) 32 | 75086423499566443626294790461747896159635481549407206330838166528837345 33 | 59953269250185783651557418217622427910089096673128817048258912126221366 34 | 0 35 | 82899844225043528315881252052116704460417867294689765206259949533005158) 36 | :: 37 | (Ell_certif 38 | 4718666264442973055662017763494094857332768848910597827514106537269 39 | 6154934806532 40 | ((766647643356876932190231753946036742091898972419711353,1)::nil) 41 | 900 42 | 0 43 | 90 44 | 900) 45 | :: 46 | (Ell_certif 47 | 766647643356876932190231753946036742091898972419711353 48 | 432 49 | ((1774647322585363268958869804318404498357590845516267,1)::nil) 50 | 111886407845002772474570366365409298112033165382738455 51 | 752469734628528106621455495761382810994729448598465265 52 | 0 53 | 223244498068698190097254653622960681088833419085712351) 54 | :: 55 | (Ell_certif 56 | 1774647322585363268958869804318404498357590845516267 57 | 3484036 58 | ((509365380433888532999908672890634937587338727,1)::nil) 59 | 1774647322585363268958869804318404498336845014040107 60 | 36370126051009921296 61 | 0 62 | 6030764964) 63 | :: 64 | (SPock_certif 65 | 509365380433888532999908672890634937587338727 66 | 2 67 | ((84894230072314755499984778815105822931223121, 1)::nil)) 68 | :: 69 | (Ell_certif 70 | 84894230072314755499984778815105822931223121 71 | 1332936 72 | ((63689652070553091446225773835726149979,1)::nil) 73 | 84894230072314755499984778815105822931129041 74 | 9834496 75 | 0 76 | 3136) 77 | :: 78 | (SPock_certif 79 | 63689652070553091446225773835726149979 80 | 2 81 | ((18538246409960803251808677733, 1)::nil)) 82 | :: 83 | (Ell_certif 84 | 18538246409960803251808677733 85 | 22305783 86 | ((831095972284889937607,1)::nil) 87 | 0 88 | 6912 89 | 24 90 | 144) 91 | :: 92 | (SPock_certif 93 | 831095972284889937607 94 | 2 95 | ((1428863796293, 1)::nil)) 96 | :: (Proof_certif 1428863796293 prime1428863796293) :: nil)). 97 | vm_cast_no_check (refl_equal true). 98 | Time Qed. 99 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/prime9.v: -------------------------------------------------------------------------------- 1 | Require Import PocklingtonRefl. 2 | 3 | 4 | Local Open Scope positive_scope. 5 | 6 | Lemma prime4508941553 : prime 4508941553. 7 | Proof. 8 | apply (Pocklington_refl 9 | (Pock_certif 4508941553 3 ((16576991, 1)::(2,4)::nil) 1) 10 | ((Pock_certif 16576991 7 ((1657699, 1)::(2,1)::nil) 1) :: 11 | (Pock_certif 1657699 2 ((29, 1)::(3, 1)::(2,1)::nil) 130) :: 12 | (Proof_certif 29 prime29) :: 13 | (Proof_certif 3 prime3) :: 14 | (Proof_certif 2 prime2) :: 15 | nil)). 16 | vm_cast_no_check (refl_equal true). 17 | Qed. 18 | 19 | Lemma prime901234567890123456789012345678901234567890123456789012345678901234567890211: prime 901234567890123456789012345678901234567890123456789012345678901234567890211. 20 | apply (Pocklington_refl 21 | 22 | (Ell_certif 23 | 901234567890123456789012345678901234567890123456789012345678901234567890211 24 | 4050731092 25 | ((222486891235515136186930165563036894503916729222810524577723178123,1)::nil) 26 | 0 27 | 524546682092298418209229841820922984182092298418209229841820922984182092233 28 | 450617283945061728394506172839450617283945061728394506172839450617283945121 29 | 281635802465663580246566358024656635802465663580246566358024656635802465751) 30 | ( 31 | (Ell_certif 32 | 222486891235515136186930165563036894503916729222810524577723178123 33 | 107024 34 | ((2078850456304334879904789258138711748572189593279863874430709,1)::nil) 35 | 222486891235515136186930165563036894503916729222810524577722841983 36 | 92236816 37 | 0 38 | 9604) 39 | :: 40 | (Ell_certif 41 | 2078850456304334879904789258138711748572189593279863874430709 42 | 228 43 | ((9117765159229538946950830079552831972482624828665900683671,1)::nil) 44 | 0 45 | 192 46 | 4 47 | 16) 48 | :: 49 | (Ell_certif 50 | 9117765159229538946950830079552831972482624828665900683671 51 | 14591416 52 | ((624871853371155955457018707393787749486143125084059,1)::nil) 53 | 9117765159229538946950830079552831972482624828665900603031 54 | 10838016 55 | 240 56 | 2304) 57 | :: 58 | (Ell_certif 59 | 624871853371155955457018707393787749486143125084059 60 | 3252 61 | ((192150016411794574248775724948189993781867541981,1)::nil) 62 | 0 63 | 419904 64 | 108 65 | 1296) 66 | :: 67 | (Ell_certif 68 | 192150016411794574248775724948189993781867541981 69 | 36075 70 | ((5326403781338726936903009916273800504055847,1)::nil) 71 | 0 72 | 500 73 | 5 74 | 25) 75 | :: 76 | (Ell_certif 77 | 5326403781338726936903009916273800504055847 78 | 14243 79 | ((373966424302374986793941983713669426703,1)::nil) 80 | 5326403781338726936903009916256563841237607 81 | 27544082901737469648 82 | 141572 83 | 5010657796) 84 | :: 85 | (Ell_certif 86 | 373966424302374986793941983713669426703 87 | 927 88 | ((403415775946467083950818227317015681,1)::nil) 89 | 0 90 | 44851536 91 | 705 92 | 19881) 93 | :: 94 | (SPock_certif 95 | 403415775946467083950818227317015681 96 | 2 97 | ((50239402180479521590404073, 1)::nil)) 98 | :: 99 | (Ell_certif 100 | 50239402180479521590404073 101 | 386113 102 | ((130115800764195271033,1)::nil) 103 | 0 104 | 1080 105 | 6 106 | 36) 107 | :: 108 | (SPock_certif 109 | 130115800764195271033 110 | 2 111 | ((774498814072590899, 1)::nil)) 112 | :: 113 | (SPock_certif 114 | 774498814072590899 115 | 2 116 | ((387249407036295449, 1)::nil)) 117 | :: 118 | (Ell_certif 119 | 387249407036295449 120 | 85884770 121 | ((4508941553,1)::nil) 122 | 242079864415856010 123 | 0 124 | 338859559496148969 125 | 290469711956002490) 126 | :: (Proof_certif 4508941553 prime4508941553) :: nil)). 127 | vm_cast_no_check (refl_equal true). 128 | Time Qed. 129 | -------------------------------------------------------------------------------- /src/Coqprime/examples/t75/res: -------------------------------------------------------------------------------- 1 | Finished transaction in 39. secs (39.091057u,0.153977s) 2 | Finished transaction in 37. secs (36.682423u,0.154977s) 3 | Finished transaction in 79. secs (79.045983u,0.167974s) 4 | Finished transaction in 90. secs (89.222437u,0.158976s) 5 | Finished transaction in 24. secs (23.688399u,0.114983s) 6 | Finished transaction in 6. secs (5.634144u,0.084987s) 7 | Finished transaction in 97. secs (96.794285u,0.125981s) 8 | Finished transaction in 79. secs (78.935001u,0.139979s) 9 | Finished transaction in 23. secs (23.017501u,0.105983s) 10 | -------------------------------------------------------------------------------- /src/Coqprime/num/Bits.v: -------------------------------------------------------------------------------- 1 | Require Import ZArith Zpow_facts. 2 | 3 | Open Scope Z_scope. 4 | 5 | Fixpoint plength (p: positive) : positive := 6 | match p with 7 | xH => xH 8 | | xO p1 => Pos.succ (plength p1) 9 | | xI p1 => Pos.succ (plength p1) 10 | end. 11 | 12 | Theorem plength_correct: forall p, (Zpos p < 2 ^ Zpos (plength p))%Z. 13 | assert (F: (forall p, 2 ^ (Zpos (Pos.succ p)) = 2 * 2 ^ Zpos p)%Z). 14 | intros p; replace (Zpos (Pos.succ p)) with (1 + Zpos p)%Z. 15 | rewrite Zpower_exp. 1-2: auto with zarith. 16 | red; intros; discriminate. 17 | rewrite Zpos_succ_morphism; unfold Z.succ; auto with zarith. 18 | intros p; elim p; simpl plength; auto. 19 | intros p1 Hp1; rewrite F; repeat rewrite Zpos_xI. 20 | assert (tmp: (forall p, 2 * p = p + p)%Z); 21 | try repeat rewrite tmp; auto with zarith. 22 | intros p1 Hp1; rewrite F; rewrite (Zpos_xO p1). 23 | assert (tmp: (forall p, 2 * p = p + p)%Z); 24 | try repeat rewrite tmp; auto with zarith. 25 | rewrite Zpower_1_r; auto with zarith. 26 | Qed. 27 | 28 | Theorem plength_pred_correct: forall p, (Zpos p <= 2 ^ Zpos (plength (Pos.pred p)))%Z. 29 | intros p; case (Psucc_pred p); intros H1. 30 | subst; simpl plength. 31 | rewrite Zpower_1_r; auto with zarith. 32 | pattern p at 1; rewrite <- H1. 33 | rewrite Zpos_succ_morphism; unfold Z.succ; auto with zarith. 34 | generalize (plength_correct (Pos.pred p)); auto with zarith. 35 | Qed. 36 | 37 | Definition Pdiv p q := 38 | match Z.div (Zpos p) (Zpos q) with 39 | Zpos q1 => match (Zpos p) - (Zpos q) * (Zpos q1) with 40 | Z0 => q1 41 | | _ => (Pos.succ q1) 42 | end 43 | | _ => xH 44 | end. 45 | 46 | Theorem Pdiv_le: forall p q, 47 | Zpos p <= Zpos q * Zpos (Pdiv p q). 48 | intros p q. 49 | unfold Pdiv. 50 | assert (H1: Zpos q > 0); auto with zarith. 51 | assert (H1b: Zpos p >= 0). 52 | red; intros; discriminate. 53 | generalize (Z_div_ge0 (Zpos p) (Zpos q) H1 H1b). 54 | generalize (Z_div_mod_eq_full (Zpos p) (Zpos q)); case Z.div. 55 | intros HH _; rewrite HH; rewrite Zmult_0_r; rewrite Zmult_1_r; simpl. 56 | case (Z_mod_lt (Zpos p) (Zpos q) H1); auto with zarith. 57 | intros q1 H2. 58 | replace (Zpos p - Zpos q * Zpos q1) with (Zpos p mod Zpos q). 59 | 2: pattern (Zpos p) at 2; rewrite H2; auto with zarith. 60 | generalize H2 (Z_mod_lt (Zpos p) (Zpos q) H1); clear H2; 61 | case Z.modulo. 62 | intros HH _; rewrite HH; auto with zarith. 63 | intros r1 HH (_,HH1); rewrite HH; rewrite Zpos_succ_morphism. 64 | unfold Z.succ; rewrite Zmult_plus_distr_r; auto with zarith. 65 | intros r1 _ (HH,_); case HH; auto. 66 | intros q1 HH; rewrite HH. 67 | unfold Z.ge; simpl Z.compare; intros HH1; case HH1; auto. 68 | Qed. 69 | 70 | Definition is_one p := match p with xH => true | _ => false end. 71 | 72 | Theorem is_one_one: forall p, is_one p = true -> p = xH. 73 | intros p; case p; auto; intros p1 H1; discriminate H1. 74 | Qed. 75 | 76 | Definition get_height digits p := 77 | let r := Pdiv p digits in 78 | if is_one r then xH else Pos.succ (plength (Pos.pred r)). 79 | 80 | Theorem get_height_correct: 81 | forall digits N, 82 | Zpos N <= Zpos digits * (2 ^ (Zpos (get_height digits N) -1)). 83 | intros digits N. 84 | unfold get_height. 85 | assert (H1 := Pdiv_le N digits). 86 | case_eq (is_one (Pdiv N digits)); intros H2. 87 | rewrite (is_one_one _ H2) in H1. 88 | rewrite Zmult_1_r in H1. 89 | change (2^(1-1))%Z with 1; rewrite Zmult_1_r; auto. 90 | clear H2. 91 | apply Z.le_trans with (1 := H1). 92 | apply Zmult_le_compat_l; auto with zarith. 93 | rewrite Zpos_succ_morphism; unfold Z.succ. 94 | rewrite Zplus_comm; rewrite Zminus_plus. 95 | apply plength_pred_correct. 96 | Qed. 97 | -------------------------------------------------------------------------------- /src/Coqprime/num/Int63Compat.v.v811: -------------------------------------------------------------------------------- 1 | From Coq Require Export Int63. 2 | -------------------------------------------------------------------------------- /src/Coqprime/num/Int63Compat.v.v812: -------------------------------------------------------------------------------- 1 | From Coq Require Export Int63. 2 | -------------------------------------------------------------------------------- /src/Coqprime/num/Int63Compat.v.v813: -------------------------------------------------------------------------------- 1 | From Coq Require Export Int63. 2 | -------------------------------------------------------------------------------- /src/Coqprime/num/Int63Compat.v.v814: -------------------------------------------------------------------------------- 1 | From Coq Require Export Int63. 2 | -------------------------------------------------------------------------------- /src/Coqprime/num/Int63Compat.v.v815: -------------------------------------------------------------------------------- 1 | From Coq Require Export Int63. 2 | -------------------------------------------------------------------------------- /src/Coqprime/num/Int63Compat.v.v816: -------------------------------------------------------------------------------- 1 | From Coq Require Export Uint63. 2 | -------------------------------------------------------------------------------- /src/Coqprime/num/Nbasic.v: -------------------------------------------------------------------------------- 1 | Require Import ZArith. 2 | Require Import Basic_type. 3 | 4 | 5 | Definition zn2z_word_comm : forall w n, zn2z (word w n) = word (zn2z w) n. 6 | fix zn2z_word_comm 2. 7 | intros w n; case n. 8 | reflexivity. 9 | intros n0;simpl. 10 | case (zn2z_word_comm w n0). 11 | reflexivity. 12 | Defined. 13 | 14 | Fixpoint extend (n:nat) {struct n} : forall w:Set, zn2z w -> word w (S n) := 15 | match n return forall w:Set, zn2z w -> word w (S n) with 16 | | O => fun w x => x 17 | | S m => 18 | let aux := extend m in 19 | fun w x => WW W0 (aux w x) 20 | end. 21 | 22 | Section ExtendMax. 23 | 24 | Variable w:Set. 25 | 26 | Definition Tmax n m := 27 | ( {p:nat| word (word w n) p = word w m} 28 | + {p:nat| word (word w m) p = word w n})%type. 29 | 30 | Definition max : forall n m, Tmax n m. 31 | fix max 1;intros n. 32 | case n. 33 | intros m;left;exists m;exact (refl_equal (word w m)). 34 | intros n0 m;case m. 35 | right;exists (S n0);exact (refl_equal (word w (S n0))). 36 | intros m0;case (max n0 m0);intros H;case H;intros p Heq. 37 | left;exists p;simpl. 38 | case (zn2z_word_comm (word w n0) p). 39 | case Heq. 40 | exact (refl_equal (zn2z (word (word w n0) p))). 41 | right;exists p;simpl. 42 | case (zn2z_word_comm (word w m0) p). 43 | case Heq. 44 | exact (refl_equal (zn2z (word (word w m0) p))). 45 | Defined. 46 | 47 | Definition extend_to_max : 48 | forall n m (x:zn2z (word w n)) (y:zn2z (word w m)), 49 | (zn2z (word w m) + zn2z (word w n))%type. 50 | intros n m x y. 51 | case (max n m);intros (p, Heq). 52 | left; case Heq;exact (extend p (word w n) x). 53 | right;case Heq;exact (extend p (word w m) y). 54 | Defined. 55 | 56 | End ExtendMax. 57 | 58 | Section Reduce. 59 | 60 | Variable w : Set. 61 | Variable nT : Set. 62 | Variable N0 : nT. 63 | Variable eq0 : w -> bool. 64 | Variable reduce_n : w -> nT. 65 | Variable zn2z_to_Nt : zn2z w -> nT. 66 | 67 | Definition reduce_n1 (x:zn2z w) := 68 | match x with 69 | | W0 => N0 70 | | WW xh xl => 71 | if eq0 xh then reduce_n xl 72 | else zn2z_to_Nt x 73 | end. 74 | 75 | End Reduce. 76 | 77 | Section ReduceRec. 78 | 79 | Variable w : Set. 80 | Variable nT : Set. 81 | Variable N0 : nT. 82 | Variable reduce_1n : zn2z w -> nT. 83 | Variable c : forall n, word w (S n) -> nT. 84 | 85 | Fixpoint reduce_n (n:nat) : word w (S n) -> nT := 86 | match n return word w (S n) -> nT with 87 | | O => reduce_1n 88 | | S m => fun x => 89 | match x with 90 | | W0 => N0 91 | | WW xh xl => 92 | match xh with 93 | | W0 => @reduce_n m xl 94 | | _ => @c (S m) x 95 | end 96 | end 97 | end. 98 | 99 | End ReduceRec. 100 | 101 | Definition opp_compare cmp := 102 | match cmp with 103 | | Lt => Gt 104 | | Eq => Eq 105 | | Gt => Lt 106 | end. 107 | 108 | Section CompareRec. 109 | 110 | Variable wm w : Set. 111 | Variable w_0 : w. 112 | Variable compare : w -> w -> comparison. 113 | Variable compare0_m : wm -> comparison. 114 | Variable compare_m : wm -> w -> comparison. 115 | 116 | Fixpoint compare0_mn (n:nat) : word wm n -> comparison := 117 | match n return word wm n -> comparison with 118 | | 0 => compare0_m 119 | | S m => fun x => 120 | match x with 121 | | W0 => Eq 122 | | WW xh xl => 123 | match compare0_mn m xh with 124 | | Eq => compare0_mn m xl 125 | | r => Lt 126 | end 127 | end 128 | end. 129 | 130 | Fixpoint compare_mn_1 (n:nat) : word wm n -> w -> comparison := 131 | match n return word wm n -> w -> comparison with 132 | | 0 => compare_m 133 | | S m => fun x y => 134 | match x with 135 | | W0 => compare w_0 y 136 | | WW xh xl => 137 | match compare0_mn m xh with 138 | | Eq => compare_mn_1 m xl y 139 | | r => Gt 140 | end 141 | end 142 | end. 143 | 144 | End CompareRec. 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/.depend: -------------------------------------------------------------------------------- 1 | basic_type.cmo: zpower.cmi binPos.cmi binInt.cmi basic_type.cmi 2 | basic_type.cmx: zpower.cmx binPos.cmx binInt.cmx basic_type.cmi 3 | binInt.cmo: datatypes.cmi binPos.cmi binNat.cmi binInt.cmi 4 | binInt.cmx: datatypes.cmx binPos.cmx binNat.cmx binInt.cmi 5 | binNat.cmo: datatypes.cmi binPos.cmi binNat.cmi 6 | binNat.cmx: datatypes.cmx binPos.cmx binNat.cmi 7 | binPos.cmo: peano.cmi datatypes.cmi binPos.cmi 8 | binPos.cmx: peano.cmx datatypes.cmx binPos.cmi 9 | datatypes.cmo: datatypes.cmi 10 | datatypes.cmx: datatypes.cmi 11 | genBase.cmo: datatypes.cmi binPos.cmi binInt.cmi basic_type.cmi genBase.cmi 12 | genBase.cmx: datatypes.cmx binPos.cmx binInt.cmx basic_type.cmx genBase.cmi 13 | genDivn1.cmo: genBase.cmi datatypes.cmi binPos.cmi binNat.cmi basic_type.cmi \ 14 | genDivn1.cmi 15 | genDivn1.cmx: genBase.cmx datatypes.cmx binPos.cmx binNat.cmx basic_type.cmx \ 16 | genDivn1.cmi 17 | genLift.cmo: datatypes.cmi binPos.cmi binNat.cmi basic_type.cmi genLift.cmi 18 | genLift.cmx: datatypes.cmx binPos.cmx binNat.cmx basic_type.cmx genLift.cmi 19 | genSqrt.cmo: genBase.cmi datatypes.cmi binPos.cmi binNat.cmi basic_type.cmi \ 20 | genSqrt.cmi 21 | genSqrt.cmx: genBase.cmx datatypes.cmx binPos.cmx binNat.cmx basic_type.cmx \ 22 | genSqrt.cmi 23 | genWord.cmo: znZ.cmi zn2Z.cmi datatypes.cmi binPos.cmi binNat.cmi binInt.cmi \ 24 | basic_type.cmi genWord.cmi 25 | genWord.cmx: znZ.cmx zn2Z.cmx datatypes.cmx binPos.cmx binNat.cmx binInt.cmx \ 26 | basic_type.cmx genWord.cmi 27 | logic.cmo: logic.cmi 28 | logic.cmx: logic.cmi 29 | lucas.cmo: zpower.cmi znZ.cmi zmisc.cmi mod_op.cmi datatypes.cmi binPos.cmi \ 30 | binInt.cmi lucas.cmi 31 | lucas.cmx: zpower.cmx znZ.cmx zmisc.cmx mod_op.cmx datatypes.cmx binPos.cmx \ 32 | binInt.cmx lucas.cmi 33 | mod_op.cmo: znZ.cmi genLift.cmi datatypes.cmi binPos.cmi binNat.cmi \ 34 | basic_type.cmi mod_op.cmi 35 | mod_op.cmx: znZ.cmx genLift.cmx datatypes.cmx binPos.cmx binNat.cmx \ 36 | basic_type.cmx mod_op.cmi 37 | peano.cmo: datatypes.cmi peano.cmi 38 | peano.cmx: datatypes.cmx peano.cmi 39 | testlucas.cmo: zpower.cmi znZ.cmi zn2Z.cmi zmisc.cmi w64C.cmo w31C.cmo \ 40 | mod_op.cmi datatypes.cmi binPos.cmi binNat.cmi binInt.cmi basic_type.cmi 41 | testlucas.cmx: zpower.cmx znZ.cmx zn2Z.cmx zmisc.cmx w64C.cmx w31C.cmx \ 42 | mod_op.cmx datatypes.cmx binPos.cmx binNat.cmx binInt.cmx basic_type.cmx 43 | w31C.cmo: zpower.cmi znZ.cmi zn2Z.cmi zmisc.cmi mod_op.cmi datatypes.cmi \ 44 | binPos.cmi binNat.cmi binInt.cmi basic_type.cmi 45 | w31C.cmx: zpower.cmx znZ.cmx zn2Z.cmx zmisc.cmx mod_op.cmx datatypes.cmx \ 46 | binPos.cmx binNat.cmx binInt.cmx basic_type.cmx 47 | w31.cmo: zpower.cmi znZ.cmi zmisc.cmi mod_op.cmi genWord.cmi datatypes.cmi \ 48 | binPos.cmi binNat.cmi binInt.cmi basic_type.cmi 49 | w31.cmx: zpower.cmx znZ.cmx zmisc.cmx mod_op.cmx genWord.cmx datatypes.cmx \ 50 | binPos.cmx binNat.cmx binInt.cmx basic_type.cmx 51 | w64C.cmo: zpower.cmi znZ.cmi zn2Z.cmi zmisc.cmi mod_op.cmi datatypes.cmi \ 52 | binPos.cmi binNat.cmi binInt.cmi basic_type.cmi 53 | w64C.cmx: zpower.cmx znZ.cmx zn2Z.cmx zmisc.cmx mod_op.cmx datatypes.cmx \ 54 | binPos.cmx binNat.cmx binInt.cmx basic_type.cmx 55 | w64.cmo: zpower.cmi znZ.cmi zn2Z.cmi zmisc.cmi mod_op.cmi genWord.cmi \ 56 | datatypes.cmi binPos.cmi binNat.cmi binInt.cmi basic_type.cmi 57 | w64.cmx: zpower.cmx znZ.cmx zn2Z.cmx zmisc.cmx mod_op.cmx genWord.cmx \ 58 | datatypes.cmx binPos.cmx binNat.cmx binInt.cmx basic_type.cmx 59 | zmisc.cmo: datatypes.cmi binPos.cmi binInt.cmi zmisc.cmi 60 | zmisc.cmx: datatypes.cmx binPos.cmx binInt.cmx zmisc.cmi 61 | zn2Z.cmo: znZ.cmi genSqrt.cmi genDivn1.cmi genBase.cmi datatypes.cmi \ 62 | binPos.cmi binNat.cmi basic_type.cmi zn2Z.cmi 63 | zn2Z.cmx: znZ.cmx genSqrt.cmx genDivn1.cmx genBase.cmx datatypes.cmx \ 64 | binPos.cmx binNat.cmx basic_type.cmx zn2Z.cmi 65 | znZ.cmo: datatypes.cmi binPos.cmi binNat.cmi binInt.cmi basic_type.cmi \ 66 | znZ.cmi 67 | znZ.cmx: datatypes.cmx binPos.cmx binNat.cmx binInt.cmx basic_type.cmx \ 68 | znZ.cmi 69 | zpower.cmo: zmisc.cmi logic.cmi datatypes.cmi binPos.cmi binInt.cmi \ 70 | zpower.cmi 71 | zpower.cmx: zmisc.cmx logic.cmx datatypes.cmx binPos.cmx binInt.cmx \ 72 | zpower.cmi 73 | basic_type.cmi: zpower.cmi binPos.cmi binInt.cmi 74 | binInt.cmi: datatypes.cmi binPos.cmi binNat.cmi 75 | binNat.cmi: datatypes.cmi binPos.cmi 76 | binPos.cmi: peano.cmi datatypes.cmi 77 | genBase.cmi: datatypes.cmi binPos.cmi binInt.cmi basic_type.cmi 78 | genDivn1.cmi: genBase.cmi datatypes.cmi binPos.cmi binNat.cmi basic_type.cmi 79 | genLift.cmi: datatypes.cmi binPos.cmi binNat.cmi basic_type.cmi 80 | genSqrt.cmi: genBase.cmi datatypes.cmi binPos.cmi binNat.cmi basic_type.cmi 81 | genWord.cmi: znZ.cmi zn2Z.cmi datatypes.cmi binPos.cmi binNat.cmi binInt.cmi \ 82 | basic_type.cmi 83 | lucas.cmi: zpower.cmi znZ.cmi zmisc.cmi mod_op.cmi datatypes.cmi binPos.cmi \ 84 | binInt.cmi 85 | mod_op.cmi: znZ.cmi genLift.cmi datatypes.cmi binPos.cmi binNat.cmi \ 86 | basic_type.cmi 87 | peano.cmi: datatypes.cmi 88 | zmisc.cmi: datatypes.cmi binPos.cmi binInt.cmi 89 | zn2Z.cmi: znZ.cmi genSqrt.cmi genDivn1.cmi genBase.cmi datatypes.cmi \ 90 | binPos.cmi binNat.cmi basic_type.cmi 91 | znZ.cmi: datatypes.cmi binPos.cmi binNat.cmi binInt.cmi basic_type.cmi 92 | zpower.cmi: zmisc.cmi logic.cmi datatypes.cmi binPos.cmi binInt.cmi 93 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLC=ocamlc 2 | OCAMLOPT=ocamlopt 3 | OCAMLDEP=ocamldep 4 | OCAMLLIB=eval ocamlc -where 5 | 6 | GENML = datatypes.ml logic.ml peano.ml \ 7 | binPos.ml binNat.ml binInt.ml \ 8 | zmisc.ml zpower.ml basic_type.ml \ 9 | genBase.ml genDivn1.ml genSqrt.ml genLift.ml \ 10 | znZ.ml zn2Z.ml genWord.ml mod_op.ml 11 | 12 | GENMLI=$(GENML:.ml=.mli) 13 | 14 | MLSOURCES=$(GENML) w31C.ml w64C.ml testlucas.ml 15 | 16 | CMX=$(MLSOURCES:.ml=.cmx) 17 | CM0=$(MLSOURCES:.ml=.cmo) 18 | 19 | 20 | testlucas: $(CMX) uint31C.o uint64C.o 21 | $(OCAMLOPT) -o testlucas nums.cmxa uint31C.o uint64C.o $(CMX) 22 | 23 | testlucas.byte: $(CM0) uint31C.o uint64C.o 24 | $(OCAMLC) -o testlucas.byte nums.cma -custom uint31C.o uint64C.o $(CM0) 25 | 26 | uint31C.o: uint31C.c 27 | $(OCAMLOPT) -c uint31C.c 28 | 29 | uint64C.o: uint64C.c 30 | $(OCAMLOPT) -c uint64C.c 31 | 32 | clean_gen: 33 | rm -f $(GENML) $(GENMLI) *~ 34 | 35 | clean_comp: 36 | rm -f test31C test64 *.cmi *.cmx *.o *~ *~ 37 | 38 | clean: clean_gen clean_comp 39 | 40 | .SUFFIXES: .ml .mli .cmo .cmi .cmx 41 | 42 | .ml.cmo: 43 | $(OCAMLC) -c $< 44 | 45 | .mli.cmi: 46 | $(OCAMLC) -c $< 47 | 48 | .ml.cmx: 49 | $(OCAMLOPT) -c $< 50 | 51 | 52 | depend: 53 | $(OCAMLDEP) *.ml *.mli > .depend 54 | 55 | include .depend 56 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/coq_gc.h: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* Coq Compiler */ 4 | /* */ 5 | /* Benjamin Gregoire, projets Logical and Cristal */ 6 | /* INRIA Rocquencourt */ 7 | /* */ 8 | /* */ 9 | /***********************************************************************/ 10 | 11 | #ifndef _COQ_CAML_GC_ 12 | #define _COQ_CAML_GC_ 13 | #include "caml/mlvalues.h" 14 | #include "caml/alloc.h" 15 | 16 | typedef void (*scanning_action) (value, value *); 17 | 18 | 19 | CAMLextern char *young_ptr; 20 | CAMLextern char *young_limit; 21 | CAMLextern void (*scan_roots_hook) (scanning_action); 22 | CAMLextern void minor_collection (void); 23 | 24 | #define Caml_white (0 << 8) 25 | #define Caml_black (3 << 8) 26 | 27 | #define Make_header(wosize, tag, color) \ 28 | (((header_t) (((header_t) (wosize) << 10) \ 29 | + (color) \ 30 | + (tag_t) (tag))) \ 31 | ) 32 | 33 | 34 | #define Alloc_small(result, wosize, tag) do{ \ 35 | young_ptr -= Bhsize_wosize (wosize); \ 36 | if (young_ptr < young_limit){ \ 37 | young_ptr += Bhsize_wosize (wosize); \ 38 | minor_collection (); \ 39 | young_ptr -= Bhsize_wosize (wosize); \ 40 | } \ 41 | Hd_hp (young_ptr) = Make_header ((wosize), (tag), Caml_black); \ 42 | (result) = Val_hp (young_ptr); \ 43 | }while(0) 44 | 45 | 46 | #endif /*_COQ_CAML_GC_ */ 47 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/extract.v: -------------------------------------------------------------------------------- 1 | Require Import GenWord. 2 | Require Import Mod_op. 3 | Require Import Lucas. 4 | 5 | Unset Extraction Optimize. 6 | Unset Extraction AutoInline. 7 | 8 | Recursive Extraction Library GenWord. 9 | Recursive Extraction Library Mod_op. 10 | Recursive Extraction Library Lucas. 11 | 12 | coqtop -I ../ -I ../../Tactic -I ../../N -I ../../Z -I ../../PrimalityTest -I ../../List -I ../W/W8 13 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/lucas.ml: -------------------------------------------------------------------------------- 1 | open BinInt 2 | open BinPos 3 | open Datatypes 4 | open Mod_op 5 | open Zmisc 6 | open ZnZ 7 | open Zpower 8 | 9 | (** val znz_of_Z : 'a1 znz_op -> coq_Z -> 'a1 **) 10 | 11 | let znz_of_Z op = function 12 | | Z0 -> op.znz_0 13 | | Zpos p -> snd (op.znz_of_pos p) 14 | | Zneg p -> op.znz_0 15 | 16 | (** val lucastest : 'a1 znz_op -> positive -> coq_Z **) 17 | 18 | let lucastest op p = 19 | let b = 20 | znz_of_Z op 21 | (coq_Zminus (coq_Zpower (Zpos (Coq_xO Coq_xH)) (Zpos p)) (Zpos Coq_xH)) 22 | in 23 | let mod_op = make_mod_op op b in 24 | let w2 = op.znz_add op.znz_1 op.znz_1 in 25 | let w4 = op.znz_add w2 w2 in 26 | let square_m2 = 27 | let square = fun x -> mod_op.square_mod x in 28 | let sub = fun x x0 -> mod_op.sub_mod x x0 in (fun x -> sub (square x) w2) 29 | in 30 | op.znz_to_Z (iter_pos (coq_Pminus p (Coq_xO Coq_xH)) square_m2 w4) 31 | 32 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/lucas.mli: -------------------------------------------------------------------------------- 1 | open BinInt 2 | open BinPos 3 | open Datatypes 4 | open Mod_op 5 | open Zmisc 6 | open ZnZ 7 | open Zpower 8 | 9 | val znz_of_Z : 'a1 znz_op -> coq_Z -> 'a1 10 | 11 | val lucastest : 'a1 znz_op -> positive -> coq_Z 12 | 13 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/testlucas.ml: -------------------------------------------------------------------------------- 1 | open Datatypes 2 | open BinPos 3 | open BinNat 4 | open BinInt 5 | open Zpower 6 | open Zmisc 7 | open Basic_type 8 | open ZnZ 9 | open Zn2Z 10 | open Mod_op 11 | open W31C 12 | open W64C 13 | 14 | let znz_of_Z op = function 15 | | Z0 -> op.znz_0 16 | | Zpos p -> snd (op.znz_of_pos p) 17 | | Zneg p -> op.znz_0 18 | 19 | (** val lucastest : 'a1 znz_op -> positive -> coq_Z **) 20 | 21 | let lucastest op p = 22 | let b = 23 | znz_of_Z op 24 | (coq_Zminus (coq_Zpower (Zpos (Coq_xO Coq_xH)) (Zpos p)) (Zpos Coq_xH)) 25 | in 26 | let mod_op = make_mod_op op b in 27 | let w2 = op.znz_add op.znz_1 op.znz_1 in 28 | let w4 = op.znz_add w2 w2 in 29 | let square_m2 = 30 | let square = mod_op.square_mod in 31 | let sub = mod_op.sub_mod in 32 | fun x -> sub (square x) w2 33 | in 34 | let t = Sys.time () in 35 | let res = 36 | iter_pos (coq_Pminus p (Coq_xO Coq_xH)) square_m2 w4 in 37 | let time = Sys.time () -. t in 38 | Format.print_string "Finished in "; 39 | Format.print_float time; 40 | (match op.znz_compare op.znz_0 res with 41 | | Eq -> Format.print_string "s, result is 0\n" 42 | | _ -> Format.print_string "s, result is not 0\n"); 43 | Format.print_flush() 44 | 45 | let mlucastest op p = 46 | let b = 47 | znz_of_Z op 48 | (coq_Zminus (coq_Zpower (Zpos (Coq_xO Coq_xH)) (Zpos p)) (Zpos Coq_xH)) 49 | in 50 | let mod_op = mmake_mod_op op b p (coq_Pminus (Coq_xO op.znz_digits) p) in 51 | let w2 = op.znz_add op.znz_1 op.znz_1 in 52 | let w4 = op.znz_add w2 w2 in 53 | let square_m2 = 54 | let square = mod_op.square_mod in 55 | let sub = mod_op.sub_mod in 56 | fun x -> sub (square x) w2 57 | in 58 | let t = Sys.time () in 59 | let res = 60 | iter_pos (coq_Pminus p (Coq_xO Coq_xH)) square_m2 w4 in 61 | let time = Sys.time () -. t in 62 | Format.print_string "Finished in "; 63 | Format.print_float time; 64 | (match op.znz_compare op.znz_0 res with 65 | | Eq -> Format.print_string "s, result is 0\n" 66 | | _ -> Format.print_string "s, result is not 0\n"); 67 | Format.print_flush() 68 | 69 | let bi_lucastest p = 70 | let b = Big_int.pred_big_int (Big_int.power_int_positive_int 2 p) in 71 | let square_m2 x = 72 | Big_int.mod_big_int 73 | (Big_int.sub_big_int(Big_int.square_big_int x)(Big_int.big_int_of_int 2)) 74 | b in 75 | let t = Sys.time () in 76 | let res = 77 | iter_pos (coq_Pminus (uint_to_pos p) (Coq_xO Coq_xH)) square_m2 78 | (Big_int.big_int_of_int 4) 79 | in 80 | let time = Sys.time () -. t in 81 | Format.print_string "Finished in "; 82 | Format.print_float time; 83 | if Big_int.eq_big_int res Big_int.zero_big_int then 84 | Format.print_string "s, result is 0\n" 85 | else Format.print_string "s, result is not 0\n"; 86 | Format.print_flush() 87 | 88 | 89 | let _ = mlucastest w31_7_op (uint_to_pos 3217) 90 | 91 | let mk_test op31 op64 n = 92 | Format.printf "test mersenne %i\n" n; 93 | print_string "w31C : "; 94 | mlucastest op31 (uint_to_pos n); 95 | print_string "w64C : "; 96 | mlucastest op64 (uint_to_pos n); 97 | print_string "Big_int : "; 98 | bi_lucastest n; 99 | print_string "\n\n" 100 | 101 | let _ = mk_test w31_3_op w64_1_op 127 102 | let _ = mk_test w31_5_op w64_4_op 521 103 | let _ = mk_test w31_5_op w64_4_op 607 104 | let _ = mk_test w31_6_op w64_5_op 1279 105 | let _ = mk_test w31_7_op w64_6_op 2203 106 | let _ = mk_test w31_7_op w64_6_op 2281 107 | let _ = mk_test w31_7_op w64_6_op 3217 108 | let _ = mk_test w31_8_op w64_7_op 4253 109 | let _ = mk_test w31_8_op w64_7_op 4423 110 | let _ = mk_test w31_9_op w64_8_op 9689 111 | let _ = mk_test w31_9_op w64_8_op 9941 112 | let _ = mk_test w31_9_op w64_8_op 11213 113 | let _ = mk_test w31_10_op w64_9_op 19937 114 | let _ = mk_test w31_10_op w64_9_op 21701 115 | let _ = mk_test w31_10_op w64_9_op 23209 116 | let _ = mk_test w31_11_op w64_10_op 44497 117 | -------------------------------------------------------------------------------- /src/Coqprime/num/extraction/uint31C.c: -------------------------------------------------------------------------------- 1 | #include "caml/config.h" 2 | #include "caml/alloc.h" 3 | #include "caml/memory.h" 4 | #include "caml/mlvalues.h" 5 | 6 | 7 | #define Eq (Val_int(0)) 8 | #define Lt (Val_int(1)) 9 | #define Gt (Val_int(2)) 10 | 11 | #define Coq_true (Val_int(0)) 12 | #define Coq_false (Val_int(1)) 13 | 14 | #define Alloc_small(res, n, tag) (res = caml_alloc_small(n, tag)) 15 | 16 | #define Make_C0(res, v) do { \ 17 | Alloc_small(res, 1, 0); \ 18 | Field(res, 0) = v; \ 19 | } while(0) 20 | 21 | #define Make_C1(res, v) do { \ 22 | Alloc_small(res, 1, 1); \ 23 | Field(res, 0) = v; \ 24 | } while(0) \ 25 | 26 | #define UWtype unsigned long 27 | #define UWsize 32 28 | #define UWhalfsize (UWsize/2) 29 | #define __ll_highpart(x) (((UWtype)(x))>> UWhalfsize) 30 | #define __ll_lowpart(x) (((UWtype)(x)) & 0xFFFF) 31 | #define __ll_B (1 << UWhalfsize) 32 | 33 | CAMLprim value uint_compare(value x, value y) { 34 | unsigned long ux, uy; 35 | ux = ((unsigned long)x); uy = ((unsigned long)y); 36 | if (ux < uy) return Lt; 37 | else if (ux == uy) return Eq; 38 | else return Gt; 39 | } 40 | 41 | CAMLprim value uint_add_c (value x, value y) { 42 | value res, _r; 43 | _r =(value)((long)x + (long)y -1); 44 | if (((UWtype)_r) < ((UWtype)x)) Make_C1(res,_r); 45 | else Make_C0(res, _r); 46 | return res; 47 | } 48 | 49 | CAMLprim value uint_add_carry_c (value x, value y) { 50 | value res, _r; 51 | _r =(value)((long)x + (long)y + 1); 52 | if (((UWtype)_r) <= ((UWtype)x)) Make_C1(res,_r); 53 | else Make_C0(res, _r); 54 | return res; 55 | } 56 | 57 | 58 | CAMLprim value uint_sub_c(value x, value y) { 59 | value res, _r; 60 | _r =(value) ((long)x - (long) y + 1); 61 | if ((UWtype)x < (UWtype)_r) Make_C1(res, _r); 62 | else Make_C0(res, _r); 63 | return res; 64 | } 65 | 66 | CAMLprim value uint_sub_carry_c(value x, value y) { 67 | value res, _r; 68 | _r = (value)((long)x - (long)y - 1); 69 | if ((UWtype)x <= (UWtype)_r) Make_C1(res, _r); 70 | else Make_C0(res,_r); 71 | return res; 72 | } 73 | 74 | 75 | CAMLprim value uint_mul_c (value u, value v) { 76 | uint64 x, y, z; 77 | value res; 78 | x = (uint64) (Unsigned_long_val(u)); 79 | y = (uint64) (((UWtype)v) ^ 1); 80 | z = x * y; 81 | if (z == 0) res = Val_long(0); 82 | else { 83 | Alloc_small(res, 2, 0); 84 | Field(res, 0) = Val_long((uint32)(z >> 32)); 85 | Field(res, 1) = (value) 86 | (((uint32)(z & (((uint64)1 << 32) - 1))) | 1); 87 | } 88 | return res; 89 | 90 | } 91 | 92 | CAMLprim value uint_div21(value v1, value v0, value vd) { 93 | uint64 x, y, q, r; 94 | value res; 95 | x = (uint64) (Unsigned_long_val(v1)) << 32 | 96 | (uint64) (((UWtype)v0) ^ 1); 97 | y = (uint64) (((UWtype)vd) ^ 1); 98 | 99 | q = x / y; 100 | r = x - y * q; 101 | 102 | Alloc_small(res, 2, 0); 103 | Field(res, 0) = Val_long((uint32)q); 104 | Field(res, 1) = (value)((uint32)r | 1); 105 | return res; 106 | } 107 | 108 | CAMLprim value uint_div_eucl(value x, value y) { 109 | value res; 110 | unsigned long ux, uy, uq, ur; 111 | ux =Unsigned_long_val(x); 112 | uy = Unsigned_long_val(y); 113 | uq = ux / uy; 114 | ur = ux % uy; 115 | Alloc_small(res, 2, 0); 116 | Field(res, 0) = Val_long(uq); 117 | Field(res, 1) = Val_long(ur); 118 | return res; 119 | } 120 | 121 | CAMLprim value uint_mod(value x, value y) { 122 | unsigned long ux, uy; 123 | ux =Unsigned_long_val(x); 124 | uy = Unsigned_long_val(y); 125 | return Val_long (ux % uy); 126 | } 127 | 128 | 129 | 130 | 131 | 132 | 133 | --------------------------------------------------------------------------------