• Stars
    star
    282
  • Rank 146,549 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Lean version manager

elan: Lean version manager

elan is a small tool for managing your installations of the Lean theorem prover. It places lean and leanpkg binaries in your PATH that automatically select and, if necessary, download the Lean version described in the lean_version field of your project's leanpkg.toml. You can also install, select, run, and uninstall Lean versions manually using the commands of the elan executable.

~/my/package $ cat leanpkg.toml | grep lean_version
lean_version = "nightly-2018-04-10"
~/my/package $ leanpkg -v
info: downloading component 'lean'
 14.6 MiB /  14.6 MiB (100 %)   2.2 MiB/s ETA:   0 s
info: installing component 'lean'
Lean package manager, version nightly-2018-04-10
[...]
~/my/package $ elan show
installed toolchains
--------------------

stable
nightly-2018-04-06
nightly-2018-04-10
master

active toolchain
----------------

nightly-2018-04-10 (overridden by '/home/me/my/package/leanpkg.toml')
Lean (version 3.3.1, nightly-2018-04-10, commit d36b859c6579, Release)

Installation

Manual Installation

Linux/macOS/Cygwin/MSYS2/git bash/...: run the following command in a terminal:

curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh

ARM Mac:

Lean 4 has native macOS/aarch64 releases (nightly only so far) that you can install as above by choosing the leanprover/lean4:nightly toolchain. For Lean 3, you need to run the installer under Rosetta (install using softwareupdate --install-rosetta if you haven't already done so) because there are no native macOS/aarch64 releases for it right now:

curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | arch -x86_64 sh

Windows: run the following commands in a terminal:

curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.ps1
powershell -ExecutionPolicy Bypass -f elan-init.ps1
del elan-init.ps1

Alternatively, on any supported platform: Grab the latest release for your platform, unpack it, and run the contained installation program.

The installation will tell you where it will install elan to (~/.elan by default), and also ask you about editing your shell config to extend PATH. elan can be uninstalled via elan self uninstall, which should revert these changes.

Homebrew

$ brew install elan-init

Please note that native macOS/aarch64 releases are unavailable for some toolchains. See Manual Installation for more information.

Nix

$ nix-env -iA nixpkgs.elan

Prerequisites

On some systems, lean/leanpkg will not work out of the box even if installed through elan:

  • You'll need git to download dependencies through leanpkg.
  • macOS: Install Homebrew, then run brew install gmp coreutils. (gmp is required by lean, coreutils is required by leanpkg)

Implementation

elan is basically a fork of rustup. Apart from new features and adaptions to the Lean infrastructure, these are the basic changes to the original code:

  • Replaced every mention of rustup with elan, cargo with leanpkg, and rust(c) with lean
  • Merged CARGO_HOME and RUSTUP_HOME
  • Removed options to configure host triple

Build

If you want to build elan from source, you will need to install Rust and Cargo and run the following:

cargo build

The built binaries will show up in target/debug folder. You can test that it works by running the following:

./target/debug/elan --help

Build on Windows

The windows build requires a 64bit developer command prompt and a windows version of perl.exe which you can download from https://strawberryperl.com/. Make sure this downloaded perl.exe is the first thing in your PATH so that the build does not try and use c:\Program Files\Git\usr\bin\perl.exe. The git provided version of perl doesn't work for some reason.

Then you can run cargo build as shown above.

More Repositories

1

lean4

Lean 4 programming language and theorem prover
Lean
4,612
star
2

lean3

Lean Theorem Prover
C++
2,143
star
3

vscode-lean4

Visual Studio Code extension for the Lean 4 proof assistant
TypeScript
157
star
4

theorem_proving_in_lean4

Theorem Proving in Lean 4
JavaScript
157
star
5

lean2

Lean theorem prover version 0.2 (it supports standard and HoTT modes)
C++
121
star
6

vscode-lean

Extension for VS Code that provides support for the older Lean 3 language. Succeeded by vscode-lean4 ('lean4' in the extensions menu) for the Lean 4 language.
TypeScript
117
star
7

lake

**(Deprecated: Merged into Lean 4)** Lean 4 build system and package manager with configuration files written in Lean.
Lean
98
star
8

verso

Lean documentation authoring tool
Lean
96
star
9

logic_and_proof_lean3

CMU Undergrad Course
TeX
96
star
10

lean3-mode

Emacs mode for Lean
Emacs Lisp
69
star
11

fp-lean

Functional Programming in Lean
JavaScript
68
star
12

lean4-cli

A Lean 4 library for configuring Command Line Interfaces and parsing command line arguments.
Lean
67
star
13

doc-gen4

Document Generator for Lean 4
Lean
62
star
14

LeanInk

LeanInk is a command line helper tool for Alectryon which aims to ease the integration of Lean 4.
Lean
60
star
15

SampCert

SampCert : Verified Differential Privacy
Lean
59
star
16

tc

Reference type checker for the Lean theorem prover
Haskell
57
star
17

LNSym

Armv8 Native Code Symbolic Simulator in Lean
Lean
52
star
18

lean4-samples

Code samples for Lean 4
Lean
49
star
19

leansat

This package provides an interface and foundation for verified SAT reasoning
Lean
48
star
20

theorem_proving_in_lean

Theorem proving in Lean
Python
47
star
21

tutorial

Lean Tutorials
TeX
43
star
22

functional_programming_in_lean

A book about functional programming in Lean
38
star
23

lean-client-js

TypeScript
34
star
24

lean4-nightly

Nightly builds
22
star
25

lean.vim

Vim Script
18
star
26

lean4checker

Replay the `Environment` for a given Lean module, ensuring that all declarations are accepted by the kernel.
Lean
17
star
27

reservoir

Package registry for Lean/Lake.
Vue
16
star
28

super

Superposition prover
Lean
15
star
29

presentations

lean-related presentations
TeX
15
star
30

SHerLOC

A StableHLO analyzer in Lean
Lean
15
star
31

leanprover.github.io

www
HTML
15
star
32

lean-action

GitHub action for standard CI in Lean projects
Shell
14
star
33

leanbv

Lean
11
star
34

lean4export

Plain-text declaration export for Lean 4
Lean
11
star
35

lean3-web-editor

Lean web editor
TypeScript
9
star
36

smt2_interface

Interface to SMT2 solvers
Lean
9
star
37

lean-llvm

Custom-built LLVM toolchain for use in Lean 4
5
star
38

cmu-15815-s15

CMU 15-815 Spring 2015 : Interactive Theorem Proving
JavaScript
4
star
39

subverso

Lean
3
star
40

mini_crush

Mini crush tactic example
Lean
3
star
41

deprecated-homebrew-lean

See https://github.com/Homebrew/homebrew-core/blob/master/Formula/lean.rb
Ruby
3
star
42

NKL

A formalization of the NKI ISA
Lean
2
star
43

mkleanbook

JavaScript
2
star
44

Lean.tmbundle

A TextMate bundle for the Lean language
2
star
45

lean4-pr-releases

Automated releases from leanprover/lean4 PRs
2
star
46

lean-nightly

Lean nightly builds
2
star
47

macports

macports repository for Lean
Shell
1
star
48

ppa-updater

Ubuntu PPA updater for Lean
Shell
1
star
49

emacs-dependencies

Auxiliary repository to store emacs packages required by Lean Emacs mode
Emacs Lisp
1
star
50

reservoir-index

Registry index for Reservoir
Lean
1
star
51

TensorLib

A verified tensor library in Lean
Lean
1
star
52

TenCert

Verified tensor compilation in Lean
Lean
1
star