Zulip Chat Archive

Stream: Is there code for X?

Topic: A tactic for "reaching" inside a quantified statement?


Kent Van Vels (Aug 29 2022 at 20:58):

I am trying to show a claim related to Cauchy sequences. I understand there is support in mathlib for Cauchy sequences, but I want to understand this myself. I get to this state in my proof/code.

u0 u1 : cauchy_seqQ,
h0 :  (ε : ), 0 < ε  ( (N : ),  (n : ), N  n  |u0.z n - u1.z n|  ε)
  (ε : ), 0 < ε  ( (N : ),  (n : ), N  n  |u1.z n - u0.z n|  ε)

Is there a way to use abs_sub_comm inside the conclusion somehow so I can use the h0 hypothesis?

I can unwrap and rewrap the quantifiers, but I am thinking there has to be a better way. Any help is appreciated.

Yaël Dillies (Aug 29 2022 at 20:58):

Use simp_rw :wink:

Kent Van Vels (Aug 29 2022 at 21:02):

Thank you. It worked great.

Kyle Miller (Aug 29 2022 at 21:12):

I once made a tactic for this situation, and to use it you'd write something like enter h0 with ε hε N n hN. But that's not in mathlib, and it might not even work anymore.

Another suggestion is simpa [abs_sub_comm] using h0

Alex J. Best (Aug 29 2022 at 23:47):

tactic#conv can also be very useful for things like this, where you need very precise control of the rewrites. Sometimes it can be a little inconvenient if the rewrites have nontrivial side conditions though


Last updated: Dec 20 2023 at 11:08 UTC