GithubHelp home page GithubHelp logo

xiyuzhai / leanaide Goto Github PK

View Code? Open in Web Editor NEW

This project forked from siddhartha-gadgil/leanaide

0.0 0.0 0.0 121.77 MB

Tools based on AI for helping with Lean 4

License: Apache License 2.0

Shell 0.14% Python 5.43% Scala 1.02% Julia 0.01% TeX 0.73% HTML 0.01% Lean 36.35% Jupyter Notebook 56.30% Dockerfile 0.03%

leanaide's Introduction

LeanAide

LeanAide or LeanAIde (accidental pun) is work in progress to build AI based tools to help development with the Lean Theorem Prover. For now it has one tool under development, which translates statements written in natural language in a doc-string like format to Lean types (including theorem statements).

leanaide-mathlib4

Quickstart: translation to Lean statements

Our translation is based on GPT 3.5-turbo/GPT 4, to use which you need an OpenAI key. To get started please configure environment variables using the following bash commands or equivalent in your system:

export OPENAI_API_KEY=<your-open-ai-key>

Build this repository with the following commands:

lake exe cache get # download prebuilt mathlib binaries
lake build mathlib
lake build

After this open the folder in VS code (or equivalent) with Lean 4 and go to the file LeanCodePrompts/TranslateExample.lean or the file LeanCodePrompts/TranslateDemo.lean. Any statement written using syntax similar to l!"There are infinitely many primes" will be translated into Lean code. You will see examples of this in the demo files. Once the translation is done, a Try this hyperlink and code-action will appear. Clicking on this will add the translated code to the file.

To use in your own project, include this project as a dependency in lakefile.lean using the following.

require LeanCodePrompts from git "https://github.com/siddhartha-gadgil/LeanAide"@"main

If you import LeanAide and Mathlib to a file, the translation will be available.

Contributions and details

This is joint work by our team,

  • Siddhartha Gadgil
  • Anand Rao Tadipatri
  • Ayush Agrawal
  • Ashvni Narayanan
  • Navin Goyal

with a lot of help from the Lean community and from collaborators at Microsoft Research. Our server is hosted with support from research credits from Google.

Our work is described in a note at the 2nd Math AI workshop and in more detail (along with related work) in a preprint.

leanaide's People

Contributors

siddhartha-gadgil avatar 0art0 avatar ayush1801 avatar laughinggas avatar dependabot[bot] avatar navingoyal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.