\n
## Screenshot: Formal Mathematical Proof Code
### Overview
The image displays a dark-themed code editor window (resembling a macOS interface with red, yellow, and green window control dots in the top-left corner) containing two formal mathematical theorem statements and their proofs. The code is written in a formal proof language, likely Lean, with syntax highlighting. The content consists of two distinct theorems: one algebraic and one from a mathematics competition.
### Components/Axes
* **UI Elements**: A dark gray editor window with a subtle drop shadow, set against a light gray-blue background. The window has three colored circles (red, yellow, green) in its top-left corner.
* **Code Structure**: The code is presented in a monospaced font with syntax highlighting. Key colors include:
* **Blue/Cyan**: Theorem names, type declarations (`ℝ`, `→`).
* **White/Light Gray**: General code text, parentheses, colons.
* **Red**: Numerical constants (e.g., `3`, `9`, `2`, `5`, `40`).
* **Green**: Proof tactics (`by`, `linarith`, `norm_num`, `field_simp`, `norm_cast`).
* **Content Layout**: The two theorem blocks are separated by a blank line. Each follows a similar structure: a `theorem` declaration, a list of parameters and hypotheses in parentheses, a conclusion, and a proof starting with `:= by`.
### Detailed Analysis
The image contains two complete, self-contained formal proofs.
**Theorem 1: `mathd_algebra_148`**
* **Declaration**: `theorem mathd_algebra_148`
* **Parameters & Hypotheses**:
* `(c : ℝ)` - `c` is a real number.
* `(f : ℝ → ℝ)` - `f` is a function from real numbers to real numbers.
* `(h₀ : ∀ x, f x = c * x^3 - 9 * x + 3)` - Hypothesis `h₀`: For all `x`, `f(x) = c*x³ - 9*x + 3`.
* `(h₁ : f 2 = 9)` - Hypothesis `h₁`: `f(2) = 9`.
* **Conclusion**: `c = 3`
* **Proof**: `:= by linarith [h₀ 2]`
* The proof uses the `linarith` (linear arithmetic) tactic, supplied with the instantiation of hypothesis `h₀` at `x=2` (i.e., `f(2) = c*2³ - 9*2 + 3`). Combined with `h₁` (`f(2)=9`), this allows the tactic to solve for `c`.
**Theorem 2: `amc12a_2016_p3`**
* **Declaration**: `theorem amc12a_2016_p3`
* **Parameters & Hypotheses**:
* `(f : ℝ → ℝ → ℝ)` - `f` is a function taking two real numbers and returning a real number.
* `(h₀ : ∀ x, ∀ (y) (_ : y ≠ 0), f x y = x - y * Int.floor (x / y))` - Hypothesis `h₀`: For all `x` and all `y` where `y ≠ 0`, `f(x, y) = x - y * floor(x / y)`. This defines `f` as the remainder operation (modulo).
* **Conclusion**: `f (3 / 8) (-(2 / 5)) = -(1 / 40)`
* **Proof**: `:= by norm_num [h₀] field_simp norm_cast`
* The proof uses a sequence of tactics: `norm_num` (normalizes numerical expressions using hypothesis `h₀`), `field_simp` (simplifies expressions in a field), and `norm_cast` (manages type casts between numeric types).
### Key Observations
1. **Formal Verification**: The code represents machine-checkable proofs of mathematical statements, not just informal descriptions.
2. **Proof Strategy Contrast**: The first proof is very concise, relying on a single powerful tactic (`linarith`) applied to a specific instance of a hypothesis. The second proof uses a sequence of more specialized simplification and normalization tactics.
3. **Mathematical Content**: The first theorem is a straightforward algebraic solve for a coefficient. The second theorem formalizes a property of the modulo operation (specifically, the remainder when dividing `3/8` by `-2/5`) and is sourced from the 2016 AMC 12A competition (Problem 3).
4. **Syntax Highlighting**: The color scheme aids readability by distinguishing between theorem names, types, numerical values, and proof commands.
### Interpretation
This image is a snapshot of formal mathematics in practice. It demonstrates how abstract mathematical problems—solving for a constant in a cubic function and evaluating a specific modular arithmetic expression—can be translated into a precise, logical language for computer verification.
The first theorem (`mathd_algebra_148`) shows the power of automated reasoning (`linarith`) for solving linear constraints derived from algebraic definitions. The second theorem (`amc12a_2016_p3`) is more intricate, requiring the formal definition of the floor function (`Int.floor`) and the manipulation of rational numbers. The proof tactics suggest the challenge lies in correctly simplifying the expression `3/8 - (-2/5) * floor((3/8)/(-2/5))` to `-1/40`.
The presence of a competition problem (`amc12a_2016_p3`) indicates this code might be part of a repository for formalizing olympiad or contest problems, serving as both a verification tool and an educational resource. The clean, highlighted presentation suggests it is meant for human reading as well as machine execution, bridging the gap between human mathematical intuition and formal logical rigor.