0

There is a set of pairs (set_pairs) and I want to create a set (set_fsts) of first elements of those pairs. I am writing it in the following way

definition "set_fsts = {f . p ∈ set_piars ∧ fst p = f}" but Isabelle shows me this err msg: Extra variable on rhs "p"

Could you please help me with this?

S2020
  • 1
  • 1

2 Answers2

1

You need to introduce p by existential quantification, i.e. EX p. P : set_pairs ...

Shorter way would be to define set_fsts as fst ` set_pairs

  • Thanks for your response. I tried the following piece of code but it is still not working. What am I missing? definition "set_pairs≡{(1,2), (3,4)}" definition "set_fsts ≡ {fst p. ∀p ∈ set_pairs}" – S2020 Jan 07 '22 at 16:47
0

You can try

set_fsts = {fst p . p ∈ set_piars}

This would work in Isabelle/ZF, I am not sure about Isabelle/HOL.

Slawomir K.
  • 146
  • 4
  • Thanks for your response. I tried the following piece of code but it is still not working. What am I missing? definition "set_pairs≡{(1,2), (3,4)}" definition "set_fsts ≡ {fst p. ∀p ∈ set_pairs}" – S2020 Jan 07 '22 at 16:48
  • Did you try without the ∀ quantifier (as in my response)? – Slawomir K. Jan 08 '22 at 19:08