- Write finite element code where the energy/action can be written down like on paper and the final cede can be differentiated with respect to almost anything like domain, stiffness parameters, initial conditions etc.
- Support compilation to GPU and CPU.
- Semi-automatic differentiation and optimization tools.
- Inline C++ compiler to write efficient low level code.
- Formalize and wrap OpenVDB, NanoVDB, Houdini, Eigen primitives.
- Node based editor in Houdini.
My first goal is to write couple of simple ODE solvers maybe some simple finite difference solvers. The main things to focus on:
- compare performance to hand written C++ code
- attempt at semi-automatic differentiation of energy/lagrangian
Implement these to in the order to get these examples working:
- Harmonic Oscillator
- Pendulum
- NBody
- NPendulum in 2D
- NPendulum in 3D
- 1D wave equation
- 2D wave equation
Everything that will hopefully be in mathlib one day
This contains all categories and basic proof automation in those categories.
- proofs for algebraic operations
- proofs for combinators
- Hom and morphisms
- LInv - is it a category?
- RInv - is it a category?
- Difeo - This needs diffeology to have internalized Hom
This contains basic operators proofs about them and simplification identities
differential, gradient, tangent_map, back_prop
- [ ] Implement `IsSmooth` - just duplicate IsDiff and add axiom that differential of smooth is smooth
- [ ] Implement `IsLInv` `IsRInv`
- [ ] experiment with `extends` keyword to chain categories properly and test if `IsInv` can be written just as an extension of `IsLInv` and `IsRInv`
- [ ] Define Hom for categories and pick arrows
- Lin: ⊸ –o -o
- Smooth: ⟿ ~~> \r~3
- Dif: ⇝ -~> \r~2
- Cont: ↦ –> \r6
- Diffeo: ↭ <~> \lr5
- RInv: ↠ ->> \r23
- LInv: ↪ >-> \r8
- Inv: ↔ <-> \lr
- [ ] internalized combinators
- [ ] extract smooth/linear/… symbol - this will create appropriate morphism
- [ ] modify remove lambda let to work with morphisms
- [ ] Specialized notation
λₛ
for morphisms, maybe also ascii version asfun (x : X) ~~> (f x)
orfun (v : V) --o (A v)
- [ ] Implement
IsCont
- [ ] Add
IsDiffeo
a category of diffeomorphisms
- [ ] add simple algebraic simplification, probably based on this zulip chat
- Attempt 1: What the link suggest does not work naively in my case :(
- [X] add
autodiff
,autograd
tactics - [X] make
rmlamlet
work in conv mode - [ ] rewrite
autodiff
andautograd
to use conv mode - [ ] add
autodual
tactic - [ ] fix `remove lambda let` to work properly with `let` such that for loops are correctly abstracted
- [ ] Add basic real functions like
sin, cos, exp
and their derivatives and inverses - [ ]
Vector T n
fixed sized array of type T - [ ]
Tensor #[n1, n2, n3]
fast float array to hold data - probably column major - [ ]
Vec2, Vec3, Vec4
simple fixed size vectors - [ ]
Mat2, Mat3, Mat4
simple fixed size matrices
- [X] add tactics
solver_check
andsolver_assumtion
- [X] add tactic
lift_limit
- [X] rewrite
Impl
based on Mario’s answer - [ ] add tactic
assume_this
- [ ] add tactic
check_this
- [ ] refine
lift_limit
It should automatically callassume_this
for assuming lifting of the limit
Based on how lift_limit currently works it should call one iteration of beta-reduction.
- [ ] add tactic
finish_impl
probably just `apply Solver.pure` - [ ] check computability in
finish_impl
The approach is probably to replace every free variables in the target expression by their instance of `Inhabited`. For this useExpr.replaceFVar
If the target is a function, synthesize all arguments with `Inhabited` and apply them.
Finally I need to figure out how to test if an expression can be evaluated.
- [ ] implement
assemble
- [ ] Figure out how to deal with adjoint and dual in case of integrals
- [ ] Automatize duality on integrals
On using external C code: zulip thread
Example on how to use lean_external_object
- [ ] do a simple experiment to bind some C/C++ linear solver look into this zulip thread for info and links
- [ ] try wrapping Thrust vector into =lean_external_object=
- [X] Lean implementation
- [ ] C++ implementation
- [ ] measure performance and create nice comparison
- [X] Hamiltonian formulation
- [ ] Lagrangian formulation
- [ ] Action formulation
- [ ] Lean implementation
- [ ] C++ implementation
- [ ] measure performance and create nice comparison
- [ ] Hamiltonian formulation
- [ ] Lagrangian formulation
- [ ] Action formulation
- [ ] Lean implementation
- [ ] C++ implementation
- [ ] measure performance and create nice comparison
- [ ] Hamiltonian formulation
- [ ] Lagrangian formulation
- [ ] Action formulation
- [ ] Lean implementation
- [ ] C++ implementation
- [ ] measure performance and create nice comparison
- [ ] Hamiltonian formulation
- [ ] Lagrangian formulation
- [ ] Action formulation
- [ ] Lean implementation
- [ ] C++ implementation
- [ ] measure performance and create nice comparison
- [ ] Hamiltonian formulation
- [ ] Lagrangian formulation
- [ ] Action formulation
- [ ] Lean implementation
- [ ] C++ implementation
- [ ] measure performance and create nice comparison
- [ ] Hamiltonian formulation
- [ ] Lagrangian formulation
- [ ] Action formulation
- When cursor is places at the end of `repeat rw[thrm]` the goal shows only one rewrite as repeat didn’t work. This is confusing.
- λₛ: Computable Semantics for Differentiable Programming with Higher-Order Functions and Datatypes, 2021
- DiffTaichi: Differentiable Programming for Physical Simulation, 2020
- Verified Tensor-Program Optimization Via High-Level Scheduling Rewrites, 2022
- The Differential Lambda-Calculus, 2003
- Reverse-mode AD in a functional framework: Lambda the Ultimate Backpropagator, 2008
- Efficient differentiable programming in a functional array-processing language, 2018
- Computing Higher Order Derivatives of Matrix and Tensor Expressions, 2018 and its web app
- The Simple Essence of Automatic Differentiation (Extended version), 2018
- Automatic differentiation in ML: Where we are and where we should be going, 2018
- The Differentiable Curry, 2019
- A Differentiable Programming System to Bridge Machine Learning and Scientific Computing, 2019
- A Simple Differentiable Programming Language, 2020
- Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions
- Provably Correct, Asymptotically Efficient, Higher-Order Reverse-Mode Automatic Differentiation, 2022
- A Language and Compiler View on Differentiable Programming, 2023
- Denotationally Correct, Purely Functional, Efficient Reverse-mode Automatic Differentiation, 2023
- Efficient and Sound Differentiable Programming in a Functional Array-Processing Language, 2021
- Beyond Notations: Hygienic Macro Expansion for Theorem Proving Languages, 2020
- The Lean 4 Theorem Prover and Programming Language, 2021
- Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming, 2019
- Perceus: Garbage Free Reference Counting with Reuse, 2020
- The categorical abstract machine, 1987
- Computational Category Theory, 1988
- Categorical Combinators, Sequential Algorithms, and Functional Programming, 1993
- Differential categories, 2006
- A convenient differential category, 2010
- A categorical description of the essential structure of differential calculus, 2013
- An approach to computational category theory, 2015
- Diffeological Spaces and Denotational Semantics for Differential Programming, 2018
- David Sankel A guy writing Reflection TS proposal, but why is he interesting is that he developed some visual functional programming language similar to Houdini as he mentioned in CppCast.
- subhask
- linearmap-category
- Cateno
- Zygote
- Myia
- PhiFlow
- DiffTaichi
- Halide
- Certigrad
- Simit
- differentiable programming in Swift
- Smooth
- Atlas 2 for Mathematica
- Enzyme
- Dex
- furthark
- I❤️LA
- Jax
- diffrax
- Oryx
- FormalML
- DiffSharp
- Owl
- Sparcl - partially-invertible computation
- Enso - hybrid visual & textual programming language