File: Mathlib/Combinatorics/SimpleGraph/Regularity/Increment.lean

full_name: _aux_Mathlib_Combinatorics_SimpleGraph_Regularity_Increment___macroRules_termM_1
code: local notation3 "m" => (card α / stepBound P.parts.card : ℕ)
goal: Lean.Macro

full_name: SzemerediRegularity.increment
code: /-- The **increment partition** in Szemerédi's Regularity Lemma.

If an equipartition is *not* uniform, then the increment partition is a (much bigger) equipartition
with a slightly higher energy. This is helpful since the energy is bounded by a constant (see
`Finpartition.energy_le_one`), so this process eventually terminates and yields a
not-too-big uniform equipartition. -/
noncomputable def increment : Finpartition (univ : Finset α) 
goal: Finpartition Finset.univ

full_name: SzemerediRegularity.card_increment
code: /-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card 
goal: (SzemerediRegularity.increment hP G ε).parts.card = SzemerediRegularity.stepBound P.parts.card

full_name: SzemerediRegularity.increment_isEquipartition
code: theorem increment_isEquipartition : (increment hP G ε).IsEquipartition 
goal: (SzemerediRegularity.increment hP G ε).IsEquipartition

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Increment.0.SzemerediRegularity.distinctPairs
code: /-- The contribution to `Finpartition.energy` of a pair of distinct parts of a `Finpartition`. -/
private noncomputable def distinctPairs (x : {x // x ∈ P.parts.offDiag}) :
    Finset (Finset α × Finset α) 
goal: Finset (Finset α × Finset α)

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Increment.0.SzemerediRegularity.distinctPairs_increment
code: private theorem distinctPairs_increment :
    P.parts.offDiag.attach.biUnion (distinctPairs hP G ε) ⊆ (increment hP G ε).parts.offDiag 
goal: P.parts.offDiag.attach.biUnion (SzemerediRegularity.distinctPairs hP G ε) ⊆
  (SzemerediRegularity.increment hP G ε).parts.offDiag

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Increment.0.SzemerediRegularity.pairwiseDisjoint_distinctPairs
code: private lemma pairwiseDisjoint_distinctPairs :
    (P.parts.offDiag.attach : Set {x // x ∈ P.parts.offDiag}).PairwiseDisjoint
      (distinctPairs hP G ε) 
goal: (↑P.parts.offDiag.attach).PairwiseDisjoint (SzemerediRegularity.distinctPairs hP G ε)

full_name: SzemerediRegularity.le_sum_distinctPairs_edgeDensity_sq
code: lemma le_sum_distinctPairs_edgeDensity_sq (x : {i // i ∈ P.parts.offDiag}) (hε₁ : ε ≤ 1)
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) :
    (G.edgeDensity x.1.1 x.1.2 : ℝ) ^ 2 +
      ((if G.IsUniform ε x.1.1 x.1.2 then 0 else ε ^ 4 / 3) - ε ^ 5 / 25) ≤
    (∑ i ∈ distinctPairs hP G ε x, G.edgeDensity i.1 i.2 ^ 2 : ℝ) / 16 ^ P.parts.card 
goal: ↑(G.edgeDensity (↑x).1 (↑x).2) ^ 2 + ((if G.IsUniform ε (↑x).1 (↑x).2 then 0 else ε ^ 4 / 3) - ε ^ 5 / 25) ≤
  (∑ i ∈ SzemerediRegularity.distinctPairs hP G ε x, ↑(G.edgeDensity i.1 i.2) ^ 2) / 16 ^ P.parts.card

full_name: SzemerediRegularity.energy_increment
code: /-- The increment partition has energy greater than the original one by a known fixed amount. -/
theorem energy_increment (hP : P.IsEquipartition) (hP₇ : 7 ≤ P.parts.card)
    (hPε : 100 ≤ 4 ^ P.parts.card * ε ^ 5) (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPG : ¬P.IsUniform G ε) (hε₀ : 0 ≤ ε) (hε₁ : ε ≤ 1) :
    ↑(P.energy G) + ε ^ 5 / 4 ≤ (increment hP G ε).energy G 
goal: ↑(P.energy G) + ε ^ 5 / 4 ≤ ↑((SzemerediRegularity.increment hP G ε).energy G)