Dev.MonadicDependence.BipartiteRamsey
Lemma
For every \(k, \ell_1, \ell_2 \in \mathbb{N}\) there is a function \(U_{k, \ell_1, \ell_2} \colon \mathbb{N} \to \mathbb{N}\), monotone and unbounded in \(n\) and depending only on \(k, \ell_1, \ell_2\), such that the following holds.
For every \(n \in \mathbb{N}\) and coloring \[c \colon [n]^{\ell_1} \times [n]^{\ell_2} \to [k]\] there exist subsets \(I_1, I_2 \subseteq [n]\) of size at least \(U_{k, \ell_1, \ell_2}(n)\) and a function \(f \colon \operatorname{OTP}(\ell_1) \times \operatorname{OTP}(\ell_2) \to [k]\) such that \[c(\bar{a}, \bar{b}) = f(\operatorname{otp}(\bar{a}), \operatorname{otp}(\bar{b})) \qquad \text{for all } \bar{a} \in I_1^{\ell_1},\ \bar{b} \in I_2^{\ell_2}.\]
Here \(\operatorname{OTP}(\ell)\) denotes the (finite) set of possible order types of an \(\ell\)-tuple of elements of a linearly ordered set, and \(\operatorname{otp}(a_1, \ldots, a_\ell) := (\operatorname{otp}(a_i, a_j))_{ 1 \leq i < j \leq \ell}\) with \(\operatorname{otp}(a, b) \in \{<, =, >\}\).
Review notes
Relation to existing catalog entries. Theorem Ramsey formalizes Ramsey’s theorem for graphs (monochromatic clique or independent set). Lemma BipartiteRamsey is a bipartite Ramsey statement in a graph-theoretic form (either a set with no common neighbor, a \(1\)-subdivision of \(K_t\), or a high-degree vertex). Neither matches the shape of Mählmann’s Lemma 4.15, which is a coloring Ramsey statement on \(\ell\)-tuples that concludes order-type-uniformity on two sides independently. We therefore give a separate entry.
\(U\)-notation. Mählmann’s Lemma 4.15 is stated with “\(U\)-notation” (p. 27), which elides the specific growth of the Ramsey bound and only asserts that it is some monotone unbounded function of \(n\). We preserve this in the natural-language statement. A Lean-level formalization will need to pick an explicit function.
Intended use. This entry is used by Lemma SubdividedBicliqueRamsey (Mählmann’s Lemma 13.8), which in turn is used in the target Lemma WeaklySparseMonDepIsNowhereDense (Lemma 13.7). The proof of Lemma 13.7 itself does not invoke Lemma 4.15 directly.
Lean encoding: orderType via compare.
Mählmann’s \(\operatorname{otp}(a_1, \ldots, a_\ell)\) is a tuple
indexed by pairs \((i, j)\) with \(1 \leq i < j \leq \ell\), valued in
\(\{<, =, >\}\). Our orderType uses
compare : V → V → Ordering on all pairs
\((i, j) \in \texttt{Fin } \ell \times \texttt{Fin } \ell\):
\[\texttt{orderType}\ a\ (i, j) := \texttt{compare}\ (a\ i)\ (a\ j).\]
This is equivalent to the source’s definition: the \(i = j\) diagonal
is always eq, and the \(i > j\) half is redundant with the
\(i < j\) half (compare is antisymmetric on
LinearOrder). We use the full square rather than the strict
lower triangle because it is much more convenient in Lean — no
coercion machinery around “\(i < j\) as a Fin pair”.
\(U\)-notation packaging. The universally quantified
“\(U_{k, \ell_1, \ell_2}\)” of the source becomes an existentially
packaged \((U, \texttt{Monotone } U, \forall N, \exists n, N \leq U n)\):
\[\exists U : \mathbb{N} \to \mathbb{N},\ \texttt{Monotone } U\
\land\ (\forall N, \exists n, N \leq U\ n) \land \ldots\]
Monotone + the unboundedness clause captures “monotone and
unbounded in \(n\)” exactly. Downstream uses that need “\(U n \to
\infty\) as \(n \to \infty\)” can combine the two.
Coloring shape: curried. The coloring is
(Fin \(\ell_1\) → Fin \(n\)) → (Fin \(\ell_2\) → Fin \(n\)) → Fin \(k\)
(curried) rather than
(Fin \(\ell_1\) × Fin \(\ell_2\)) → Fin \(n\). Minor difference;
the curried form is slightly more Lean-idiomatic for subsequent
pattern matching over the two tuples separately.
Positivity of \(k\). The Lean contract adds an explicit
hypothesis \(\mathtt{hk : 0 < k}\) not present in Mählmann’s source
statement. The source uses \([k]\) informally as a \(1\)-indexed set,
silently assuming \(k \geq 1\). Without \(\mathtt{0 < k}\) the Lean
statement is false at \((k = 0, \ell_i \geq 1, n = 0)\): the
colouring \(c\) has empty domain and so exists vacuously, but the
required \(f : (\texttt{Fin } \ell_1 \times \texttt{Fin } \ell_1 \to
\texttt{Ordering}) \to \ldots \to \texttt{Fin } 0\) has nonempty
domain and empty codomain. The hypothesis makes this degeneracy
explicit; downstream uses of bipartiteRamsey discharge it
trivially.
Dev/MonadicDependence/BipartiteRamsey/Contract.lean (full)
| 1 | import Mathlib.Data.Finset.Card |
| 2 | import Mathlib.Order.Monotone.Basic |
| 3 | import Catalog.Sparsity.Preliminaries.Contract |
| 4 | |
| 5 | namespace Dev.MonadicDependence.BipartiteRamsey |
| 6 | |
| 7 | /-- Order type of a tuple `a : Fin ℓ → V` (`V` linearly ordered). For |
| 8 | each pair `(i, j) : Fin ℓ × Fin ℓ`, records whether `a i < a j`, |
| 9 | `a i = a j`, or `a i > a j`. Mählmann p. 28 writes this as `otp(a)`. -/ |
| 10 | def orderType {V : Type*} [LinearOrder V] {ℓ : ℕ} (a : Fin ℓ → V) : |
| 11 | Fin ℓ × Fin ℓ → Ordering := |
| 12 | fun p => compare (a p.1) (a p.2) |
| 13 | |
| 14 | /-- Mählmann Lemma 4.15 (Bipartite Ramsey). For every `k, ℓ₁, ℓ₂ : ℕ` |
| 15 | there exists a monotone, unbounded function `U : ℕ → ℕ` (depending only |
| 16 | on `k, ℓ₁, ℓ₂`) such that, for every `n` and every coloring |
| 17 | `c : (Fin ℓ₁ → Fin n) → (Fin ℓ₂ → Fin n) → Fin k`, there exist |
| 18 | `I₁, I₂ : Finset (Fin n)` with `U n ≤ |I₁|`, `U n ≤ |I₂|`, and a |
| 19 | function |
| 20 | `f : (Fin ℓ₁ × Fin ℓ₁ → Ordering) → (Fin ℓ₂ × Fin ℓ₂ → Ordering) → Fin k` |
| 21 | such that `c a b = f (orderType a) (orderType b)` whenever every |
| 22 | coordinate of `a` lies in `I₁` and every coordinate of `b` in `I₂`. -/ |
| 23 | axiom bipartiteRamsey (k ℓ₁ ℓ₂ : ℕ) (hk : 0 < k) : |
| 24 | ∃ U : ℕ → ℕ, Monotone U ∧ (∀ N : ℕ, ∃ n : ℕ, N ≤ U n) ∧ |
| 25 | ∀ (n : ℕ) (c : (Fin ℓ₁ → Fin n) → (Fin ℓ₂ → Fin n) → Fin k), |
| 26 | ∃ I₁ I₂ : Finset (Fin n), |
| 27 | U n ≤ I₁.card ∧ U n ≤ I₂.card ∧ |
| 28 | ∃ f : (Fin ℓ₁ × Fin ℓ₁ → Ordering) → |
| 29 | (Fin ℓ₂ × Fin ℓ₂ → Ordering) → Fin k, |
| 30 | ∀ (a : Fin ℓ₁ → Fin n) (b : Fin ℓ₂ → Fin n), |
| 31 | (∀ i, a i ∈ I₁) → (∀ j, b j ∈ I₂) → |
| 32 | c a b = f (orderType a) (orderType b) |
| 33 | |
| 34 | end Dev.MonadicDependence.BipartiteRamsey |
| 35 |