Zulip Chat Archive

Stream: new members

Topic: set comprehension issue


Matt Earnshaw (Feb 03 2020 at 16:43):

lean does not like my definition of concat – hopefully self explanatory what i am trying to do, any pointers? thanks :-)

inductive word
  | ε : word
  | nonempty : char → word → word

infixr ` ⊚ ` :100 := word.nonempty
notation `language` := set word

def concat (U V : language) : language := {u ⊚ v | u ∈ U ∧ v ∈ V}

Reid Barton (Feb 03 2020 at 17:02):

You can't put an expression on the left side of set builder notation, just a variable

Reid Barton (Feb 03 2020 at 17:04):

So you could write something like {w | ∃ u v, u ∈ U ∧ v ∈ V ∧ w = u ⊚ v}

Yury G. Kudryashov (Feb 03 2020 at 17:05):

Or {w | ∃ (u ∈ U) (v ∈ V), w = u ⊚ v}

Matt Earnshaw (Feb 03 2020 at 17:06):

ok, thanks!

Matt Earnshaw (Feb 03 2020 at 17:29):

edit: nevermind


Last updated: Dec 20 2023 at 11:08 UTC