Zulip Chat Archive

Stream: new members

Topic: Small sorrys help


rtertr (Sonia) (Jun 11 2023 at 12:37):

Hello everyone,

I have the following small sorry's that I struggle to resolve, and that I have not been able to find theorems in the Mathlib.
The first one is about disjoint sets, saying that [-a,a] and (a,infinity) are disjoint.
The next one is about type conversion. Delta is real, but cast as complex, and I need to show that 1 and 2 are both natural and complex numbers.
The third one is about the limit of a real number going to zero, but the number is cast as a complex number.
And the last one is about arctan going to pi/2.
Any help would be greatly appreciated! Here is the minimal code:
Kind regards!

import tactic
import analysis.special_functions.gaussian

section
open set
open set filter
open real

noncomputable theory

namespace real

lemma Icc_disjoint_Iio {μ:} (h: 0 μ): disjoint (Icc (-μ) μ) (Ioi μ):=
begin
  sorry,
end

lemma pow_complex_to_natural {δ: }: (δ:) ^ ((1:)/(2:)) = (δ:) ^ ((1:)/(2:)):=
begin
  sorry,
end

lemma tendsto_coe:tendsto (λ (k : ), (k: )) (nhds_within 0 (Ioi 0)) (nhds 0):=
begin
  simp only,
  sorry,
end

lemma tendsto_arctan_at_top: tendsto (λ (k : ), arctan k) at_top (nhds (real.pi / 2)):=
begin
  sorry,
end

Kevin Buzzard (Jun 11 2023 at 13:10):

I doubt the second one is true, because (1 : nat) / (2 : nat) = 0 : nat

Ruben Van de Velde (Jun 11 2023 at 13:27):

For the first:

lemma Icc_disjoint_Iio {μ:} (h: 0 μ): disjoint (Icc (-μ) μ) (Ioi μ):=
begin
  intros s h1 h2,
  simp [set.subset_empty_iff, set.eq_empty_iff_forall_not_mem],
  intros x hx,
  specialize h1 hx,
  specialize h2 hx,
  simp at h1 h2,
  linarith,
end

rtertr (Sonia) (Jun 11 2023 at 13:34):

Kevin Buzzard said:

I doubt the second one is true, because (1 : nat) / (2 : nat) = 0 : nat

Ah okay, then there must be something wrong else where in my proof! :D

rtertr (Sonia) (Jun 11 2023 at 13:35):

Ruben Van de Velde said:

For the first:

Thank you! :D :tada: :tada: :tada:

Eric Wieser (Jun 12 2023 at 13:41):

intros is generally the wrong way to prove disjoint

Eric Wieser (Jun 12 2023 at 13:42):

(it used to be, but the definition changed to be more general and is now inconvenient)

Yaël Dillies (Jun 12 2023 at 13:42):

Eric, do you think we should have made disjoint and codisjoint structures to avoid people trying to intro into them?

Eric Wieser (Jun 12 2023 at 13:43):

Maybe, though then they'd just use split

Eric Wieser (Jun 12 2023 at 13:44):

In this case docs#set.Iic_disjoint_Ioi (and monotonicity) provides a much shorter proof

Yaël Dillies (Jun 12 2023 at 13:44):

I quite like the idea because it also matches the status of docs#is_compl

Kevin Buzzard (Jun 12 2023 at 13:46):

A nontrivial percentage of my Lean 3 students would use fconstructor (which comes up so often that I suspect that one of those super-generic tactics like hint is suggesting it)

Yaël Dillies (Jun 12 2023 at 13:47):

Oh that's really surprising. I literally never used fconstructor.

Kevin Buzzard (Jun 12 2023 at 13:48):

yeah me neither, but probably you are not trying to write a Lean project as part of your degree when you'd never used the language three weeks before...

Eric Wieser (Jun 12 2023 at 13:59):

Eric Wieser said:

In this case docs#set.Iic_disjoint_Ioi (and monotonicity) provides a much shorter proof

lemma Icc_disjoint_Iio {μ:} : disjoint (Icc (-μ) μ) (Ioi μ):=
(set.Iic_disjoint_Ioi le_rfl).mono_left set.Icc_subset_Iic_self

didn't even need your h

Eric Wieser (Jun 12 2023 at 14:02):

Another one:

lemma tendsto_coe : tendsto (λ k : , (k : )) (nhds_within 0 (Ioi 0)) (nhds 0) :=
(complex.continuous_of_real.tendsto' 0 _ complex.of_real_zero).mono_left nhds_within_le_nhds

rtertr (Sonia) (Jun 12 2023 at 14:11):

Eric Wieser said:

Another one:

Wow, great! Thank you! I might write about it in my thesis. Can I write your name to credit you, or do you have any privacy concerns? It will just be read by my two advisors, btw :) I will also write a credit in my PR, ofc as well.

Eric Wieser (Jun 12 2023 at 14:13):

My name is already plastered all over mathlib header comments, so feel free to

rtertr (Sonia) (Jun 12 2023 at 14:13):

I guess, this is a general question. How do you give credit to people who helped you on Zulip without potentially causing privacy issues? :) Do you normally write all the usernames of the people who helped or how so? :)

Eric Wieser (Jun 12 2023 at 14:14):

Zulip is public anyway, so I think any personal info written in web-public channels here is probably fair game to include elsewhere (but it does no harm to check)

Eric Wieser (Jun 12 2023 at 14:14):

I tried the last one too, but I'm not familiar enough with filters to know if the last sorry is true:

lemma tendsto_arctan_at_top: tendsto (λ (k : ), arctan k) at_top (nhds (real.pi / 2)):=
begin
  simp_rw arctan,
  refine tendsto.comp _ (order_iso.tendsto_at_top _),
  sorry
end

rtertr (Sonia) (Jun 12 2023 at 14:20):

Thank you! :D

Eric Wieser (Jun 12 2023 at 14:25):

With the sorry slightly abstracted:

lemma at_top_eq_nhds_within (a b : ) :  (at_top : filter (set.Ioo a b)) = (𝓝[] b).comap coe :=
sorry -- this might not be true!

lemma tendsto_arctan_at_top: tendsto (λ (k : ), arctan k) at_top (nhds (real.pi / 2)):=
begin
  simp_rw arctan,
  apply tendsto.comp _ (order_iso.tendsto_at_top _),
  rw at_top_eq_nhds_within,
  exact tendsto_comap.mono_right nhds_within_le_nhds,
end

Eric Wieser (Jun 12 2023 at 15:00):

I made a new thread for that sorry

Julian Berman (Jun 12 2023 at 23:52):

Kevin Buzzard said:

A nontrivial percentage of my Lean 3 students would use fconstructor (which comes up so often that I suspect that one of those super-generic tactics like hint is suggesting it)

(This is precisely it, or was for me, fconstructor shows up constantly in hint and I had to learn it was useless after seeing it so often and never having it get me anywhere I couldn't have already gotten to)

Kevin Buzzard (Jun 13 2023 at 06:11):

I knew it would be something like that!

rtertr (Sonia) (Jun 26 2023 at 19:33):

Good evening everyone,
I have another small sorry question!
Just trying to prove the following:

import tactic
import analysis.special_functions.gaussian

section
open real

noncomputable theory

namespace real

theorem complex_coe_ne_zero {δ: } (: 0<δ): (δ: )  0:=
begin
  norm_cast,
  sorry,
end

David Renshaw (Jun 26 2023 at 19:39):

  exact ne_of_gt 

David Renshaw (Jun 26 2023 at 19:40):

(That's what the library_search tactic told me to do.)

rtertr (Sonia) (Jun 26 2023 at 19:41):

Oh, great! Mine just timed-out, so I guess I should extend the thinking time :D :tada:

David Renshaw (Jun 26 2023 at 19:42):

Hm... yeah I see that my .emacs does have a line (setq lean-timeout-limit 1000000), so maybe that's why mine didn't time out.

rtertr (Sonia) (Jun 26 2023 at 19:42):

well, thank you for the time then haha!

Kevin Buzzard (Jun 26 2023 at 21:02):

Maybe one of exact hδ.ne or exact hδ.ne'works. Or even exact_mod_cast hδ.ne' is a one-liner?

Note that in Lean 4 library_search is much faster (and is called exact?). Time to upgrade? ;-)


Last updated: Dec 20 2023 at 11:08 UTC