Zulip Chat Archive

Stream: Is there code for X?

Topic: closed interval not neighborhood of edge


llllvvuu (Feb 18 2024 at 02:21):

I tried a few spellings, nothing came up for exact?/apply?/aesop?/etc:

import Mathlib

open scoped Topology

lemma foo {a b : โ„} : Set.Icc a b โˆ‰ ๐“ a := by
  by_contra hc
  obtain โŸจฮต, ฮต_pos, ฮต_in_iccโŸฉ := Metric.mem_nhds_iff.mp hc
  have h_mem : a - ฮต/2 โˆˆ Metric.ball a ฮต := mem_ball_iff_norm'.mpr (by simp [ฮต_pos, abs_of_pos])
  have h_nmem : a - ฮต/2 โˆ‰ Set.Icc a b := Set.not_mem_Icc_of_lt (by linarith)
  exact h_nmem (ฮต_in_icc h_mem)

lemma bar {a b c : โ„} : Set.Icc a b โˆˆ ๐“ c โ†” a < c โˆง c < b := by
  constructor
  ยท sorry
  ยท exact fun โŸจh1, h2โŸฉ โ†ฆ Icc_mem_nhds h1 h2

lemma baz {a b c : โ„} : Set.Icc a b โˆˆ ๐“ c โ†” Set.Ioo a b โˆˆ ๐“ c := by
  constructor
  ยท sorry
  ยท exact fun h โ†ฆ Filter.mem_of_superset h Set.Ioo_subset_Icc_self

Do we have something like this?

Patrick Massot (Feb 18 2024 at 03:11):

I would be surprised if this is in Mathlib. They look pretty useless. What are you trying to do with those lemmas?

llllvvuu (Feb 18 2024 at 03:45):

I have (not #mwe unfortunately):

def Rectangle (z w : โ„‚) : Set โ„‚ := [[z.re, w.re]] ร—โ„‚ [[z.im, w.im]]

lemma RectanglePullToNhdOfPole' {f : โ„‚ โ†’ โ„‚} {zโ‚€ zโ‚ zโ‚‚ zโ‚ƒ p : โ„‚}
    -- ...
    (hp : Rectangle zโ‚ zโ‚‚ โˆˆ ๐“ p) (hz : Rectangle zโ‚ zโ‚‚ โІ Rectangle zโ‚€ zโ‚ƒ)
    (fHolo : HolomorphicOn f (Rectangle zโ‚€ zโ‚ƒ \ {p})) :
    RectangleIntegral f zโ‚€ zโ‚ƒ = RectangleIntegral f zโ‚ zโ‚‚ := by
  sorry

and I need p to not be on the edge of the inner rectangle. But maybe I should take instead of (hp : Rectangle zโ‚ zโ‚‚ โˆˆ ๐“ p), just directly (hp : zโ‚ < p.re โˆง ...)?

Junyan Xu (Feb 18 2024 at 09:38):

import Mathlib

open scoped Topology

lemma bar {a b c : โ„} : Set.Icc a b โˆˆ ๐“ c โ†” a < c โˆง c < b := by
  rw [โ† mem_interior_iff_mem_nhds, interior_Icc]; rfl

lemma foo {a b : โ„} : Set.Icc a b โˆ‰ ๐“ a := by
  rw [bar]; exact (irrefl _ ยท.1)

lemma baz {a b c : โ„} : Set.Icc a b โˆˆ ๐“ c โ†” Set.Ioo a b โˆˆ ๐“ c := by
  rw [โ† interior_Icc]; exact interior_mem_nhds.symm

Yury G. Kudryashov (Mar 05 2024 at 15:58):

bar above looks like a reasonable simp lemma for mathlib, probably with Ioo spelling on the right.

llllvvuu (Mar 05 2024 at 18:21):

https://github.com/leanprover-community/mathlib4/pull/11178


Last updated: May 02 2025 at 03:31 UTC