l3lab/ntp-mathlib huggingface dataset:
theorem infsep_of_fintype [Decidable s.Nontrivial] [DecidableEq α] [Fintype s] : s.infsep =
    if hs : s.Nontrivial then s.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝² : Decidable (Set.Nontrivial s)
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
⊢ infsep s =
    if hs : Set.Nontrivial s then
      Finset.inf' (toFinset (offDiag s)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist)
    else 0

Next tactic:
split_ifs with hs
theorem infsep_of_fintype [Decidable s.Nontrivial] [DecidableEq α] [Fintype s] : s.infsep =
    if hs : s.Nontrivial then s.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝² : Decidable (Set.Nontrivial s)
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
hs : Set.Nontrivial s
⊢ infsep s = Finset.inf' (toFinset (offDiag s)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist)

Next tactic:
refine' eq_of_forall_le_iff fun _ => _
theorem infsep_of_fintype [Decidable s.Nontrivial] [DecidableEq α] [Fintype s] : s.infsep =
    if hs : s.Nontrivial then s.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · refine' eq_of_forall_le_iff fun _ => _
    

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝² : Decidable (Set.Nontrivial s)
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
hs : Set.Nontrivial s
x✝ : ℝ
⊢ x✝ ≤ infsep s ↔ x✝ ≤ Finset.inf' (toFinset (offDiag s)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist)

Next tactic:
simp_rw [hs.le_infsep_iff, imp_forall_iff, Finset.le_inf'_iff, mem_toFinset, mem_offDiag,
      Prod.forall, uncurry_apply_pair, and_imp]
theorem infsep_of_fintype [Decidable s.Nontrivial] [DecidableEq α] [Fintype s] : s.infsep =
    if hs : s.Nontrivial then s.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · refine' eq_of_forall_le_iff fun _ => _
    simp_rw [hs.le_infsep_iff, imp_forall_iff, Finset.le_inf'_iff, mem_toFinset, mem_offDiag,
      Prod.forall, uncurry_apply_pair, and_imp]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝³ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝² : Decidable (Set.Nontrivial s)
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
hs : ¬Set.Nontrivial s
⊢ infsep s = 0

Next tactic:
rw [not_nontrivial_iff] at hs
theorem infsep_of_fintype [Decidable s.Nontrivial] [DecidableEq α] [Fintype s] : s.infsep =
    if hs : s.Nontrivial then s.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · refine' eq_of_forall_le_iff fun _ => _
    simp_rw [hs.le_infsep_iff, imp_forall_iff, Finset.le_inf'_iff, mem_toFinset, mem_offDiag,
      Prod.forall, uncurry_apply_pair, and_imp]
  · rw [not_nontrivial_iff] at hs
    

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝³ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝² : Decidable (Set.Nontrivial s)
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
hs : Set.Subsingleton s
⊢ infsep s = 0

Next tactic:
exact hs.infsep_zero
theorem Nontrivial.infsep_of_fintype [DecidableEq α] [Fintype s] (hs : s.Nontrivial) :
    s.infsep = s.offDiag.toFinset.inf' (by 

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

Next tactic:
simpa
theorem Nontrivial.infsep_of_fintype [DecidableEq α] [Fintype s] (hs : s.Nontrivial) :
    s.infsep = s.offDiag.toFinset.inf' (by simpa) (uncurry dist) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
hs : Set.Nontrivial s
⊢ infsep s = Finset.inf' (toFinset (offDiag s)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist)

Next tactic:
classical rw [Set.infsep_of_fintype, dif_pos hs]
theorem Nontrivial.infsep_of_fintype [DecidableEq α] [Fintype s] (hs : s.Nontrivial) :
    s.infsep = s.offDiag.toFinset.inf' (by simpa) (uncurry dist) := by
  classical 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝¹ : DecidableEq α
inst✝ : Fintype ↑s
hs : Set.Nontrivial s
⊢ infsep s = Finset.inf' (toFinset (offDiag s)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist)

Next tactic:
rw [Set.infsep_of_fintype, dif_pos hs]
theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝ : Decidable (Set.Nontrivial s)
hsf : Set.Finite s
hs : Set.Nontrivial s
⊢ Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))

Next tactic:
simpa
theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝ : Decidable (Set.Nontrivial s)
hsf : Set.Finite s
⊢ Set.infsep s =
    if hs : Set.Nontrivial s then
      Finset.inf' (Finite.toFinset (_ : Set.Finite (offDiag s)))
        (_ : Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))) (uncurry dist)
    else 0

Next tactic:
split_ifs with hs
theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝ : Decidable (Set.Nontrivial s)
hsf : Set.Finite s
hs : Set.Nontrivial s
⊢ Set.infsep s =
    Finset.inf' (Finite.toFinset (_ : Set.Finite (offDiag s)))
      (_ : Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))) (uncurry dist)

Next tactic:
refine' eq_of_forall_le_iff fun _ => _
theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · refine' eq_of_forall_le_iff fun _ => _
    

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝ : Decidable (Set.Nontrivial s)
hsf : Set.Finite s
hs : Set.Nontrivial s
x✝ : ℝ
⊢ x✝ ≤ Set.infsep s ↔
    x✝ ≤
      Finset.inf' (Finite.toFinset (_ : Set.Finite (offDiag s)))
        (_ : Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))) (uncurry dist)

Next tactic:
simp_rw [hs.le_infsep_iff, imp_forall_iff, Finset.le_inf'_iff, Finite.mem_toFinset,
      mem_offDiag, Prod.forall, uncurry_apply_pair, and_imp]
theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · refine' eq_of_forall_le_iff fun _ => _
    simp_rw [hs.le_infsep_iff, imp_forall_iff, Finset.le_inf'_iff, Finite.mem_toFinset,
      mem_offDiag, Prod.forall, uncurry_apply_pair, and_imp]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝ : Decidable (Set.Nontrivial s)
hsf : Set.Finite s
hs : ¬Set.Nontrivial s
⊢ Set.infsep s = 0

Next tactic:
rw [not_nontrivial_iff] at hs
theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0 := by
  split_ifs with hs
  · refine' eq_of_forall_le_iff fun _ => _
    simp_rw [hs.le_infsep_iff, imp_forall_iff, Finset.le_inf'_iff, Finite.mem_toFinset,
      mem_offDiag, Prod.forall, uncurry_apply_pair, and_imp]
  · rw [not_nontrivial_iff] at hs
    

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s t : Set α
inst✝ : Decidable (Set.Nontrivial s)
hsf : Set.Finite s
hs : Set.Subsingleton s
⊢ Set.infsep s = 0

Next tactic:
exact hs.infsep_zero
theorem Finite.infsep_of_nontrivial (hsf : s.Finite) (hs : s.Nontrivial) :
    s.infsep = hsf.offDiag.toFinset.inf' (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoMetricSpace α
x y z : α
s t : Set α
hsf : Set.Finite s
hs : Set.Nontrivial s
⊢ Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))

Next tactic:
simpa
theorem Finite.infsep_of_nontrivial (hsf : s.Finite) (hs : s.Nontrivial) :
    s.infsep = hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoMetricSpace α
x y z : α
s t : Set α
hsf : Set.Finite s
hs : Set.Nontrivial s
⊢ Set.infsep s =
    Finset.inf' (Finite.toFinset (_ : Set.Finite (offDiag s)))
      (_ : Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))) (uncurry dist)

Next tactic:
classical simp_rw [hsf.infsep, dif_pos hs]
theorem Finite.infsep_of_nontrivial (hsf : s.Finite) (hs : s.Nontrivial) :
    s.infsep = hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) := by
  classical 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PseudoMetricSpace α
x y z : α
s t : Set α
hsf : Set.Finite s
hs : Set.Nontrivial s
⊢ Set.infsep s =
    Finset.inf' (Finite.toFinset (_ : Set.Finite (offDiag s)))
      (_ : Finset.Nonempty (Finite.toFinset (_ : Set.Finite (offDiag s)))) (uncurry dist)

Next tactic:
simp_rw [hsf.infsep, dif_pos hs]
theorem _root_.Finset.coe_infsep [DecidableEq α] (s : Finset α) : (s : Set α).infsep =
    if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (uncurry dist) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
⊢ infsep ↑s = if hs : Finset.Nonempty (Finset.offDiag s) then Finset.inf' (Finset.offDiag s) hs (uncurry dist) else 0

Next tactic:
have H : (s : Set α).Nontrivial ↔ s.offDiag.Nonempty := by
    rw [← Set.offDiag_nonempty, ← Finset.coe_offDiag, Finset.coe_nonempty]
theorem _root_.Finset.coe_infsep [DecidableEq α] (s : Finset α) : (s : Set α).infsep =
    if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (uncurry dist) else 0 := by
  have H : (s : Set α).Nontrivial ↔ s.offDiag.Nonempty := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
⊢ Set.Nontrivial ↑s ↔ Finset.Nonempty (Finset.offDiag s)

Next tactic:
rw [← Set.offDiag_nonempty, ← Finset.coe_offDiag, Finset.coe_nonempty]
theorem _root_.Finset.coe_infsep [DecidableEq α] (s : Finset α) : (s : Set α).infsep =
    if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (uncurry dist) else 0 := by
  have H : (s : Set α).Nontrivial ↔ s.offDiag.Nonempty := by
    rw [← Set.offDiag_nonempty, ← Finset.coe_offDiag, Finset.coe_nonempty]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
H : Set.Nontrivial ↑s ↔ Finset.Nonempty (Finset.offDiag s)
⊢ infsep ↑s = if hs : Finset.Nonempty (Finset.offDiag s) then Finset.inf' (Finset.offDiag s) hs (uncurry dist) else 0

Next tactic:
split_ifs with hs
theorem _root_.Finset.coe_infsep [DecidableEq α] (s : Finset α) : (s : Set α).infsep =
    if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (uncurry dist) else 0 := by
  have H : (s : Set α).Nontrivial ↔ s.offDiag.Nonempty := by
    rw [← Set.offDiag_nonempty, ← Finset.coe_offDiag, Finset.coe_nonempty]
  split_ifs with hs
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
H : Set.Nontrivial ↑s ↔ Finset.Nonempty (Finset.offDiag s)
hs : Finset.Nonempty (Finset.offDiag s)
⊢ infsep ↑s = Finset.inf' (Finset.offDiag s) hs (uncurry dist)

Next tactic:
simp_rw [(H.mpr hs).infsep_of_fintype, ← Finset.coe_offDiag, Finset.toFinset_coe]
theorem _root_.Finset.coe_infsep [DecidableEq α] (s : Finset α) : (s : Set α).infsep =
    if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (uncurry dist) else 0 := by
  have H : (s : Set α).Nontrivial ↔ s.offDiag.Nonempty := by
    rw [← Set.offDiag_nonempty, ← Finset.coe_offDiag, Finset.coe_nonempty]
  split_ifs with hs
  · simp_rw [(H.mpr hs).infsep_of_fintype, ← Finset.coe_offDiag, Finset.toFinset_coe]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
H : Set.Nontrivial ↑s ↔ Finset.Nonempty (Finset.offDiag s)
hs : ¬Finset.Nonempty (Finset.offDiag s)
⊢ infsep ↑s = 0

Next tactic:
exact (not_nontrivial_iff.mp (H.mp.mt hs)).infsep_zero
theorem _root_.Finset.coe_infsep_of_offDiag_nonempty [DecidableEq α] {s : Finset α}
    (hs : s.offDiag.Nonempty) : (s : Set α).infsep = s.offDiag.inf' hs (uncurry dist) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
hs : Finset.Nonempty (Finset.offDiag s)
⊢ infsep ↑s = Finset.inf' (Finset.offDiag s) hs (uncurry dist)

Next tactic:
rw [Finset.coe_infsep, dif_pos hs]
theorem _root_.Finset.coe_infsep_of_offDiag_empty
    [DecidableEq α] {s : Finset α} (hs : s.offDiag = ∅) : (s : Set α).infsep = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
hs : Finset.offDiag s = ∅
⊢ infsep ↑s = 0

Next tactic:
rw [← Finset.not_nonempty_iff_eq_empty] at hs
theorem _root_.Finset.coe_infsep_of_offDiag_empty
    [DecidableEq α] {s : Finset α} (hs : s.offDiag = ∅) : (s : Set α).infsep = 0 := by
  rw [← Finset.not_nonempty_iff_eq_empty] at hs
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
s✝ t : Set α
inst✝ : DecidableEq α
s : Finset α
hs : ¬Finset.Nonempty (Finset.offDiag s)
⊢ infsep ↑s = 0

Next tactic:
rw [Finset.coe_infsep, dif_neg hs]
theorem Nontrivial.infsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.infsep = dist x y := by
  

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

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

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

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

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

Next tactic:
simp_rw [hs.infsep_of_fintype]
theorem Nontrivial.infsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.infsep = dist x y := by
  classical
    cases nonempty_fintype s
    simp_rw [hs.infsep_of_fintype]
    

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

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

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

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

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : PseudoMetricSpace α
x y z : α
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)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist) = uncurry dist w
⊢ ∃ x ∈ s,
    ∃ y ∈ s,
      x ≠ y ∧ Finset.inf' (toFinset (offDiag s)) (_ : Finset.Nonempty (toFinset (offDiag s))) (uncurry dist) = dist x y

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

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

Next tactic:
exact ⟨w.fst, hxy.1, w.snd, hxy.2.1, hxy.2.2, hed⟩
theorem infsep_zero_iff_subsingleton_of_finite [Finite s] : s.infsep = 0 ↔ s.Subsingleton := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MetricSpace α
s : Set α
inst✝ : Finite ↑s
⊢ infsep s = 0 ↔ Set.Subsingleton s

Next tactic:
rw [infsep_zero, einfsep_eq_top_iff, or_iff_right_iff_imp]
theorem infsep_zero_iff_subsingleton_of_finite [Finite s] : s.infsep = 0 ↔ s.Subsingleton := by
  rw [infsep_zero, einfsep_eq_top_iff, or_iff_right_iff_imp]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MetricSpace α
s : Set α
inst✝ : Finite ↑s
⊢ einfsep s = 0 → Set.Subsingleton s

Next tactic:
exact fun H => (einfsep_pos_of_finite.ne' H).elim
theorem infsep_pos_iff_nontrivial_of_finite [Finite s] : 0 < s.infsep ↔ s.Nontrivial := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MetricSpace α
s : Set α
inst✝ : Finite ↑s
⊢ 0 < infsep s ↔ Set.Nontrivial s

Next tactic:
rw [infsep_pos, einfsep_lt_top_iff, and_iff_right_iff_imp]
theorem infsep_pos_iff_nontrivial_of_finite [Finite s] : 0 < s.infsep ↔ s.Nontrivial := by
  rw [infsep_pos, einfsep_lt_top_iff, and_iff_right_iff_imp]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MetricSpace α
s : Set α
inst✝ : Finite ↑s
⊢ Set.Nontrivial s → 0 < einfsep s

Next tactic:
exact fun _ => einfsep_pos_of_finite
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  

Proof state:
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m : α
h : ∀ i ∈ Ico n m, r i (succ i)
hnm : n ≤ m
⊢ ReflTransGen r n m

Next tactic:
revert h
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  revert h; 

Proof state:
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m : α
hnm : n ≤ m
⊢ (∀ i ∈ Ico n m, r i (succ i)) → ReflTransGen r n m

Next tactic:
refine' Succ.rec _ _ hnm
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  revert h; refine' Succ.rec _ _ hnm
  · 

Proof state:
case refine'_1
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m : α
hnm : n ≤ m
⊢ (∀ i ∈ Ico n n, r i (succ i)) → ReflTransGen r n n

Next tactic:
intro _
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  revert h; refine' Succ.rec _ _ hnm
  · intro _
    

Proof state:
case refine'_1
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m : α
hnm : n ≤ m
h✝ : ∀ i ∈ Ico n n, r i (succ i)
⊢ ReflTransGen r n n

Next tactic:
exact ReflTransGen.refl
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  revert h; refine' Succ.rec _ _ hnm
  · intro _
    exact ReflTransGen.refl
  · 

Proof state:
case refine'_2
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m : α
hnm : n ≤ m
⊢ ∀ (n_1 : α),
    n ≤ n_1 →
      ((∀ i ∈ Ico n n_1, r i (succ i)) → ReflTransGen r n n_1) →
        (∀ i ∈ Ico n (succ n_1), r i (succ i)) → ReflTransGen r n (succ n_1)

Next tactic:
intro m hnm ih h
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  revert h; refine' Succ.rec _ _ hnm
  · intro _
    exact ReflTransGen.refl
  · intro m hnm ih h
    

Proof state:
case refine'_2
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m✝ : α
hnm✝ : n ≤ m✝
m : α
hnm : n ≤ m
ih : (∀ i ∈ Ico n m, r i (succ i)) → ReflTransGen r n m
h : ∀ i ∈ Ico n (succ m), r i (succ i)
⊢ ReflTransGen r n (succ m)

Next tactic:
have : ReflTransGen r n m := ih fun i hi => h i ⟨hi.1, hi.2.trans_le <| le_succ m⟩
/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m := by
  revert h; refine' Succ.rec _ _ hnm
  · intro _
    exact ReflTransGen.refl
  · intro m hnm ih h
    have : ReflTransGen r n m := ih fun i hi => h i ⟨hi.1, hi.2.trans_le <| le_succ m⟩
    

Proof state:
case refine'_2
α : Type u_1
inst✝² : PartialOrder α
inst✝¹ : SuccOrder α
inst✝ : IsSuccArchimedean α
r : α → α → Prop
n m✝ : α
hnm✝ : n ≤ m✝
m : α
hnm : n ≤ m
ih : (∀ i ∈ Ico n m, r i (succ i)) → ReflTransGen r n m
h : ∀ i ∈ Ico n (succ m), r i (succ i)
this : ReflTransGen r n m
⊢ ReflTransGen r n (succ m)

Next tactic:
rcases (le_succ m).eq_or_lt with hm | hm