l3lab/ntp-mathlib huggingface dataset:
theorem freeGroupoidFunctor_id :
    freeGroupoidFunctor (Prefunctor.id V) = Functor.id (FreeGroupoid V) := by
  dsimp only [freeGroupoidFunctor]; symm
  

Proof state:
V : Type u
inst✝² : Quiver V
V' : Type u'
inst✝¹ : Quiver V'
V'' : Type u''
inst✝ : Quiver V''
⊢ 𝟭 (FreeGroupoid V) = lift (𝟭q V ⋙q of V)

Next tactic:
apply lift_unique
theorem freeGroupoidFunctor_id :
    freeGroupoidFunctor (Prefunctor.id V) = Functor.id (FreeGroupoid V) := by
  dsimp only [freeGroupoidFunctor]; symm
  apply lift_unique; 

Proof state:
case hΦ
V : Type u
inst✝² : Quiver V
V' : Type u'
inst✝¹ : Quiver V'
V'' : Type u''
inst✝ : Quiver V''
⊢ of V ⋙q (𝟭 (FreeGroupoid V)).toPrefunctor = 𝟭q V ⋙q of V

Next tactic:
rfl
theorem freeGroupoidFunctor_comp (φ : V ⥤q V') (φ' : V' ⥤q V'') :
    freeGroupoidFunctor (φ ⋙q φ') = freeGroupoidFunctor φ ⋙ freeGroupoidFunctor φ' := by
  

Proof state:
V : Type u
inst✝² : Quiver V
V' : Type u'
inst✝¹ : Quiver V'
V'' : Type u''
inst✝ : Quiver V''
φ : V ⥤q V'
φ' : V' ⥤q V''
⊢ freeGroupoidFunctor (φ ⋙q φ') = freeGroupoidFunctor φ ⋙ freeGroupoidFunctor φ'

Next tactic:
dsimp only [freeGroupoidFunctor]
theorem freeGroupoidFunctor_comp (φ : V ⥤q V') (φ' : V' ⥤q V'') :
    freeGroupoidFunctor (φ ⋙q φ') = freeGroupoidFunctor φ ⋙ freeGroupoidFunctor φ' := by
  dsimp only [freeGroupoidFunctor]; 

Proof state:
V : Type u
inst✝² : Quiver V
V' : Type u'
inst✝¹ : Quiver V'
V'' : Type u''
inst✝ : Quiver V''
φ : V ⥤q V'
φ' : V' ⥤q V''
⊢ lift (φ ⋙q φ' ⋙q of V'') = lift (φ ⋙q of V') ⋙ lift (φ' ⋙q of V'')

Next tactic:
symm
theorem freeGroupoidFunctor_comp (φ : V ⥤q V') (φ' : V' ⥤q V'') :
    freeGroupoidFunctor (φ ⋙q φ') = freeGroupoidFunctor φ ⋙ freeGroupoidFunctor φ' := by
  dsimp only [freeGroupoidFunctor]; symm
  

Proof state:
V : Type u
inst✝² : Quiver V
V' : Type u'
inst✝¹ : Quiver V'
V'' : Type u''
inst✝ : Quiver V''
φ : V ⥤q V'
φ' : V' ⥤q V''
⊢ lift (φ ⋙q of V') ⋙ lift (φ' ⋙q of V'') = lift (φ ⋙q φ' ⋙q of V'')

Next tactic:
apply lift_unique
theorem freeGroupoidFunctor_comp (φ : V ⥤q V') (φ' : V' ⥤q V'') :
    freeGroupoidFunctor (φ ⋙q φ') = freeGroupoidFunctor φ ⋙ freeGroupoidFunctor φ' := by
  dsimp only [freeGroupoidFunctor]; symm
  apply lift_unique; 

Proof state:
case hΦ
V : Type u
inst✝² : Quiver V
V' : Type u'
inst✝¹ : Quiver V'
V'' : Type u''
inst✝ : Quiver V''
φ : V ⥤q V'
φ' : V' ⥤q V''
⊢ of V ⋙q (lift (φ ⋙q of V') ⋙ lift (φ' ⋙q of V'')).toPrefunctor = φ ⋙q φ' ⋙q of V''

Next tactic:
rfl
theorem le_einfsep_iff {d} :
    d ≤ s.einfsep ↔ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → d ≤ edist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
d : ℝ≥0∞
⊢ d ≤ einfsep s ↔ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → d ≤ edist x y

Next tactic:
simp_rw [einfsep, le_iInf_iff]
theorem einfsep_zero : s.einfsep = 0 ↔ ∀ C > 0, ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < C := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ einfsep s = 0 ↔ ∀ C > 0, ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < C

Next tactic:
simp_rw [einfsep, ← _root_.bot_eq_zero, iInf_eq_bot, iInf_lt_iff, exists_prop]
theorem einfsep_pos : 0 < s.einfsep ↔ ∃ C > 0, ∀ x ∈ s, ∀ y ∈ s, x ≠ y → C ≤ edist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ 0 < einfsep s ↔ ∃ C > 0, ∀ x ∈ s, ∀ y ∈ s, x ≠ y → C ≤ edist x y

Next tactic:
rw [pos_iff_ne_zero, Ne.def, einfsep_zero]
theorem einfsep_pos : 0 < s.einfsep ↔ ∃ C > 0, ∀ x ∈ s, ∀ y ∈ s, x ≠ y → C ≤ edist x y := by
  rw [pos_iff_ne_zero, Ne.def, einfsep_zero]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ (¬∀ C > 0, ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < C) ↔ ∃ C > 0, ∀ x ∈ s, ∀ y ∈ s, x ≠ y → C ≤ edist x y

Next tactic:
simp only [not_forall, not_exists, not_lt, exists_prop, not_and]
theorem einfsep_top :
    s.einfsep = ∞ ↔ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → edist x y = ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ einfsep s = ⊤ ↔ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → edist x y = ⊤

Next tactic:
simp_rw [einfsep, iInf_eq_top]
theorem einfsep_lt_top :
    s.einfsep < ∞ ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ einfsep s < ⊤ ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < ⊤

Next tactic:
simp_rw [einfsep, iInf_lt_iff, exists_prop]
theorem einfsep_ne_top :
    s.einfsep ≠ ∞ ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y ≠ ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ einfsep s ≠ ⊤ ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y ≠ ⊤

Next tactic:
simp_rw [← lt_top_iff_ne_top, einfsep_lt_top]
theorem einfsep_lt_iff {d} :
    s.einfsep < d ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < d := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
d : ℝ≥0∞
⊢ einfsep s < d ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < d

Next tactic:
simp_rw [einfsep, iInf_lt_iff, exists_prop]
theorem nontrivial_of_einfsep_lt_top (hs : s.einfsep < ∞) : s.Nontrivial := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hs : einfsep s < ⊤
⊢ Set.Nontrivial s

Next tactic:
rcases einfsep_lt_top.1 hs with ⟨_, hx, _, hy, hxy, _⟩
theorem nontrivial_of_einfsep_lt_top (hs : s.einfsep < ∞) : s.Nontrivial := by
  rcases einfsep_lt_top.1 hs with ⟨_, hx, _, hy, hxy, _⟩
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hs : einfsep s < ⊤
w✝¹ : α
hx : w✝¹ ∈ s
w✝ : α
hy : w✝ ∈ s
hxy : w✝¹ ≠ w✝
right✝ : edist w✝¹ w✝ < ⊤
⊢ Set.Nontrivial s

Next tactic:
exact ⟨_, hx, _, hy, hxy⟩
theorem Subsingleton.einfsep (hs : s.Subsingleton) : s.einfsep = ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hs : Set.Subsingleton s
⊢ Set.einfsep s = ⊤

Next tactic:
rw [einfsep_top]
theorem Subsingleton.einfsep (hs : s.Subsingleton) : s.einfsep = ∞ := by
  rw [einfsep_top]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hs : Set.Subsingleton s
⊢ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → edist x y = ⊤

Next tactic:
exact fun _ hx _ hy hxy => (hxy <| hs hx hy).elim
theorem le_einfsep_image_iff {d} {f : β → α} {s : Set β} : d ≤ einfsep (f '' s)
    ↔ ∀ x ∈ s, ∀ y ∈ s, f x ≠ f y → d ≤ edist (f x) (f y) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s✝ t : Set α
d : ℝ≥0∞
f : β → α
s : Set β
⊢ d ≤ einfsep (f '' s) ↔ ∀ x ∈ s, ∀ y ∈ s, f x ≠ f y → d ≤ edist (f x) (f y)

Next tactic:
simp_rw [le_einfsep_iff, ball_image_iff]
theorem einfsep_iUnion_mem_option {ι : Type*} (o : Option ι) (s : ι → Set α) :
    (⋃ i ∈ o, s i).einfsep = ⨅ i ∈ o, (s i).einfsep := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s✝ t : Set α
ι : Type u_3
o : Option ι
s : ι → Set α
⊢ einfsep (⋃ i ∈ o, s i) = ⨅ i ∈ o, einfsep (s i)

Next tactic:
cases o
theorem einfsep_iUnion_mem_option {ι : Type*} (o : Option ι) (s : ι → Set α) :
    (⋃ i ∈ o, s i).einfsep = ⨅ i ∈ o, (s i).einfsep := by cases o <;> 

Proof state:
case none
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s✝ t : Set α
ι : Type u_3
s : ι → Set α
⊢ einfsep (⋃ i ∈ none, s i) = ⨅ i ∈ none, einfsep (s i)

Next tactic:
simp
theorem einfsep_iUnion_mem_option {ι : Type*} (o : Option ι) (s : ι → Set α) :
    (⋃ i ∈ o, s i).einfsep = ⨅ i ∈ o, (s i).einfsep := by cases o <;> 

Proof state:
case some
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s✝ t : Set α
ι : Type u_3
s : ι → Set α
val✝ : ι
⊢ einfsep (⋃ i ∈ some val✝, s i) = ⨅ i ∈ some val✝, einfsep (s i)

Next tactic:
simp
theorem einfsep_insert_le : (insert x s).einfsep ≤ ⨅ (y ∈ s) (_ : x ≠ y), edist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ einfsep (insert x s) ≤ ⨅ y ∈ s, ⨅ (_ : x ≠ y), edist x y

Next tactic:
simp_rw [le_iInf_iff]
theorem einfsep_insert_le : (insert x s).einfsep ≤ ⨅ (y ∈ s) (_ : x ≠ y), edist x y := by
  simp_rw [le_iInf_iff]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ ∀ i ∈ s, x ≠ i → einfsep (insert x s) ≤ edist x i

Next tactic:
refine' fun _ hy hxy => einfsep_le_edist_of_mem (mem_insert _ _) (mem_insert_of_mem _ hy) hxy
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ edist x y ⊓ edist y x ≤ einfsep {x, y}

Next tactic:
simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ ∀ (x_1 : α),
    x_1 = x ∨ x_1 = y →
      ∀ (y_1 : α), y_1 = x ∨ y_1 = y → x_1 ≠ y_1 → edist x y ≤ edist x_1 y_1 ∨ edist y x ≤ edist x_1 y_1

Next tactic:
rintro a (rfl | rfl) b (rfl | rfl) hab
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
inst✝ : EDist α
y : α
s t : Set α
b : α
hab : b ≠ b
⊢ edist b y ≤ edist b b ∨ edist y b ≤ edist b b

Next tactic:
try simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try 

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
inst✝ : EDist α
y : α
s t : Set α
b : α
hab : b ≠ b
⊢ edist b y ≤ edist b b ∨ edist y b ≤ edist b b

Next tactic:
simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (

Proof state:
case inl.inr
α : Type u_1
β : Type u_2
inst✝ : EDist α
s t : Set α
a b : α
hab : a ≠ b
⊢ edist a b ≤ edist a b ∨ edist b a ≤ edist a b

Next tactic:
try simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try 

Proof state:
case inl.inr
α : Type u_1
β : Type u_2
inst✝ : EDist α
s t : Set α
a b : α
hab : a ≠ b
⊢ edist a b ≤ edist a b ∨ edist b a ≤ edist a b

Next tactic:
simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (

Proof state:
case inr.inl
α : Type u_1
β : Type u_2
inst✝ : EDist α
s t : Set α
a b : α
hab : a ≠ b
⊢ edist b a ≤ edist a b ∨ edist a b ≤ edist a b

Next tactic:
try simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try 

Proof state:
case inr.inl
α : Type u_1
β : Type u_2
inst✝ : EDist α
s t : Set α
a b : α
hab : a ≠ b
⊢ edist b a ≤ edist a b ∨ edist a b ≤ edist a b

Next tactic:
simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
inst✝ : EDist α
x : α
s t : Set α
b : α
hab : b ≠ b
⊢ edist x b ≤ edist b b ∨ edist b x ≤ edist b b

Next tactic:
try simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try 

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
inst✝ : EDist α
x : α
s t : Set α
b : α
hab : b ≠ b
⊢ edist x b ≤ edist b b ∨ edist b x ≤ edist b b

Next tactic:
simp only [le_refl, true_or, or_true]
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try simp only [le_refl, true_or, or_true]) <;>
    

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
inst✝ : EDist α
y : α
s t : Set α
b : α
hab : b ≠ b
⊢ edist b y ≤ edist b b ∨ edist y b ≤ edist b b

Next tactic:
contradiction
theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep := by
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff, mem_singleton_iff]
  rintro a (rfl | rfl) b (rfl | rfl) hab <;> (try simp only [le_refl, true_or, or_true]) <;>
    

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
inst✝ : EDist α
x : α
s t : Set α
b : α
hab : b ≠ b
⊢ edist x b ≤ edist b b ∨ edist b x ≤ edist b b

Next tactic:
contradiction
theorem einfsep_pair_le_right (hxy : x ≠ y) : ({x, y} : Set α).einfsep ≤ edist y x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hxy : x ≠ y
⊢ einfsep {x, y} ≤ edist y x

Next tactic:
rw [pair_comm]
theorem einfsep_pair_le_right (hxy : x ≠ y) : ({x, y} : Set α).einfsep ≤ edist y x := by
  rw [pair_comm]; 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hxy : x ≠ y
⊢ einfsep {y, x} ≤ edist y x

Next tactic:
exact einfsep_pair_le_left hxy.symm
theorem einfsep_eq_iInf : s.einfsep = ⨅ d : s.offDiag, (uncurry edist) (d : α × α) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
⊢ einfsep s = ⨅ d, uncurry edist ↑d

Next tactic:
refine' eq_of_forall_le_iff fun _ => _
theorem einfsep_eq_iInf : s.einfsep = ⨅ d : s.offDiag, (uncurry edist) (d : α × α) := by
  refine' eq_of_forall_le_iff fun _ => _
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
x✝ : ℝ≥0∞
⊢ x✝ ≤ einfsep s ↔ x✝ ≤ ⨅ d, uncurry edist ↑d

Next tactic:
simp_rw [le_einfsep_iff, le_iInf_iff, imp_forall_iff, SetCoe.forall, mem_offDiag,
    Prod.forall, uncurry_apply_pair, and_imp]
theorem einfsep_of_fintype [DecidableEq α] [Fintype s] :
    s.einfsep = s.offDiag.toFinset.inf (uncurry edist) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : EDist α
x y : α
s t : Set α
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
⊢ einfsep s = Finset.inf (toFinset (offDiag s)) (uncurry edist)

Next tactic:
refine' eq_of_forall_le_iff fun _ => _
theorem einfsep_of_fintype [DecidableEq α] [Fintype s] :
    s.einfsep = s.offDiag.toFinset.inf (uncurry edist) := by
  refine' eq_of_forall_le_iff fun _ => _
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : EDist α
x y : α
s t : Set α
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
x✝ : ℝ≥0∞
⊢ x✝ ≤ einfsep s ↔ x✝ ≤ Finset.inf (toFinset (offDiag s)) (uncurry edist)

Next tactic:
simp_rw [le_einfsep_iff, imp_forall_iff, Finset.le_inf_iff, mem_toFinset, mem_offDiag,
    Prod.forall, uncurry_apply_pair, and_imp]
theorem Finite.einfsep (hs : s.Finite) : s.einfsep = hs.offDiag.toFinset.inf (uncurry edist) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hs : Set.Finite s
⊢ Set.einfsep s = Finset.inf (Finite.toFinset (_ : Set.Finite (offDiag s))) (uncurry edist)

Next tactic:
refine' eq_of_forall_le_iff fun _ => _
theorem Finite.einfsep (hs : s.Finite) : s.einfsep = hs.offDiag.toFinset.inf (uncurry edist) := by
  refine' eq_of_forall_le_iff fun _ => _
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : EDist α
x y : α
s t : Set α
hs : Set.Finite s
x✝ : ℝ≥0∞
⊢ x✝ ≤ Set.einfsep s ↔ x✝ ≤ Finset.inf (Finite.toFinset (_ : Set.Finite (offDiag s))) (uncurry edist)

Next tactic:
simp_rw [le_einfsep_iff, imp_forall_iff, Finset.le_inf_iff, Finite.mem_toFinset, mem_offDiag,
    Prod.forall, uncurry_apply_pair, and_imp]
theorem Finset.coe_einfsep [DecidableEq α] {s : Finset α} :
    (s : Set α).einfsep = s.offDiag.inf (uncurry edist) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
⊢ einfsep ↑s = Finset.inf (Finset.offDiag s) (uncurry edist)

Next tactic:
simp_rw [einfsep_of_fintype, ← Finset.coe_offDiag, Finset.toFinset_coe]
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ einfsep s = edist x y

Next tactic:
classical
    cases nonempty_fintype s
    simp_rw [einfsep_of_fintype]
    rcases Finset.exists_mem_eq_inf s.offDiag.toFinset (by simpa) (uncurry edist) with ⟨w, hxy, hed⟩
    simp_rw [mem_toFinset] at hxy
    refine' ⟨w.fst, hxy.1, w.snd, hxy.2.1, hxy.2.2, hed⟩
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  classical
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ einfsep s = edist x y

Next tactic:
cases nonempty_fintype s
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  classical
    cases nonempty_fintype s
    

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
val✝ : Fintype ↑s
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ einfsep s = edist x y

Next tactic:
simp_rw [einfsep_of_fintype]
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  classical
    cases nonempty_fintype s
    simp_rw [einfsep_of_fintype]
    

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
val✝ : Fintype ↑s
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ Finset.inf (toFinset (offDiag s)) (uncurry edist) = edist x y

Next tactic:
rcases Finset.exists_mem_eq_inf s.offDiag.toFinset (by simpa) (uncurry edist) with ⟨w, hxy, hed⟩
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  classical
    cases nonempty_fintype s
    simp_rw [einfsep_of_fintype]
    rcases Finset.exists_mem_eq_inf s.offDiag.toFinset (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
val✝ : Fintype ↑s
⊢ Finset.Nonempty (toFinset (offDiag s))

Next tactic:
simpa
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  classical
    cases nonempty_fintype s
    simp_rw [einfsep_of_fintype]
    rcases Finset.exists_mem_eq_inf s.offDiag.toFinset (by simpa) (uncurry edist) with ⟨w, hxy, hed⟩
    

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
val✝ : Fintype ↑s
w : α × α
hxy : w ∈ toFinset (offDiag s)
hed : Finset.inf (toFinset (offDiag s)) (uncurry edist) = uncurry edist w
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ Finset.inf (toFinset (offDiag s)) (uncurry edist) = edist x y

Next tactic:
simp_rw [mem_toFinset] at hxy
theorem Nontrivial.einfsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.einfsep = edist x y := by
  classical
    cases nonempty_fintype s
    simp_rw [einfsep_of_fintype]
    rcases Finset.exists_mem_eq_inf s.offDiag.toFinset (by simpa) (uncurry edist) with ⟨w, hxy, hed⟩
    simp_rw [mem_toFinset] at hxy
    

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : EDist α
x y : α
s t : Set α
inst✝ : Finite ↑s
hs : Set.Nontrivial s
val✝ : Fintype ↑s
w : α × α
hed : Finset.inf (toFinset (offDiag s)) (uncurry edist) = uncurry edist w
hxy : w ∈ offDiag s
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ Finset.inf (toFinset (offDiag s)) (uncurry edist) = edist x y

Next tactic:
refine' ⟨w.fst, hxy.1, w.snd, hxy.2.1, hxy.2.2, hed⟩
theorem einfsep_pair (hxy : x ≠ y) : ({x, y} : Set α).einfsep = edist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
x y z : α
s t : Set α
hxy : x ≠ y
⊢ einfsep {x, y} = edist x y

Next tactic:
nth_rw 1 [← min_self (edist x y)]
theorem einfsep_pair (hxy : x ≠ y) : ({x, y} : Set α).einfsep = edist x y := by
  nth_rw 1 [← min_self (edist x y)]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
x y z : α
s t : Set α
hxy : x ≠ y
⊢ einfsep {x, y} = min (edist x y) (edist x y)

Next tactic:
convert einfsep_pair_eq_inf hxy using 2
theorem einfsep_pair (hxy : x ≠ y) : ({x, y} : Set α).einfsep = edist x y := by
  nth_rw 1 [← min_self (edist x y)]
  convert einfsep_pair_eq_inf hxy using 2
  

Proof state:
case h.e'_3.h.e'_2
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
x y z : α
s t : Set α
hxy : x ≠ y
⊢ edist x y = edist y x

Next tactic:
rw [edist_comm]
theorem einfsep_insert : einfsep (insert x s) =
    (⨅ (y ∈ s) (_ : x ≠ y), edist x y) ⊓ s.einfsep := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
x y z : α
s t : Set α
⊢ einfsep (insert x s) = (⨅ y ∈ s, ⨅ (_ : x ≠ y), edist x y) ⊓ einfsep s

Next tactic:
refine' le_antisymm (le_min einfsep_insert_le (einfsep_anti (subset_insert _ _))) _
theorem einfsep_insert : einfsep (insert x s) =
    (⨅ (y ∈ s) (_ : x ≠ y), edist x y) ⊓ s.einfsep := by
  refine' le_antisymm (le_min einfsep_insert_le (einfsep_anti (subset_insert _ _))) _
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
x y z : α
s t : Set α
⊢ (⨅ y ∈ s, ⨅ (_ : x ≠ y), edist x y) ⊓ einfsep s ≤ einfsep (insert x s)

Next tactic:
simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff]
theorem einfsep_insert : einfsep (insert x s) =
    (⨅ (y ∈ s) (_ : x ≠ y), edist x y) ⊓ s.einfsep := by
  refine' le_antisymm (le_min einfsep_insert_le (einfsep_anti (subset_insert _ _))) _
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
x y z : α
s t : Set α
⊢ ∀ (x_1 : α),
    x_1 = x ∨ x_1 ∈ s →
      ∀ (y : α), y = x ∨ y ∈ s → x_1 ≠ y → ⨅ y ∈ s, ⨅ (_ : x ≠ y), edist x y ≤ edist x_1 y ∨ einfsep s ≤ edist x_1 y

Next tactic:
rintro y (rfl | hy) z (rfl | hz) hyz
theorem einfsep_insert : einfsep (insert x s) =
    (⨅ (y ∈ s) (_ : x ≠ y), edist x y) ⊓ s.einfsep := by
  refine' le_antisymm (le_min einfsep_insert_le (einfsep_anti (subset_insert _ _))) _
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff]
  rintro y (rfl | hy) z (rfl | hz) hyz
  · 

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
y z✝ : α
s t : Set α
z : α
hyz : z ≠ z
⊢ ⨅ y ∈ s, ⨅ (_ : z ≠ y), edist z y ≤ edist z z ∨ einfsep s ≤ edist z z

Next tactic:
exact False.elim (hyz rfl)
theorem einfsep_insert : einfsep (insert x s) =
    (⨅ (y ∈ s) (_ : x ≠ y), edist x y) ⊓ s.einfsep := by
  refine' le_antisymm (le_min einfsep_insert_le (einfsep_anti (subset_insert _ _))) _
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff]
  rintro y (rfl | hy) z (rfl | hz) hyz
  · exact False.elim (hyz rfl)
  · 

Proof state:
case inl.inr
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
y✝ z✝ : α
s t : Set α
y z : α
hz : z ∈ s
hyz : y ≠ z
⊢ ⨅ y_1 ∈ s, ⨅ (_ : y ≠ y_1), edist y y_1 ≤ edist y z ∨ einfsep s ≤ edist y z

Next tactic:
exact Or.inl (iInf_le_of_le _ (iInf₂_le hz hyz))
theorem einfsep_insert : einfsep (insert x s) =
    (⨅ (y ∈ s) (_ : x ≠ y), edist x y) ⊓ s.einfsep := by
  refine' le_antisymm (le_min einfsep_insert_le (einfsep_anti (subset_insert _ _))) _
  simp_rw [le_einfsep_iff, inf_le_iff, mem_insert_iff]
  rintro y (rfl | hy) z (rfl | hz) hyz
  · exact False.elim (hyz rfl)
  · exact Or.inl (iInf_le_of_le _ (iInf₂_le hz hyz))
  · 

Proof state:
case inr.inl
α : Type u_1
β : Type u_2
inst✝ : PseudoEMetricSpace α
y✝ z✝ : α
s t : Set α
y : α
hy : y ∈ s
z : α
hyz : y ≠ z
⊢ ⨅ y ∈ s, ⨅ (_ : z ≠ y), edist z y ≤ edist y z ∨ einfsep s ≤ edist y z

Next tactic:
rw [edist_comm]