Skip to main content
Ctrl+K
Magma Magma
About Get Magma Documentation Try online People How to Cite Contact
Login
  • Preface
  • The Magma Language
  • Sets, Sequences, and Mappings
  • Basic Rings
  • Matrices and Linear Algebra
  • Lattices and Quadratic Forms
  • Global Fields
  • Local Fields
  • Modules
  • Finite Groups
  • Finitely Presented Groups
  • Algebras
  • Representation Theory
  • Lie Theory
  • Commutative Algebra
  • Algebraic Geometry
  • Arithmetic Geometry
  • Modular Arithmetic Geometry
  • Topology
  • Geometry
  • Combinatorics
  • Coding Theory
  • Optimization
  • References
  • Sets, Sequences, and Mappings
  • Tuples and Cartesian Products

Tuples and Cartesian Products#

  • Introduction
  • Cartesian Product Constructor and Functions
    • car< R₁, ..., Rₖ >: Str, ..., Str → SetCart
    • CartesianProduct(R, S): Str, ..., Str → SetCart
    • CartesianProduct(L): [Str] → SetCart
    • CartesianProduct(L): <Str> → SetCart
    • CartesianPower(R, k): Str, RngIntElt → SetCart
    • Flat(C): SetCart → SetCart
    • NumberOfComponents(C): SetCart → RngIntElt
    • Component(C, i): SetCart, RngIntElt → Str
    • C[i]: SetCart, RngIntElt → Str
    • Components(C): SetCart → List
    • # C: SetCart → RngIntElt
    • Rep(C): SetCart → Elt
    • Random(C): SetCart → Elt
    • Example: Cartesian Product of Q and Z
  • Creating and Modifying Tuples
    • elt< C | a₁, a₂, ..., aₖ >: SetCart, Elt, ..., Elt → Tup
    • C ! < a₁, a₂, ..., aₖ >: SetCart, Elt, ..., Elt → Tup
    • < a₁, a₂, ..., aₖ >: Elt, ..., Elt → Tup
    • Append(T, x): Tup, Elt → Tup
    • Append(~T, x): Tup, Elt
    • Prune(T): Tup → Tup
    • Prune(~T): Tup
    • Flat(T): Tup → Tup
    • Example: Pairs of Primes and Reciprocals
  • Tuple Access Functions
    • Parent(T): Tup → SetCart
    • # T: Tup → RngIntElt
    • T[i]: Tup → Elt
    • Explode(T): Tup → t1, t2, ...
    • TupleToList(T): Tup → List
    • Tuplist(T): Tup → List
    • Example: Accessing Tuple Entries
  • Equality
    • T eq U: Tup, Tup → BoolElt
    • T ne U: Tup, Tup → BoolElt
  • Iteration
    • x in T
    • i -> x in T
  • Other Operations
    • IsEmpty(T): Tup → BoolElt
    • &* T: Tup → Any

previous

Bibliography

next

Introduction

Magma Magma

Magma is maintained and distributed by the Computational Algebra Group, School of Mathematics and Statistics, University of Sydney.

University of Sydney

Explore

  • About Magma
  • Documentation
  • Download
  • Calculator

Community

  • People
  • Contributions
  • Publications
  • Events
  • News

Help

  • FAQ
  • Contact
  • Subscriptions
  • How to Cite
© 1993–2026 Computational Algebra Group. All rights reserved. Built at the University of Sydney, Australia.