Theorem: SimpleGraph.triangle_counting'
File: Mathlib/Combinatorics/SimpleGraph/Triangle/Counting.lean

tactic: have h₁ : (badVertices G ε s t).card ≤ s.card * ε := G.card_badVertices_le dst hst
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card

tactic: have h₂ : (badVertices G ε s u).card ≤ s.card * ε := G.card_badVertices_le dsu usu
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card

tactic: let X' := s \ (badVertices G ε s t ∪ badVertices G ε s u)
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card

tactic: have : X'.biUnion _ ⊆ (s ×ˢ t ×ˢ u).filter fun (a, b, c) ↦ G.Adj a b ∧ G.Adj a c ∧ G.Adj b c :=
  triangle_split_helper _
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card

tactic: refine le_trans ?_ (Nat.cast_le.2 $ card_le_card this)
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(filter
          (fun x =>
            match x with
            | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
          (s ×ˢ t ×ˢ u)).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))).card

tactic: rw [card_biUnion, Nat.cast_sum]
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ↑(X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ∑ x ∈ X', ↑(image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))).card

α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ ∀ x ∈ X',
    ∀ y ∈ X',
      x ≠ y →
        Disjoint (image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u)))
          (image (fun x => (y, x)) (G.interedges (filter (G.Adj y) t) (filter (G.Adj y) u)))

tactic: rintro a _ b _ t
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ ∀ x ∈ X',
    ∀ y ∈ X',
      x ≠ y →
        Disjoint (image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u)))
          (image (fun x => (y, x)) (G.interedges (filter (G.Adj y) t) (filter (G.Adj y) u)))
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t✝ u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t✝)
hst : G.IsUniform ε s t✝
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t✝ u)
utu : G.IsUniform ε t✝ u
h₁ : ↑(SimpleGraph.badVertices G ε s t✝).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t✝ ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t✝) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t✝ ×ˢ u)
a : α
a✝¹ : a ∈ X'
b : α
a✝ : b ∈ X'
t : a ≠ b
⊢ Disjoint (image (fun x => (a, x)) (G.interedges (filter (G.Adj a) t✝) (filter (G.Adj a) u)))
    (image (fun x => (b, x)) (G.interedges (filter (G.Adj b) t✝) (filter (G.Adj b) u)))

tactic: rw [disjoint_left]
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t✝ u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t✝)
hst : G.IsUniform ε s t✝
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t✝ u)
utu : G.IsUniform ε t✝ u
h₁ : ↑(SimpleGraph.badVertices G ε s t✝).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t✝ ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t✝) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t✝ ×ˢ u)
a : α
a✝¹ : a ∈ X'
b : α
a✝ : b ∈ X'
t : a ≠ b
⊢ Disjoint (image (fun x => (a, x)) (G.interedges (filter (G.Adj a) t✝) (filter (G.Adj a) u)))
    (image (fun x => (b, x)) (G.interedges (filter (G.Adj b) t✝) (filter (G.Adj b) u)))
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t✝ u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t✝)
hst : G.IsUniform ε s t✝
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t✝ u)
utu : G.IsUniform ε t✝ u
h₁ : ↑(SimpleGraph.badVertices G ε s t✝).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t✝ ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t✝) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t✝ ×ˢ u)
a : α
a✝¹ : a ∈ X'
b : α
a✝ : b ∈ X'
t : a ≠ b
⊢ ∀ ⦃a_1 : α × α × α⦄,
    a_1 ∈ image (fun x => (a, x)) (G.interedges (filter (G.Adj a) t✝) (filter (G.Adj a) u)) →
      a_1 ∉ image (fun x => (b, x)) (G.interedges (filter (G.Adj b) t✝) (filter (G.Adj b) u))

tactic: simp only [Prod.forall, mem_image, not_exists, exists_prop, mem_filter, Prod.mk.inj_iff,
  exists_imp, and_imp, not_and, mem_product, or_assoc]
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t✝ u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t✝)
hst : G.IsUniform ε s t✝
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t✝ u)
utu : G.IsUniform ε t✝ u
h₁ : ↑(SimpleGraph.badVertices G ε s t✝).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t✝ ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t✝) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t✝ ×ˢ u)
a : α
a✝¹ : a ∈ X'
b : α
a✝ : b ∈ X'
t : a ≠ b
⊢ ∀ ⦃a_1 : α × α × α⦄,
    a_1 ∈ image (fun x => (a, x)) (G.interedges (filter (G.Adj a) t✝) (filter (G.Adj a) u)) →
      a_1 ∉ image (fun x => (b, x)) (G.interedges (filter (G.Adj b) t✝) (filter (G.Adj b) u))
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t✝ u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t✝)
hst : G.IsUniform ε s t✝
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t✝ u)
utu : G.IsUniform ε t✝ u
h₁ : ↑(SimpleGraph.badVertices G ε s t✝).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t✝ ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t✝) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t✝ ×ˢ u)
a : α
a✝¹ : a ∈ X'
b : α
a✝ : b ∈ X'
t : a ≠ b
⊢ ∀ (a_1 a_2 b_1 a_3 b_2 : α),
    (a_3, b_2) ∈ G.interedges (filter (G.Adj a) t✝) (filter (G.Adj a) u) →
      a = a_1 →
        a_3 = a_2 →
          b_2 = b_1 →
            ∀ (a b_3 : α),
              (a, b_3) ∈ G.interedges (filter (G.Adj b) t✝) (filter (G.Adj b) u) → b = a_1 → a = a_2 → ¬b_3 = b_1

tactic: aesop
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t✝ u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t✝)
hst : G.IsUniform ε s t✝
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t✝ u)
utu : G.IsUniform ε t✝ u
h₁ : ↑(SimpleGraph.badVertices G ε s t✝).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t✝ ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t✝) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t✝ ×ˢ u)
a : α
a✝¹ : a ∈ X'
b : α
a✝ : b ∈ X'
t : a ≠ b
⊢ ∀ (a_1 a_2 b_1 a_3 b_2 : α),
    (a_3, b_2) ∈ G.interedges (filter (G.Adj a) t✝) (filter (G.Adj a) u) →
      a = a_1 →
        a_3 = a_2 →
          b_2 = b_1 →
            ∀ (a b_3 : α),
              (a, b_3) ∈ G.interedges (filter (G.Adj b) t✝) (filter (G.Adj b) u) → b = a_1 → a = a_2 → ¬b_3 = b_1
state_after: no goals

tactic: apply le_trans _ (card_nsmul_le_sum X' _ _ $ G.good_vertices_triangle_card dst dsu dtu utu)
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤
    ∑ x ∈ X', ↑(image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))).card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ X'.card • (ε ^ 3 * ↑t.card * ↑u.card)

tactic: rw [nsmul_eq_mul]
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ X'.card • (ε ^ 3 * ↑t.card * ↑u.card)
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ ↑X'.card * (ε ^ 3 * ↑t.card * ↑u.card)

tactic: have := hst.pos.le
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ ↑X'.card * (ε ^ 3 * ↑t.card * ↑u.card)
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ ↑X'.card * (ε ^ 3 * ↑t.card * ↑u.card)

tactic: suffices hX' : (1 - 2 * ε) * s.card ≤ X'.card by
  exact Eq.trans_le (by ring) (mul_le_mul_of_nonneg_right hX' $ by positivity)
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ ↑X'.card * (ε ^ 3 * ↑t.card * ↑u.card)
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
⊢ (1 - 2 * ε) * ↑s.card ≤ ↑X'.card

tactic: have i : badVertices G ε s t ∪ badVertices G ε s u ⊆ s :=
  union_subset (filter_subset _ _) (filter_subset _ _)
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
⊢ (1 - 2 * ε) * ↑s.card ≤ ↑X'.card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ (1 - 2 * ε) * ↑s.card ≤ ↑X'.card

tactic: rw [sub_mul, one_mul, card_sdiff i, Nat.cast_sub (card_le_card i), sub_le_sub_iff_left,
  mul_assoc, mul_comm ε, two_mul]
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ (1 - 2 * ε) * ↑s.card ≤ ↑X'.card
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ ↑(SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε + ↑s.card * ε

tactic: refine (Nat.cast_le.2 $ card_union_le _ _).trans ?_
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ ↑(SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε + ↑s.card * ε
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ ↑((SimpleGraph.badVertices G ε s t).card + (SimpleGraph.badVertices G ε s u).card) ≤ ↑s.card * ε + ↑s.card * ε

tactic: rw [Nat.cast_add]
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ ↑((SimpleGraph.badVertices G ε s t).card + (SimpleGraph.badVertices G ε s u).card) ≤ ↑s.card * ε + ↑s.card * ε
state_after: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ ↑(SimpleGraph.badVertices G ε s t).card + ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε + ↑s.card * ε

tactic: exact add_le_add h₁ h₂
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
i : SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u ⊆ s
⊢ ↑(SimpleGraph.badVertices G ε s t).card + ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε + ↑s.card * ε
state_after: no goals

tactic: exact Eq.trans_le (by ring) (mul_le_mul_of_nonneg_right hX' $ by positivity)
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
hX' : (1 - 2 * ε) * ↑s.card ≤ ↑X'.card
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card ≤ ↑X'.card * (ε ^ 3 * ↑t.card * ↑u.card)
state_after: no goals

tactic: ring
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
hX' : (1 - 2 * ε) * ↑s.card ≤ ↑X'.card
⊢ (1 - 2 * ε) * ε ^ 3 * ↑s.card * ↑t.card * ↑u.card = (1 - 2 * ε) * ↑s.card * (ε ^ 3 * ↑t.card * ↑u.card)
state_after: no goals

tactic: positivity
state_before: α : Type u_1
G G' : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : ℝ
s t u : Finset α
dst : 2 * ε ≤ ↑(G.edgeDensity s t)
hst : G.IsUniform ε s t
dsu : 2 * ε ≤ ↑(G.edgeDensity s u)
usu : G.IsUniform ε s u
dtu : 2 * ε ≤ ↑(G.edgeDensity t u)
utu : G.IsUniform ε t u
h₁ : ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε
h₂ : ↑(SimpleGraph.badVertices G ε s u).card ≤ ↑s.card * ε
X' : Finset α := s \ (SimpleGraph.badVertices G ε s t ∪ SimpleGraph.badVertices G ε s u)
this✝ :
  (X'.biUnion fun x => image (fun x_1 => (x, x_1)) (G.interedges (filter (G.Adj x) t) (filter (G.Adj x) u))) ⊆
    filter
      (fun x =>
        match x with
        | (a, b, c) => G.Adj a b ∧ G.Adj a c ∧ G.Adj b c)
      (s ×ˢ t ×ˢ u)
this : 0 ≤ ε
hX' : (1 - 2 * ε) * ↑s.card ≤ ↑X'.card
⊢ 0 ≤ ε ^ 3 * ↑t.card * ↑u.card
state_after: no goals