/- 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.Combinatorics.SimpleGraph.Basic public import FormalConjecturesForMathlib.Data.Finset.Card@[expose] public sectionopen Finsetnamespace SimpleGraphvariable {n k : }

The Johnson graph $J(n, k)$ has as vertices the $k$-subsets of an $n$-set. Two vertices are adjacent if their intersection has size $k - 1$.

@[simps -isSimp] def johnson (n k : ) : SimpleGraph {s : Finset (Fin n) // #s = k} where Adj s t := #(s.val t.val) + 1 = k symm.symm s t h := n✝:k✝:n:k:s:{ s // #s = k }t:{ s // #s = k }h:#(s t) + 1 = k#(t s) + 1 = k All goals completed! 🐙 loopless.irrefl := n✝:k✝:n:k: (a : { s // #s = k }), ¬#(a a) + 1 = k All goals completed! 🐙scoped notation "J(" n ", " k ")" => johnson n kn:k:s:Finset (Fin n)hs:#s = kt:Finset (Fin n)ht:#t = kh:k #(s t) + 1hst:¬s = ts t s n:k:s:Finset (Fin n)hs:#s = kt:Finset (Fin n)ht:#t = kh:k #(s t) + 1hst:¬s = t¬s t n:k:s:Finset (Fin n)hs:#s = kt:Finset (Fin n)ht:#t = kh:k #(s t) + 1hst:s ts = t exact eq_of_subset_of_card_le hst (n:k:s:Finset (Fin n)hs:#s = kt:Finset (Fin n)ht:#t = kh:k #(s t) + 1hst:s t#t #s All goals completed! 🐙)lemma not_johnson_adj_iff_lt {s t : {s : Finset (Fin n) // #s = k}} : ¬ J(n, k).Adj s t s = t #(s.val t.val) + 1 < k := n:k:s:{ s // #s = k }t:{ s // #s = k }¬J(n, k).Adj s t s = t #(s t) + 1 < k n:k:s:{ s // #s = k }t:{ s // #s = k }¬s = t #(s t) + 1 < k s = t #(s t) + 1 < k; All goals completed! 🐙end SimpleGraph