/- Copyright 2025 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import Mathlib.Data.Finset.Basic public import Mathlib.Data.Fintype.Card public import Mathlib.Order.Lattice.Nat@[expose] public section

Hypergraph Ramsey Numbers

This file defines the r-uniform hypergraph Ramsey number R_r(n).

namespace Combinatorics

The r-uniform hypergraph Ramsey number R_r(n). The smallest natural number m such that every 2-coloring of the r-subsets of a set of size m contains a monochromatic subset of size n.

noncomputable def hypergraphRamsey (r n : ) : := sInf { m | (c : Finset (Fin m) Bool), (S : Finset (Fin m)), S.card = n (color : Bool), (e : Finset (Fin m)), e S e.card = r c e = color }

n ≤ hypergraphRamsey r n when the set is nonempty.

theorem le_hypergraphRamsey (r n : ) (hne : { m | (c : Finset (Fin m) Bool), (S : Finset (Fin m)), S.card = n (color : Bool), (e : Finset (Fin m)), e S e.card = r c e = color }.Nonempty) : n hypergraphRamsey r n := r:n:hne:{m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}.Nonemptyn hypergraphRamsey r n r:n:hne:{m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}.Nonempty b {m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}, n b r:n:hne:{m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}.Nonemptym:hm:m {m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}n m r:n:hne:{m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}.Nonemptym:hm:m {m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}this: S, S.card = n color, e S, e.card = r false = colorn m r:n:hne:{m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}.Nonemptym:hm:m {m | (c : Finset (Fin m) Bool), S, S.card = n color, e S, e.card = r c e = color}S:Finset (Fin m)hS:S.card = nn m calc n = S.card := hS.symm _ Fintype.card (Fin m) := Finset.card_le_univ S _ = m := Fintype.card_fin m

hypergraphRamsey r r = r for any r.

r:h_mem:r {m | (c : Finset (Fin m) Bool), S, S.card = m color, e S, e.card = r c e = color}hypergraphRamsey r r = r All goals completed! 🐙end Combinatorics