Language Maps #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4. Maps between first-order languages in the style of the Flypitch project, as well as several important maps between structures.
Main Definitions #
- A
first_order.language.Lhom
, denotedL →ᴸ L'
, is a map between languages, sending the symbols of one to symbols of the same kind and arity in the other. - A
first_order.language.Lequiv
, denotedL ≃ᴸ L'
, is an invertible language homomorphism. first_order.language.with_constants
is defined so that ifM
is anL.Structure
andA : set M
,L.with_constants A
, denotedL[[A]]
, is a language which adds constant symbols for elements ofA
toL
.
References #
For the Flypitch project:
- on_function : Π ⦃n : ℕ⦄, L.functions n → L'.functions n
- on_relation : Π ⦃n : ℕ⦄, L.relations n → L'.relations n
A language homomorphism maps the symbols of one language to symbols of another.
Instances for first_order.language.Lhom
- first_order.language.Lhom.has_sizeof_inst
- first_order.language.Lhom.inhabited
- first_order.language.Lhom.unique
Defines a map between languages defined with language.mk₂
.
Equations
- first_order.language.Lhom.mk₂ φ₀ φ₁ φ₂ φ₁' φ₂' = {on_function := λ (n : ℕ), n.cases_on φ₀ (λ (n : ℕ), n.cases_on φ₁ (λ (n : ℕ), n.cases_on φ₂ (λ (_x : ℕ), pempty.elim))), on_relation := λ (n : ℕ), n.cases_on pempty.elim (λ (n : ℕ), n.cases_on φ₁' (λ (n : ℕ), n.cases_on φ₂' (λ (_x : ℕ), pempty.elim)))}
Pulls a structure back along a language map.
Equations
- ϕ.reduct M = {fun_map := λ (n : ℕ) (f : L.functions n) (xs : fin n → M), first_order.language.Structure.fun_map (ϕ.on_function f) xs, rel_map := λ (n : ℕ) (r : L.relations n) (xs : fin n → M), first_order.language.Structure.rel_map (ϕ.on_relation r) xs}
The identity language homomorphism.
Equations
- first_order.language.Lhom.id L = {on_function := λ (n : ℕ), id, on_relation := λ (n : ℕ), id}
Instances for first_order.language.Lhom.id
Equations
The inclusion of the left factor into the sum of two languages.
Equations
- first_order.language.Lhom.sum_inl = {on_function := λ (n : ℕ), sum.inl, on_relation := λ (n : ℕ), sum.inl}
Instances for first_order.language.Lhom.sum_inl
The inclusion of the right factor into the sum of two languages.
Equations
- first_order.language.Lhom.sum_inr = {on_function := λ (n : ℕ), sum.inr, on_relation := λ (n : ℕ), sum.inr}
Instances for first_order.language.Lhom.sum_inr
The inclusion of an empty language into any other language.
Equations
- first_order.language.Lhom.of_is_empty L L' = {on_function := λ (n : ℕ), _.elim, on_relation := λ (n : ℕ), _.elim}
Instances for first_order.language.Lhom.of_is_empty
Equations
- first_order.language.Lhom.unique = {to_inhabited := {default := first_order.language.Lhom.of_is_empty L L' _inst_3}, uniq := _}
The composition of two language homomorphisms.
Equations
- g.comp f = {on_function := λ (n : ℕ) (F : L.functions n), g.on_function (f.on_function F), on_relation := λ (_x : ℕ) (R : L.relations _x), g.on_relation (f.on_relation R)}
A language map defined on two factors of a sum.
Equations
- ϕ.sum_elim ψ = {on_function := λ (n : ℕ), sum.elim (λ (f : L.functions n), ϕ.on_function f) (λ (f : L''.functions n), ψ.on_function f), on_relation := λ (n : ℕ), sum.elim (λ (f : L.relations n), ϕ.on_relation f) (λ (f : L''.relations n), ψ.on_relation f)}
Instances for first_order.language.Lhom.sum_elim
The map between two sum-languages induced by maps on the two factors.
Equations
- ϕ.sum_map ψ = {on_function := λ (n : ℕ), sum.map (λ (f : L.functions n), ϕ.on_function f) (λ (f : L₁.functions n), ψ.on_function f), on_relation := λ (n : ℕ), sum.map (λ (f : L.relations n), ϕ.on_relation f) (λ (f : L₁.relations n), ψ.on_relation f)}
Instances for first_order.language.Lhom.sum_map
- on_function : ∀ {n : ℕ}, function.injective (λ (f : L.functions n), ϕ.on_function f)
- on_relation : ∀ {n : ℕ}, function.injective (λ (R : L.relations n), ϕ.on_relation R)
A language homomorphism is injective when all the maps between symbol types are.
Pulls a L
-structure along a language map ϕ : L →ᴸ L'
, and then expands it
to an L'
-structure arbitrarily.
Equations
- ϕ.default_expansion M = {fun_map := λ (n : ℕ) (f : L'.functions n) (xs : fin n → M), dite (f ∈ set.range (λ (f : L.functions n), ϕ.on_function f)) (λ (h' : f ∈ set.range (λ (f : L.functions n), ϕ.on_function f)), first_order.language.Structure.fun_map (Exists.some h') xs) (λ (h' : f ∉ set.range (λ (f : L.functions n), ϕ.on_function f)), inhabited.default), rel_map := λ (n : ℕ) (r : L'.relations n) (xs : fin n → M), dite (r ∈ set.range (λ (r : L.relations n), ϕ.on_relation r)) (λ (h' : r ∈ set.range (λ (r : L.relations n), ϕ.on_relation r)), first_order.language.Structure.rel_map (Exists.some h') xs) (λ (h' : r ∉ set.range (λ (r : L.relations n), ϕ.on_relation r)), inhabited.default)}
- map_on_function : ∀ {n : ℕ} (f : L.functions n) (x : fin n → M), first_order.language.Structure.fun_map (ϕ.on_function f) x = first_order.language.Structure.fun_map f x
- map_on_relation : ∀ {n : ℕ} (R : L.relations n) (x : fin n → M), first_order.language.Structure.rel_map (ϕ.on_relation R) x = first_order.language.Structure.rel_map R x
A language homomorphism is an expansion on a structure if it commutes with the interpretation of all symbols on that structure.
Instances of this typeclass
- first_order.language.Lhom.is_expansion_on_reduct
- first_order.language.Lhom.id_is_expansion_on
- first_order.language.Lhom.of_is_empty_is_expansion_on
- first_order.language.Lhom.sum_elim_is_expansion_on
- first_order.language.Lhom.sum_map_is_expansion_on
- first_order.language.Lhom.sum_inl_is_expansion_on
- first_order.language.Lhom.sum_inr_is_expansion_on
- first_order.language.with_constants_self_expansion
- first_order.language.with_constants_expansion
- first_order.language.add_empty_constants_is_expansion_on'
- first_order.language.add_empty_constants_symm_is_expansion_on
- first_order.language.add_constants_expansion
- first_order.language.constants_on_map_inclusion_is_expansion_on
- first_order.language.map_constants_inclusion_is_expansion_on
- first_order.language.ordered_structure_has_le
- to_Lhom : L →ᴸ L'
- inv_Lhom : L' →ᴸ L
- left_inv : self.inv_Lhom.comp self.to_Lhom = first_order.language.Lhom.id L
- right_inv : self.to_Lhom.comp self.inv_Lhom = first_order.language.Lhom.id L'
A language equivalence maps the symbols of one language to symbols of another bijectively.
Instances for first_order.language.Lequiv
- first_order.language.Lequiv.has_sizeof_inst
- first_order.language.Lequiv.inhabited
The identity equivalence from a first-order language to itself.
Equations
- first_order.language.Lequiv.refl L = {to_Lhom := first_order.language.Lhom.id L, inv_Lhom := first_order.language.Lhom.id L, left_inv := _, right_inv := _}
The inverse of an equivalence of first-order languages.
The composition of equivalences of first-order languages.
A language with constants indexed by a type.
Equations
Instances for first_order.language.constants_on
Gives a constants_on α
structure to a type by assigning each constant a value.
A map between index types induces a map between constant languages.
Equations
Instances for first_order.language.Lhom.constants_on_map
Extends a language with a constant for each element of a parameter set in M
.
Equations
- L.with_constants α = L.sum (first_order.language.constants_on α)
Instances for first_order.language.with_constants
The language map adding constants.
Equations
Instances for first_order.language.Lhom_with_constants
The constant symbol indexed by a particular element.
Adds constants to a language map.
Equations
Instances for first_order.language.Lhom.add_constants
The language map removing an empty constant set.
Equations
The language map extending the constant set.