Theorem: SimpleGraph.regularityReduced_edges_card_aux
File: Mathlib/Combinatorics/SimpleGraph/Triangle/Removal.lean

Proof steps:
state_before: α : Type u_1
inst✝³ : DecidableEq α
inst✝² : Fintype α
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
s t : Finset α
P : Finpartition univ
ε : ℝ
inst✝ : Nonempty α
hε : 0 < ε
hP : P.IsEquipartition
hPε : P.IsUniform G (ε / 8)
hP' : 4 / ε ≤ ↑P.parts.card
⊢ 2 * (↑G.edgeFinset.card - ↑(regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) < 2 * ε * ↑(Fintype.card α ^ 2)
state_after: α : Type u_1
inst✝³ : DecidableEq α
inst✝² : Fintype α
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
s t : Finset α
P : Finpartition univ
ε : ℝ
inst✝ : Nonempty α
hε : 0 < ε
hP : P.IsEquipartition
hPε : P.IsUniform G (ε / 8)
hP' : 4 / ε ≤ ↑P.parts.card
A : Finset (α × α) :=
  (P.nonUniforms G (ε / 8)).biUnion fun x =>
    match x with
    | (U, V) => U ×ˢ V
⊢ 2 * (↑G.edgeFinset.card - ↑(regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) < 2 * ε * ↑(Fintype.card α ^ 2)
tactic: let A := (P.nonUniforms G (ε/8)).biUnion fun (U, V) ↦ U ×ˢ V
state_before: α : Type u_1
inst✝³ : DecidableEq α
inst✝² : Fintype α
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
s t : Finset α
P : Finpartition univ
ε : ℝ
inst✝ : Nonempty α
hε : 0 < ε
hP : P.IsEquipartition
hPε : P.IsUniform G (ε / 8)
hP' : 4 / ε ≤ ↑P.parts.card
A : Finset (α × α) :=
  (P.nonUniforms G (ε / 8)).biUnion fun x =>
    match x with
    | (U, V) => U ×ˢ V
⊢ 2 * (↑G.edgeFinset.card - ↑(regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) < 2 * ε * ↑(Fintype.card α ^ 2)
state_after: α : Type u_1
inst✝³ : DecidableEq α
inst✝² : Fintype α
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
s t : Finset α
P : Finpartition univ
ε : ℝ
inst✝ : Nonempty α
hε : 0 < ε
hP : P.IsEquipartition
hPε : P.IsUniform G (ε / 8)
hP' : 4 / ε ≤ ↑P.parts.card
A : Finset (α × α) :=
  (P.nonUniforms G (ε / 8)).biUnion fun x =>
    match x with
    | (U, V) => U ×ˢ V
B : Finset (α × α) := P.parts.biUnion offDiag
⊢ 2 * (↑G.edgeFinset.card - ↑(regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) < 2 * ε * ↑(Fintype.card α ^ 2)
tactic: let B := P.parts.biUnion offDiag
state_before: α : Type u_1
inst✝³ : DecidableEq α
inst✝² : Fintype α
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
s t : Finset α
P : Finpartition univ
ε : ℝ
inst✝ : Nonempty α
hε : 0 < ε
hP : P.IsEquipartition
hPε : P.IsUniform G (ε / 8)
hP' : 4 / ε ≤ ↑P.parts.card
A : Finset (α × α) :=
  (P.nonUniforms G (ε / 8)).biUnion fun x =>
    match x with
    | (U, V) => U ×ˢ V
B : Finset (α × α) := P.parts.biUnion offDiag
⊢ 2 * (↑G.edgeFinset.card - ↑(regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) < 2 * ε * ↑(Fintype.card α ^ 2)
state_after: α : Type u_1
inst✝³ : DecidableEq α
inst✝² : Fintype α
G : SimpleGraph α
inst✝¹ : DecidableRel G.Adj
s t : Finset α
P : Finpartition univ
ε : ℝ
inst✝ : Nonempty α
hε : 0 < ε
hP : P.IsEquipartition
hPε : P.IsUniform G (ε / 8)
hP' : 4 / ε ≤ ↑P.parts.card
A : Finset (α × α) :=
  (P.nonUniforms G (ε / 8)).biUnion fun x =>
    match x with
    | (U, V) => U ×ˢ V
B : Finset (α × α) := P.parts.biUnion offDiag
C : Finset (α × α) :=
  (P.sparsePairs G (ε / 4)).biUnion fun x =>
    match x with
    | (U, V) => G.interedges U V
⊢ 2 * (↑G.edgeFinset.card - ↑(regularityReduced P G (ε / 8) (ε / 4)).edgeFinset.card) < 2 * ε * ↑(Fintype.card α ^ 2)
tactic: let C := (P.sparsePairs G (ε/4)).biUnion fun (U, V) ↦ G.interedges U V