l3lab/ntp-mathlib huggingface dataset:
theorem IsUniform.symm : Symmetric (IsUniform G ε) := fun s t h t' ht' s' hs' ht hs => by
  rw [edgeDensity_comm _ t', edgeDensity_comm _ t]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s✝ t✝ : Finset α
a b : α
s t : Finset α
h : IsUniform G ε s t
t' : Finset α
ht' : t' ⊆ t
s' : Finset α
hs' : s' ⊆ s
ht : ↑(card t) * ε ≤ ↑(card t')
hs : ↑(card s) * ε ≤ ↑(card s')
⊢ |↑(edgeDensity G s' t') - ↑(edgeDensity G s t)| < ε

Next tactic:
exact h hs' ht' hs ht
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
⊢ IsUniform G ε {a} {b}

Next tactic:
intro s' hs' t' ht' hs ht
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
s' : Finset α
hs' : s' ⊆ {a}
t' : Finset α
ht' : t' ⊆ {b}
hs : ↑(card {a}) * ε ≤ ↑(card s')
ht : ↑(card {b}) * ε ≤ ↑(card t')
⊢ |↑(edgeDensity G s' t') - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
rw [card_singleton, Nat.cast_one, one_mul] at hs ht
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
s' : Finset α
hs' : s' ⊆ {a}
t' : Finset α
ht' : t' ⊆ {b}
hs : ε ≤ ↑(card s')
ht : ε ≤ ↑(card t')
⊢ |↑(edgeDensity G s' t') - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · 

Proof state:
case inl
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
t' : Finset α
ht' : t' ⊆ {b}
ht : ε ≤ ↑(card t')
hs' : ∅ ⊆ {a}
hs : ε ≤ ↑(card ∅)
⊢ |↑(edgeDensity G ∅ t') - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
replace hs : ε ≤ 0 := by simpa using hs
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by 

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
t' : Finset α
ht' : t' ⊆ {b}
ht : ε ≤ ↑(card t')
hs' : ∅ ⊆ {a}
hs : ε ≤ ↑(card ∅)
⊢ ε ≤ 0

Next tactic:
simpa using hs
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by simpa using hs
    

Proof state:
case inl
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
t' : Finset α
ht' : t' ⊆ {b}
ht : ε ≤ ↑(card t')
hs' : ∅ ⊆ {a}
hs : ε ≤ 0
⊢ |↑(edgeDensity G ∅ t') - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
exact (hε.not_le hs).elim
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by simpa using hs
    exact (hε.not_le hs).elim
  

Proof state:
case inr
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
t' : Finset α
ht' : t' ⊆ {b}
ht : ε ≤ ↑(card t')
hs' : {a} ⊆ {a}
hs : ε ≤ ↑(card {a})
⊢ |↑(edgeDensity G {a} t') - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by simpa using hs
    exact (hε.not_le hs).elim
  obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
  · 

Proof state:
case inr.inl
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
hs' : {a} ⊆ {a}
hs : ε ≤ ↑(card {a})
ht' : ∅ ⊆ {b}
ht : ε ≤ ↑(card ∅)
⊢ |↑(edgeDensity G {a} ∅) - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
replace ht : ε ≤ 0 := by simpa using ht
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by simpa using hs
    exact (hε.not_le hs).elim
  obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
  · replace ht : ε ≤ 0 := by 

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
hs' : {a} ⊆ {a}
hs : ε ≤ ↑(card {a})
ht' : ∅ ⊆ {b}
ht : ε ≤ ↑(card ∅)
⊢ ε ≤ 0

Next tactic:
simpa using ht
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by simpa using hs
    exact (hε.not_le hs).elim
  obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
  · replace ht : ε ≤ 0 := by simpa using ht
    

Proof state:
case inr.inl
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
hs' : {a} ⊆ {a}
hs : ε ≤ ↑(card {a})
ht' : ∅ ⊆ {b}
ht : ε ≤ 0
⊢ |↑(edgeDensity G {a} ∅) - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
exact (hε.not_le ht).elim
theorem isUniform_singleton (hε : 0 < ε) : G.IsUniform ε {a} {b} := by
  intro s' hs' t' ht' hs ht
  rw [card_singleton, Nat.cast_one, one_mul] at hs ht
  obtain rfl | rfl := Finset.subset_singleton_iff.1 hs'
  · replace hs : ε ≤ 0 := by simpa using hs
    exact (hε.not_le hs).elim
  obtain rfl | rfl := Finset.subset_singleton_iff.1 ht'
  · replace ht : ε ≤ 0 := by simpa using ht
    exact (hε.not_le ht).elim
  · 

Proof state:
case inr.inr
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
hε : 0 < ε
hs' : {a} ⊆ {a}
hs : ε ≤ ↑(card {a})
ht' : {b} ⊆ {b}
ht : ε ≤ ↑(card {b})
⊢ |↑(edgeDensity G {a} {b}) - ↑(edgeDensity G {a} {b})| < ε

Next tactic:
rwa [sub_self, abs_zero]
theorem not_isUniform_zero : ¬G.IsUniform (0 : 𝕜) s t := fun h =>
  (abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by 

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : IsUniform G 0 s t
⊢ ↑(card s) * 0 ≤ ↑(card ∅)

Next tactic:
simp
theorem not_isUniform_zero : ¬G.IsUniform (0 : 𝕜) s t := fun h =>
  (abs_nonneg _).not_lt <| h (empty_subset _) (empty_subset _) (by simp) (by 

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : IsUniform G 0 s t
⊢ ↑(card t) * 0 ≤ ↑(card ∅)

Next tactic:
simp
theorem isUniform_one : G.IsUniform (1 : 𝕜) s t := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
⊢ IsUniform G 1 s t

Next tactic:
intro s' hs' t' ht' hs ht
theorem isUniform_one : G.IsUniform (1 : 𝕜) s t := by
  intro s' hs' t' ht' hs ht
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
s' : Finset α
hs' : s' ⊆ s
t' : Finset α
ht' : t' ⊆ t
hs : ↑(card s) * 1 ≤ ↑(card s')
ht : ↑(card t) * 1 ≤ ↑(card t')
⊢ |↑(edgeDensity G s' t') - ↑(edgeDensity G s t)| < 1

Next tactic:
rw [mul_one] at hs ht
theorem isUniform_one : G.IsUniform (1 : 𝕜) s t := by
  intro s' hs' t' ht' hs ht
  rw [mul_one] at hs ht
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
s' : Finset α
hs' : s' ⊆ s
t' : Finset α
ht' : t' ⊆ t
hs : ↑(card s) ≤ ↑(card s')
ht : ↑(card t) ≤ ↑(card t')
⊢ |↑(edgeDensity G s' t') - ↑(edgeDensity G s t)| < 1

Next tactic:
rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
    eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
theorem isUniform_one : G.IsUniform (1 : 𝕜) s t := by
  intro s' hs' t' ht' hs ht
  rw [mul_one] at hs ht
  rw [eq_of_subset_of_card_le hs' (Nat.cast_le.1 hs),
    eq_of_subset_of_card_le ht' (Nat.cast_le.1 ht), sub_self, abs_zero]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
s' : Finset α
hs' : s' ⊆ s
t' : Finset α
ht' : t' ⊆ t
hs : ↑(card s) ≤ ↑(card s')
ht : ↑(card t) ≤ ↑(card t')
⊢ 0 < 1

Next tactic:
exact zero_lt_one
theorem not_isUniform_iff :
    ¬G.IsUniform ε s t ↔ ∃ s', s' ⊆ s ∧ ∃ t', t' ⊆ t ∧ ↑s.card * ε ≤ s'.card ∧
      ↑t.card * ε ≤ t'.card ∧ ε ≤ |G.edgeDensity s' t' - G.edgeDensity s t| := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
⊢ ¬IsUniform G ε s t ↔
    ∃ s' ⊆ s,
      ∃ t' ⊆ t, ↑(card s) * ε ≤ ↑(card s') ∧ ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|

Next tactic:
unfold IsUniform
theorem not_isUniform_iff :
    ¬G.IsUniform ε s t ↔ ∃ s', s' ⊆ s ∧ ∃ t', t' ⊆ t ∧ ↑s.card * ε ≤ s'.card ∧
      ↑t.card * ε ≤ t'.card ∧ ε ≤ |G.edgeDensity s' t' - G.edgeDensity s t| := by
  unfold IsUniform
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
⊢ (¬∀ ⦃s' : Finset α⦄,
        s' ⊆ s →
          ∀ ⦃t' : Finset α⦄,
            t' ⊆ t →
              ↑(card s) * ε ≤ ↑(card s') →
                ↑(card t) * ε ≤ ↑(card t') → |↑(edgeDensity G s' t') - ↑(edgeDensity G s t)| < ε) ↔
    ∃ s' ⊆ s,
      ∃ t' ⊆ t, ↑(card s) * ε ≤ ↑(card s') ∧ ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|

Next tactic:
simp only [not_forall, not_lt, exists_prop, exists_and_left, Rat.cast_abs, Rat.cast_sub]
theorem left_nonuniformWitnesses_subset (h : ¬G.IsUniform ε s t) :
    (G.nonuniformWitnesses ε s t).1 ⊆ s := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ (nonuniformWitnesses G ε s t).1 ⊆ s

Next tactic:
rw [nonuniformWitnesses, dif_pos h]
theorem left_nonuniformWitnesses_subset (h : ¬G.IsUniform ε s t) :
    (G.nonuniformWitnesses ε s t).1 ⊆ s := by
  rw [nonuniformWitnesses, dif_pos h]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ (Exists.choose
          (_ :
            ∃ s' ⊆ s,
              ∃ t' ⊆ t,
                ↑(card s) * ε ≤ ↑(card s') ∧
                  ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|),
        Exists.choose
          (_ :
            ∃ t' ⊆ t,
              ↑(card s) * ε ≤
                  ↑(card
                      (Exists.choose
                        (_ :
                          ∃ s' ⊆ s,
                            ∃ t' ⊆ t,
                              ↑(card s) * ε ≤ ↑(card s') ∧
                                ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))) ∧
                ↑(card t) * ε ≤ ↑(card t') ∧
                  ε ≤
                    ↑|edgeDensity G
                            (Exists.choose
                              (_ :
                                ∃ s' ⊆ s,
                                  ∃ t' ⊆ t,
                                    ↑(card s) * ε ≤ ↑(card s') ∧
                                      ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))
                            t' -
                          edgeDensity G s t|)).1 ⊆
    s

Next tactic:
exact (not_isUniform_iff.1 h).choose_spec.1
theorem left_nonuniformWitnesses_card (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitnesses ε s t).1.card := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ↑(card s) * ε ≤ ↑(card (nonuniformWitnesses G ε s t).1)

Next tactic:
rw [nonuniformWitnesses, dif_pos h]
theorem left_nonuniformWitnesses_card (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitnesses ε s t).1.card := by
  rw [nonuniformWitnesses, dif_pos h]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ↑(card s) * ε ≤
    ↑(card
        (Exists.choose
              (_ :
                ∃ s' ⊆ s,
                  ∃ t' ⊆ t,
                    ↑(card s) * ε ≤ ↑(card s') ∧
                      ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|),
            Exists.choose
              (_ :
                ∃ t' ⊆ t,
                  ↑(card s) * ε ≤
                      ↑(card
                          (Exists.choose
                            (_ :
                              ∃ s' ⊆ s,
                                ∃ t' ⊆ t,
                                  ↑(card s) * ε ≤ ↑(card s') ∧
                                    ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))) ∧
                    ↑(card t) * ε ≤ ↑(card t') ∧
                      ε ≤
                        ↑|edgeDensity G
                                (Exists.choose
                                  (_ :
                                    ∃ s' ⊆ s,
                                      ∃ t' ⊆ t,
                                        ↑(card s) * ε ≤ ↑(card s') ∧
                                          ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))
                                t' -
                              edgeDensity G s t|)).1)

Next tactic:
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.1
theorem right_nonuniformWitnesses_subset (h : ¬G.IsUniform ε s t) :
    (G.nonuniformWitnesses ε s t).2 ⊆ t := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ (nonuniformWitnesses G ε s t).2 ⊆ t

Next tactic:
rw [nonuniformWitnesses, dif_pos h]
theorem right_nonuniformWitnesses_subset (h : ¬G.IsUniform ε s t) :
    (G.nonuniformWitnesses ε s t).2 ⊆ t := by
  rw [nonuniformWitnesses, dif_pos h]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ (Exists.choose
          (_ :
            ∃ s' ⊆ s,
              ∃ t' ⊆ t,
                ↑(card s) * ε ≤ ↑(card s') ∧
                  ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|),
        Exists.choose
          (_ :
            ∃ t' ⊆ t,
              ↑(card s) * ε ≤
                  ↑(card
                      (Exists.choose
                        (_ :
                          ∃ s' ⊆ s,
                            ∃ t' ⊆ t,
                              ↑(card s) * ε ≤ ↑(card s') ∧
                                ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))) ∧
                ↑(card t) * ε ≤ ↑(card t') ∧
                  ε ≤
                    ↑|edgeDensity G
                            (Exists.choose
                              (_ :
                                ∃ s' ⊆ s,
                                  ∃ t' ⊆ t,
                                    ↑(card s) * ε ≤ ↑(card s') ∧
                                      ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))
                            t' -
                          edgeDensity G s t|)).2 ⊆
    t

Next tactic:
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.1
theorem right_nonuniformWitnesses_card (h : ¬G.IsUniform ε s t) :
    (t.card : 𝕜) * ε ≤ (G.nonuniformWitnesses ε s t).2.card := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ↑(card t) * ε ≤ ↑(card (nonuniformWitnesses G ε s t).2)

Next tactic:
rw [nonuniformWitnesses, dif_pos h]
theorem right_nonuniformWitnesses_card (h : ¬G.IsUniform ε s t) :
    (t.card : 𝕜) * ε ≤ (G.nonuniformWitnesses ε s t).2.card := by
  rw [nonuniformWitnesses, dif_pos h]
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ↑(card t) * ε ≤
    ↑(card
        (Exists.choose
              (_ :
                ∃ s' ⊆ s,
                  ∃ t' ⊆ t,
                    ↑(card s) * ε ≤ ↑(card s') ∧
                      ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|),
            Exists.choose
              (_ :
                ∃ t' ⊆ t,
                  ↑(card s) * ε ≤
                      ↑(card
                          (Exists.choose
                            (_ :
                              ∃ s' ⊆ s,
                                ∃ t' ⊆ t,
                                  ↑(card s) * ε ≤ ↑(card s') ∧
                                    ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))) ∧
                    ↑(card t) * ε ≤ ↑(card t') ∧
                      ε ≤
                        ↑|edgeDensity G
                                (Exists.choose
                                  (_ :
                                    ∃ s' ⊆ s,
                                      ∃ t' ⊆ t,
                                        ↑(card s) * ε ≤ ↑(card s') ∧
                                          ↑(card t) * ε ≤ ↑(card t') ∧ ε ≤ ↑|edgeDensity G s' t' - edgeDensity G s t|))
                                t' -
                              edgeDensity G s t|)).2)

Next tactic:
exact (not_isUniform_iff.1 h).choose_spec.2.choose_spec.2.2.1
theorem nonuniformWitnesses_spec (h : ¬G.IsUniform ε s t) :
    ε ≤
      |G.edgeDensity (G.nonuniformWitnesses ε s t).1 (G.nonuniformWitnesses ε s t).2 -
          G.edgeDensity s t| := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ε ≤ ↑|edgeDensity G (nonuniformWitnesses G ε s t).1 (nonuniformWitnesses G ε s t).2 - edgeDensity G s t|

Next tactic:
rw [nonuniformWitnesses, dif_pos h]
theorem nonuniformWitness_subset (h : ¬G.IsUniform ε s t) : G.nonuniformWitness ε s t ⊆ s := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ nonuniformWitness G ε s t ⊆ s

Next tactic:
unfold nonuniformWitness
theorem nonuniformWitness_subset (h : ¬G.IsUniform ε s t) : G.nonuniformWitness ε s t ⊆ s := by
  unfold nonuniformWitness
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ (if WellOrderingRel s t then (nonuniformWitnesses G ε s t).1 else (nonuniformWitnesses G ε t s).2) ⊆ s

Next tactic:
split_ifs
theorem nonuniformWitness_subset (h : ¬G.IsUniform ε s t) : G.nonuniformWitness ε s t ⊆ s := by
  unfold nonuniformWitness
  split_ifs
  · 

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
h✝ : WellOrderingRel s t
⊢ (nonuniformWitnesses G ε s t).1 ⊆ s

Next tactic:
exact G.left_nonuniformWitnesses_subset h
theorem nonuniformWitness_subset (h : ¬G.IsUniform ε s t) : G.nonuniformWitness ε s t ⊆ s := by
  unfold nonuniformWitness
  split_ifs
  · exact G.left_nonuniformWitnesses_subset h
  · 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
h✝ : ¬WellOrderingRel s t
⊢ (nonuniformWitnesses G ε t s).2 ⊆ s

Next tactic:
exact G.right_nonuniformWitnesses_subset fun i => h i.symm
theorem le_card_nonuniformWitness (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitness ε s t).card := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ↑(card s) * ε ≤ ↑(card (nonuniformWitness G ε s t))

Next tactic:
unfold nonuniformWitness
theorem le_card_nonuniformWitness (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitness ε s t).card := by
  unfold nonuniformWitness
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
⊢ ↑(card s) * ε ≤
    ↑(card (if WellOrderingRel s t then (nonuniformWitnesses G ε s t).1 else (nonuniformWitnesses G ε t s).2))

Next tactic:
split_ifs
theorem le_card_nonuniformWitness (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitness ε s t).card := by
  unfold nonuniformWitness
  split_ifs
  · 

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
h✝ : WellOrderingRel s t
⊢ ↑(card s) * ε ≤ ↑(card (nonuniformWitnesses G ε s t).1)

Next tactic:
exact G.left_nonuniformWitnesses_card h
theorem le_card_nonuniformWitness (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitness ε s t).card := by
  unfold nonuniformWitness
  split_ifs
  · exact G.left_nonuniformWitnesses_card h
  · 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h : ¬IsUniform G ε s t
h✝ : ¬WellOrderingRel s t
⊢ ↑(card s) * ε ≤ ↑(card (nonuniformWitnesses G ε t s).2)

Next tactic:
exact G.right_nonuniformWitnesses_card fun i => h i.symm
theorem nonuniformWitness_spec (h₁ : s ≠ t) (h₂ : ¬G.IsUniform ε s t) : ε ≤ |G.edgeDensity
    (G.nonuniformWitness ε s t) (G.nonuniformWitness ε t s) - G.edgeDensity s t| := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h₁ : s ≠ t
h₂ : ¬IsUniform G ε s t
⊢ ε ≤ ↑|edgeDensity G (nonuniformWitness G ε s t) (nonuniformWitness G ε t s) - edgeDensity G s t|

Next tactic:
unfold nonuniformWitness
theorem nonuniformWitness_spec (h₁ : s ≠ t) (h₂ : ¬G.IsUniform ε s t) : ε ≤ |G.edgeDensity
    (G.nonuniformWitness ε s t) (G.nonuniformWitness ε t s) - G.edgeDensity s t| := by
  unfold nonuniformWitness
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹ : LinearOrderedField 𝕜
G : SimpleGraph α
inst✝ : DecidableRel G.Adj
ε : 𝕜
s t : Finset α
a b : α
h₁ : s ≠ t
h₂ : ¬IsUniform G ε s t
⊢ ε ≤
    ↑|edgeDensity G (if WellOrderingRel s t then (nonuniformWitnesses G ε s t).1 else (nonuniformWitnesses G ε t s).2)
            (if WellOrderingRel t s then (nonuniformWitnesses G ε t s).1 else (nonuniformWitnesses G ε s t).2) -
          edgeDensity G s t|

Next tactic:
rcases trichotomous_of WellOrderingRel s t with (lt | rfl | gt)