mathlib documentation

model_theory.basic

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 #

References #

For the Flypitch project:

Languages and Structures #

@[nolint]
structure first_order.language  :
Type (max (u+1) (v+1))
  • functions : Type ?
  • relations : Type ?

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
@[nolint]

The type of constants in a given language.

Equations
@[class]

A language is relational when it has no function symbols.

Instances
@[class]

A language is algebraic when it has no relation symbols.

Instances
@[protected, instance]
@[protected, instance]
@[class]
structure first_order.language.Structure (L : first_order.language) (M : Type u_1) :
Type (max u u_1 v)

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.

Instances

Maps #

structure first_order.language.hom (L : first_order.language) (M : Type u_1) (N : Type u_2) [L.Structure M] [L.Structure N] :
Type (max u_1 u_2)

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.

structure first_order.language.embedding (L : first_order.language) (M : Type u_1) (N : Type u_2) [L.Structure M] [L.Structure N] :
Type (max u_1 u_2)

An embedding of first-order structures is an embedding that commutes with the interpretations of functions and relations.

structure first_order.language.equiv (L : first_order.language) (M : Type u_1) (N : Type u_2) [L.Structure M] [L.Structure N] :
Type (max u_1 u_2)

An equivalence of first-order structures is an equivalence that commutes with the interpretations of functions and relations.

@[protected, instance]
def first_order.language.hom.has_coe_to_fun {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] :
has_coe_to_fun (L.hom M N) (λ (_x : L.hom M N), M → N)
Equations
@[simp]
theorem first_order.language.hom.to_fun_eq_coe {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {f : L.hom M N} :
@[ext]
theorem first_order.language.hom.ext {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] ⦃f g : L.hom M N⦄ (h : ∀ (x : M), f x = g x) :
f = g
theorem first_order.language.hom.ext_iff {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {f g : L.hom M N} :
f = g ∀ (x : M), f x = g x
@[simp]
theorem first_order.language.hom.map_fun {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.hom M N) {n : } (f : L.functions n) (x : fin n → M) :
@[simp]
theorem first_order.language.hom.map_const {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.hom M N) (c : L.const) :
φ c = c
@[simp]
theorem first_order.language.hom.map_rel {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.hom M N) {n : } (r : L.relations n) (x : fin n → M) :
def first_order.language.hom.id (L : first_order.language) (M : Type u_1) [L.Structure M] :
L.hom M M

The identity map from a structure to itself

Equations
@[protected, instance]
Equations
@[simp]
theorem first_order.language.hom.id_apply {L : first_order.language} {M : Type u_1} [L.Structure M] (x : M) :
def first_order.language.hom.comp {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (hnp : L.hom N P) (hmn : L.hom M N) :
L.hom M P

Composition of first-order homomorphisms

Equations
@[simp]
theorem first_order.language.hom.comp_apply {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (g : L.hom N P) (f : L.hom M N) (x : M) :
(g.comp f) x = g (f x)
theorem first_order.language.hom.comp_assoc {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] {Q : Type u_4} [L.Structure Q] (f : L.hom M N) (g : L.hom N P) (h : L.hom P Q) :
(h.comp g).comp f = h.comp (g.comp f)

Composition of first-order homomorphisms is associative.

@[protected, instance]
def first_order.language.embedding.has_coe_to_fun {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] :
has_coe_to_fun (L.embedding M N) (λ (_x : L.embedding M N), M → N)
Equations
@[simp]
theorem first_order.language.embedding.map_fun {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.embedding M N) {n : } (f : L.functions n) (x : fin n → M) :
@[simp]
theorem first_order.language.embedding.map_const {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.embedding M N) (c : L.const) :
φ c = c
@[simp]
theorem first_order.language.embedding.map_rel {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.embedding M N) {n : } (r : L.relations n) (x : fin n → M) :
def first_order.language.embedding.to_hom {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.embedding M N) :
L.hom M N

A first-order embedding is also a first-order homomorphism.

Equations
@[simp]
theorem first_order.language.embedding.coe_to_hom {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {f : L.embedding M N} :
@[ext]
theorem first_order.language.embedding.ext {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] ⦃f g : L.embedding M N⦄ (h : ∀ (x : M), f x = g x) :
f = g
theorem first_order.language.embedding.ext_iff {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {f g : L.embedding M N} :
f = g ∀ (x : M), f x = g x
theorem first_order.language.embedding.injective {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.embedding M N) :
def first_order.language.embedding.of_injective {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] [L.is_algebraic] {f : L.hom M N} (hf : function.injective f) :
L.embedding M N

In an algebraic language, any injective homomorphism is an embedding.

Equations

The identity embedding from a structure to itself

Equations
def first_order.language.embedding.comp {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (hnp : L.embedding N P) (hmn : L.embedding M N) :
L.embedding M P

Composition of first-order embeddings

Equations
@[simp]
theorem first_order.language.embedding.comp_apply {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (g : L.embedding N P) (f : L.embedding M N) (x : M) :
(g.comp f) x = g (f x)
theorem first_order.language.embedding.comp_assoc {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] {Q : Type u_4} [L.Structure Q] (f : L.embedding M N) (g : L.embedding N P) (h : L.embedding P Q) :
(h.comp g).comp f = h.comp (g.comp f)

Composition of first-order embeddings is associative.

@[simp]
theorem first_order.language.embedding.comp_to_hom {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (hnp : L.embedding N P) (hmn : L.embedding M N) :
(hnp.comp hmn).to_hom = hnp.to_hom.comp hmn.to_hom
def first_order.language.equiv.symm {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) :
L.equiv N M

The inverse of a first-order equivalence is a first-order equivalence.

Equations
@[protected, instance]
def first_order.language.equiv.has_coe_to_fun {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] :
has_coe_to_fun (L.equiv M N) (λ (_x : L.equiv M N), M → N)
Equations
@[simp]
theorem first_order.language.equiv.apply_symm_apply {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) (a : N) :
f ((f.symm) a) = a
@[simp]
theorem first_order.language.equiv.symm_apply_apply {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) (a : M) :
(f.symm) (f a) = a
@[simp]
theorem first_order.language.equiv.map_fun {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.equiv M N) {n : } (f : L.functions n) (x : fin n → M) :
@[simp]
theorem first_order.language.equiv.map_const {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.equiv M N) (c : L.const) :
φ c = c
@[simp]
theorem first_order.language.equiv.map_rel {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (φ : L.equiv M N) {n : } (r : L.relations n) (x : fin n → M) :
def first_order.language.equiv.to_embedding {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) :
L.embedding M N

A first-order equivalence is also a first-order embedding.

Equations
def first_order.language.equiv.to_hom {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) :
L.hom M N

A first-order equivalence is also a first-order homomorphism.

Equations
@[simp]
theorem first_order.language.equiv.to_embedding_to_hom {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) :
@[simp]
theorem first_order.language.equiv.coe_to_hom {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {f : L.equiv M N} :
@[simp]
theorem first_order.language.equiv.coe_to_embedding {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) :
@[ext]
theorem first_order.language.equiv.ext {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] ⦃f g : L.equiv M N⦄ (h : ∀ (x : M), f x = g x) :
f = g
theorem first_order.language.equiv.ext_iff {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {f g : L.equiv M N} :
f = g ∀ (x : M), f x = g x
theorem first_order.language.equiv.injective {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] (f : L.equiv M N) :
def first_order.language.equiv.refl (L : first_order.language) (M : Type u_1) [L.Structure M] :
L.equiv M M

The identity equivalence from a structure to itself

Equations
def first_order.language.equiv.comp {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (hnp : L.equiv N P) (hmn : L.equiv M N) :
L.equiv M P

Composition of first-order equivalences

Equations
@[simp]
theorem first_order.language.equiv.comp_apply {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] (g : L.equiv N P) (f : L.equiv M N) (x : M) :
(g.comp f) x = g (f x)
theorem first_order.language.equiv.comp_assoc {L : first_order.language} {M : Type u_1} {N : Type u_2} [L.Structure M] [L.Structure N] {P : Type u_3} [L.Structure P] {Q : Type u_4} [L.Structure Q] (f : L.equiv M N) (g : L.equiv N P) (h : L.equiv P Q) :
(h.comp g).comp f = h.comp (g.comp f)

Composition of first-order homomorphisms is associative.