Zulip Chat Archive

Stream: new members

Topic: How to use sort


Matthew Honnor (May 10 2022 at 17:38):

Dear all, I am trying to make some simple definitions but I don't know how to get lean to view the complex numbers as a sort rather then a type. I am trying to use \Sigma' to define a series and this is giving me an error:

has type
ℕ → ℂ : Type
but is expected to have type
ℕ → Sort ? : Type ?

I am also not aware of what a sort is! Any help or reccomendations for reading on this would be great.

Thanks in advance.

Kevin Buzzard (May 10 2022 at 17:39):

Can you post the code which created this error? See #mwe for a guide on how to ask effective questions here. PS the issue is probably not what you think it is: the error seems to indicate that Lean was expecting a type universe rather than the complex numbers. Oh -- also #backticks

Kevin Buzzard (May 10 2022 at 17:41):

PS hi Matthew!

Matthew Honnor (May 10 2022 at 18:57):

Thanks for letting me know about mwe and backticks, here is the code that created this error.

import analysis.complex.basic

def analytic_sum_term ( a : ℕ → ℂ ) ( z : ℂ ) ( u : ℂ ) : ℕ → ℂ :=
  λ k , a k *( z - u )^k

def analytic_sum ( u : ℂ ) ( a : ℕ → ℂ ) : ℂ → ℂ :=
  λ z, Σ' ( k : ℕ ), ( analytic_sum_term a z u k)

Thanks again

Ruben Van de Velde (May 10 2022 at 19:02):

I think you're using the wrong Σ'

Patrick Johnson (May 10 2022 at 19:02):

You need ∑ (type with \sum)

Ruben Van de Velde (May 10 2022 at 19:03):

noncomputable def analytic_sum ( u : ℂ ) ( a : ℕ → ℂ ) : ℂ → ℂ :=
  λ z, ∑' k : ℕ, analytic_sum_term a z u k

works

Matthew Honnor (May 10 2022 at 19:11):

Thanks, that works now. How does the noncomputable def work?


Last updated: Feb 28 2026 at 14:05 UTC