Zulip Chat Archive

Stream: general

Topic: refl for <= on ennreal


Kevin Buzzard (May 09 2022 at 10:13):

This surprised me:

import data.real.ennreal

open_locale ennreal

noncomputable instance : preorder 0 := infer_instance -- works fine

example (a : 0) : a  a :=
begin
  exact le_refl a, -- works fine
end

example (a : 0) : a  a :=
begin
  refl, -- fails
  /-
  invalid apply tactic, failed to unify
    a ≤ a
  with
    ∀ [_inst_1 : preorder ?m_1] (a : ?m_1), a ≤ a
  -/
end

I don't think I've seen refl failing to prove x <= x on a preorder before.

Kevin Buzzard (May 09 2022 at 10:14):

Is it the apply bug?

example (a : 0) : a  a :=
begin
  apply le_refl _, -- works
end

example (a : 0) : a  a :=
begin
  apply le_refl, -- fails
end

Alex J. Best (May 09 2022 at 10:33):

I guess this is why we have refl' docs#tactic.interactive.reflexivity'

Floris van Doorn (May 09 2022 at 13:30):

Yes, this is the apply bug.

Kevin Buzzard (May 09 2022 at 13:37):

Thanks both. Indeed refl' works.

Yury G. Kudryashov (May 09 2022 at 23:02):

Should we redefine order on with_top?

Yury G. Kudryashov (May 09 2022 at 23:03):

With eqn compiler

Yaël Dillies (May 09 2022 at 23:07):

Yeah, I don't really understand the point of the current definition.

Eric Wieser (May 09 2022 at 23:14):

Are you describing docs#with_top.has_le?

Eric Wieser (May 09 2022 at 23:17):

I could believe the current definition is vaguely useful to at least have as a lemma statement somewhere, but the defeqs feel far more useful in the equation compiler version

Yaël Dillies (May 09 2022 at 23:17):

Yes, exactly.

Yury G. Kudryashov (May 09 2022 at 23:53):

Who is going to make a PR?

Yury G. Kudryashov (May 15 2022 at 14:41):

Nobody volunteered, so I'm going to do it.

Yury G. Kudryashov (May 15 2022 at 14:42):

BTW, why docs#with_bot.has_le has priority 10?

Yaël Dillies (May 15 2022 at 14:43):

Something to do with with_bot/with_top leakage?


Last updated: Dec 20 2023 at 11:08 UTC