Nextjournal / Dec 16 2019
Coq Environment
This notebook creates the default Coq environment in Nextjournal.
Setup
Build Environment
Install OCaml and a few dependencies.
apt-get -qq updateDEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends \  ocaml bubblewrap aspcud \  libexpat1-dev libgtk-3-dev libgtksourceview-3.0-devapt-get cleanrm -r /var/lib/apt/lists/* # Clear package list so it isn't stale62.9s
Coq (Bash)
Download the OCaml package manager, OPAM.
URL="https://github.com/ocaml/opam/releases/download/${OPAM_VERSION}/opam-${OPAM_VERSION}-x86_64-linux"wget --progress=bar:force -P /results $URL2.1s
Coq (Bash)
Install OPAM and use it to install Coq and CoqIDE.
mkdir -p $OPAMROOTcp NJ__REF_ /usr/local/bin/opamchmod a+x /usr/local/bin/opamopam init -ay --disable-sandboxingopam config envopam pin add coq -y ${COQ_VERSION}opam install -y coqide1452.9s
Coq (Bash)
Install Jupyter, dependencies, and the Coq Jupyter kernel.
pip install future coq-jupyterpython3 -m coq_jupyter.install5.5s
Coq (Bash)
Print info.
du -hsx /coqc --versionjupyter kernelspec list13.9s
Coq (Bash)
Test
Theorem hello_world : (forall A : Prop, A -> A).Proof.  intros A.  intros proof_of_A.  exact proof_of_A.Qed.0.8s
Coq Test (Coq)
Coq