Skip to content

Commit e01a621

Browse files
committed
improve definable function theorems and simplify proofs using the term theorem
1 parent 54116be commit e01a621

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

Mathlib/ModelTheory/Definability.lean

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -458,44 +458,49 @@ def DefinableFun (f : (α → M) → M) : Prop :=
458458
def DefinableMap (F : (α → M) → (β → M)) : Prop :=
459459
∀ i : β, DefinableFun L A fun x => F x i
460460

461-
variable {L A}
461+
variable {L A} {f : (α → M) → M}
462462

463-
theorem DefinableFun.mono {f : (α → M) → M} {B : Set M} (hAs : DefinableFun L A f) (hAB : A ⊆ B) :
463+
theorem DefinableFun.mono {B : Set M} (hAs : DefinableFun L A f) (hAB : A ⊆ B) :
464464
DefinableFun L B f :=
465465
Set.Definable.mono hAs hAB
466466

467-
theorem empty_definableFun_iff {f : (α → M) → M} :
467+
theorem empty_definableFun_iff :
468468
DefinableFun L (∅ : Set M) f ↔
469469
∃ φ : L.Formula (α ⊕ Unit), tupleGraph f = setOf φ.Realize := by
470470
simp [DefinableFun, Set.empty_definable_iff]
471471

472-
/-- A function symbol is a definable function. -/
473-
theorem DefinableFun.fun_symbol {n : ℕ} (f : L.Functions n) :
474-
DefinableFun L (∅ : Set M) (fun x : Fin n → M => Structure.funMap f x) := by
475-
rw [empty_definableFun_iff]
476-
exists (Term.func f (Term.var ∘ Sum.inl)).equal (Term.var (Sum.inr ()))
472+
theorem definableFun_iff_empty_definableFun_with_params :
473+
DefinableFun L A f ↔ DefinableFun (L[[A]]) (∅ : Set M) f :=
474+
empty_definable_iff.symm
477475

478476
/-- A term is a definable function. -/
479-
theorem _root_.Language.Term.definableFun_realize (t : L.Term α) :
477+
theorem _root_.FirstOrder.Language.Term.definableFun_realize (t : L.Term α) :
480478
DefinableFun L (∅ : Set M) (fun v => t.realize v) := by
481479
rw [empty_definableFun_iff]
482480
exists (t.relabel Sum.inl).equal (Term.var (Sum.inr ()))
483481
ext v
484482
simp
485483

486-
variable (L A)
484+
/-- A function symbol is a definable function. -/
485+
theorem DefinableFun.fun_symbol {n : ℕ} (f : L.Functions n) :
486+
DefinableFun L (∅ : Set M) (fun x : Fin n → M => Structure.funMap f x) :=
487+
(Term.func f Term.var).definableFun_realize
488+
489+
variable (L)
490+
491+
/-- A coordinate projection is a definable function. -/
492+
theorem _root_.FirstOrder.Language.definableFun_var (i : α) :
493+
DefinableFun L (∅ : Set M) (fun v => v i) :=
494+
(Term.var i).definableFun_realize
487495

488496
/-- A constant function is a definable function. -/
489497
theorem _root_.FirstOrder.Language.definableFun_const {A : Set M} {a : M}
490498
(γ : Type*) (ha : a ∈ A) :
491499
DefinableFun L A (fun _ : γ → M => a) := by
492-
simp only [DefinableFun]
493-
convert (Definable.singleton_of_mem L ha).preimage_comp (fun _ : Fin 1 => Sum.inr ()) using 1
494-
simp only [tupleGraph, Fin.isValue, mem_singleton_iff, preimage_setOf_eq, comp_apply]
495-
ext v
496-
exact comm
500+
rw [definableFun_iff_empty_definableFun_with_params]
501+
exact ((L.con (⟨a,ha⟩ : ↑A)).term).definableFun_realize
497502

498-
variable {L A}
503+
variable {L}
499504

500505
/-- The preimage of a definable set under a definable map is definable. -/
501506
lemma _root_.Set.Definable.preimage_map

0 commit comments

Comments
 (0)