Zulip Chat Archive

Stream: new members

Topic: 'open' error


Holly Liu (Aug 20 2021 at 19:56):

i have this code (by a member of lean zulip):

open free_group (of)

/- The 3-strand braid group. -/
def braids_rel3 : set (free_group (fin 2)) :=
{(of 0)⁻¹ * (of 1)⁻¹ * (of 0)⁻¹ * of 1 * of 0 * of 1}

i am getting red underlines under open and each of, the error being command does not accept doc string. how do i resolve this?

Holly Liu (Aug 20 2021 at 19:58):

these are my imports:

import data.zmod.basic
import group_theory.presented_group
import group_theory.free_group
import data.equiv.mul_add
import algebra.group.defs
import algebra.group_power
import tactic

Bryan Gin-ge Chen (Aug 20 2021 at 20:05):

Do you have a doc string before open? (i.e. a comment that starts with /-- and ends with -/)

Bryan Gin-ge Chen (Aug 20 2021 at 20:05):

If so, try changing the first /-- to /- instead.

Holly Liu (Aug 20 2021 at 21:07):

that fixed it, thanks

Scott Morrison (Aug 21 2021 at 00:13):

(It's a good idea to post code snippets as a #mwe --- i.e. an entire file (ideally minimised) that we could copy and paste into an editor window. e.g. in this example Bryan wouldn't have needed to deduce you had a misplaced doc-string.)

Holly Liu (Aug 21 2021 at 01:02):

alright i'll do that next time


Last updated: Dec 20 2023 at 11:08 UTC