TITLE: What's the nearest algebraic theory to inner product spaces?
QUESTION [10 upvotes]: Following the references to the accepted answer to Is the category of Banach spaces with contractions an algebraic theory? one discovers that there is an algebraic theory (infinitary) which is closely related to Banach-spaces-with-contractions but which contains some extra stuff (this wider category is called the category of totally convex spaces).  This category has a remarkably nice presentation, and the relevant paper (MR1223636) also discusses Banach algebras (not algebraic) and $C^*$-algebras (algebraic).
Inspired by this, my question is:

What's the nearest algebraic theory for inner product spaces?

There's also a connection to the question In what sense are fields an algebraic theory?.  Fields aren't an algebraic theory, but there are "nearby" algebraic theories that can be used instead.  Most often used is that of commutative, unital rings but there's also the theory of meadows which is "nearer" in some vague sense.
Also, in my answer to Clifford algebra as an adjunction?, I argued that vector+spaces+with+bilinear+form was sort of algebraic over pointed sets (I'd like an expert to check that if one's around!).  But in this question, I don't want to change the underlying category (i.e. that of sets) but rather change (as little as possible) the category of inner product spaces.
Let me give a little more detail on the kind of answer I'd like to see.  If one thinks about defining an inner product space, then it feels almost as though it is algebraic.  The vector space structure is certainly algebraic and then on top of that there is a bilinear form with certain properties.  All but one of these properties is expressed as an equality so these look like the usual sort of identities that one gets in an algebraic theory.  However, there are two stumbling blocks:

The positive definiteness of the inner product (and nondegeneracy, depending on whether you interpret "positive definite" to imply this or not)
The codomain of the inner product.

The first is easy to deal with: simply allow arbitrary symmetric bilinear (or sesquilinear if over $\mathbb{C}$) forms.  That's not a huge problem.
The second is more problematic.  "Operations" in an algebraic theory go from products of the "base" object to the base object itself, $X^n \to X$, not to some other object no matter how special.  One way around this is to start in the monoidal category $\operatorname{Vect}$ and use PROPs but that's not what I want.  So we need to "beef up" the binary form to a genuine operation.  One possibility would be to define a ternary operation $X^3 \to X$ which "morally" is the operation $(u,v,w) \mapsto \langle u, v \rangle w$.
Then, of course, there should be a variety (ha ha) of identities that this new operation should satisfy.  So one set of possible answers to this question will be simply listing these identities.  However, there may be other ways of making a bilinear form into an actual operation so other answers could give suggestions for these.  It would also be interesting to see, for any particular answer, an example of a model of the theory that isn't a vector space with a symmetric bilinear form.

REPLY [3 votes]: Certainly you can get fairly close with your ternary operation $T(x,y,z) = \langle x,y \rangle z$.  You can impose conditions on $T$ so that it comes from a bilinear form that takes values in a commutative ring of extended scalars acting on the vector space $V$.  This is not entirely a bad thing; you could instead start with an abelian group $A$ and let $T$ induce both the bilinear form and the ground ring.  To stick close to your original question, let's suppose that $V$ is a vector space over a fixed field $k$, and that the elements of $k$ are written into the algebraic theory.  Then still the scalars could extend further, but you can write axioms to make sure that that is all that happens.
In detail, you can first suppose that $T(x,y,z)$ is trilinear and that $T(x,y,z) = T(y,x,z)$.  Then $T$ can already be read as a bilinear form that takes values in operators acting on $V$.  We can use the shorthand $U(z) = T(a,b,z)$, with $U$ an implicit function of $a$ and $b$, and see what conditions can be further imposed.  You can impose the axiom:
$$T(a,b,T(c,d,x)) = T(c,d,T(a,b,x)),$$
which says that the different values of $U$ all commute, and thus generate a commutative algebra $R$.  You can also impose the relation:
$$T(T(a,b,x),y,z) = T(a,b,T(x,y,z)),$$
in other words $T(U(x),y,z) = U(T(x,y,z))$.  This relation says that $T$, as an operator-valued inner product, is $U$-linear.
With these relations, every word $W$ in $T$ collapses like this, after permuting inputs:
$$W(x_0,x_1,\ldots,x_{2n}) = \langle x_1, x_2 \rangle \cdots \langle x_{2n-1}, x_{2n} \rangle x_0,$$
where the product is interpreted over $R$ rather than over $k$.  (The number of inputs must be even because $T$ is ternary.)  This sort of collapse is the most that you can expect from any $(n,1)$-ary operation formed from a bilinear form.  I think that that proves that with this approach, you can't do better than inner products with extension of scalars.
For all I know, it is possible that you could hard-code Euclidean geometry in some more subtle way using inequalities and names of elements in $\mathbb{C}$ or $\mathbb{R}$ in addition to using multilinear algebra.  I do not know how to do that, though.