## Formal Proof Code Snippet: Schur Convexity Theorem
### Overview
The image displays a code snippet from a formal verification or theorem-proving environment (likely Lean 4 or a similar system). It shows the definition and the beginning of a proof for a mathematical theorem named `schur_convex_xlogx`. The theorem asserts that a specific function involving the sum of `x * log(x)` is Schur-convex. The snippet includes line numbers, a proof status indicator, and the initial steps of the proof script.
### Components/Axes
* **Line Numbers:** A vertical gutter on the left displays line numbers from 530 to 536.
* **Proof Status Indicator:** A blue checkmark (`✓`) is positioned to the left of line 531, indicating that the theorem or the proof up to that point has been successfully verified.
* **Code Content:** The main area contains the theorem statement and the initial proof tactics. The text uses syntax highlighting with different colors for keywords, types, and variables.
### Detailed Analysis
The following is a precise transcription of the text in the image, line by line:
**Line 530:** (Empty line)
**Line 531:** `theorem schur_convex_xlogx {n : ℕ} :`
**Line 532:** ` SchurConvex (fun x : Fin n → ℝ => ∑ i, x i * Real.log (x i)) := by`
**Line 533:** ` unfold SchurConvex`
**Line 534:** ` intro x y hx_nonneg hy_nonneg h`
**Line 535:** ` obtain ⟨h_majorization, h_sum_eq⟩ := h`
**Line 536:** (Empty line)
**Breakdown of the Code:**
1. **Theorem Declaration (Lines 531-532):**
* `theorem schur_convex_xlogx`: Declares a theorem with the given name.
* `{n : ℕ}`: A universal parameter `n`, a natural number (ℕ).
* `SchurConvex (fun x : Fin n → ℝ => ∑ i, x i * Real.log (x i))`: The proposition being proved. It states that the function mapping a vector `x` (of length `n`, with indices from `Fin n` and real number components ℝ) to the sum (`∑`) of `x i * Real.log (x i)` over all indices `i` is Schur-convex.
* `:= by`: Begins the proof script.
2. **Proof Script (Lines 533-535):**
* `unfold SchurConvex`: The first tactic. It expands the definition of the `SchurConvex` predicate in the goal.
* `intro x y hx_nonneg hy_nonneg h`: Introduces the variables and hypotheses required by the now-unfolded definition. This typically includes two vectors `x` and `y`, hypotheses that their components are non-negative (`hx_nonneg`, `hy_nonneg`), and a hypothesis `h` that `x` is majorized by `y` (or vice-versa, depending on the definition's direction).
* `obtain ⟨h_majorization, h_sum_eq⟩ := h`: Destructures the hypothesis `h` into two separate hypotheses: `h_majorization` (the majorization condition) and `h_sum_eq` (the condition that the sums of the vector components are equal).
### Key Observations
* **Successful Verification:** The blue checkmark on line 531 strongly suggests the theorem has been fully proven and verified by the system.
* **Mathematical Context:** The theorem deals with **Schur-convexity**, a property of functions that preserve the order of vectors under majorization. The specific function `f(x) = Σ xᵢ log(xᵢ)` is a well-known convex function related to entropy.
* **Proof Structure:** The proof begins by unfolding the definition and introducing the standard hypotheses for a Schur-convexity proof: two vectors, non-negativity constraints, and a majorization relation.
* **Syntax:** The code uses standard formal mathematics syntax: `Fin n` for a finite type of size `n`, `ℝ` for real numbers, `∑` for summation, and `Real.log` for the natural logarithm.
### Interpretation
This code snippet captures a formal, machine-checked proof of a non-trivial mathematical fact. The theorem `schur_convex_xlogx` establishes that the function `f(x) = Σ xᵢ log(xᵢ)` is Schur-convex on the domain of non-negative vectors. This result is significant in optimization theory, information theory, and economics, as Schur-convex functions are used to model concepts of inequality, dispersion, and entropy.
The proof script shows the initial, logical steps: reducing the abstract property (`SchurConvex`) to its concrete definition involving vectors and majorization, and then breaking down the majorization hypothesis into its constituent parts (majorization and equal sums). The presence of the checkmark indicates that the subsequent, unseen proof steps successfully leveraged these components to complete the argument, providing a rigorous, computational guarantee of the theorem's truth. This exemplifies the use of interactive theorem provers to formalize and verify complex mathematical reasoning.