Zulip Chat Archive

Stream: mathlib4

Topic: Interval integral


Patrick Massot (Aug 31 2023 at 22:27):

What is new idiomatic way to write 01xdx\int_0^1 x\,dx? I know ∫ x in (0 : ℝ)..1, x works, but is doesn't look nice.

Kyle Miller (Aug 31 2023 at 22:30):

I haven't tested it, but you could try ∫ x : ℝ in 0..1, x, which looks a little nicer

Patrick Massot (Aug 31 2023 at 22:34):

I should have written this was my first attempt, but it doesn't work.

Patrick Massot (Aug 31 2023 at 22:35):

type mismatch
  0..val
has type
  floatSpec.float : Type
but is expected to have type
  Set  : Type

Patrick Massot (Aug 31 2023 at 22:35):

It really feels like something is missing a scope. Things about float shouldn't interfere here.

Henrik Böving (Aug 31 2023 at 22:37):

I think this is a funny interaction of builtin syntax. 0. is a shorthand for 0.0 : Floatlike in many other languages and .val is the dot notation val operation on float

Kyle Miller (Aug 31 2023 at 22:38):

So perhaps ∫ x : ℝ in 0 .. 1, x might work?

Arend Mellendijk (Aug 31 2023 at 22:39):

It doesn't, but ∫ x in (0)..1, x does.

Patrick Massot (Aug 31 2023 at 22:40):

For 10 very weird seconds it seemed that everything worked, including ∫ x in 0 .. 1, x. Then I realized I was working in the wrong VSCode, the one running Lean 3 :(

Patrick Massot (Aug 31 2023 at 22:41):

I guess it's time for me to take a break.

Yury G. Kudryashov (Sep 01 2023 at 03:09):

I think that this issue with zero is a good reason to change the notation.

Yury G. Kudryashov (Sep 01 2023 at 03:10):

See this thread

Yury G. Kudryashov (Sep 01 2023 at 03:11):

I failed to implement the ∫ x in [a:b], f x notation from there.


Last updated: Dec 20 2023 at 11:08 UTC