Zulip Chat Archive

Stream: Is there code for X?

Topic: ennreal.frontier_Iic


Kalle Kytölä (Dec 04 2021 at 22:02):

What is the right way of proving that the boundary of an Iic-interval up to a finite x : ennreal is the singleton {x}?

I.e.:

import topology.algebra.ordered.basic
import topology.instances.ennreal

open order set
open_locale topological_space nnreal ennreal

lemma ennreal.frontier_Iic_how (x : 0) (hx : x  ) :
  frontier (Iic x) = {x} := sorry

Kalle Kytölä (Dec 04 2021 at 22:02):

For comparison, in , the following is found by library_search:

import topology.algebra.ordered.basic
import topology.instances.ennreal

open order set
open_locale topological_space nnreal ennreal

lemma real.frontier_Iic_like_this (x : ) :
  frontier (Iic x) = {x} := frontier_Iic

Kalle Kytölä (Dec 04 2021 at 22:02):

The reason frontier_Iic does not apply to ennreal is the assumption [no_top_order] in it. The assumption hx : x ≠ ∞ of course has mathematically "the same content".

Kalle Kytölä (Dec 04 2021 at 22:03):

Below is a super clumsy solution (but I believe in the right generality). I think such lemmas are important enough to include in mathlib (at least frontier_Ici in nnreal etc. would lead to similar issues), but my question is: what is the non-clumsy way to do these?

Kalle Kytölä (Dec 04 2021 at 22:11):

I believe the relevant existing stuff should be around docs#frontier_Iic .

Yury G. Kudryashov (Dec 05 2021 at 07:43):

The proper way is to prove theorems like docs#closure_Ioi with assumption (Ioi x).nonempty.

Yury G. Kudryashov (Dec 05 2021 at 07:45):

You can either add new lemmas as prime versions or use h : (Ioi x).nonempty . some_tac, where some_tac tries to apply set.nonempty_Ioi and set.nonempty_Iio.

Yury G. Kudryashov (Dec 05 2021 at 07:48):

It looks like we have docs#closure_Ioi'

Yury G. Kudryashov (Dec 05 2021 at 07:51):

@[simp] lemma interior_Ici' {a : α} (ha : (Iio a).nonempty) : interior (Ici a) = Ioi a :=
let b, hb := ha in by rw [ compl_Iio, interior_compl, closure_Iio' hb, compl_Iic]


@[simp] lemma frontier_Ici' {a : α} (ha : (Iio a).nonempty) : frontier (Ici a) = {a} :=
by simp [frontier, ha]

Yury G. Kudryashov (Dec 05 2021 at 07:52):

The first proof can be simplified if you rewrite closure_Ioi' so that it assumes (Ioi a).nonempty

Yury G. Kudryashov (Dec 05 2021 at 07:52):

I'm not sure whether new lemmas should just replace the old ones or not.

Kalle Kytölä (Dec 05 2021 at 23:16):

Thank you very much! This looks great.

In the existing formulations, the typeclass [no_top_order] is really doing its work when it applies: I was super happy how smoothly (:= by library_search) the proof of frontier (Iic x) = {x} went in and ℝ≥0. I would therefore not want to remove the old ones, even if I think the new ones are needed as well.

I made a PR #10630 including both the Iic and Ici cases, with Yury's succinct proofs. [Edit: I guess I should include Iio and Ioi cases as well.]

Kalle Kytölä (Dec 05 2021 at 23:16):

By the way, I have not found documentation for the let ... in ... syntax, especially the in keyword in it. Any hints on where to look? I could not find it described in the #tpil nor at docs#tactic.interactive.let . By trial and error I figured the following would be essentially the same, right?

@[simp] lemma interior_Ici' {a : α} (ha : (Iio a).nonempty) : interior (Ici a) = Ioi a :=
by { cases ha with b hb, rw [ compl_Iio, interior_compl, closure_Iio' hb, compl_Iic], }

So is let X := Y in more or less the same as starting in tactic mode with cases Y with X and then continuing?

Reid Barton (Dec 05 2021 at 23:32):

let ... in ... is term mode syntax

Reid Barton (Dec 05 2021 at 23:33):

If X is a pattern, then it's like you say. Otherwise, it is like the let tactic

Kalle Kytölä (Dec 05 2021 at 23:40):

Ok, I think I only looked in #tpil tactics chapter, which makes no sense given that it is a term mode syntax. Searching for small words such as let and in is not easy, though. But I think I roughly got it now. Thanks!

Yury G. Kudryashov (Dec 06 2021 at 02:43):

I made a few comments. Please implement suggested changes, then change the label from awaiting-author to awaiting-review.

Kalle Kytölä (Dec 06 2021 at 22:52):

Thank you! I implemented the changes.

Kalle Kytölä (Dec 06 2021 at 22:53):

The "build mathlib" check now reports Build succeeded, but the file was noisy. I don't know what this means or how to fix it. Could someone help me understand what it is about?

(Btw, I didn't yet add the label "awaiting-review", since there is this failing check.)

Kevin Buzzard (Dec 06 2021 at 22:58):

It probably means that there is some blue output, e.g. a #check or non-terminal ring in the file somewhere.

Kalle Kytölä (Dec 06 2021 at 23:31):

Thank you! There was indeed a blue #lint at the end of the file :oops:.

Yury G. Kudryashov (Dec 07 2021 at 00:16):

I changed assumptions in more lemmas. Let's see if it compiles.

Stuart Presnell (Dec 07 2021 at 06:31):

Would it be possible to change this error message to make it more informative?

Yury G. Kudryashov (Dec 07 2021 at 08:21):

It's in scripts/detect_errors.py


Last updated: Dec 20 2023 at 11:08 UTC