# Is there a rigorous theory of context, whereby sets can gain additional structure within a context?

Consider sets $G$ and $H$ and a function $f : G \rightarrow H$. So far, it doesn't really make sense to ask whether $G$ and $H$ are groups (technically, the answer is "no, they're not groups"), and it certainly doesn't make any sense to ask whether $f$ is a group homomorphism.

However, viewing $G$ and $H$ as sets equipped with a binary operation, it suddenly makes sense to ask whether $G$ and $H$ are groups. Suppose they are. Then, it also makes sense to ask whether or not $f$ is a group homomorphism.

So $G$ and $H$ are just sets, but in context they can be viewed as groups, or topological spaces, or whatever.

So what I'm looking for is a rigorous way of endowing sets with additional structure within specific contexts. So for example, in the "empty-context," set $G$ is just a set, with no additional structure. But within a context, $G$ might be equipped with a binary operation, or some open sets, or whatever.

As a more complete example, I'd like to make precise the meaning of theorems like the following.

Theorem. Let $G$ and $H$ denote sets and $f : G \rightarrow H$ denote a function. Let $\Gamma$ denote a context wherein $G$ and $H$ are groups and $f$ is a group homomorphism. Then the following are equivalent.

1. $f$ is an injection
2. In the context $\Gamma$, it holds that the kernel of $f$ is a singleton set.

Note that condition 1 is context-independent, because whether or not $f$ is an injection or not does not depend on the additional structure that $\Gamma$ endows upon $G$ and $H$. On the other hand, condition 2 is context-dependent, because the meaning of "the kernel of $f$" depends on the additional structure that $\Gamma$ endows upon $H$.

So in conclusion, I'm looking for a rigorous approach to this idea that sets can gain structure within contexts. I want something that is near computer-readable, and not "hand-waivy."

Remark. Groups are just an example; I am not specifically interested in groups.

Edit. What follows is the thinking that lead me to the idea of context.

Usually, we can make assumptions by opening a new "environment" in our proof. For instance, if $p$ is already a natural number, we can open a new environment in which we assume that $p$ is prime. If we prove the statement $p>10$ within the new environment, then we get to write the statement "If $p$ is prime, then $p>10$" in the original environment.

Now importantly, when we open a new environment in this way, we are not usually allowed to "remove" assumptions. For instance, if $p$ is already natural, we can write "Assume $p$ is prime," but we cannot write, "Assume $p$ is no longer natural." That is, we cannot undo an assumption by making a new assumption.

In a sense, this is exactly what I'm looking for. I'd like to be able to say,

"Assume $G$ is no longer just a set; assume it is now a set together with a binary operation satisfying the group axioms."

Of course, no assumption could possibly achieve this. An assumption cannot undo a previous assumption.

So we get clever; we invent the notion of a context. Our sentence becomes:

Let $\Gamma$ denote a context in which $G$ is no longer just a set; rather, it is now a set together with a binary operation satisfying the group axioms.

Now we've made a bit of progress, because we're no longer trying to use assumptions to undo other assumptions.

But this begs the question: what does the above sentence even mean? And what is the right definition of the word "context"?

• Is it possible that you're looking for category theory? Or something in it (monomorphism, e.g.)? Mar 25, 2013 at 23:08
• I'm not sure if I'm at fault for not understanding the question, so I'm leaving this comment here in hopes that in case I'm not the only one, the OP will try to clarify. Mar 25, 2013 at 23:09
• @GitGud Can you pinpoint where, in particular, the question is imprecise? I will edit the question if I can figure out how to be clearer about what I mean. Mar 25, 2013 at 23:11
• Perhaps you'd be interested in the theory of universal algebra and varieties of algebras: en.wikipedia.org/wiki/Universal_algebra Mar 27, 2013 at 13:08
• Although you seem to be more interested in algebraic contexts, Joyal's beautiful theory of combinatorial species is a possible answer for the question title. Apr 1, 2013 at 21:25

I'm not entirely sure what you are after, but perhaps the following will be useful to you.

Fixing a context $\Gamma$ can be thought of as fixing a category $C$. After all, the context you seem to be referring to amounts to specifying the axioms of a structure on sets and then singling out the structure preserving functions, calling them homomorphisms.

Thus, actually, you are looking at concrete categories: a category $C$ together with a faithful forgetful functor to $Set$. Basically, this says that the things in your context are sets endowed with some extra structure and that the morhpisms are structure preserving functions.

Now the theorem you quote can be re-written as follows. Consider the concrete category $Grp$ of groups and group homomorphisms with its forgetful functor $U:Grp \to Set$. Let $G,H$ be groups and $f:G\to H$ a homomorphism. The following are equivalent:

1) $U(f):U(G)\to U(H)$ is an injective function.

2) $f:G\to H$ has trivial kernel.

So now your observation that condition one is context free simply means that you consider a property of something in the context of groups after applying the forgetful functor to. The observation that condition 2 is context dependent means that it is happening in the category $Grp$ and not in $Set$.

Since dealing with kernels categorically is slightly, involved lets instead consider the notion of monomorphism categorically. A morphism $f:A\to B$ is a monomorphism if it can be cancled on the left: given $g,h:Z\to A$ with $f\circ g=f\circ h$, it follows that $g=h$.

Now, the following holds:

1) In the category $Set$ of sets and functions, a morphism $f$ is a monomorphism iff it is an injective function.

2) In the category $Grp$ of groups and homomorphisms, a morphism $f$ is a monomorphism iff its kernel is trivial.

Both of these theorems characterize monomorphism in the category in terms of some other property.

Now, your thoerem can be restated again as:

A morphism $f$ in $Grp$ is a monomorphism iff $U(f)$ is a monomorphism.

So, you seem to be interested in properties that are reflected and/or preserved by the forgetful functor. At this point I'll refer you to the book Abstract and concrete categories

• This is an extremely interesting suggestion, and it might just work. I'm not quite sure about the details of how it would work, though. By "elements," let us mean, "global elements," in the sense of ETCS. So in your approach, how would I write a statement like the following? "Let $G$ and $H$ denote groups, $\phi : G \rightarrow H$ denote a group homomorphism, and let $x \in G$ denote a non-identity element of $G$. Then the preimage of $\{x\}$ under $\phi$ does not have $e_G$ as an element." Mar 26, 2013 at 6:30
• Since the categories are concrete, you can refer to elements in an object by referring directly to elements in the underlying set. No need to try and use global elements (which, in the case of Grp won't give you much). Mar 26, 2013 at 6:41
• By $x \in G$ I meant, "$x$ is a global element of the underlying set of $G$." Mar 26, 2013 at 6:43
• its easier to just let $x\in G$ mean that $x$ is an element of the set $G$. Mar 26, 2013 at 6:44
• Anyway, I guess what I meant by the second comment was this. Statements like the one I left in the first comment aren't really category-theoretic in spirit; but I still want to be free to make those kind of statements. Mar 26, 2013 at 6:46