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

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

full_name: SzemerediRegularity.chunk
code: /-- The portion of `SzemerediRegularity.increment` which partitions `U`. -/
noncomputable def chunk : Finpartition U 
goal: Finpartition U

full_name: SzemerediRegularity.star
code: /-- The portion of `SzemerediRegularity.chunk` which is contained in the witness of non-uniformity
of `U` and `V`. -/
noncomputable def star (V : Finset α) : Finset (Finset α) 
goal: Finset (Finset α)

full_name: SzemerediRegularity.biUnion_star_subset_nonuniformWitness
code: theorem biUnion_star_subset_nonuniformWitness :
    (star hP G ε hU V).biUnion id ⊆ G.nonuniformWitness ε U V 
goal: (SzemerediRegularity.star hP G ε hU V).biUnion id ⊆ G.nonuniformWitness ε U V

full_name: SzemerediRegularity.star_subset_chunk
code: theorem star_subset_chunk : star hP G ε hU V ⊆ (chunk hP G ε hU).parts 
goal: SzemerediRegularity.star hP G ε hU V ⊆ (SzemerediRegularity.chunk hP G ε hU).parts

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.card_nonuniformWitness_sdiff_biUnion_star
code: private theorem card_nonuniformWitness_sdiff_biUnion_star (hV : V ∈ P.parts) (hUV : U ≠ V)
    (h₂ : ¬G.IsUniform ε U V) :
    (G.nonuniformWitness ε U V \ (star hP G ε hU V).biUnion id).card ≤
    2 ^ (P.parts.card - 1) * m 
goal: (G.nonuniformWitness ε U V \ (SzemerediRegularity.star hP G ε hU V).biUnion id).card ≤
  2 ^ (P.parts.card - 1) * (Fintype.card α / SzemerediRegularity.stepBound P.parts.card)

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.one_sub_eps_mul_card_nonuniformWitness_le_card_star
code: private theorem one_sub_eps_mul_card_nonuniformWitness_le_card_star (hV : V ∈ P.parts)
    (hUV : U ≠ V) (hunif : ¬G.IsUniform ε U V) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) :
    (1 - ε / 10) * (G.nonuniformWitness ε U V).card ≤ ((star hP G ε hU V).biUnion id).card 
goal: (1 - ε / 10) * ↑(G.nonuniformWitness ε U V).card ≤ ↑((SzemerediRegularity.star hP G ε hU V).biUnion id).card

full_name: SzemerediRegularity.card_chunk
code: theorem card_chunk (hm : m ≠ 0) : (chunk hP G ε hU).parts.card = 4 ^ P.parts.card 
goal: (SzemerediRegularity.chunk hP G ε hU).parts.card = 4 ^ P.parts.card

full_name: SzemerediRegularity.card_eq_of_mem_parts_chunk
code: theorem card_eq_of_mem_parts_chunk (hs : s ∈ (chunk hP G ε hU).parts) :
    s.card = m ∨ s.card = m + 1 
goal: s.card = Fintype.card α / SzemerediRegularity.stepBound P.parts.card ∨
  s.card = Fintype.card α / SzemerediRegularity.stepBound P.parts.card + 1

full_name: SzemerediRegularity.m_le_card_of_mem_chunk_parts
code: theorem m_le_card_of_mem_chunk_parts (hs : s ∈ (chunk hP G ε hU).parts) : m ≤ s.card 
goal: Fintype.card α / SzemerediRegularity.stepBound P.parts.card ≤ s.card

full_name: SzemerediRegularity.card_le_m_add_one_of_mem_chunk_parts
code: theorem card_le_m_add_one_of_mem_chunk_parts (hs : s ∈ (chunk hP G ε hU).parts) : s.card ≤ m + 1 
goal: s.card ≤ Fintype.card α / SzemerediRegularity.stepBound P.parts.card + 1

full_name: SzemerediRegularity.card_biUnion_star_le_m_add_one_card_star_mul
code: theorem card_biUnion_star_le_m_add_one_card_star_mul :
    (((star hP G ε hU V).biUnion id).card : ℝ) ≤ (star hP G ε hU V).card * (m + 1) 
goal: ↑((SzemerediRegularity.star hP G ε hU V).biUnion id).card ≤
  ↑(SzemerediRegularity.star hP G ε hU V).card * (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1)

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.le_sum_card_subset_chunk_parts
code: private theorem le_sum_card_subset_chunk_parts (h𝒜 : 𝒜 ⊆ (chunk hP G ε hU).parts) (hs : s ∈ 𝒜) :
    (𝒜.card : ℝ) * s.card * (m / (m + 1)) ≤ (𝒜.sup id).card 
goal: ↑𝒜.card * ↑s.card *
    (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) /
      (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1)) ≤
  ↑(𝒜.sup id).card

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.sum_card_subset_chunk_parts_le
code: private theorem sum_card_subset_chunk_parts_le (m_pos : (0 : ℝ) < m)
    (h𝒜 : 𝒜 ⊆ (chunk hP G ε hU).parts) (hs : s ∈ 𝒜) :
    ((𝒜.sup id).card : ℝ) ≤ 𝒜.card * s.card * ((m + 1) / m) 
goal: ↑(𝒜.sup id).card ≤
  ↑𝒜.card * ↑s.card *
    ((↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1) /
      ↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card))

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.one_sub_le_m_div_m_add_one_sq
code: private theorem one_sub_le_m_div_m_add_one_sq [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) :
    ↑1 - ε ^ 5 / ↑50 ≤ (m / (m + 1 : ℝ)) ^ 2 
goal: 1 - ε ^ 5 / 50 ≤
  (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) /
      (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1)) ^
    2

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.m_add_one_div_m_le_one_add
code: private theorem m_add_one_div_m_le_one_add [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) : ((m + 1 : ℝ) / m) ^ 2 ≤ ↑1 + ε ^ 5 / 49 
goal: ((↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1) /
      ↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card)) ^
    2 ≤
  1 + ε ^ 5 / 49

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.density_sub_eps_le_sum_density_div_card
code: private theorem density_sub_eps_le_sum_density_div_card [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    {hU : U ∈ P.parts} {hV : V ∈ P.parts} {A B : Finset (Finset α)}
    (hA : A ⊆ (chunk hP G ε hU).parts) (hB : B ⊆ (chunk hP G ε hV).parts) :
    (G.edgeDensity (A.biUnion id) (B.biUnion id)) - ε ^ 5 / 50 ≤
    (∑ ab ∈ A.product B, (G.edgeDensity ab.1 ab.2 : ℝ)) / (A.card * B.card) 
goal: ↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) - ε ^ 5 / 50 ≤
  (∑ ab ∈ A.product B, ↑(G.edgeDensity ab.1 ab.2)) / (↑A.card * ↑B.card)

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.sum_density_div_card_le_density_add_eps
code: private theorem sum_density_div_card_le_density_add_eps [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts} {A B : Finset (Finset α)}
    (hA : A ⊆ (chunk hP G ε hU).parts) (hB : B ⊆ (chunk hP G ε hV).parts) :
    (∑ ab ∈ A.product B, G.edgeDensity ab.1 ab.2 : ℝ) / (A.card * B.card) ≤
    G.edgeDensity (A.biUnion id) (B.biUnion id) + ε ^ 5 / 49 
goal: (∑ ab ∈ A.product B, ↑(G.edgeDensity ab.1 ab.2)) / (↑A.card * ↑B.card) ≤
  ↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) + ε ^ 5 / 49

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.average_density_near_total_density
code: private theorem average_density_near_total_density [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts} {A B : Finset (Finset α)}
    (hA : A ⊆ (chunk hP G ε hU).parts) (hB : B ⊆ (chunk hP G ε hV).parts) :
    |(∑ ab ∈ A.product B, G.edgeDensity ab.1 ab.2 : ℝ) / (A.card * B.card) -
      G.edgeDensity (A.biUnion id) (B.biUnion id)| ≤ ε ^ 5 / 49 
goal: |(∑ ab ∈ A.product B, ↑(G.edgeDensity ab.1 ab.2)) / (↑A.card * ↑B.card) -
      ↑(G.edgeDensity (A.biUnion id) (B.biUnion id))| ≤
  ε ^ 5 / 49

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.edgeDensity_chunk_aux
code: private theorem edgeDensity_chunk_aux [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hU : U ∈ P.parts) (hV : V ∈ P.parts) :
    (G.edgeDensity U V : ℝ) ^ 2 - ε ^ 5 / ↑25 ≤
    ((∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
      (G.edgeDensity ab.1 ab.2 : ℝ)) / ↑16 ^ P.parts.card) ^ 2 
goal: ↑(G.edgeDensity U V) ^ 2 - ε ^ 5 / 25 ≤
  ((∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
        ↑(G.edgeDensity ab.1 ab.2)) /
      16 ^ P.parts.card) ^
    2

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.abs_density_star_sub_density_le_eps
code: private theorem abs_density_star_sub_density_le_eps (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts} (hUV' : U ≠ V) (hUV : ¬G.IsUniform ε U V) :
    |(G.edgeDensity ((star hP G ε hU V).biUnion id) ((star hP G ε hV U).biUnion id) : ℝ) -
      G.edgeDensity (G.nonuniformWitness ε U V) (G.nonuniformWitness ε V U)| ≤ ε / 5 
goal: |↑(G.edgeDensity ((SzemerediRegularity.star hP G ε hU V).biUnion id)
          ((SzemerediRegularity.star hP G ε hV U).biUnion id)) -
      ↑(G.edgeDensity (G.nonuniformWitness ε U V) (G.nonuniformWitness ε V U))| ≤
  ε / 5

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.eps_le_card_star_div
code: private theorem eps_le_card_star_div [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) (hε₁ : ε ≤ 1) (hU : U ∈ P.parts) (hV : V ∈ P.parts)
    (hUV : U ≠ V) (hunif : ¬G.IsUniform ε U V) :
    ↑4 / ↑5 * ε ≤ (star hP G ε hU V).card / ↑4 ^ P.parts.card 
goal: 4 / 5 * ε ≤ ↑(SzemerediRegularity.star hP G ε hU V).card / 4 ^ P.parts.card

full_name: _private.Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk.0.SzemerediRegularity.edgeDensity_star_not_uniform
code: /-- Lower bound on the edge densities between non-uniform parts of `SzemerediRegularity.star`. -/
private theorem edgeDensity_star_not_uniform [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts} (hUVne : U ≠ V) (hUV : ¬G.IsUniform ε U V) :
    ↑3 / ↑4 * ε ≤
    |(∑ ab ∈ (star hP G ε hU V).product (star hP G ε hV U), (G.edgeDensity ab.1 ab.2 : ℝ)) /
      ((star hP G ε hU V).card * (star hP G ε hV U).card) -
        (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
          (G.edgeDensity ab.1 ab.2 : ℝ)) / (16 : ℝ) ^ P.parts.card| 
goal: 3 / 4 * ε ≤
  |(∑ ab ∈ (SzemerediRegularity.star hP G ε hU V).product (SzemerediRegularity.star hP G ε hV U),
          ↑(G.edgeDensity ab.1 ab.2)) /
        (↑(SzemerediRegularity.star hP G ε hU V).card * ↑(SzemerediRegularity.star hP G ε hV U).card) -
      (∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
          ↑(G.edgeDensity ab.1 ab.2)) /
        16 ^ P.parts.card|

full_name: SzemerediRegularity.edgeDensity_chunk_not_uniform
code: /-- Lower bound on the edge densities between non-uniform parts of `SzemerediRegularity.increment`.
-/
theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts}
    (hUVne : U ≠ V) (hUV : ¬G.IsUniform ε U V) :
    (G.edgeDensity U V : ℝ) ^ 2 - ε ^ 5 / ↑25 + ε ^ 4 / ↑3 ≤
    (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
      (G.edgeDensity ab.1 ab.2 : ℝ) ^ 2) / ↑16 ^ P.parts.card 
goal: ↑(G.edgeDensity U V) ^ 2 - ε ^ 5 / 25 + ε ^ 4 / 3 ≤
  (∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
      ↑(G.edgeDensity ab.1 ab.2) ^ 2) /
    16 ^ P.parts.card

full_name: SzemerediRegularity.edgeDensity_chunk_uniform
code: /-- Lower bound on the edge densities between parts of `SzemerediRegularity.increment`. This is the
blanket lower bound used the uniform parts. -/
theorem edgeDensity_chunk_uniform [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) (hU : U ∈ P.parts) (hV : V ∈ P.parts) :
    (G.edgeDensity U V : ℝ) ^ 2 - ε ^ 5 / ↑25 ≤
    (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
      (G.edgeDensity ab.1 ab.2 : ℝ) ^ 2) / ↑16 ^ P.parts.card 
goal: ↑(G.edgeDensity U V) ^ 2 - ε ^ 5 / 25 ≤
  (∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
      ↑(G.edgeDensity ab.1 ab.2) ^ 2) /
    16 ^ P.parts.card