You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Verification and sorry-free is NOT the point of this repo!** This is a scientific computing library focused on practical functionality. Technical debt via `sorry_proof` is acceptable. Priorities:
5
+
1. Keep up with Lean 4 releases (currently v4.26)
6
+
2. BLAS benchmarks and performance
7
+
3. Gradient/autodiff tests
8
+
4. Better ML support (see lean-mlir for inspiration)
-**LeanBLAS** (`../LeanBLAS`): Vendored locally for active development. Expect frequent changes to BLAS bindings, Level 1-3 operations, and FFI layer. Keep in sync with SciLean's mathlib version.
45
+
-**LeanPlot** (`../LeanPlot`): Local visualization library
46
+
47
+
## Build Commands
48
+
- Build entire project: `lake build`
49
+
- Run tests: `lake test`
50
+
- Test a specific file: `lake build Test.file_name` (e.g., `lake build Test.calculus.revFDeriv_test`)
51
+
- Run an example: `lake build ExampleName && .lake/build/bin/ExampleName` (e.g., `lake build HarmonicOscillator && .lake/build/bin/HarmonicOscillator`)
52
+
53
+
## Code Style Guidelines
54
+
-**Indentation**: 2 spaces
55
+
-**Naming**: CamelCase for types/classes, snake_case for variables, Unicode for mathematical symbols
56
+
-**Imports**: Organized at top by dependency, open primary namespace
57
+
-**Types**: Use typeclasses for mathematical abstractions, explicit type constraints where needed
58
+
-**Documentation**: `/--` blocks with markdown, mathematical notation where appropriate
59
+
-**Attributes**: Use `@[simp]`, `@[fun_trans]`, `@[data_synth]` for optimization rules
60
+
-**Error handling**: Use dependent types and type constraints over runtime checks
61
+
62
+
## Conventions
63
+
- Proofs use the `by` syntax with tactic blocks
64
+
- Mathematical properties follow the theorem naming pattern `operation.arg_name.property_rule`
65
+
- Make heavy use of metaprogramming for tactics and automation
66
+
- Clear distinction between forward and reverse mode differentiation in naming
67
+
- Add existing imports as comments when disabling them
68
+
69
+
## TODO (for future sessions)
70
+
- Reenable doc.verso
71
+
72
+
## Lean 4 Tips
73
+
-**Float infinity**: Lean 4 stdlib doesn't have `Float.inf`. Define as:
74
+
```lean
75
+
def Float.inf : Float := 1.0 / 0.0
76
+
def Float.negInf : Float := -1.0 / 0.0
77
+
```
78
+
These are proper IEEE 754 infinity values for min/max tracking.
79
+
80
+
---
81
+
82
+
use lean-lsp-mcp hover on nested src code after writing it to ENSURE its in
83
+
the right namespace. like `Float.inf` may need to be `_root_.Float.inf`.
0 commit comments