Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

LeanEval crystallographic groups, affine equivalences, and counting functions

Definition
LeanEval_SpaceGroups_Definitions

by xuanji · Sep 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

discrete-geometrygroup-theory

For every natural dimension ddd, let EdE_dEd​ be real Euclidean space, and consider subgroups of its affine isometry group. A group satisfies the discrete condition when, for every point xxx and every real ε>0\varepsilon>0ε>0, only finitely many of its elements move xxx by distance at most ε\varepsilonε. It is crystallographic when it also contains translations by the members of some linearly independent family of ddd vectors.

Two such groups are affinely equivalent when conjugation by an invertible affine map identifies their sets of affine transformations. The orientation-preserving version additionally requires that conjugating map to have positive linear determinant. An isometry is orientation-preserving precisely when its own linear determinant is positive.

The three counting functions take extended-natural cardinalities of the sets of distinct equivalence-class subsets: unrestricted affine equivalence; orientation-preserving affine equivalence; and orientation-preserving affine equivalence restricted to crystallographic groups all of whose elements preserve orientation. They do not prescribe any numerical answer, assume a classification, or identify groups by a supplied finite list. This bundle provides exactly the reusable definitions needed by the goal.

Definition code
import Mathlib

namespace LeanEval
namespace Geometry
namespace SpaceGroupsProblem

/-- The Euclidean model space `ℝᵈ`. -/
abbrev E (d : ℕ) := EuclideanSpace ℝ (Fin d)

/-- The Euclidean motion group `E_d`. -/
abbrev EuclideanIsom (d : ℕ) := E d ≃ᵃⁱ[ℝ] E d

/-- The affine group `Aff(ℝᵈ)`. -/
abbrev AffineGroup (d : ℕ) := E d ≃ᵃ[ℝ] E d

/-- `g ∈ E_d` is **translation by `v`**. -/
def IsTranslationBy {d : ℕ} (g : EuclideanIsom d) (v : E d) : Prop :=
  ∀ x : E d, g x = x + v

/-- A subgroup `G ≤ E_d` is **discrete** in the proper-discontinuity
sense. -/
def IsDiscrete {d : ℕ} (G : Subgroup (EuclideanIsom d)) : Prop :=
  ∀ x : E d, ∀ ε > (0 : ℝ),
    {g : EuclideanIsom d | g ∈ G ∧ dist (g x) x ≤ ε}.Finite

/-- A subgroup `G ≤ E_d` is **crystallographic**: discrete and contains
`d` linearly independent translations. -/
structure IsCrystallographicGroup {d : ℕ} (G : Subgroup (EuclideanIsom d)) : Prop where
  discrete : IsDiscrete G
  cocompact : ∃ v : Fin d → E d, LinearIndependent ℝ v ∧
    ∀ i, ∃ g : EuclideanIsom d, g ∈ G ∧ IsTranslationBy g (v i)

/-- The set of crystallographic groups in dimension `d`. -/
def CrystallographicGroup (d : ℕ) : Type :=
  { G : Subgroup (EuclideanIsom d) // IsCrystallographicGroup G }

/-- An affine isometry is **orientation-preserving** if its linear part
has positive determinant. -/
def IsOrientationPreservingIsom {d : ℕ} (g : EuclideanIsom d) : Prop :=
  0 < (g.toAffineEquiv.linear.det : ℝ)

/-- Two subgroups `G₁, G₂ ≤ E_d` are **affinely equivalent**. -/
def AffinelyEquivalent {d : ℕ} (G₁ G₂ : Subgroup (EuclideanIsom d)) : Prop :=
  ∃ φ : AffineGroup d,
    {h : AffineGroup d | ∃ g ∈ G₁, h = φ * g.toAffineEquiv * φ⁻¹} =
    {h : AffineGroup d | ∃ g ∈ G₂, h = g.toAffineEquiv}

/-- Two subgroups `G₁, G₂ ≤ E_d` are **orientation-preserving affinely
equivalent**: conjugation by a positive-determinant affine map takes
one to the other. -/
def AffOPEquivalent {d : ℕ} (G₁ G₂ : Subgroup (EuclideanIsom d)) : Prop :=
  ∃ φ : AffineGroup d, 0 < (φ.linear.det : ℝ) ∧
    {h : AffineGroup d | ∃ g ∈ G₁, h = φ * g.toAffineEquiv * φ⁻¹} =
    {h : AffineGroup d | ∃ g ∈ G₂, h = g.toAffineEquiv}

/-- Count of crystallographic groups modulo affine equivalence. -/
noncomputable def crystallographicCount (d : ℕ) : ℕ∞ :=
  Set.encard {S : Set (CrystallographicGroup d) |
    ∃ G₀ : CrystallographicGroup d,
      S = {H : CrystallographicGroup d | AffinelyEquivalent G₀.1 H.1}}

/-- Count of crystallographic groups modulo orientation-preserving
affine equivalence. -/
noncomputable def crystallographicCountOP (d : ℕ) : ℕ∞ :=
  Set.encard {S : Set (CrystallographicGroup d) |
    ∃ G₀ : CrystallographicGroup d,
      S = {H : CrystallographicGroup d | AffOPEquivalent G₀.1 H.1}}

/-- Count of orientation-preserving crystallographic groups modulo
orientation-preserving affine equivalence. -/
noncomputable def crystallographicCountOPOnly (d : ℕ) : ℕ∞ :=
  Set.encard {S : Set { G : CrystallographicGroup d //
                          ∀ g, g ∈ G.1 → IsOrientationPreservingIsom g } |
    ∃ G₀ : { G : CrystallographicGroup d //
              ∀ g, g ∈ G.1 → IsOrientationPreservingIsom g },
      S = {H | AffOPEquivalent G₀.1.1 H.1.1}}

end SpaceGroupsProblem
end Geometry
end LeanEval
Source
LeanEval v1, statement revision 1, problem space_groups_230; LeanEval/Geometry/SpaceGroups.lean, LeanEval.Geometry.SpaceGroupsProblem.space_groups, repository commit 296b7491ec989d21bcf8636a9a69231a1e5d1d25: https://github.com/leanprover/lean-eval/blob/296b7491ec989d21bcf8636a9a69231a1e5d1d25/LeanEval/Geometry/SpaceGroups.lean . Metadata: manifests/problems/space_groups_230.toml at the same commit. Background: Oliver Knill, Some Fundamental Theorems in Mathematics, section 94 (Crystallography), printed p. 41, version last updated June 25, 2023, https://people.math.harvard.edu/~knill/graphgeometry/papers/fundamental.pdf . The exact LeanEval definitions, not the background prose alone, govern this target.
Read-back

What the Lean code literally says, in plain math · gpt-6-astra

E. For every natural number ddd, E(d)E(d)E(d) denotes the real Euclidean space with coordinates indexed by {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, equipped with its Euclidean inner product. This includes d=0d=0d=0, when the space consists of a single zero vector.

EuclideanIsom. For every natural number ddd, EuclideanIsom⁡(d)\operatorname{EuclideanIsom}(d)EuclideanIsom(d) denotes the type of bijective real affine isometries from the coordinate Euclidean space Rd\mathbb R^dRd to itself. Dimension zero is included.

AffineGroup. For every natural number ddd, AffineGroup⁡(d)\operatorname{AffineGroup}(d)AffineGroup(d) denotes the type of bijective real affine maps from the coordinate Euclidean space Rd\mathbb R^dRd to itself, with group operation given by composition. These maps need not preserve distances. Dimension zero is included.

IsTranslationBy. For any natural number ddd, any bijective real affine isometry ggg of Rd\mathbb R^dRd, and any vector v∈Rdv\in\mathbb R^dv∈Rd, this predicate means that g(x)=x+vg(x)=x+vg(x)=x+v for every x∈Rdx\in\mathbb R^dx∈Rd. The vector vvv may be zero; dimension zero is also allowed.

IsDiscrete. For any natural number ddd and any subgroup GGG of the group of bijective real affine isometries of Rd\mathbb R^dRd, this predicate means that, for every x∈Rdx\in\mathbb R^dx∈Rd and every real ε>0\varepsilon>0ε>0, the set {g∈G:dist⁡(g(x),x)≤ε}\{g\in G:\operatorname{dist}(g(x),x)\leq\varepsilon\}{g∈G:dist(g(x),x)≤ε} is finite. The inequality includes its boundary, and the finiteness concerns the isometries themselves, not just their images of xxx. Dimension zero is included.

IsCrystallographicGroup. For any natural number ddd and any subgroup GGG of the group of bijective real affine isometries of Rd\mathbb R^dRd, this proposition requires both of the following: for every x∈Rdx\in\mathbb R^dx∈Rd and every real ε>0\varepsilon>0ε>0, the set {g∈G:dist⁡(g(x),x)≤ε}\{g\in G:\operatorname{dist}(g(x),x)\leq\varepsilon\}{g∈G:dist(g(x),x)≤ε} is finite; and there exists a real-linearly independent family (vi)i∈{0,…,d−1}(v_i)_{i\in\{0,\ldots,d-1\}}(vi​)i∈{0,…,d−1}​ of vectors in Rd\mathbb R^dRd such that, for every index iii, some g∈Gg\in Gg∈G satisfies g(x)=x+vig(x)=x+v_ig(x)=x+vi​ for every x∈Rdx\in\mathbb R^dx∈Rd. The second requirement is the field named cocompact. When d=0d=0d=0, the family is empty, its linear independence holds, and the requirement for each index is vacuous.

CrystallographicGroup. For every natural number ddd, this defines the type of subgroups GGG of the bijective real affine isometries of Rd\mathbb R^dRd, together with evidence that they satisfy these two conditions: for every point xxx and every real ε>0\varepsilon>0ε>0, only finitely many g∈Gg\in Gg∈G satisfy dist⁡(g(x),x)≤ε\operatorname{dist}(g(x),x)\leq\varepsilondist(g(x),x)≤ε; and there exist ddd real-linearly independent vectors viv_ivi​ such that each map x↦x+vix\mapsto x+v_ix↦x+vi​ belongs to GGG. Dimension zero is included, with an empty family of vectors and no translation requirements from that family.

IsOrientationPreservingIsom. For any natural number ddd and any bijective real affine isometry ggg of Rd\mathbb R^dRd, this predicate means that the real determinant of the linear part of ggg is strictly positive. There is no condition on its translation part. When d=0d=0d=0, the determinant is 111, so the predicate holds.

AffinelyEquivalent. For any natural number ddd and any two subgroups G1,G2G_1,G_2G1​,G2​ of the bijective real affine isometries of Rd\mathbb R^dRd, this predicate means that there exists a bijective real affine map φ:Rd→Rd\varphi:\mathbb R^d\to\mathbb R^dφ:Rd→Rd such that {φ∘g∘φ−1:g∈G1}={g:g∈G2}\{\varphi\circ g\circ\varphi^{-1}:g\in G_1\}=\{g:g\in G_2\}{φ∘g∘φ−1:g∈G1​}={g:g∈G2​} as sets of bijective affine maps. The map φ\varphiφ need not be an isometry and has no determinant-sign restriction. Neither subgroup is assumed to satisfy any discreteness or translation condition. Dimension zero is included.

AffOPEquivalent. For any natural number ddd and any two subgroups G1,G2G_1,G_2G1​,G2​ of the bijective real affine isometries of Rd\mathbb R^dRd, this predicate means that there exists a bijective real affine map φ:Rd→Rd\varphi:\mathbb R^d\to\mathbb R^dφ:Rd→Rd whose linear part has strictly positive real determinant and for which {φ∘g∘φ−1:g∈G1}={g:g∈G2}\{\varphi\circ g\circ\varphi^{-1}:g\in G_1\}=\{g:g\in G_2\}{φ∘g∘φ−1:g∈G1​}={g:g∈G2​} as sets of bijective affine maps. The map φ\varphiφ need not preserve distances, and the elements of G1G_1G1​ and G2G_2G2​ are not required to have positive determinant. Neither subgroup is assumed discrete or required to contain specified translations. Dimension zero is included, where the determinant restriction holds automatically.

crystallographicCount. For every natural number ddd, let Cd\mathcal C_dCd​ be the type of subgroups GGG of the bijective real affine isometries of Rd\mathbb R^dRd satisfying both: for every x∈Rdx\in\mathbb R^dx∈Rd and real ε>0\varepsilon>0ε>0, the set {g∈G:dist⁡(g(x),x)≤ε}\{g\in G:\operatorname{dist}(g(x),x)\leq\varepsilon\}{g∈G:dist(g(x),x)≤ε} is finite; and GGG contains the translations by each vector in some real-linearly independent family of ddd vectors. This definition assigns the extended natural cardinality of the set of subsets S⊆CdS\subseteq\mathcal C_dS⊆Cd​ for which there exists G0∈CdG_0\in\mathcal C_dG0​∈Cd​ such that SSS consists exactly of those H∈CdH\in\mathcal C_dH∈Cd​ for which some bijective real affine map φ\varphiφ satisfies {φ∘g∘φ−1:g∈G0}={h:h∈H}\{\varphi\circ g\circ\varphi^{-1}:g\in G_0\}=\{h:h\in H\}{φ∘g∘φ−1:g∈G0​}={h:h∈H}. There is no determinant restriction on φ\varphiφ. Distinct subsets are counted, rather than choices of representatives or conjugating maps; the value is ∞\infty∞ if there are infinitely many such subsets, and 000 if there are none. Dimension zero is included, where the family of translation vectors is empty.

crystallographicCountOP. For every natural number ddd, let Cd\mathcal C_dCd​ be the type of subgroups GGG of the bijective real affine isometries of Rd\mathbb R^dRd such that, for every point xxx and real ε>0\varepsilon>0ε>0, only finitely many g∈Gg\in Gg∈G satisfy dist⁡(g(x),x)≤ε\operatorname{dist}(g(x),x)\leq\varepsilondist(g(x),x)≤ε, and such that GGG contains translations by all vectors in some real-linearly independent family of ddd vectors. This definition assigns the extended natural cardinality of the set of subsets S⊆CdS\subseteq\mathcal C_dS⊆Cd​ for which there exists G0∈CdG_0\in\mathcal C_dG0​∈Cd​ such that SSS consists exactly of those H∈CdH\in\mathcal C_dH∈Cd​ satisfying {φ∘g∘φ−1:g∈G0}={h:h∈H}\{\varphi\circ g\circ\varphi^{-1}:g\in G_0\}=\{h:h\in H\}{φ∘g∘φ−1:g∈G0​}={h:h∈H} for some bijective real affine map φ\varphiφ with strictly positive determinant of its linear part. Group elements themselves have no determinant-sign restriction. Distinct subsets are counted, not representatives or maps; infinitely many subsets give ∞\infty∞, and no subsets give 000. Dimension zero is included, with an empty translation family and determinant 111 for the conjugating map.

crystallographicCountOPOnly. For every natural number ddd, let Cd+\mathcal C_d^+Cd+​ be the type of subgroups GGG of the bijective real affine isometries of Rd\mathbb R^dRd satisfying all three conditions: for every xxx and every real ε>0\varepsilon>0ε>0, the set {g∈G:dist⁡(g(x),x)≤ε}\{g\in G:\operatorname{dist}(g(x),x)\leq\varepsilon\}{g∈G:dist(g(x),x)≤ε} is finite; GGG contains translations by every vector in some real-linearly independent family of ddd vectors; and every g∈Gg\in Gg∈G has strictly positive determinant of its linear part. This definition assigns the extended natural cardinality of the set of subsets S⊆Cd+S\subseteq\mathcal C_d^+S⊆Cd+​ for which there exists G0∈Cd+G_0\in\mathcal C_d^+G0​∈Cd+​ such that SSS consists exactly of those H∈Cd+H\in\mathcal C_d^+H∈Cd+​ for which some bijective real affine map φ\varphiφ with strictly positive determinant of its linear part satisfies {φ∘g∘φ−1:g∈G0}={h:h∈H}\{\varphi\circ g\circ\varphi^{-1}:g\in G_0\}=\{h:h\in H\}{φ∘g∘φ−1:g∈G0​}={h:h∈H}. Distinct subsets are counted, not representatives or conjugating maps; the value is ∞\infty∞ for infinitely many subsets and 000 for none. Dimension zero is included, where the translation family is empty and all the determinant conditions hold with determinant 111.

Human review
  • Endorsed by Shuze Chen · Sep 6, 2026

  • Endorsed by xuanji · Sep 6, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me