## Code Screenshot: Lean 4 Mathematical Theorems
### Overview
The image is a screenshot of a code editor window displaying three mathematical theorem statements and their proofs written in the Lean 4 theorem prover syntax. The code is presented with syntax highlighting on a dark background. The window has the standard macOS-style traffic light buttons (red, yellow, green) in the top-left corner.
### Components/Axes
* **Window Frame**: A dark gray rounded rectangle containing the code.
* **Traffic Light Buttons**: Three colored circles (red, yellow, green) positioned horizontally in the top-left corner of the window frame.
* **Code Content**: Three distinct theorem blocks, each following a similar structure: a theorem name, variable declarations, hypotheses, a goal statement, and a proof tactic.
* **Syntax Highlighting**:
* Keywords (`theorem`, `by`, `nlinarith`, `linarith`, `simp`, `rw`) are in a pinkish-red color.
* Theorem names (`mathd_algebra_141`, etc.) are in a light orange/peach color.
* Variable names (`a`, `b`, `x`, `y`) and hypothesis labels (`h₀`, `h₁`, `h₂`) are in a light blue/cyan color.
* Numeric literals (`180`, `54`, `369`, `11`, `5`, `2`) are in a yellow color.
* Mathematical operators (`*`, `+`, `=`, `^`, `:=`, `:`, `->`) and punctuation are in white or light gray.
* The type `ℝ` (real numbers) is in a light blue color.
* Function names (`Real.sqrt`) are in white.
### Detailed Analysis
The image contains three separate theorem proofs. The language is English, embedded within Lean 4 code syntax.
**Theorem 1: `mathd_algebra_141`**
* **Variables**: `a`, `b` of type `ℝ` (real numbers).
* **Hypotheses**:
* `h₁`: `(a * b) = 180`
* `h₂`: `2 * (a + b) = 54`
* **Goal**: `(a^2 + b^2) = 369`
* **Proof Tactic**: `by nlinarith` (a tactic for nonlinear arithmetic).
**Theorem 2: `mathd_algebra_329`**
* **Variables**: `x`, `y` of type `ℝ`.
* **Hypotheses**:
* `h₀`: `3 * y = x`
* `h₁`: `2 * x + 5 * y = 11`
* **Goal**: `x + y = 4`
* **Proof Tactic**: `by linarith` (a tactic for linear arithmetic).
**Theorem 3: `mathd_algebra_547`**
* **Variables**: `x`, `y` of type `ℝ`.
* **Hypotheses**:
* `h₀`: `x = 5`
* `h₁`: `y = 2`
* **Goal**: `Real.sqrt (x ^ 3 - 2 ^ y) = 11`
* **Proof Tactic**: A multi-step proof:
1. `by simp [h₀, h₁, sq]` (simplifies using hypotheses and the definition of square).
2. `rw [Real.sqrt_eq_iff_sq_eq] <;> norm_num` (rewrites using the property that sqrt(a)=b iff b²=a, then normalizes numbers).
### Key Observations
1. **Structure**: All three theorems follow a consistent pattern: `theorem [name] ([vars] : ℝ) ([hypotheses]) : [goal] := by [tactic]`.
2. **Proof Complexity**: The proof tactics increase in complexity from a single automated tactic (`nlinarith`, `linarith`) to a combination of simplification and rewriting (`simp`, `rw`).
3. **Mathematical Content**: The theorems cover basic algebra: solving for sums of squares given product and sum (Theorem 141), solving a system of linear equations (Theorem 329), and evaluating a square root of a numeric expression (Theorem 547).
4. **Syntax**: The code uses standard Lean 4 notation. The `ℝ` symbol denotes the type of real numbers. The `:=` symbol separates the goal from the proof. The `by` keyword introduces a tactic block.
### Interpretation
This image is a technical artifact from the domain of formal verification and automated theorem proving. It demonstrates how mathematical problems are encoded and solved within a proof assistant like Lean.
* **Purpose**: These are likely example problems or test cases, possibly from a dataset (suggested by the naming scheme `mathd_algebra_XXX`), used to train or benchmark automated reasoning systems. The proofs rely on Lean's powerful arithmetic solvers (`linarith`, `nlinarith`), which can automatically discharge many goals involving linear and nonlinear arithmetic over reals.
* **Relationship Between Elements**: Each theorem block is a self-contained unit. The hypotheses provide the given information, the goal states what needs to be proven, and the tactic is the computational strategy that bridges the two. The successful proof (indicated by the lack of an error message) confirms the logical validity of the goal given the hypotheses.
* **Notable Pattern**: The progression from `linarith` to `nlinarith` to a custom `simp`/`rw` sequence illustrates different levels of automation. Linear systems are the easiest to solve automatically. Nonlinear problems (like the sum of squares in Theorem 141) require a more powerful solver. The final theorem, while arithmetically simple, requires explicit rewriting rules, showing that not all problems are solvable by a single "magic" tactic.
* **Underlying Message**: The image showcases the power and conciseness of modern theorem-proving languages. Complex mathematical reasoning is expressed in a compact, structured, and machine-verifiable format. The clean syntax highlighting and presentation suggest this is from an educational resource, a well-documented codebase, or a research paper demonstrating automated problem-solving capabilities.