tldr: The core is a very general concept that can be used in a vast amount of models. Applying it to the setting of a general equilibrium, you can show that every competitive equilibrium is in the core.
The core
The core is a concept that can be defined for very abstract environments.
Consider a population of agents $N$ and an space $\Omega$ of outcomes. Assume that every agent has nice (transitive and complete) preference relation $\succeq_i$ over the elements in $\Omega$.
In addition, agents can form coalitions $A \subseteq N$ and for every state $x \in \Omega$ and coalition $A$ there is a correspondence $\Gamma_A: \Omega \rightrightarrows \Omega$ that determines to which states the coalition $A$ can deviate to when starting at $x$.
For example if $y \in \Gamma_A(x)$ this means that at state $x$ the coalition $A$ has the power to move to state $y$.
We say that a state $x$ dominates the state $y$ by coalition $A$ if:
- $y \in \Gamma_A(x)$
- for all $i \in A$: $y \succeq_i x$ and there is at least one $j \in A$ such that $y \succ_j x$.
Condition 1 states that $A$ has the power to move from $x$ to $y$. Condition 2 requires that every member of $A$ (weakly) prefers $y$ over $x$ and at least one member strictly prefers $y$ over $x$. If both conditions hold, then you can say that $x$ is not a stable situation as $A$ can find a better state $y$.
Now given such structure $(N, \Omega, (\succeq_i|i \in N), (\gamma_A|A \subseteq N))$ we can define a the core as the set of all states $x \in \Omega$ that are not dominated by some other state. In other words, no coalition can find a profitable deviation from $x$.
Exchange economies and perfect equilibria
Now give this, let us show that for an exchange economy, the competitive equilibrium is in the core. An exchange economy consists of a set of agents, $N$, a set of goods $J$. Each agent has a locally non-satiated utility function $u_i: \mathbb{R}^J_+ \to \mathbb{R}$ and an endowment $\omega_i \in \mathbb{R}^J_+$. A price vector $p \in \mathbb{R}^J_+$ together with an allocation $(x_1, \ldots, x_N)$ for the agents in the economy is a competitive equilibrium if for all agents $i \in N$:
$$
x_i \in \arg \max_{q} u(q) \text{ subject to } p' q = p' \omega_i
$$
(equality of the budget constraint holds due to locally non-satiation) and:
$$
\sum_{i \in N} x_i = \sum_{i \in N} \omega_i
$$
This second condition requires demand to be equal to supply.
To show that every allocation of a competitive equilibrium is in the core, we first need to get a mapping from our exchange economy to the structure given above:
The set of agents is simply the set $N$
The set of states $\Omega$ can be any allocation $(x_1, \ldots, x_N)$ such that $\sum_{i \in N} x_i = \sum_{i \in N} \omega_i$.
The preferences $\succeq_i$ are the ones that correspond to the utility functions.
$$
(x_1, \ldots, x_n) \succeq_i (y_1, \ldots, y_N) \iff u(x_i) \ge u(y_i).
$$
Now for the possible deviations of a coalition $A$, we assume that each coalition can move to an allocation by simply reallocating their own endowments. This means that they can move to a new allocation for their members as long as the total consumption within the coalition does not exceed the total endowment of the members in the coalition. (There is an issue here as I am not specifying what happens to the consumption of the members outside the coalition once a coalition deviates, but we will see that this does not really matter for the argument).
Given this, let us show that any competitive equilibrium is in the core. Towards a contradiction, assume that $(x_1, \ldots, x_N)$ is a competitive equilibrium with price vector $p$, and assume that coalition $A$ has found a profitable deviation $(y_i| i \in A)$. This means that:
for all members $i \in A$:
$$
u_i(y_i) \ge u_i(x_i),
$$
for at least one member $j \in A$
$$
u_j(y_j) > u_j(x_j).
$$
The total consumption in $A$ must not exceed the total endowment of members in $A$
$$
\sum_{i \in A} y_i \le \sum_{i \in A} \omega_i
$$
Let us show that these three conditions lead to a contradiction. First, using a simple revealed preference argument it follows from $u_i(y_i) \ge u_i(x_i)$ that:
$$
p' y_i \ge p' x_i.
$$
Indeed, otherwise $p' y_i < p' x_i \le p' \omega_i$ which means that $y_i$ was cheaper than $x_i$. This however contradicts the assumption that $x_i$ was utility maximising for $i$ at prices $p$. Also using a similar revealed preference argument, we can show that $u_j(y_j) > u_j(x_j)$ implies:
$$
p' y_j > p' x_j.
$$
So adding these inequalities across $i \in A$, we get:
$$
\sum_{i \in A} p' y_i > \sum_{i \in A} p' x_i.
$$
On the other hand from the budget constraint conditions and 3. we also have that:
$$
\sum_{i \in A} p' x_i = \sum_{i \in A} p' \omega_i = p' \sum_{i \in A} \omega_i \ge p' \sum_{i \in A} y_i = \sum_{i \in A} p' y_i
$$
a contradiction.