Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(model_theory/basic): define quotient structures #11747

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/model_theory/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1077,5 +1077,48 @@ instance : boolean_algebra (L.definable_set M α) :=
end definable_set
end definability

section quotients

variables (L) {M' : Type*}

/-- A prestructure is a first-order structure with a `setoid` equivalence relation on it,
such that quotienting by that equivalence relation is still a structure. -/
class prestructure (s : setoid M') :=
(to_structure : L.Structure M')
(fun_equiv : ∀{n} {f : L.functions n} (x y : fin n → M'),
x ≈ y → fun_map f x ≈ fun_map f y)
(rel_equiv : ∀{n} {r : L.relations n} (x y : fin n → M') (h : x ≈ y),
(rel_map r x = rel_map r y))

variables {L} {M'} {s : setoid M'} [ps : L.prestructure s]

instance quotient_structure :
L.Structure (quotient s) :=
{ fun_map := λ n f x, quotient.map (@fun_map L M' ps.to_structure n f) prestructure.fun_equiv
(quotient.fin_choice x),
rel_map := λ n r x, quotient.lift (@rel_map L M' ps.to_structure n r) prestructure.rel_equiv
(quotient.fin_choice x) }

variables [s]
include s

lemma fun_map_quotient_mk {n : ℕ} (f : L.functions n) (x : fin n → M') :
fun_map f (λ i, ⟦x i⟧) = ⟦@fun_map _ _ ps.to_structure _ f x⟧ :=
begin
change quotient.map (@fun_map L M' ps.to_structure n f) prestructure.fun_equiv
(quotient.fin_choice _) = _,
rw [quotient.fin_choice_eq, quotient.map_mk],
end

lemma realize_term_quotient_mk {β : Type*} (x : β → M') (t : L.term β) :
realize_term (λ i, ⟦x i⟧) t = ⟦@realize_term _ _ ps.to_structure _ x t⟧ :=
begin
induction t with a1 a2 a3 a4 ih a6 a7 a8 a9 a0,
{ refl },
simp only [ih, fun_map_quotient_mk, realize_term],
end

end quotients

end language
end first_order