Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
lattice.cppm File Reference

Geometric lattices (ℤ², ℕ², Gaussian integers in ℂ). More...

#include <concepts>
#include <utility>
import dedekind.sets;
import dedekind.category;
import dedekind.geometry:affine;
Include dependency graph for lattice.cppm:

Classes

struct  dedekind::geometry::LatticeFactory< NaturalLatticeSet >
struct  dedekind::geometry::LatticeFactory< 𝔸< I > >

Namespaces

namespace  dedekind::category

Concepts

concept  dedekind::geometry::IsGeometricLattice
 A Set S whose elements are integer-coordinate points, embedded into a continuous vector space V via a declared-monic arrow E.

Typedefs

using dedekind::geometry::NaturalLatticeSet = 𝔸<Cardinality>
using dedekind::geometry::IntegerLatticeSet = 𝔸<int>
using dedekind::geometry::IntegerLatticeScalar = typename IntegerLatticeSet::Domain
using dedekind::geometry::IntegerLatticePoint2D
using dedekind::geometry::NaturalLatticeScalar = Cardinality
using dedekind::geometry::NaturalLatticePoint2D

Functions

constexpr auto dedekind::geometry::natural_lattice_2d ()
 The unbounded natural lattice in 2D: Λ_nat = { (x, y) ∈ ℕ² }.
constexpr auto dedekind::geometry::integer_lattice_2d ()
 The unbounded integer lattice in 2D: Λ_int = { (x, y) ∈ ℤ² }.
constexpr auto dedekind::geometry::square_natural_grid (unsigned int n)
 The canonical N×N square natural grid: G_N^nat = { (x, y) ∈ ℕ² | 0 ≤ x < n, 0 ≤ y < n }.
constexpr auto dedekind::geometry::square_integer_grid (IntegerLatticeScalar lower, IntegerLatticeScalar upper)
 Bounded square integer grid: G_Z = { (x, y) ∈ ℤ² | lower ≤ x < upper, lower ≤ y < upper }.

Variables

template<typename S>
constexpr LatticeFactory< S > dedekind::geometry::lattice {}
constexpr auto dedekind::geometry::embed_z2_r2
 The canonical embedding ℤ² ↪ ℝ²: (x, y) ↦ Vector{x, y}.
template<>
constexpr bool dedekind::category::is_monic_arrow_v< std::decay_t< decltype(dedekind::geometry::embed_z2_r2)> >

Detailed Description

Geometric lattices (ℤ², ℕ², Gaussian integers in ℂ).

@partition :lattice

Note
"解伏題之法は、消去の術に在り" — Seki Kōwa (関 孝和, 1642–1708), paraphrase of the central thesis of Kaifukudai no Hō (解伏題之法, 1683), the treatise that introduced determinant theory roughly a decade before Leibniz. [Trans: "The method of solving buried problems lies in the technique of elimination."]

Seki computed on a sangi (算木) wooden board — a literal integer lattice — making his school's algebraic technique a natural ancestor of the IntegerLatticePoint2D / integer_lattice_2d() carriers below.

Typedef Documentation

◆ IntegerLatticePoint2D

using dedekind::geometry::IntegerLatticePoint2D
export
Initial value:
std::pair<IntegerLatticeScalar, IntegerLatticeScalar>

◆ NaturalLatticePoint2D

using dedekind::geometry::NaturalLatticePoint2D
export
Initial value:
std::pair<NaturalLatticeScalar, NaturalLatticeScalar>

Function Documentation

◆ square_integer_grid()

auto dedekind::geometry::square_integer_grid ( IntegerLatticeScalar lower,
IntegerLatticeScalar upper )
constexprexport

Bounded square integer grid: G_Z = { (x, y) ∈ ℤ² | lower ≤ x < upper, lower ≤ y < upper }.

Uses the ambient integer lattice species and explicit bounds, so negative coordinates are admitted when lower < 0.

◆ square_natural_grid()

auto dedekind::geometry::square_natural_grid ( unsigned int n)
constexprexport

The canonical N×N square natural grid: G_N^nat = { (x, y) ∈ ℕ² | 0 ≤ x < n, 0 ≤ y < n }.

Built as the cartesian product of two finite bounded naturals using the set-builder DSL. This is the lattice domain before any continuous embedding. Post-#401 the grid coordinates are NaturalLatticePoint2D = pair<unsigned, unsigned> to match the ℕ carrier reading.

Parameters
nSide length of the grid (number of points per axis).
Returns
A Set<NaturalLatticePoint2D, Kleene, ...>.

Variable Documentation

◆ embed_z2_r2

auto dedekind::geometry::embed_z2_r2
inlineconstexprexport
Initial value:
=
[](const IntegerLatticePoint2D& p) noexcept -> Vector<double, 2> {
return {static_cast<double>(p.first), static_cast<double>(p.second)};
})
An element of a Coordinate Space over a Field F.
Definition affine.cppm:96
constexpr auto arrow(F f)
Definition morphism.cppm:446

The canonical embedding ℤ² ↪ ℝ²: (x, y) ↦ Vector{x, y}.

Maps each integer pair to the corresponding point in ℝ². This is a group homomorphism (ℤ², +) → (ℝ², +). Declared monic below: distinct integer pairs map to distinct vectors since component equality implies coordinate equality.