Write more documentation

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2026-06-25 19:36:14 -05:00
parent cbad43efdc
commit a12b6c0c3c
3 changed files with 82 additions and 0 deletions

View File

@@ -1,11 +1,46 @@
import Spa.Lattice
/-!
# Product Lattice
This file provides a proof that, in addition to being a lattice,
the product of two types $\alpha \times \beta$ forms a `Spa.FiniteHeightLattice`
if both $\alpha$ and $\beta$ have a finite height.
The proof proceeds by "unzipping" a chain:
$$
(a_1, b_1) < (a_1, b_2) < \ldots < (a_n, b_m)
$$
In which, at each step, either an $\alpha$ or $\beta$ element
might ratchet up, into two chains:
$$
\begin{aligned}
a_1 < \ldots < a_n \\
b_1 < \ldots < b_m
\end{aligned}
$$
Because at least one of the two "unzipped" chains grows with
each element of the product chain, the full chain length
can't exceed the sum of the two components. By the definition
of finite height, these two chains are bounded, and therefore,
the product chain is bounded too.
-/
namespace Spa
section Unzip
variable {α β : Type*} [PartialOrder α] [PartialOrder β]
/-- The unzipping lemma: any chain (`LTSeries`) of product
elements can be decomposed into chains of components,
whose lengths bound the chain. -/
lemma LTSeries.exists_unzip (c : LTSeries (α × β)) :
(c₁ : LTSeries α) (c₂ : LTSeries β),
c₁.head = c.head.1 c₁.last = c.last.1
@@ -60,6 +95,9 @@ section FixedHeight
variable {α β : Type*}
/-- The longest possible chain is one in which only one of the components grows
at a time, making the maximum height of $\alpha \times \beta$ be
$\text{height}_\alpha + \text{height}_\beta$. -/
instance prod [A : FiniteHeightLattice α] [B : FiniteHeightLattice β] :
FiniteHeightLattice (α × β) where
toLattice := inferInstance