Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Aether Catalog definitions — Tropical_MachineLearning_TropicalConversion

Definition
Tropical_MachineLearning_TropicalConversion

by raver1975 · Sep 13, 2026 · Mathlib c5ea003 (Lean v4.30.0)

aether-catalogtropical

Definition bundle for the Aether Catalog module Tropical.MachineLearning.TropicalConversion, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.

Definition code
-- Def bundle generated from Tropical/MachineLearning/TropicalConversion.lean by skeleton subtraction
import Mathlib

/-! # Tropical Neural Network Conversion — Formal Foundations

This file formalizes the core mathematical guarantees for converting
classical neural network layers to tropical (max-plus) representations.

## Key Results

1. **`relu_is_tropical`** — ReLU(x) = max(x, 0) is a tropical operation.
2. **`tropMul_distrib_left`** — Tropical multiplication distributes over tropical addition.
3. **`relu_conversion_exact`** — Converting ReLU layers to tropical form is exact.
4. **`softmax_concentration`** — Softmax concentrates on the argmax as β → ∞.
5. **`convError_triangle`** — Composition errors compose via triangle inequality.
-/

noncomputable section

open Real Finset BigOperators

-- ═══════════════════════════════════════════════════════════════
-- Section 1: Tropical Semiring Operations
-- ═══════════════════════════════════════════════════════════════

/-- Tropical addition is max. -/
def tropAdd' (a b : ℝ) : ℝ := max a b

/-- Tropical multiplication is classical addition. -/
def tropMul' (a b : ℝ) : ℝ := a + b






-- ═══════════════════════════════════════════════════════════════
-- Section 2: ReLU is Tropical
-- ═══════════════════════════════════════════════════════════════

/-- ReLU function. -/
def reluFn (x : ℝ) : ℝ := max x 0




-- ═══════════════════════════════════════════════════════════════
-- Section 3: Conversion Error Bounds
-- ═══════════════════════════════════════════════════════════════

/-- Conversion error between two functions. -/
def convError (f g : ℝ → ℝ) (x : ℝ) : ℝ := |f x - g x|






-- ═══════════════════════════════════════════════════════════════
-- Section 4: Quantization Error
-- ═══════════════════════════════════════════════════════════════



/-
═══════════════════════════════════════════════════════════════
Section 5: Softmax Concentration (Tropical Limit)
═══════════════════════════════════════════════════════════════

Softmax converges to hardmax (tropical) as temperature → 0.
    For distinct scores, the argmax gets probability → 1.
    Here: exp(β·s₂) / (exp(β·s₁) + exp(β·s₂)) > 1/2 when s₂ > s₁.
-/

end

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me