---
title: "Set-Theoretic Operations"
canonical: "https://docs.magma-maths.org/v2.30-1/FiniteGroups/BlackBoxGroups/set.html"
source: "https://docs.magma-maths.org/v2.30-1/FiniteGroups/BlackBoxGroups/set.md"
part: "Finite Groups"
chapter: "Black-Box Groups"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Finite Groups", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/index-finite-groups.md"}
  - {"title": "Black-Box Groups", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/BlackBoxGroups/index-black-box-groups.md"}
prev: {"title": "Operations on Elements", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/BlackBoxGroups/operation-element.md"}
next: {"title": "Almost Simple Groups", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/AlmostSimpleGroups/index-almost-simple-groups.md"}
intrinsics:
  - {"name": "in", "signature": "g in G: GrpBBElt, GrpBB -> BoolElt"}
  - {"name": "PseudoRandom", "signature": "PseudoRandom(G): GrpBB -> GrpBBElt"}
  - {"name": "Rep", "signature": "Rep(G): GrpBB -> GrpBBElt"}
  - {"name": "!", "signature": "G ! g: GrpBB, GrpBBElt -> GrpBBElt"}
---

# Set-Theoretic Operations

## Membership and Equality

<a id="operation-op-in-grpbbelt-grpbb"></a>
### `g in G: GrpBBElt, GrpBB -> BoolElt`

Return `true` if and only if $G$ is the parent group of $g$ or the parent group of $g$ is a subgroup of $G$.

## Set Operations

<a id="function-pseudorandom-grpbb"></a>
### `PseudoRandom(G): GrpBB -> GrpBBElt`

Return a pseudo-random element of the BB-group $G$. The method used is product-replacement with accumulator.

<a id="function-rep-grpbb"></a>
### `Rep(G): GrpBB -> GrpBBElt`

A representative element of $G$.

## Coercions Between Related Groups

<a id="operation-op-grpbb-grpbbelt"></a>
### `G ! g: GrpBB, GrpBBElt -> GrpBBElt`

Given an element $g$ belonging to a subgroup of the BB-group $G$, rewrite $g$ as an element of $G$.
