/- Copyright 2026 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. -/ import FormalConjecturesUtil

Erdős Problem 905

References:

    erdosproblems.com/905

    [KhNi79] Khadzhiivanov, N. G. and Nikiforov, S. V., Solution of a problem of P. Erdős about the maximum number of triangles with a common edge in a graph. C. R. Acad. Bulgare Sci. (1979), 1315-1318.

namespace Erdos905open Finset

Every graph with $n$ vertices and $>n^2/4$ edges contains an edge which is in at least $n/6$ triangles.

A conjecture of Bollobás and Erdős. This was proved independently by Edwards (unpublished) and Khadzhiivanov and Nikiforov [KhNi79].

@[category research solved, AMS 5, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos905.lean"] theorem erdos_905 (n : ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (hG : (n : ) ^ 2 / 4 < (#G.edgeFinset : )) : e G.edgeFinset, (n : ) / 6 (#(G.trianglesContaining e) : ) := n:G:SimpleGraph (Fin n)inst✝:DecidableRel G.AdjhG:n ^ 2 / 4 < (#G.edgeFinset) e G.edgeFinset, n / 6 (#(G.trianglesContaining e)) All goals completed! 🐙end Erdos905