\documentclass[11pt]{article}
\usepackage[dvips]{graphicx}
\usepackage{enumerate}
\usepackage{ifthen}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{hyperref}

%\pagestyle{empty}
\topmargin -0.55in
\oddsidemargin -0.3in
\evensidemargin -0.3in
\textheight 9in
\textwidth 7.1in 

\newcommand{\ALPHA}{\checkmark} 
\newcommand{\SPACE}{0.025in} 

\newcommand{\force}{{\noindent{$\mbox{\;}$}}}

\begin{document}

\noindent {}%\hspace*{-0.2in}
\fbox{\fbox{\parbox{6.85in}{{\scshape{Math 4010 \hfill Introduction to {\sc GAP}}} }}} \\

\vspace{-0.2in}

\begin{center} \Large
An Introduction to {\it Groups, Algorithms, and Programming} (GAP)
\end{center}

GAP is free (open source) mathematical software which is particularly great for computing with groups.  A few helpful links\dots

\vspace{0.1in}

\force \hspace*{-0.35in}
\begin{minipage}{7in}
\begin{itemize}
\item \href{https://www.gap-system.org}{https://www.gap-system.org}

GAP's homepage. Here you can find the official GAP manuals and download the latest version of GAP.

\item \href{https://college.cengage.com/mathematics/gallian/abstract_algebra/5e/shared/gap/gap_manual.pdf}{https://college.cengage.com/mathematics/gallian/abstract\_algebra/5e/shared/gap/gap\_manual.pdf}

A GAP manual written specifically to accompany Joe Gallian's {\it Contemporary Abstract Algebra} ($5^{\mathrm{th}}$ edition). This is the easiest gentle introduction to GAP that I've found. I also like that it's written to be used with Gallian's text (each section parallels a chapter of the textbook).

\item \href{https://www.math.hawaii.edu/~williamdemeo/GAP/GapNotes.pdf}{https://www.math.hawaii.edu/$\sim$williamdemeo/GAP/GapNotes.pdf}

These notes list a lot of different group related GAP commands for finding things such as the lattice of subgroups etc.

\item \href{https://www.math.colostate.edu/~hulpke/lectures/m666/ctblex1.pdf}{https://www.math.colostate.edu/$\sim$hulpke/lectures/m666/ctblex1.pdf}

What does displaying a character table tell you?

\item \href{https://ggap.sourceforge.net}{https://ggap.sourceforge.net}

GGAP is a frontend for the GAP system (GAP is command line software). I've had a lot of trouble getting GGAP to run on my office Mac and my PCs at home (right now GGAP doesn't work on any of them, but it has in the past).

\item \href{https://www.math.colostate.edu/~hulpke/CGT/education.html}{https://www.math.colostate.edu/$\sim$hulpke/CGT/education.html}

This person has two convenient installers (one for PC and one for Mac). They include GGAP. If they work for you, fantastic (I've had mixed results).

\item \href{https://cloud.sagemath.com}{https://cloud.sagemath.com} 

The SAGE cloud. SAGE is a computer algebra system suite much like Maple. However, SAGE is {\it free} (open source) and is available online (through the SAGE cloud). GAP will run inside of SAGE. This is your quickest way to access GAP. You can login to the SAGE cloud, open a GAP console, and start right away (no need to install any software).
\end{itemize}
\end{minipage}

\vspace{0.1in}

Getting GAP to run\dots

\begin{itemize}
\item On a PC? Download the latest version from GAP's homepage. Use the Windows (.zip) version. Uncompress the .zip file to where ever you want to keep GAP. No need to run an installer -- I think. It should be ready to go. Go to the \verb|/bin| folder and find \verb|gap.bat|. If you are using Windows 7, you'll need to right-click on the file and ``run as administrator'' to get the adequate permissions from mommy Windows (yes, mommy I would like my software to actually run).
\item Online? Go to the SAGE cloud. Create an account. Create a new project. Create a command line terminal. At the terminal (the dollar sign) type \verb|sage|. This will load up SAGE. Then in SAGE type \verb|gap_console()|. That's it. You're running GAP online!
\end{itemize}


\newpage

\begin{itemize}
\item A lot of GAP's syntax is like Maple. For example, to get help on a topic type ``\verb|? topic|''. Or to assign a mapping to the variable name $f$ use ``\verb|f := x -> x^2;|''. Notice that commands end with a semicolon. If you'd like to suppress output use a double semicolon.

\item Gallian's GAP introduction has some nice notes on how to load/save work in command line GAP. If you have GGAP this is much easier. For example, you can use ``\verb|LogTo("filename");|'' to save or ``\verb|LogTo();|'' to save again.

\item \verb|Gcd(a,b);| and \verb|Lcm(a,b);| compute what you'd think. To get the extended Euclidean algorithm information use \verb|Gcdex(a,b);|. Then we have gcd = a*coeff1 + b*coeff2 as well as 0 = a*coeff3 + b*coeff4.

\item \verb|10 mod 3| 

\item To create a procedure\dots

\verb|myFunction := function(x)| \\
\force \quad \verb|local t;| \\
\force \quad \verb|t := x^2;| \\
\force \quad \verb|return t;| \\
\verb|end;|

\item Create a dihedral group using \verb|D4 := DihedralGroup(IsPermGroup,8);|. This creates the dihedral group $D_4$ or $D_{2 \cdot 4}$ of order $8$. The ``\verb|IsPermGroup|'' creates it as a permutation group.

\item \verb|Size(D4);| \quad \verb|Elements(D4);| \quad \verb|Center(D4);| \quad \verb|IsAbelian(D4);| \quad \verb|IsCyclic(D4);|

\item Multiplying permutations \verb|(1,2)(3,4)*(1,2,3)| is done {\bf left to right} (the opposite of our convention)!

\item Let \verb|G := DihedralGroup(IsPermGroup,16);| and \verb|a := G.1;| so \verb|a| the first generator of $G$ -- that is -- $(123\dots 8)$.  \verb|G[3]*G[5]| multiplies the third and fifth elements of $G$. 

\verb|Subgroup(G,[a]);|  creates the cyclic subgroup generated by \verb|a|. More generally, \verb|Subgroup(G,[a,b,etc.]);| creates the subgroup of $G$ which is generated by \verb|a,b,| etc.

\item \verb|Centralizer(G,a);|  (the centralizer of $a$ in $G$). \quad \verb|Order(a);| \quad \verb|Inverse(a);|

\item Define the unit groups (mod $n$)\dots

\verb|uGroup := function(n)| \\
\force \quad \verb|local s,i,o;| \\
\force \quad \verb|o := One(Integers mod n);   # the One object to signal we're in U(n).| \\
\force \quad \verb|s :=  n -> Filtered([1..n-1],i->Gcd(i,n)=1);| \\
\force \quad \verb|return s(n)*o;| \\
\verb|end;|

\verb|G := uGroup(10);   # G = U(10)|

\item How does GAP do what it does? Well, it's open source so we can see. For example:

\verb|G := DihedralGroup(IsPermGroup,16);|\\
\verb|code := ApplicableMethod(IsCyclic,[G],1);|\\
\verb|Print(code);|

will display the code used to determine if $G$ is a cyclic group or not.

\item \verb|Collected(List(Elements(G),Order));| computes how many elements of each order $G$ has.

\item \verb|SymmetricGroup(n);| \quad \verb|AlternatingGroup(n);| \quad \verb|CycleStructurePerm(a);|

\item \verb|Filtered(Elements(SymmetricGroup(5)),s->CycleStructurePerm(s)=[,,1]);| finds all of the 4-cycles in $S_5$. Replacing \verb|[,,1]| with \verb|[1,1]| would find all of the elements consisting of a transposition and a 3-cycle (disjoint). 

\item \verb|x^f| computes the image of $x$ under $f$. \verb|x/f| computes the preimage of $x$ under $f$. If both \verb|x| and \verb|y| are group elements \verb|x^y| conjugates \verb|x| by \verb|y|. For example: $(1,2,3)^(1,2) = (1,3,2)$, $2^(1,2,3)=3$, $2/(1,2,3)=1$, $(1,2,3)^(-1)=(1,3,2)$ (exponents works as you'd think).

\item \verb|Orbit(H,a)| \quad \verb|Stabilizer(H,a)|

\item \verb|DirectProduct(A,B)|

\item Let \verb|G := AlternatingGroup(4);| and \verb|H := Subgroup(G,[(1,2)(3,4),(1,4)(2,3)]);|.

\verb|IsNormal(H,G);| \quad \verb|RightCosets(G,H);| \quad \verb|FactorGroup(G,H);| or \verb|G/H;|

\item Free groups? \verb|F := FreeGroup(2);| \quad \verb|a := F.1;| \quad \verb|b := F.2;| \quad \verb|G := F/[a^4,b^2,(a*b)^2];| creates a generator and relation version of $D_4$ where $a$ is the rotation of order $4$ and $b$ is a reflection.

\item \verb|List(ConjugacyClasses(G),Size);|  finds the sizes of all of the conjugacy classes.

\item \verb|List(ConjugacyClasses(G),x->[x,Size(x)]);|  lists the sizes of each conjugacy class with the class itself.

\item \verb|Size(AllGroups(Size,8,IsAbelian,true));| finds out how many Abelian groups of order 8 there are (up to isomorphism). GAP has a ``small groups'' library which has all groups up to order 2000 (except order 1024) classified.

\item \verb|SylowSubgroup(SymmetricGroup(7),2);| find a Sylow $2$-subgroup of $S_7$.

\item \verb|Display(CharacterTable(SymmetricGroup(5)));| displays the character table of $S_5$. See the notes linked to on the first page for a cypher for this somewhat cryptic display.

\item \verb|quit;|  breaks out of loop (in case of an error) or just plain old quits GAP.
\end{itemize}

\end{document}










\end{document}
