Zulip Chat Archive

Stream: mathlib4

Topic: New-style dot notation and pi types


Yury G. Kudryashov (Mar 03 2023 at 22:42):

The following #mwe fails:

variable [LE α] [LE β] [LE γ]

def Monotone (f : α  β) : Prop :=  x y⦄, x  y  f x  f y

theorem Monotone.comp {g : β  γ} {f : α  β} (hg : Monotone g)
    (hf : Monotone f) : Monotone (g  f) := fun _ _ h => hg (hf h)

example {f : α  α} (h : Monotone f) : Monotone (f  f) := .comp h h

Yury G. Kudryashov (Mar 03 2023 at 22:43):

It seems that Lean intros as many variables as it can before looking for new style dot notation. Is it intentional? Is it documented?

Yury G. Kudryashov (Mar 04 2023 at 05:02):

@Mario Carneiro @Gabriel Ebner :up:

Mario Carneiro (Mar 04 2023 at 05:04):

it doesn't sound intentional

Mario Carneiro (Mar 04 2023 at 05:05):

it does sound like there is a pretty large search space of potential interpretations though

Yury G. Kudryashov (Mar 04 2023 at 05:13):

Do you often have many stages with named output type?

Reid Barton (Mar 04 2023 at 05:13):

is it related to implicit lambdas?

Yury G. Kudryashov (Mar 04 2023 at 05:14):

No, Lean just intros everything it can before trying new style dot notation.

Yury G. Kudryashov (Mar 04 2023 at 05:16):

I'm OK with "try NS.name if the current goal is a named type NS, then intro everything we can".

Yury G. Kudryashov (Mar 04 2023 at 05:17):

This doesn't increase the search space too much.


Last updated: Dec 20 2023 at 11:08 UTC