Zulip Chat Archive

Stream: Is there code for X?

Topic: Typeclass for nontrivial topology


Eric Wieser (Aug 06 2025 at 23:32):

Do we have something like this?

import Mathlib

variable {α}

class NontrivialTopology (α) [TopologicalSpace α] where
  ne_top : TopologicalSpace α  

theorem exists_not_inseparable (α) [TopologicalSpace α] [NontrivialTopology α] :
     x y : α, ¬ Inseparable x y := by
  have := NontrivialTopology.ne_top (α := α)
  contrapose! this
  ext
  simp_rw [inseparable_iff_forall_isOpen] at this
  simp_rw [isOpen_iff_mem_nhds, nhds_top, Filter.mem_top] at *
  refine fun h i hi => top_unique ?_, fun h i hi => ?_⟩
  · exact fun x _  (this x i _ h).2 hi
  · rw [h i hi]
    exact Filter.univ_mem

instance {α} [TopologicalSpace α] [NontrivialTopology α] : Nontrivial (SeparationQuotient α) :=
  let x, y, hxy := exists_not_inseparable α
  ⟨⟦x, y, mt Quotient.exact hxy

Notification Bot (Aug 06 2025 at 23:32):

2 messages were moved here from #Is there code for X? > Typeclass for indiscrete topology by Eric Wieser.

Notification Bot (Aug 06 2025 at 23:33):

A message was moved from this topic to #Is there code for X? > Typeclass for indiscrete topology by Eric Wieser.

Yaël Dillies (Aug 07 2025 at 03:57):

I saw
Eric Wieser said:

we have a few lemmas using ∃ x, ‖x‖ ≠ 0 for seminormed spaces which end up with API duplication for nontrivial normed spaces.

in the original thread. Would a statement about 𝓝 x for some x : α suffice?

Eric Wieser (Aug 07 2025 at 21:22):

I don't really understand your question, but

theorem exists_norm_ne_zero {α} [SeminormedAddCommGroup α] [NontrivialTopology α] :
     x : α, x  0 := by
  obtain x, y, h := exists_not_inseparable α
  refine x - y, mt ?_ h
  rw [ dist_eq_norm, Metric.inseparable_iff]
  exact id

gives me what I need

Eric Wieser (Aug 07 2025 at 21:23):

My initial goal is generalizing docs#NormedSpace.nonempty_sphere

Eric Wieser (Aug 08 2025 at 00:06):

Anyway, #28102 adds (much shorter versions of) the proofs in the top post without yet introducing any typeclasses.

Eric Wieser (Aug 30 2025 at 00:54):

#29120 explores adding new typeclasses and generalizes exists_norm_eq to nontrivial seminormed spaces.


Last updated: Dec 20 2025 at 21:32 UTC