Basics on First-Order Structures #
This file defines first-order languages and structures in the style of the Flypitch project, as well as several important maps between structures.
Main Definitions #
- A
first_order.language
defines a language as a pair of functions from the natural numbers toType l
. One sendsn
to the type ofn
-ary functions, and the other sendsn
to the type ofn
-ary relations. - A
first_order.language.Structure
interprets the symbols of a givenfirst_order.language
in the context of a given type. - A
first_order.language.hom
, denotedM →[L] N
, is a map from theL
-structureM
to theL
-structureN
that commutes with the interpretations of functions, and which preserves the interpretations of relations (although only in the forward direction). - A
first_order.language.embedding
, denotedM ↪[L] N
, is an embedding from theL
-structureM
to theL
-structureN
that commutes with the interpretations of functions, and which preserves the interpretations of relations in both directions. - A
first_order.language.elementary_embedding
, denotedM ↪ₑ[L] N
, is an embedding from theL
-structureM
to theL
-structureN
that commutes with the realizations of all formulas. - A
first_order.language.equiv
, denotedM ≃[L] N
, is an equivalence from theL
-structureM
to theL
-structureN
that commutes with the interpretations of functions, and which preserves the interpretations of relations in both directions.
References #
For the Flypitch project:
Languages and Structures #
A first-order language consists of a type of functions of every natural-number arity and a type of relations of every natural-number arity.
The empty language has no symbols.
Equations
The type of constants in a given language.
A language is relational when it has no function symbols.
A language is algebraic when it has no relation symbols.
- fun_map : Π {n : ℕ}, L.functions n → (fin n → M) → M
- rel_map : Π {n : ℕ}, L.relations n → (fin n → M) → Prop
A first-order structure on a type M
consists of interpretations of all the symbols in a given
language. Each function of arity n
is interpreted as a function sending tuples of length n
(modeled as (fin n → M)
) to M
, and a relation of arity n
is a function from tuples of length
n
to Prop
.
Maps #
- to_fun : M → N
- map_fun' : (∀ {n : ℕ} (f : L.functions n) (x : fin n → M), self.to_fun (first_order.language.Structure.fun_map f x) = first_order.language.Structure.fun_map f (self.to_fun ∘ x)) . "obviously"
- map_rel' : (∀ {n : ℕ} (r : L.relations n) (x : fin n → M), first_order.language.Structure.rel_map r x → first_order.language.Structure.rel_map r (self.to_fun ∘ x)) . "obviously"
A homomorphism between first-order structures is a function that commutes with the interpretations of functions and maps tuples in one structure where a given relation is true to tuples in the second structure where that relation is still true.
- to_embedding : M ↪ N
- map_fun' : (∀ {n : ℕ} (f : L.functions n) (x : fin n → M), self.to_embedding.to_fun (first_order.language.Structure.fun_map f x) = first_order.language.Structure.fun_map f (self.to_embedding.to_fun ∘ x)) . "obviously"
- map_rel' : (∀ {n : ℕ} (r : L.relations n) (x : fin n → M), first_order.language.Structure.rel_map r (self.to_embedding.to_fun ∘ x) ↔ first_order.language.Structure.rel_map r x) . "obviously"
An embedding of first-order structures is an embedding that commutes with the interpretations of functions and relations.
- to_equiv : M ≃ N
- map_fun' : (∀ {n : ℕ} (f : L.functions n) (x : fin n → M), self.to_equiv.to_fun (first_order.language.Structure.fun_map f x) = first_order.language.Structure.fun_map f (self.to_equiv.to_fun ∘ x)) . "obviously"
- map_rel' : (∀ {n : ℕ} (r : L.relations n) (x : fin n → M), first_order.language.Structure.rel_map r (self.to_equiv.to_fun ∘ x) ↔ first_order.language.Structure.rel_map r x) . "obviously"
An equivalence of first-order structures is an equivalence that commutes with the interpretations of functions and relations.
Equations
- first_order.language.has_coe_t = {coe := λ (c : L.const), first_order.language.Structure.fun_map c fin.elim0}
Equations
The identity map from a structure to itself
Equations
- first_order.language.hom.inhabited = {default := first_order.language.hom.id L M _inst_1}
Composition of first-order homomorphisms
Composition of first-order homomorphisms is associative.
Equations
- first_order.language.embedding.has_coe_to_fun = {coe := λ (f : L.embedding M N), f.to_embedding.to_fun}
In an algebraic language, any injective homomorphism is an embedding.
Equations
- first_order.language.embedding.of_injective hf = {to_embedding := {to_fun := f.to_fun, inj' := hf}, map_fun' := _, map_rel' := _}
The identity embedding from a structure to itself
Equations
- first_order.language.embedding.refl L M = {to_embedding := function.embedding.refl M, map_fun' := _, map_rel' := _}
Equations
Composition of first-order embeddings
Composition of first-order embeddings is associative.
The inverse of a first-order equivalence is a first-order equivalence.
A first-order equivalence is also a first-order embedding.
Equations
- f.to_embedding = {to_embedding := {to_fun := ⇑f, inj' := _}, map_fun' := _, map_rel' := _}
The identity equivalence from a structure to itself
Equations
- first_order.language.equiv.refl L M = {to_equiv := equiv.refl M, map_fun' := _, map_rel' := _}
Equations
- first_order.language.equiv.inhabited = {default := first_order.language.equiv.refl L M _inst_1}
Composition of first-order equivalences
Composition of first-order homomorphisms is associative.