{"id":24513882,"url":"https://github.com/lecopivo/scilean","last_synced_at":"2026-01-28T15:30:58.251Z","repository":{"id":41142519,"uuid":"411052875","full_name":"lecopivo/SciLean","owner":"lecopivo","description":"Scientific computing in Lean 4","archived":false,"fork":false,"pushed_at":"2025-06-09T19:27:04.000Z","size":11252,"stargazers_count":415,"open_issues_count":28,"forks_count":33,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-07-10T23:52:19.208Z","etag":null,"topics":["lean4","numerical-methods","scientific-computing","symbolic-computation"],"latest_commit_sha":null,"homepage":"https://lecopivo.github.io/scientific-computing-lean/","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lecopivo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-27T21:50:10.000Z","updated_at":"2025-07-08T13:29:52.000Z","dependencies_parsed_at":"2024-01-17T20:43:07.454Z","dependency_job_id":"8c288a8d-530b-443a-92e9-1fd80ae73371","html_url":"https://github.com/lecopivo/SciLean","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lecopivo/SciLean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lecopivo%2FSciLean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lecopivo%2FSciLean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lecopivo%2FSciLean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lecopivo%2FSciLean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lecopivo","download_url":"https://codeload.github.com/lecopivo/SciLean/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lecopivo%2FSciLean/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lean4","numerical-methods","scientific-computing","symbolic-computation"],"created_at":"2025-01-22T00:56:52.639Z","updated_at":"2026-01-28T15:30:58.246Z","avatar_url":"https://github.com/lecopivo.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SciLean: Scientific Computing in Lean\n\n  Library for scientific computing such as solving differential equations, optimization or machine learning written in [Lean](http://leanprover.github.io/). This library is in an *early stage of development* and at its current stage is just a proof of concept on how Lean can be used for scientific computing.\n\nLean is an expressive functional programming language that allows to formalize the mathematics behind these computations. This can offer several benefits:\n\n- Code transformation and optimization guided by formalization of underlining mathematics, like automatic differentiation, algebraic simplification, fine control of used approximations or execution scheduling.\n- First class symbolic computation. Any function can be purely symbolic, functions like `gradient`, `integral` or `limit` are inherently non-computable. However, they carry meaning what the program should be doing and we provide tools to manipulate them or approximate them with actually computable function.\n- Code generation based on formal specification. Many problems any scientific computing or machine learning can be stated very easily e.g. find a minimizer of a function. We then provide tools how to turn such specification into a runnable code satisfying the specification, usually in an appropriate limit of used approximations.\n- Catalogization of numerical methods.\n\n  In short, mathematics is the ultimate abstraction for numerical computing and Lean can understand mathematics. Hopefully, using Lean will allow us to create really powerful and extensible library for scientific computing.\n\n\n## Documentation\n\n### Manual\n- [Scientific Computing in Lean](https://lecopivo.github.io/scientific-computing-lean/)  \n  _A work-in-progress book on scientific computing in Lean._\n\n### Presentations\n- [Automatic Differentiation in Lean – Lean Together 2024 (30min)](https://www.youtube.com/watch?v=Kjx5KvB8FL8)  \n  Motivation and examples of forward and reverse mode AD in Lean.\n\n- [Scientific Computing in Lean – Lean for Scientists and Engineers 2024 (2h)](https://www.youtube.com/watch?v=X1oEV5SsFJ8)  \n  Overview of SciLean, n-dimensional arrays, symbolic computation, and automatic differentiation.\n\n- [Scientific Computing in Lean – Seminar at Cambridge University (09 May 2024)](https://www.youtube.com/watch?v=O12SZqIwYCk)  \n  Covers optimization through differential equations, basic probabilistic programming, and the Walk on Spheres algorithm.\n\n\n## Using SciLean\n\n### Prerequisites\n\nSciLean relies on **OpenBLAS** for accelerating numerical computations.  \nYou’ll need to have it installed on your system:\n\n- **Ubuntu**:\n  ```bash\n  sudo apt-get install libopenblas-dev\n  ```\n- **macOS**:\n  ```bash\n  brew install openblas\n  ```\n- **Windows**: Currently not officially supported.\n\n\n### Building SciLean\n\nClone and build the library with:\n\n```bash\ngit clone https://github.com/lecopivo/SciLean.git\ncd SciLean\nlake exe cache get\nlake build\n```\n\n\n### Setting Up Your Project with SciLean\n\nTo use `SciLean` in your own Lean project:\n\n1. Add a `require` statement for `scilean`.\n2. Set `moreLinkArgs` to point to your OpenBLAS library.\n\nHere’s an example `lakefile.lean` for a project named `foo`:\n\n```lean\nimport Lake\nopen Lake DSL System\n\ndef linkArgs :=\n  if System.Platform.isWindows then\n    panic! \"Windows is not supported!\"\n  else if System.Platform.isOSX then\n    #[\"-L/opt/homebrew/opt/openblas/lib\", \"-L/usr/local/opt/openblas/lib\", \"-lblas\"]\n  else -- Linux\n    #[\"-L/usr/lib/x86_64-linux-gnu/\", \"-lblas\", \"-lm\"]\n\npackage foo {\n  moreLinkArgs := linkArgs\n}\n\nrequire scilean from git \"https://github.com/lecopivo/SciLean\" @ \"v4.20.1\"\n\n@[default_target]\nlean_lib Foo {\n  roots := #[`Foo]\n}\n```\n\n\u003e **Note:** If your project uses `mathlib`, ensure compatibility with the `scilean` version. Alternatively, omit the explicit `mathlib` requirement, SciLean brings in a compatible version as a transitive dependency.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flecopivo%2Fscilean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flecopivo%2Fscilean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flecopivo%2Fscilean/lists"}