Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Aether Catalog definitions — Evergreen_Tropical_TropicalTrapdoorReversal

Definition
Evergreen_Tropical_TropicalTrapdoorReversal

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

aether-catalogevergreen

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

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

/-!
# Tropical Gate Reversal: How to Invert Tropical Circuits

## Overview

This file formalizes the **reversal** (inversion) of tropical circuits:

1. **Single gate reversal**: Each gate type has a characterized preimage set
2. **Reversal with witness**: Given gate selections, inversion reduces to linear algebra
3. **Reversal without witness**: Must enumerate exponentially many gate selections
4. **Information geometry**: Preimage sets are tropical polyhedra

## The Reversal Algorithm

### With trapdoor (gate selections known):
1. For each min/max gate, fix which argument was selected
2. The circuit collapses to a **linear function** (sum of selected paths)
3. Solve the resulting linear system in O(n) time

### Without trapdoor (gate selections unknown):
1. Enumerate all 2^k possible gate selections (k = number of min/max gates)
2. For each selection, solve the linear system
3. Check which solutions are consistent with the selection
4. Exponential in k
-/

noncomputable section

open Real BigOperators Finset

namespace TropicalReversal

/-! ## Section 1: Single Gate Reversal -/




/-! ## Section 2: Information Loss Quantification -/


/-! ## Section 3: Tropical Polyhedra as Preimage Sets -/

/-- A tropical half-space constraint -/
inductive TropConstraint where
  | LeShift (i j : ℕ) (c : ℝ) : TropConstraint  -- x_i ≤ x_j + c
  | EqSum (i j : ℕ) (c : ℝ) : TropConstraint     -- x_i + x_j = c
  | EqConst (i : ℕ) (c : ℝ) : TropConstraint      -- x_i = c

/-- Satisfaction of a tropical constraint -/
def satisfiesConstraint (x : ℕ → ℝ) : TropConstraint → Prop
  | .LeShift i j c => x i ≤ x j + c
  | .EqSum i j c => x i + x j = c
  | .EqConst i c => x i = c

/-- A tropical polyhedron is defined by a list of constraints -/
abbrev TropPolyhedron := List TropConstraint

/-- The feasible set of a tropical polyhedron -/
def feasibleSet (poly : TropPolyhedron) : Set (ℕ → ℝ) :=
  {x | ∀ c ∈ poly, satisfiesConstraint x c}



/-! ## Section 4: Reversal with Gate Selections (Trapdoor-Assisted) -/

/-- A linearized gate: after fixing selections, each gate is either
    "take left", "take right", or "add" -/
inductive LinearizedGate where
  | TakeLeft : LinearizedGate
  | TakeRight : LinearizedGate
  | Add : LinearizedGate

/-- Evaluate a linearized gate -/
def evalLinearized (lg : LinearizedGate) (a b : ℝ) : ℝ :=
  match lg with
  | .TakeLeft => a
  | .TakeRight => b
  | .Add => a + b






/-! ## Section 5: Consistency Checking -/

/-- A min-gate selection is consistent if the selected value is indeed the minimum -/
def minSelectionConsistent (a b : ℝ) (selectLeft : Bool) : Prop :=
  if selectLeft then a ≤ b else b ≤ a

/-- A max-gate selection is consistent if the selected value is indeed the maximum -/
def maxSelectionConsistent (a b : ℝ) (selectLeft : Bool) : Prop :=
  if selectLeft then b ≤ a else a ≤ b





/-! ## Section 6: Reversal Complexity -/


/-! ## Section 7: Piecewise Linear Regions -/



/-! ## Section 8: Boundary Points -/

/-
The boundary between two linear regions is at most one point
    (when slopes differ)
-/

/-! ## Section 9: Degeneracy and Selection Ambiguity -/




end TropicalReversal

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