rzk

An experimental proof assistant based on a type theory for synthetic ∞-categories.

https://github.com/rzk-lang/rzk

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.4%) to scientific vocabulary

Keywords

category-theory haskell homotopy-type-theory proof-assistant
Last synced: 6 months ago · JSON representation ·

Repository

An experimental proof assistant based on a type theory for synthetic ∞-categories.

Basic Info
Statistics
  • Stars: 245
  • Watchers: 12
  • Forks: 11
  • Open Issues: 58
  • Releases: 29
Topics
category-theory haskell homotopy-type-theory proof-assistant
Created about 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Citation

README.md

Rzk proof assistant

Release `rzk` on Hackage `rzk` on Stackage Nightly `rzk` on Stackage LTS

Rzk documentation Rzk Playground Rzk Zulip chat

Haddock Rzk Playground

An experimental proof assistant for synthetic ∞-categories.

https://rzk-lang.github.io

Early prototype demo.

About this project

This project has started with the idea of bringing Riehl and Shulman's 2017 paper [1] to "life" by implementing a proof assistant based on their type theory with shapes. Currently an early prototype with an online playground is available. The current implementation is capable of checking various formalisations. Perhaps, the largest formalisations are available in two related projects: https://rzk-lang.github.io/sHoTT and https://github.com/emilyriehl/yoneda. sHoTT project (originally a fork of the yoneda project) aims to cover more formalisations in simplicial HoTT and ∞-categories, while yoneda project aims to compare different formalisations of the Yoneda lemma.

Internally, rzk uses a version of second-order abstract syntax allowing relatively straightforward handling of binders (such as lambda abstraction). In the future, rzk aims to support dependent type inference relying on E-unification for second-order abstract syntax [2]. Using such representation is motivated by automatic handling of binders and easily automated boilerplate code. The idea is that this should keep the implementation of rzk relatively small and less error-prone than some of the existing approaches to implementation of dependent type checkers.

An important part of rzk is a tope layer solver, which is essentially a theorem prover for a part of the type theory. A related project, dedicated just to that part is available at https://github.com/fizruk/simple-topes. simple-topes supports used-defined cubes, topes, and tope layer axioms. Once stable, simple-topes will be merged into rzk, expanding the proof assistant to the type theory with shapes, allowing formalisations for (variants of) cubical, globular, and other geometric versions of HoTT.

See the list of contributors at docs/docs/CONTRIBUTORS.md.

Discussing Rzk and getting help

A Zulip chat is available for all to join and chat about Rzk, including formalization projects, development of Rzk, and related projects: https://rzk-lang.zulipchat.com/register/

How to use rzk

For relatively small single-file formalisations, you can use the online playground at https://rzk-lang.github.io/rzk/develop/playground

However, for larger and multi-file formalisations you should install a version of rzk locally:

  • You can install the latest "stable" version of rzk from Hackage:

sh cabal update cabal install rzk

  • You can install the latest "development" version of rzk from the develop branch of this repository:

sh git clone https://github.com/rzk-lang/rzk.git cd rzk git checkout develop stack build && stack install

VS Code

There exists a VS Code extension for rzk available on the Marketplace. The extension supports basic syntax highlighting, but more features may come in the future.

Checking

To check a multi-file project, you need to call rzk typecheck specifying the files in correct order, e.g.:

sh rzk typecheck first.rzk second.rzk third.rzk

A proper support for inter-file dependencies will be implemented in the future. Until then, it is recommented to start names of files with a number, ensuring correct order when using a wildcard (*). For example:

```console . ├── 0-common.md ├── 1-paths.md ├── 2-contractible.md ├── 3-homotopies.md ├── 4-equivalences.md ├── 5-sigma.md └── 6-trivial-fibrations.md

1 directory, 7 files ```

Inside of such directory, you can run rzk typecheck on all files using wildcards:

sh rzk typecheck *-*.md

Formatting

Formatting can be done by calling rzk format and specifying the files to be formatted, e.g.:

sh rzk format file1.rzk file2.rzk

This prints the formatted version of the file to stdout.

To overwrite the file content, you must use the --write flag as such:

sh rzk format --write examples/*.rzk related/*.rzk.md

Note that if no files are specified, rzk format will format all files listed in rzk.yaml.

The CLI also supports the --check flag, which will exit with a non-zero exit code if any of the files are not formatted correctly. This is useful in CI pipelines to ensure that all files are formatted correctly.

How to contribute to rzk

Building the Documentation Locally

First, you need to install MkDocs and mdx_math Markdown extension (to enable LaTeX):

sh pip install python-markdown-math

Now, you can build and serve the documentation locally by running

sh mkdocs serve --config-file docs/mkdocs.yml

The (locally built) documentation should be available at http://127.0.0.1:8000

The pages of the documentation are the *.md files in docs/docs directory and its subdirectories. To add a new page, you can create a new *.md file and add it to the navigation by modifying docs/mkdocs.yml.

Development

The project is developed with both stack and nix.

Develop rzk with stack

For quick local development and testing it is recommended to work with a GHC version, using the stack tool. Clone this project and run stack build:

sh git clone https://github.com/rzk-lang/rzk.git cd rzk stack build

The build provides an executable rzk which can be used to typecheck files:

haskell stack exec -- rzk typecheck FILE

Develop with nix

  1. Install nix:

console sh <(curl -L https://nixos.org/nix/install) --no-daemon

  1. (Optionally) Permanently enable nix flakes to use faster and more convenient experimental (but quite stable) commands.
  2. Use cachix to avoid building multiple dependencies:
    1. Without flakes: nix-shell -p cachix --command 'cachix use miso-haskell'
    2. With flakes: nix shell nixpkgs#cachix -c cachix use miso-haskell
  3. (Optionally) Install direnv to start the devShell when you enter the repository directory.
    1. The nix-direnv repo shows installation options.
  4. (Optionally) If you use VS Code, you can install mkhl.direnv extension that loads direnv environments.

  5. Clone this repository and enter it

console git clone git@github.com:rzk-lang/rzk.git cd rzk

  1. Run direnv allow in the repository root.
  2. Use cabal for development.
    • cabal performs incremental builds meaning it will build only the parts that are changed. This is quite fast.
    • nix will rebuild the package A when its dependency B changes. Moreover, nix will rebuild all packages that are dependencies of A and that depend on B. This is much slower than incremental builds.
    • So, use nix for setting up the environment with necessary tools that don't need rebuilds.
  3. The following sections provide commands to build and run packages. They should be executed from the root directory of this repository.
  4. The commands nix-shell, nix shell, and nix develop start shells with necessary tools. Run subsequent commands from code blocks in these shells.

Permanently install rzk

without flakes

console nix-env -iA default -f default.nix rzk version

with flakes

console nix profile install rzk version

Also see nix profile remove.

Develop rzk

nix-shell and nix develop start shells with cabal, ghc with packages, hpack, haskell-language-server.

without flakes

cabal

```console nix-shell -A default

(Optionally) build

cabal build rzk cabal run rzk -- version ```

nix-build

console nix-build -A default ./result/bin/rzk version

with flakes

cabal

```console nix develop

(Optionally) build

cabal build rzk cabal run rzk -- version ```

nix build

console nix build ./result/bin/rzk version

nix run

console nix run .# -- version

nix shell

console nix shell rzk version

Build rzk-js

rzk-js is a wrapper around rzk. Building rzk-js via GHCJS produces a JavaScript script used in rzk-playground.

without flakes

cabal

console nix-shell -A ghcjs build-rzk-js

nix-build

console rm -rf rzk-playground/public/rzk.js nix-build -A rzk-js -o rzk-playground/public/rzk.js

with flakes

cabal

console nix develop .#ghcjs build-rzk-js

nix build

console rm -rf rzk-playground/public/rzk.js nix build .#rzk-js -o rzk-playground/public/rzk.js

rzk-playground

rzk-playground is a JavaScript application that combines an editor and basic rzk functionality.

Develop

  1. Load nodejs
  • without flakes: nix-shell
  • with flakes: nix develop
  1. Start a development server and open in a browser a link given by the server.

console cd rzk-playground npm run dev

Release

Build a static site to be hosted, e.g., on GitHub Pages. The release-rzk-playground script will write files to the rzk-playground-release directory.

without flakes

console nix-shell -A release release-rzk-playground

with flakes

nix develop

console nix develop .#release release-rzk-playground

nix run

console nix run .#release-rzk-playground

References

  1. Emily Riehl & Michael Shulman. A type theory for synthetic ∞-categories. Higher Structures 1(1), 147-224. 2017. https://arxiv.org/abs/1705.07442
  2. Nikolai Kudasov. E-unification for Second-Order Abstract Syntax. 2023. https://arxiv.org/abs/2302.05815

Owner

  • Name: rzk proof assistant and satellite tools
  • Login: rzk-lang
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
  - family-names: Kudasov
    given-names: Nikolai
    orcid: "https://orcid.org/0000-0001-6572-7292"
  - family-names: Abounegm
    given-names: Abdelrahman
  - family-names: Danko
    given-names: Danila
title: "Rzk: a  proof assistant for synthetic $\\infty$-categories"
version: 0.7.5
url: "https://github.com/rzk-lang/rzk"

GitHub Events

Total
  • Create event: 5
  • Release event: 1
  • Issues event: 8
  • Watch event: 39
  • Issue comment event: 11
  • Push event: 12
  • Pull request review event: 5
  • Pull request event: 10
  • Fork event: 2
Last Year
  • Create event: 5
  • Release event: 1
  • Issues event: 8
  • Watch event: 39
  • Issue comment event: 11
  • Push event: 12
  • Pull request review event: 5
  • Pull request event: 10
  • Fork event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 685
  • Total Committers: 7
  • Avg Commits per committer: 97.857
  • Development Distribution Score (DDS): 0.204
Past Year
  • Commits: 5
  • Committers: 3
  • Avg Commits per committer: 1.667
  • Development Distribution Score (DDS): 0.6
Top Committers
Name Email Commits
Nikolai Kudasov n****v@g****m 545
Abdelrahman Abounegm a****n@g****m 82
Danila Danko b****3@g****m 47
geffk2 s****x@i****m 7
Alice Logos a****s@o****m 2
Naïm Favier n@m****i 1
Lîm Tsú-thuàn d****l@p****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 56
  • Total pull requests: 108
  • Average time to close issues: 30 days
  • Average time to close pull requests: 5 days
  • Total issue authors: 12
  • Total pull request authors: 9
  • Average comments per issue: 0.7
  • Average comments per pull request: 0.47
  • Merged pull requests: 88
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 5
  • Pull requests: 12
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 11 hours
  • Issue authors: 4
  • Pull request authors: 5
  • Average comments per issue: 1.2
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
  • fizruk (29)
  • aabounegm (4)
  • emilyriehl (3)
  • jonweinb (3)
  • deemp (3)
  • kyoDralliam (2)
  • fredrik-bakke (2)
  • alicelogos (2)
  • juhp (2)
  • Seasawher (1)
  • EgbertRijke (1)
  • TashiWalde (1)
Pull Request Authors
  • fizruk (64)
  • aabounegm (22)
  • deemp (9)
  • alicelogos (4)
  • geffk2 (4)
  • dependabot[bot] (4)
  • swamp-agr (2)
  • ncfavier (2)
  • dannypsnl (2)
Top Labels
Issue Labels
enhancement (4) good first issue (2) formatter (2) documentation (1) bug (1)
Pull Request Labels
dependencies (4) formatter (1)

Packages

  • Total packages: 1
  • Total downloads:
    • hackage 1,332 total
  • Total dependent packages: 2
  • Total dependent repositories: 1
  • Total versions: 29
  • Total maintainers: 1
hackage.haskell.org: rzk

Please see the README on GitHub at https://github.com/rzk-lang/rzk#readme

  • Versions: 29
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 1,332 Total
Rankings
Dependent packages count: 7.2%
Stargazers count: 8.2%
Forks count: 17.7%
Average: 32.4%
Dependent repos count: 36.7%
Downloads: 92.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/binaries.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/upload-release-asset v1 composite
.github/workflows/build-test.yml actions
  • actions/cache v2 composite
  • actions/checkout v3 composite
  • haskell/actions/setup v1 composite
.github/workflows/ghcjs.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v3 composite
  • nix-community/cache-nix-action v1 composite
  • nixbuild/nix-quick-install-action v25 composite
.github/workflows/hackage.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • haskell-actions/hackage-publish v1 composite
.github/workflows/haddock.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/cache v2 composite
  • actions/checkout v3 composite
  • haskell/actions/setup v1 composite
.github/workflows/mkdocs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • jaxxstorm/action-install-gh-release v1.10.0 composite
rzk/rzk.cabal hackage
try-rzk/cabal.config hackage
try-rzk/try-rzk.cabal hackage
  • base *
  • ghcjs-base *
  • ghcjs-prim *
  • miso *
  • rzk *
docs/requirements.txt pypi
  • mike *
  • mkdocs-material *
  • mkdocs-plugin-rzk ==0.1.2
  • pygments-rzk *
  • python-markdown-math *