## Diagram: Mathematical Theorem Formalization Process
### Overview
The image presents a comparative visualization of mathematical theorem representation in informal and formal contexts, connected by a neural network architecture. It combines textual content, code-like syntax, and a neural network diagram to illustrate the transformation from intuitive mathematical reasoning to formal verification.
### Components/Axes
1. **Left Section ("Informal math")**:
- Contains a theorem statement and proof about infinite primes
- Includes a stylized book icon labeled "MATH"
- Text formatting: Bold theorem title, numbered proof steps, square symbol at conclusion
2. **Right Section ("Formal theorem (and proof)")**:
- Contains Lean 4 theorem specification and proof
- Code elements: Theorem name (`exists_infinite_primes`), parameters (`n : N`), logical operators (`∃`, `∧`), and proof steps
- Key functions: `minFac`, `dvd_factorial`, `Nat.dvd_add_iff_right`
3. **Central Diagram**:
- Neural network architecture with 10 nodes (black circles) and 15 edges
- Nodes arranged in 3 layers (input: 4 nodes, hidden: 3 nodes, output: 3 nodes)
- Edges represented by straight black lines
- Positioned between the two text sections
4. **Legend**:
- Located in top-right corner of the diagram
- Contains stylized "LEAN" text in uppercase
- Font style: Geometric sans-serif with angular characteristics
- Color: Black text on white background
### Detailed Analysis
**Informal Math Section**:
- Theorem 1: "There exists an infinite number of primes"
- Proof structure:
1. Let n be arbitrary positive integer
2. Let p ∈ ℤ⁺ be prime factor of n! + 1
3. Show p > n through divisibility argument
4. Conclude infinitude of primes via arbitrary n
**Formal Theorem Section**:
- Lean 4 syntax elements:
- Theorem declaration: `theorem exists_infinite_primes (n : N) : ∃ p, n ≤ p ∧ Prime p :=`
- Proof steps using Lean's proof-by-cases structure
- Key constructs:
- `minFac` (minimum factor function)
- `dvd_factorial` (divides factorial property)
- `Nat.dvd_add_iff_right` (divisibility addition equivalence)
**Neural Network Diagram**:
- Node connections suggest information flow from informal to formal representation
- Layer structure implies hierarchical processing:
- Input layer (4 nodes) processes initial theorem components
- Hidden layer (3 nodes) performs intermediate transformations
- Output layer (3 nodes) generates formal theorem components
### Key Observations
1. The neural network's 10:15 node:edge ratio suggests dense connectivity typical of universal approximation capabilities
2. The formal proof contains 7 distinct logical steps vs 4 in the informal version
3. Lean's type system is evident through parameter declarations (`n : N`) and type constraints
4. The book icon's "MATH" label connects to the theorem's mathematical content
5. The square symbol (□) in the informal proof denotes conclusion in mathematical notation
### Interpretation
This visualization demonstrates the bridge between intuitive mathematical reasoning and formal verification systems. The neural network architecture suggests that:
1. Informal proofs can be systematically transformed into formal specifications
2. The 3-layer network might represent:
- Input: Mathematical axioms/definitions
- Hidden: Logical inference mechanisms
- Output: Formal theorem statements
3. The Lean 4 code reveals the theorem's formal structure:
- Explicit parameterization (`n : N`)
- Quantifier usage (`∃ p`)
- Type constraints (`Prime p`)
4. The proof's transformation from 4 steps to 7 formal steps indicates increased granularity in formal verification
5. The absence of numerical data emphasizes the symbolic nature of mathematical proof systems
The image effectively illustrates the computational complexity of formalizing mathematical proofs, showing how neural networks might assist in this process while Lean provides the verification framework.