awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
ε : ℝ
inst_2 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 5
hε₁ : ε ≤ 1
this : 0 ≤ ε
_ : HPow.hPow (β := ℕ) (1 + HDiv.hDiv (α := ℝ) 1 (↑m : ℝ)) 2 ≤ HPow.hPow (β := ℕ) (1 + HPow.hPow (β := ℕ) ε 5 / 100) 2
_₁ :
  HPow.hPow (β := ℕ) (1 + HPow.hPow (β := ℕ) ε 5 / 100) 2 =
    1 + HPow.hPow (β := ℕ) ε 5 * (50⁻¹ + HPow.hPow (β := ℕ) ε 5 / 10000)
_₂ :
  1 + HPow.hPow (β := ℕ) ε 5 * (50⁻¹ + HPow.hPow (β := ℕ) ε 5 / 10000) ≤
    1 + HPow.hPow (β := ℕ) ε 5 * (50⁻¹ + HPow.hPow (α := ℝ) (β := ℕ) 1 5 / 10000)
_₃ : 1 + HPow.hPow (β := ℕ) ε 5 * (50⁻¹ + HPow.hPow (α := ℝ) (β := ℕ) 1 5 / 10000) ≤ 1 + HPow.hPow (β := ℕ) ε 5 * 49⁻¹
⊢ HPow.hPow (β := ℕ) (1 + HDiv.hDiv (α := ℝ) 1 (↑m : ℝ)) 2 ≤ 1 + HPow.hPow (β := ℕ) ε 5 / 49
have _₄ : 1 + HPow.hPow (β := ℕ) ε 5 * 49⁻¹ = 1 + HPow.hPow (β := ℕ) ε 5 / 49
Tactic: calc
    _ ≤ (1 + ε ^ 5 / 100) ^ 2 := by
      gcongr (1 + ?_) ^ 2
      rw [← one_div_div (100 : ℝ)]
      exact one_div_le_one_div_of_le (by sz_positivity) (hundred_div_ε_pow_five_le_m hPα hPε)
    _ = 1 + ε ^ 5 * (50⁻¹ + ε ^ 5 / 10000) := by ring
    _ ≤ 1 + ε ^ 5 * (50⁻¹ + 1 ^ 5 / 10000) := by gcongr
    _ ≤ 1 + ε ^ 5 * 49⁻¹ := by gcongr; norm_num
    _ = 1 + ε ^ 5 / 49 := by rw [div_eq_mul_inv]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
have rw : HPow.hPow (β := ℕ) ε 5 / 50 * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) ≤ HPow.hPow (β := ℕ) ε 5 / 50
Tactic: rw [sub_mul, one_mul, sub_le_sub_iff_left]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
⊢ 0 ≤ HPow.hPow (β := ℕ) ε 5 / 50
have sz_positivity : 0 < m → 0 ≤ HPow.hPow (β := ℕ) ε 5 / 50
Tactic: sz_positivity
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
sz_positivity sz_positivity₁ sz_positivity₂ sz_positivity₃ : 0 < m → 0 ≤ HPow.hPow (β := ℕ) ε 5 / 50
⊢ 0 ≤ HPow.hPow (β := ℕ) ε 5 / 50
have sz_positivity₄ : 0 < m → 0 < ε → 0 ≤ HPow.hPow (β := ℕ) ε 5 / 50
Tactic: sz_positivity
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
⊢ HPow.hPow (β := ℕ) ε 5 / 50 * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) ≤ HPow.hPow (β := ℕ) ε 5 / 50
have refine : LE.le (α := ℝ) (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) 1
Tactic: refine mul_le_of_le_one_right (by sz_positivity) ?_
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (hypothesis)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (∑ ab ∈ A.product B, (↑(G.edgeDensity ab.1 ab.2) : ℝ)) / HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)
have this : (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
  (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
Tactic: have : ↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) - ε ^ 5 / ↑50 ≤
      (↑1 - ε ^ 5 / 50) * G.edgeDensity (A.biUnion id) (B.biUnion id) := by
    rw [sub_mul, one_mul, sub_le_sub_iff_left]
    refine mul_le_of_le_one_right (by sz_positivity) ?_
    exact mod_cast G.edgeDensity_le_one _ _
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
⊢ (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (∑ ab ∈ A.product B, (↑(G.edgeDensity ab.1 ab.2) : ℝ)) / HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)
have refine : (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) ≤
  (∑ ab ∈ A.product B, (↑(G.edgeDensity ab.1 ab.2) : ℝ)) / HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)
Tactic: refine this.trans ?_
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
| (∑ ab ∈ A.product B, (↑(G.edgeDensity ab.1 ab.2) : ℝ)) / HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)
have simp : ∑ x ∈ A.product B,
  (↑(↑(#(G.interedges x.1 x.2)) : ℚ) : ℝ) /
    ((↑(HMul.hMul (α := ℚ) (↑(#x.1) : ℚ) (↑(#x.2) : ℚ)) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
Tactic: simp only [SimpleGraph.edgeDensity_def, sum_div, Rat.cast_div, div_div]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
⊢ (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) ≤
    (∑ ab ∈ A.product B, (↑(G.edgeDensity ab.1 ab.2) : ℝ)) / HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)
have conv_rhs : (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) ≤
  ∑ x ∈ A.product B,
    (↑(↑(#(G.interedges x.1 x.2)) : ℚ) : ℝ) /
      ((↑(HMul.hMul (α := ℚ) (↑(#x.1) : ℚ) (↑(#x.2) : ℚ)) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
Tactic: conv_rhs => -- Porting note: LHS and RHS need separate treatment to get the desired form
    simp only [SimpleGraph.edgeDensity_def, sum_div, Rat.cast_div, div_div]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
| (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
have rw : (1 - HPow.hPow (β := ℕ) ε 5 / 50) *
  (↑((↑(∑ ab ∈ A ×ˢ B, #(interedges G.Adj ab.1 ab.2)) : ℚ) /
        HMul.hMul (α := ℚ) (↑(#(A.sup id)) : ℚ) (↑(#(B.sup id)) : ℚ)) :
    ℝ)
Tactic: rw [SimpleGraph.edgeDensity_def, SimpleGraph.interedges, ← sup_eq_biUnion, ← sup_eq_biUnion,
      Rel.card_interedges_finpartition _ (ofSubset _ hA rfl) (ofSubset _ hB rfl), ofSubset_parts,
      ofSubset_parts]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
| (1 - HPow.hPow (β := ℕ) ε 5 / 50) *
    (↑((↑(∑ ab ∈ A ×ˢ B, #(interedges G.Adj ab.1 ab.2)) : ℚ) /
          HMul.hMul (α := ℚ) (↑(#(A.sup id)) : ℚ) (↑(#(B.sup id)) : ℚ)) :
      ℝ)
have simp : ∑ x ∈ A ×ˢ B,
  (↑(↑(#(interedges G.Adj x.1 x.2)) : ℚ) : ℝ) *
    ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / (↑(HMul.hMul (α := ℚ) (↑(#(A.sup id)) : ℚ) (↑(#(B.sup id)) : ℚ)) : ℝ))
Tactic: simp only [cast_sum, sum_div, mul_sum, Rat.cast_sum, Rat.cast_div,
      mul_div_left_comm ((1 : ℝ) - _)]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
| (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
have rw : ∑ x ∈ A ×ˢ B,
  (↑(↑(#(interedges G.Adj x.1 x.2)) : ℚ) : ℝ) *
    ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / (↑(HMul.hMul (α := ℚ) (↑(#(A.sup id)) : ℚ) (↑(#(B.sup id)) : ℚ)) : ℝ))
Tactic: rw [SimpleGraph.edgeDensity_def, SimpleGraph.interedges, ← sup_eq_biUnion, ← sup_eq_biUnion,
      Rel.card_interedges_finpartition _ (ofSubset _ hA rfl) (ofSubset _ hB rfl), ofSubset_parts,
      ofSubset_parts]
    simp only [cast_sum, sum_div, mul_sum, Rat.cast_sum, Rat.cast_div,
      mul_div_left_comm ((1 : ℝ) - _)]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
⊢ (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) ≤
    ∑ x ∈ A.product B,
      (↑(↑(#(G.interedges x.1 x.2)) : ℚ) : ℝ) /
        ((↑(HMul.hMul (α := ℚ) (↑(#x.1) : ℚ) (↑(#x.2) : ℚ)) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
have conv_lhs : LE.le (α := ℝ)
  (∑ x ∈ A ×ˢ B,
    (↑(↑(#(interedges G.Adj x.1 x.2)) : ℚ) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / (↑(HMul.hMul (α := ℚ) (↑(#(A.sup id)) : ℚ) (↑(#(B.sup id)) : ℚ)) : ℝ)))
  (∑ x ∈ A.product B,
    (↑(↑(#(G.interedges x.1 x.2)) : ℚ) : ℝ) /
      ((↑(HMul.hMul (α := ℚ) (↑(#x.1) : ℚ) (↑(#x.2) : ℚ)) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)))
Tactic: conv_lhs =>
    rw [SimpleGraph.edgeDensity_def, SimpleGraph.interedges, ← sup_eq_biUnion, ← sup_eq_biUnion,
      Rel.card_interedges_finpartition _ (ofSubset _ hA rfl) (ofSubset _ hB rfl), ofSubset_parts,
      ofSubset_parts]
    simp only [cast_sum, sum_div, mul_sum, Rat.cast_sum, Rat.cast_div,
      mul_div_left_comm ((1 : ℝ) - _)]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
⊢ LE.le (α := ℝ)
    (∑ x ∈ A ×ˢ B,
      (↑(↑(#(interedges G.Adj x.1 x.2)) : ℚ) : ℝ) *
        ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / (↑(HMul.hMul (α := ℚ) (↑(#(A.sup id)) : ℚ) (↑(#(B.sup id)) : ℚ)) : ℝ)))
    (∑ x ∈ A.product B,
      (↑(↑(#(G.interedges x.1 x.2)) : ℚ) : ℝ) /
        ((↑(HMul.hMul (α := ℚ) (↑(#x.1) : ℚ) (↑(#x.2) : ℚ)) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)))
have push_cast : LE.le (α := ℝ)
  (∑ x ∈ A ×ˢ B,
    (↑(#(interedges G.Adj x.1 x.2)) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)))
  (∑ x ∈ A.product B,
    (↑(#(G.interedges x.1 x.2)) : ℝ) /
      (HMul.hMul (α := ℝ) (↑(#x.1) : ℝ) (↑(#x.2) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)))
Tactic: push_cast
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
⊢ LE.le (α := ℝ)
    (∑ x ∈ A ×ˢ B,
      (↑(#(interedges G.Adj x.1 x.2)) : ℝ) *
        ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)))
    (∑ x ∈ A.product B,
      (↑(#(G.interedges x.1 x.2)) : ℝ) /
        (HMul.hMul (α := ℝ) (↑(#x.1) : ℝ) (↑(#x.2) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ)))
have h : ∀ i ∈ A ×ˢ B,
  (↑(#(interedges G.Adj i.1 i.2)) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)) ≤
    (↑(#(G.interedges i.1 i.2)) : ℝ) /
      (HMul.hMul (α := ℝ) (↑(#i.1) : ℝ) (↑(#i.2) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
Tactic: apply sum_le_sum
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
⊢ ∀ i ∈ A ×ˢ B,
    (↑(#(interedges G.Adj i.1 i.2)) : ℝ) *
        ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)) ≤
      (↑(#(G.interedges i.1 i.2)) : ℝ) /
        (HMul.hMul (α := ℝ) (↑(#i.1) : ℝ) (↑(#i.2) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
have h : ∀ (a b : Finset α),
  a ∈ A →
    b ∈ B →
      (↑(#(interedges G.Adj a b)) : ℝ) *
          ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)) ≤
        (↑(#(G.interedges a b)) : ℝ) /
          (HMul.hMul (α := ℝ) (↑(#a) : ℝ) (↑(#b) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
Tactic: simp only [and_imp, Prod.forall, mem_product]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
x y : Finset α
hx : x ∈ A
hy : y ∈ B
⊢ (↑(#(interedges G.Adj x y)) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)) ≤
    (↑(#(G.interedges x y)) : ℝ) /
      (HMul.hMul (α := ℝ) (↑(#x) : ℝ) (↑(#y) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
have h : (↑(#(interedges G.Adj x y)) : ℝ) *
    ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ) *
      (HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#x) : ℝ) * HMul.hMul (α := ℝ) (↑(#B) : ℝ) (↑(#y) : ℝ))) ≤
  (↑(#(G.interedges x y)) : ℝ)
Tactic: rw [mul_mul_mul_comm, mul_comm (#x : ℝ), mul_comm (#y : ℝ), le_div_iff₀, mul_assoc]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
x y : Finset α
hx : x ∈ A
hy : y ∈ B
h :
  (↑(#(interedges G.Adj x y)) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ) *
        (HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#x) : ℝ) * HMul.hMul (α := ℝ) (↑(#B) : ℝ) (↑(#y) : ℝ))) ≤
    (↑(#(G.interedges x y)) : ℝ)
⊢ (↑(#(interedges G.Adj x y)) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ)) ≤
    (↑(#(G.interedges x y)) : ℝ) /
      (HMul.hMul (α := ℝ) (↑(#x) : ℝ) (↑(#y) : ℝ) * HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#B) : ℝ))
have h₁ : 0 < HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#x) : ℝ) * HMul.hMul (α := ℝ) (↑(#B) : ℝ) (↑(#y) : ℝ)
Tactic: rw [mul_mul_mul_comm, mul_comm (#x : ℝ), mul_comm (#y : ℝ), le_div_iff₀, mul_assoc]
-- Lean 4 proof step from Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk (goal)
Goal:
α : Type u_1
inst : Fintype α
inst_1 : DecidableEq α
P : Finpartition (α := Finset α) univ
hP : P.IsEquipartition
G : SimpleGraph α
inst_2 : DecidableRel G.Adj
ε : ℝ
U V : Finset α
inst_3 : Nonempty α
hPα : #P.parts * HPow.hPow (α := ℕ) 16 #P.parts ≤ Fintype.card α
hPε : 100 ≤ HPow.hPow (α := ℝ) 4 #P.parts * HPow.hPow (β := ℕ) ε 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
this :
  (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ) - HPow.hPow (β := ℕ) ε 5 / 50 ≤
    (1 - HPow.hPow (β := ℕ) ε 5 / 50) * (↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) : ℝ)
x y : Finset α
hx : x ∈ A
hy : y ∈ B
⊢ (↑(#(interedges G.Adj x y)) : ℝ) *
      ((1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ) *
        (HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#x) : ℝ) * HMul.hMul (α := ℝ) (↑(#B) : ℝ) (↑(#y) : ℝ))) ≤
    (↑(#(G.interedges x y)) : ℝ)
have h : (1 - HPow.hPow (β := ℕ) ε 5 / 50) / HMul.hMul (α := ℝ) (↑(#(A.sup id)) : ℝ) (↑(#(B.sup id)) : ℝ) *
    (HMul.hMul (α := ℝ) (↑(#A) : ℝ) (↑(#x) : ℝ) * HMul.hMul (α := ℝ) (↑(#B) : ℝ) (↑(#y) : ℝ)) ≤
  1
Tactic: refine mul_le_of_le_one_right (cast_nonneg _) ?_