Zulip Chat Archive

Stream: new members

Topic: Error from the output of `tidy`


Stuart Presnell (Dec 26 2021 at 09:06):

I'm working on eliminating the use of finish in order/filter/lift, specifically the use in eventually_lift'_powerset_eventually. I tried commenting out finish and replacing it with tidy, which closes the goal: when the cursor is between tidy and the closing bracket I get goals accomplished πŸŽ‰. However, now I also get an error type mismatch at application αΎ°_w αΎ°, attributed to the line of the statement of lemma eventually_lift'_powerset_eventually rather than the line where tidy appears.

Is tidy producing a faulty solution (by duplicating names)? And if so, why is it not being blamed in the error statement?

import order.filter.bases
open set

open_locale classical filter

namespace filter
variables {Ξ± : Type*} {Ξ² : Type*} {f f₁ fβ‚‚ : filter Ξ±}

protected def lift (f : filter Ξ±) (g : set Ξ± β†’ filter Ξ²) :=
β¨…s ∈ f, g s

protected def lift' (f : filter Ξ±) (h : set Ξ± β†’ set Ξ²) :=
f.lift (π“Ÿ ∘ h)

lemma eventually_lift'_powerset' {f : filter Ξ±} {p : set Ξ± β†’ Prop}
  (hp : βˆ€ ⦃s t⦄, s βŠ† t β†’ p t β†’ p s) :
  (βˆ€αΆ  s in f.lift' powerset, p s) ↔ βˆƒ s ∈ f, p s := sorry

@[simp] lemma eventually_lift'_powerset_eventually {f g : filter Ξ±} {p : Ξ± β†’ Prop} :
  (βˆ€αΆ  s in f.lift' powerset, βˆ€αΆ  x in g, x ∈ s β†’ p x) ↔ βˆ€αΆ  x in f βŠ“ g, p x :=
calc _ ↔ βˆƒ s ∈ f, βˆ€αΆ  x in g, x ∈ s β†’ p x :
  eventually_lift'_powerset' $ Ξ» s t hst ht, ht.mono $ Ξ» x hx hs, hx (hst hs)
... ↔ βˆƒ (s ∈ f) (t ∈ g), βˆ€ x, x ∈ t β†’ x ∈ s β†’ p x :
  by simp only [eventually_iff_exists_mem]
... ↔ βˆ€αΆ  x in f βŠ“ g, p x : by { rw eventually_inf, tidy }

end filter

Ruben Van de Velde (Dec 26 2021 at 09:21):

Dunno about the error, but this works:

... ↔ βˆ€αΆ  x in f βŠ“ g, p x : by { rw eventually_inf, simp only [and_comm, mem_inter_iff, ←and_imp] }

Ruben Van de Velde (Dec 26 2021 at 09:21):

Or

... ↔ βˆ€αΆ  x in f βŠ“ g, p x : by simp only [eventually_inf, and_comm, mem_inter_iff, ←and_imp]

Stuart Presnell (Dec 26 2021 at 09:36):

Ah, thanks!


Last updated: Dec 20 2023 at 11:08 UTC