https://github.com/wvhulle/ennreal-arith
Simplify arithmetic expressions of ENNReal numbers in Lean4
https://github.com/wvhulle/ennreal-arith
arithmetic ennreal lean4 mathematics mathlib4 probability proof-assistant real tactic
Last synced: 8 months ago
JSON representation
Simplify arithmetic expressions of ENNReal numbers in Lean4
- Host: GitHub
- URL: https://github.com/wvhulle/ennreal-arith
- Owner: wvhulle
- License: apache-2.0
- Created: 2025-07-03T18:43:29.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-13T19:35:16.000Z (11 months ago)
- Last Synced: 2025-07-13T21:25:47.761Z (11 months ago)
- Topics: arithmetic, ennreal, lean4, mathematics, mathlib4, probability, proof-assistant, real, tactic
- Language: Lean
- Homepage:
- Size: 112 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arithmetic simplification for ENNReal
ENNReal appears frequently in Mathlib's probability theory and measure theory. This library provides a tactic `eq_as_reals` for ENNReal (extended non-negative real) numbers or arithmetic expressions.
## Installation
Add this project as a dependency to your `lakefile.toml`:
```toml
[[require]]
scope = "wvhulle"
name = "ennreal-arith"
rev = "main" # or a specific commit
```
Or if you use `leanfile.lean`,
```lean
import Lake
open Lake DSL
require «ennreal-arith» from git
"https://github.com/wvhulle/ennreal-arith.git" @ "[COMMIT_HASH]"
```
## Usage
Import in your Lean files:
```lean
import ENNRealArith
```
Use the `eq_as_reals` tactic to prove equality of probabilities (`ENNReal` in Mathlib4), lifted into the real numbers:
```lean
example : (↑2 : ENNReal) * 1 + ↑3 * 0 + ↑5 = ↑7 := by eq_as_reals
example (a : ℕ) (ha : a ≠ 0) : (↑a : ENNReal) / ↑a = 1 := by eq_as_reals
example (a b c : ℕ) (hc : c ≠ 0) :
(↑(a * c) : ENNReal) / (↑(b * c)) = ↑a / ↑b := by eq_as_reals
```