# Maximal algebraic sub-groupoids

By a theorem of Ehresmann, topological and Lie categories (by which I mean categories internal to $Top$ and $Diff$ respectively, with the condition that the source and target in the latter case are submersions) have maximal topological and Lie groupoids respectively such that the arrow-component of the inclusion functor (the object component is the identity) is an open map. A priori one could forget the smooth/topological structure and there is a maximal groupoid, but this gives us that the structure maps are smooth/copntinuous (and the inversion map is a diffeo/homeomorphism).

This result is nice in that if an arrow in a topological/Lie category is invertible then so are 'nearby' arrows (in the precise sense there is an open neighbourhood of that arrow contained in the maximal groupoid.

Now I'm wondering if there is an equivalent statement about schemes. By general results, there is a maximal algebraic groupoid for a category internal to $Sch$ (as $Sch$ is finitely complete). The inclusion map is the identity on objects, but is the arrow-component open? I don't think this is a standard fact, because I have not seen (in my admittedly limited experience) categories in $Sch$ used before (non-groupoidal examples should exist, see this answer).

First interesting (counter-)examples would be reflexive, transitive non-symmetric relations. For such a thing $R \subset X\times X$ is there an open subscheme $Q \subset R$ which is the 'maximal symmetric subrelation'?

-