Theorem: SimpleGraph.card_badVertices_le
File: Mathlib/Combinatorics/SimpleGraph/Triangle/Counting.lean

tactic: have hε : ε ≤ 1 := (le_mul_of_one_le_of_le_of_nonneg (by norm_num) le_rfl hst.pos.le).trans
  (dst.trans $ by exact_mod_cast edgeDensity_le_one _ _ _)
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
⊢ ↑(SimpleGraph.badVertices G ε s t).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
hε : ε ≤ 1
⊢ ↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε

tactic: by_contra! 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
hε : ε ≤ 1
⊢ ↑(SimpleGraph.badVertices G ε s t).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
hε : ε ≤ 1
h : ↑s.card * ε < ↑(SimpleGraph.badVertices G ε s t).card
⊢ False

tactic: have : |(G.edgeDensity (badVertices G ε s t) t - G.edgeDensity s t : ℝ)| < ε :=
  hst (filter_subset _ _) Subset.rfl h.le (mul_le_of_le_one_right (Nat.cast_nonneg _) 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
hε : ε ≤ 1
h : ↑s.card * ε < ↑(SimpleGraph.badVertices G ε s t).card
⊢ False
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
hε : ε ≤ 1
h : ↑s.card * ε < ↑(SimpleGraph.badVertices G ε s t).card
this : |↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) - ↑(G.edgeDensity s t)| < ε
⊢ False

tactic: rw [abs_sub_lt_iff] at 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
hε : ε ≤ 1
h : ↑s.card * ε < ↑(SimpleGraph.badVertices G ε s t).card
this : |↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) - ↑(G.edgeDensity s t)| < ε
⊢ False
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
hε : ε ≤ 1
h : ↑s.card * ε < ↑(SimpleGraph.badVertices G ε s t).card
this :
  ↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) - ↑(G.edgeDensity s t) < ε ∧
    ↑(G.edgeDensity s t) - ↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) < ε
⊢ False

tactic: linarith [G.edgeDensity_badVertices_le hst.pos.le dst]
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
hε : ε ≤ 1
h : ↑s.card * ε < ↑(SimpleGraph.badVertices G ε s t).card
this :
  ↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) - ↑(G.edgeDensity s t) < ε ∧
    ↑(G.edgeDensity s t) - ↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) < ε
⊢ False
state_after: no goals

tactic: norm_num
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
⊢ 1 ≤ 2
state_after: no goals

tactic: exact_mod_cast edgeDensity_le_one _ _ _
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
⊢ ↑(G.edgeDensity s t) ≤ 1
state_after: no goals