Added completeness for ZOL, and a more efficient way of putting agda in the LaTeX file

This commit is contained in:
Mysaa 2023-08-04 16:12:18 +02:00
parent 9be53b4f7f
commit a10bcd6770
Signed by: Mysaa
GPG Key ID: 7054D5D6A90F084F
8 changed files with 182 additions and 149 deletions

View File

@ -578,6 +578,7 @@ module FFOLInitial where
mForT∀∀ : {Γₜ : Cont}{A : For (Γₜ ▹t⁰)} → mForT {Γₜ} (∀∀ A) ≡ FFOL.∀∀ M (mForT {Γₜ ▹t⁰} A)
mForT∀∀ = refl
mForP∀∀ : {Γₜ : Cont}{Γₚ : Conp Γₜ}{A : For (Γₜ ▹t⁰)} → mForP {Γₜ} {Γₚ} (∀∀ A) ≡ FFOL.∀∀ M (subst (FFOL.For M) (e▹ₜP {Γₜ} {Γₚ}) (mForP {Γₜ ▹t⁰} {Γₚ ▹tp} A))
mForP∀∀ = ?
-- mFor∀∀ : {Γ : Con}{A : For ((Con.t Γ) ▹t⁰)} → mFor {Γ} (∀∀ A) ≡ FFOL.∀∀ M (mFor {Γ ▹t} A)
--mForL : {Γ : Con}{A : For (Con.t Γ ▹t⁰)}{t : Tm (Con.t Γ)} → FFOL._[_]f M (mFor {Γ = {!Γ ▹t!}} A) (FFOL._,ₜ_ M (FFOL.id M) (mTm {Γ = Γ} t)) ≡ mFor {Γ = Γ} (A [ idₜ ,ₜ t ]f)

View File

@ -2,24 +2,48 @@ define extract
cat $(1) | grep -A5000 -m1 $(3) | grep -B5000 -m1 $(4) | head -n -1 | sed 's/\\>\[6\]/\\>\[0\]/g' > $(2)
endef
define split
last=-1;i=1;for cur in $$(grep -n -e "--\\\\#" $(1) | cut -d':' -f1); do if [ ! "-1" -eq $$last ]; then dif=$$((cur-last-1));cat $(1) | head -n $$((cur-2)) | tail -n $$((dif-1)) > $(2)$$i$(3); i=$$((i+1)); fi; last=$$cur; done
endef
all: report/build/M1Report.pdf
latex/FFOL.tex: FFOL.lagda
agda --latex $<
cp latex/agda.sty report/agda.sty
latex/ZOL.tex: ZOL2.lagda
agda --latex $<
cp latex/agda.sty report/agda.sty
mv latex/ZOL2.tex latex/ZOL.tex
latex/FFOLInitial.tex: FFOLInitial.lagda
agda --latex --allow-unsolved-metas $<
cp latex/agda.sty report/agda.sty
report/build/M1Report.pdf: agda-tex-FFOL agda-tex-FIni
report/build/M1Report.pdf: agda-tex-FFOL agda-tex-FIni agda-tex-ZOL
$(cd report/; latexmk -pdf -xelatex -silent -shell-escape -outdir=build/ -synctex=1 "M1Report")
agda-tex-FIni: latex/FFOLInitial.tex
mkdir -p report/agda
@$(call extract,latex/FFOLInitial.tex,report/agda/ICont.tex,'Term\\ contexts\\ are\\ isomorphic\\ to\\ Nat','\\>\[0\]\\<')
@$(call extract,latex/FFOLInitial.tex,report/agda/ITm.tex,'A\\ term\\ variable\\ is\\ a\\ de-bruijn','\\>\[0\]\\<')
@$(call extract,latex/FFOLInitial.tex,report/agda/IFor.tex,'Now\\ we\\ can\\ define\\ formul','\\AgdaEmptyExtraSkip')
@$(call extract,latex/FFOLInitial.tex,report/agda/ISubt.tex,'Then\\ we\\ define\\ term\\ substitutions','\\>\[0\]\\<')
1 Cont
--2
3 Tm
4 For
5 Subt
--6 Subt-accessors
7 SubtT
SubtF
IdComp
Conp
SubtC
ConpTp
Pf
Ren
Subp
SubtP
SubtS
SubpP
IdCompP
CExt
@$(call extract,latex/FFOLInitial.tex,report/agda/ISubtT.tex,'We\\ now\\ define\\ the\\ action\\ of\\ term\\ substitutions','\\>\[0\]\\<')
@$(call extract,latex/FFOLInitial.tex,report/agda/ISubtF.tex,'We\\ can\\ now\\ subst\\ on\\ formul','\\AgdaEmptyExtraSkip')
@$(call extract,latex/FFOLInitial.tex,report/agda/IIdCompT.tex,'We\\ now\\ can\\ define\\ identity\\ and\\ composition\\ of\\ term\\ substitutions','\\AgdaEmptyExtraSkip')
@ -52,6 +76,10 @@ agda-tex-FFOL: latex/FFOL.tex
@$(call extract,latex/FFOL.tex,report/agda/LamApp.tex,'\\>\[6\]\\AgdaField{lam}',"AgdaEmptyExtraSkip")
@$(call extract,latex/FFOL.tex,report/agda/ForallR.tex,'\\>\[6\]\\AgdaField{∀i}',"AgdaEmptyExtraSkip")
.PHONY: clean agda-tex agda-tex-FFOL
agda-tex-ZOL: latex/ZOL.tex
mkdir -p report/agda
$(call split,"latex/ZOL.tex","report/agda/ZOL-",".tex")
.PHONY: clean agda-tex agda-tex-FFOL agda-tex-ZOL agda-tex-FIni
clean:
rm -fr *.agdai report/agda latex report/build

View File

@ -1,4 +1,4 @@
\begin{code}
\begin{code}[hide]
{-# OPTIONS --prop --rewriting #-}
open import PropUtil
@ -16,27 +16,29 @@ module ZOL2 where
infixr 10 _∘_
field
-- We first make the base category with its terminal object
--# We first make the base category with its terminal object
Con : Set ℓ¹
Sub : Con → Con → Prop ℓ² -- It makes a category
Sub : Con → Con → Prop ℓ² -- It makes a posetal category
_∘_ : {Γ Δ Ξ : Con} → Sub Δ Ξ → Sub Γ Δ → Sub Γ Ξ
--∘-ass : {Γ Δ Ξ Ψ : Con}{α : Sub Γ Δ}{β : Sub Δ Ξ}{γ : Sub Ξ Ψ}
-- → (γ ∘ β) ∘ αγ ∘ (β ∘ α)
id : {Γ : Con} → Sub Γ Γ
--idl : {Γ Δ : Con} {σ : Sub Γ Δ} → (id {Δ}) ∘ σσ
--idr : {Γ Δ : Con} {σ : Sub Γ Δ} → σ ∘ (id {Γ}) ≡ σ
◇ : Con -- The terminal object of the category
ε : {Γ : Con} → Sub Γ ◇ -- The morphism from any object to the terminal
--# Categorical equations don't need to be stated as the category is *posetal*
--∘-ass : {Γ Δ Ξ Ψ : Con}{α : Sub Γ Δ}{β : Sub Δ Ξ}{γ : Sub Ξ Ψ}
--idl : {Γ Δ : Con} {σ : Sub Γ Δ} → (id {Δ}) ∘ σσ
--idr : {Γ Δ : Con} {σ : Sub Γ Δ} → σ ∘ (id {Γ}) ≡ σ
-- → (γ ∘ β) ∘ αγ ∘ (β ∘ α)
--ε-u : {Γ : Con} → {σ : Sub Γ ◇} → σ ≡ ε {Γ}
-- Functor Con → Set called For
--# Functor Con → Set called For
For : Con → Set ℓ³
_[_]f : {Γ Δ : Con} → For Γ → Sub Δ Γ → For Δ -- Action on morphisms
[]f-id : {Γ : Con} → {F : For Γ} → F [ id {Γ} ]f ≡ F
[]f-∘ : {Γ Δ Ξ : Con} → {α : Sub Ξ Δ} → {β : Sub Δ Γ} → {F : For Γ}
→ F [ β ∘ α ]f ≡ (F [ β ]f) [ α ]f
-- Functor Con × For → Prop called Pf or ⊢
--# Functor Con × For → Prop called Pf or ⊢
Pf : (Γ : Con) → For Γ → Prop ℓ⁴
-- Action on morphisms
_[_]p : {Γ Δ : Con} → {F : For Γ} → Pf Γ F → (σ : Sub Δ Γ) → Pf Δ (F [ σ ]f)
@ -46,38 +48,40 @@ module ZOL2 where
-- []p-∘ : {Γ Δ Ξ : Con}{α : Sub Ξ Δ}{β : Sub Δ Γ}{F : For Γ}{prf : Pf Γ F}
-- → prf [ α ∘ β ]p ≡ (prf [ β ]p) [ α ]p
-- → Prop⁺
--# → Prop⁺
_▹ₚ_ : (Γ : Con) → For Γ → Con
πₚ¹ : {Γ Δ : Con}{F : For Γ} → Sub Δ (Γ ▹ₚ F) → Sub Δ Γ
πₚ² : {Γ Δ : Con}{F : For Γ} → (σ : Sub Δ (Γ ▹ₚ F)) → Pf Δ (F [ πₚ¹ σ ]f)
_,ₚ_ : {Γ Δ : Con}{F : For Γ} → (σ : Sub Δ Γ) → Pf Δ (F [ σ ]f) → Sub Δ (Γ ▹ₚ F)
-- Equality below are useless because Pf and Sub are in Prop
--,ₚ∘πₚ : {Γ Δ : Con}{F : For Γ}{σ : Sub Δ (Γ ▹ₚ F)} → (πₚ¹ σ) ,ₚ (πₚ² σ) ≡ σ
--πₚ¹∘,ₚ : {Γ Δ : Con}{σ : Sub Δ Γ}{F : For Γ}{prf : Pf Δ (F [ σ ]f)}
-- → πₚ¹ (σ ,ₚ prf) ≡ σ
-- Equality below is useless because Pf Γ F is in Prop
-- πₚ²∘,ₚ : {Γ Δ : Con}{σ : Sub Δ Γ}{F : For Γ}{prf : Pf Δ (F [ σ ]f)}
-- → πₚ² (σ ,ₚ prf) ≡ prf
--,ₚ∘ : {Γ Δ Ξ : Con}{σ : Sub Γ Ξ}{δ : Sub Δ Γ}{F : For Ξ}{prf : Pf Γ (F [ σ ]f)}
-- → (σ ,ₚ prf) ∘ δ ≡ (σ ∘ δ) ,ₚ (substP (Pf Δ) (≡sym []f-∘) (prf [ δ ]p))
{-- FORMULAE CONSTRUCTORS --}
-- i formula
--# i formula
ι : {Γ : Con} → For Γ
[]f-ι : {Γ Δ : Con} {σ : Sub Δ Γ}→ ι [ σ ]f ≡ ι
-- Implication
--# Implication
_⇒_ : {Γ : Con} → For Γ → For Γ → For Γ
[]f-⇒ : {Γ Δ : Con} → {F G : For Γ} → {σ : Sub Δ Γ}
→ (F ⇒ G) [ σ ]f ≡ (F [ σ ]f) ⇒ (G [ σ ]f)
--#
{-- PROOFS CONSTRUCTORS --}
-- Again, we don't have to write the _[_]p equalities as Proofs are in Prop
-- Lam & App
--# Lam & App
lam : {Γ : Con}{F G : For Γ} → Pf (Γ ▹ₚ F) (G [ πₚ¹ id ]f) → Pf Γ (F ⇒ G)
app : {Γ : Con}{F G : For Γ} → Pf Γ (F ⇒ G) → Pf Γ F → Pf Γ G
--#
record Mapping (S : ZOL {ℓ¹} {ℓ²} {ℓ³} {ℓ⁴}) (D : ZOL {ℓ¹'} {ℓ²'} {ℓ³'} {ℓ⁴'}) : Set (lsuc (ℓ¹ ⊔ ℓ² ⊔ ℓ³ ⊔ ℓ⁴ ⊔ ℓ¹' ⊔ ℓ²' ⊔ ℓ³' ⊔ ℓ⁴')) where
field

View File

@ -17,92 +17,91 @@ module ZOLCompleteness where
_∘-w->_ : {w w' w'' : World} → w -w-> w' → w' -w-> w'' → w -w-> w'' -- arrow composition
Ι : World → Prop ℓ¹
Ι≤ : {w w' : World} → w -w-> w' → Ι w'Ι w
Ι≤ : {w w' : World} → w -w-> w' → Ι w → Ι w'
infixr 10 _∘_
Con : Set (lsuc ℓ¹)
Con = World → Prop ℓ¹
Con = (World → Prop ℓ¹) ×'' (λ Γ → {w w' : World} → (w -w-> w')→ Γ w → Γ w')
Sub : Con → Con → Prop ℓ¹
Sub Δ Γ = (w : World) → Δ w → Γ w
Sub Δ Γ = (w : World) → (proj×''₁ Δ) w → (proj×''₁ Γ) w
_∘_ : {Γ Δ Ξ : Con} → Sub Δ Ξ → Sub Γ Δ → Sub Γ Ξ
α ∘ β = λ w γα w (β w γ)
id : {Γ : Con} → Sub Γ Γ
id = λ w γγ
◇ : Con -- The initial object of the category
◇ = λ w →
◇ = (λ w → ) ,×'' (λ _ _ → tt)
ε : {Γ : Con} → Sub Γ ◇ -- The morphism from the initial to any object
ε w Γ = tt
-- Functor Con → Set called For
For : Con → Set (lsuc ℓ¹)
For Γ = (w : World) → (Γ w) → Prop ℓ¹
_[_]f : {Γ Δ : Con} → For Γ → Sub Δ Γ → For Δ -- The functor's action on morphisms
F [ σ ]f = λ w → λ x → F w (σ w x)
For : Set (lsuc ℓ¹)
For = (World → Prop ℓ¹) ×'' (λ F → {w w' : World} → (w -w-> w')→ F w → F w')
-- Proofs
Pf : (Γ : Con) → For Γ → Prop ℓ¹
Pf Γ F = ∀ w (γ : Γ w) → F w γ
_[_]p : {Γ Δ : Con} → {F : For Γ} → Pf Γ F → (σ : Sub Δ Γ) → Pf Δ (F [ σ ]f) -- The functor's action on morphisms
Pf : (Γ : Con) → For → Prop ℓ¹
Pf Γ F = ∀ w (γ : (proj×''₁ Γ) w) → (proj×''₁ F) w
_[_]p : {Γ Δ : Con} → {F : For} → Pf Γ F → (σ : Sub Δ Γ) → Pf Δ F -- The functor's action on morphisms
prf [ σ ]p = λ w → λ γ → prf w (σ w γ)
-- Equalities below are useless because Γ ⊢ F is in prop
-- []p-id : {Γ : Con} → {F : For Γ} → {prf : Γ ⊢ F} → prf [ id {Γ} ]p ≡ prf
-- []p-∘ : {Γ Δ Ξ : Con} → {α : Sub Ξ Δ} → {β : Sub Δ Γ} → {F : For Γ} → {prf : Γ ⊢ F} → prf [ α ∘ β ]p ≡ (prf [ β ]p) [ α ]p
-- → Prop⁺
_▹ₚ_ : (Γ : Con) → For Γ → Con
Γ ▹ₚ F = λ w → Γ w ×p F w
πₚ¹ : {Γ Δ : Con} → {F : For Γ} → Sub Δ (Γ ▹ₚ F) → Sub Δ Γ
πₚ¹ σ w δ = proj×p₁ (σ w δ)
πₚ² : {Γ Δ : Con} → {F : For Γ} → (σ : Sub Δ (Γ ▹ₚ F)) → Pf Δ (F [ πₚ¹ σ ]f)
πₚ² σ w δ = proj×p₂ (σ w δ)
_,ₚ_ : {Γ Δ : Con} → {F : For Γ} → (σ : Sub Δ Γ) → Pf Δ (F [ σ ]f) → Sub Δ (Γ ▹ₚ F)
(σ ,ₚ pf) w δ = (σ w δ) ,×p pf w δ
_▹ₚ_ : (Γ : Con) → For → Con
Γ ▹ₚ F = (λ w → (proj×''₁ Γ) w ∧ (proj×''₁ F) w) ,×'' λ s γ → ⟨ proj×''₂ Γ s (proj₁ γ) , proj×''₂ F s (proj₂ γ) ⟩
πₚ¹ : {Γ Δ : Con} → {F : For} → Sub Δ (Γ ▹ₚ F) → Sub Δ Γ
πₚ¹ σ w δ = proj₁ (σ w δ)
πₚ² : {Γ Δ : Con} → {F : For} → (σ : Sub Δ (Γ ▹ₚ F)) → Pf Δ F
πₚ² σ w δ = proj₂ (σ w δ)
_,ₚ_ : {Γ Δ : Con} → {F : For} → (σ : Sub Δ Γ) → Pf Δ F → Sub Δ (Γ ▹ₚ F)
(σ ,ₚ pf) w δ = ⟨ (σ w δ) , pf w δ ⟩
-- Base formula
ι : {Γ : Con} → For Γ
ι = λ w → λ γΙ w
ι : For
ι = (λ w → Ι w) ,×'' λ s f → Ι≤ s f
-- Implication
_⇒_ : {Γ : Con} → For Γ → For Γ → For Γ
(F ⇒ G) w γ = {w' : World} → (s : w -w-> w') → (F w' {!s γ!}) → (G w' {!!})
_⇒_ : For → For → For
(F ⇒ G) = (λ w → {w' : World} → (s : w -w-> w') → ((proj×''₁ F) w') → ((proj×''₁ G) w')) ,×'' λ s f s' f' → f (s ∘-w-> s') f'
-- Lam & App
lam : {Γ : Con} → {F : For Γ} → {G : For Γ} → Pf (Γ ▹ₚ F) (G [ πₚ¹ id ]f) → Pf Γ (F ⇒ G)
--lam prf = λ w γ w' s h → prf w (γ ,×p h)
app : {Γ : Con} → {F G : For Γ} → Pf Γ (F ⇒ G) → Pf Γ F → Pf Γ G
--app prf prf' = λ w γ → prf w γ w -w->id (prf' w γ)
lam : {Γ : Con} → {F : For} → {G : For} → Pf (Γ ▹ₚ F) G → Pf Γ (F ⇒ G)
lam {Γ} pf w γ {w'} s x = pf w' ⟨ proj×''₂ Γ s γ , x ⟩
--lam prf = λ w γ w' s h → prf w (γ , h)
app : {Γ : Con} → {F G : For} → Pf Γ (F ⇒ G) → Pf Γ F → Pf Γ G
app pf pf' w γ = pf w γ -w->id (pf' w γ)
-- Again, we don't write the _[_]p equalities as everything is in Prop
zol : ZOL
zol = record
{ Con = Con
; Sub = Sub
; _∘_ = _∘_
; id = id
; _∘_ = λ {Γ}{Δ}{Ξ} σ δ → _∘_ {Γ}{Δ}{Ξ} σ δ
; id = λ {Γ} → id {Γ}
; ◇ = ◇
; ε = ε
; For = For
; _[_]f = _[_]f
; ε = λ {Γ} → ε {Γ}
; For = λ Γ → For
; _[_]f = λ A σ → A
; []f-id = refl
; []f-∘ = refl
; Pf = Pf
; _[_]p = _[_]p
; _[_]p = λ {Γ}{Δ}{F} pf σ_[_]p {Γ}{Δ}{F} pf σ
; _▹ₚ_ = _▹ₚ_
; πₚ¹ = πₚ¹
; πₚ² = πₚ²
; _,ₚ_ = _,ₚ_
; πₚ¹ = λ {Γ}{Δ}{F}σπₚ¹ {Γ}{Δ}{F} σ
; πₚ² = λ {Γ}{Δ}{F}σπₚ² {Γ}{Δ}{F} σ
; _,ₚ_ = λ {Γ}{Δ}{F} σ pf → _,ₚ_ {Γ}{Δ}{F}σ pf
; ι = ι
; []f-ι = refl
; _⇒_ = _⇒_
; []f-⇒ = refl
; lam = lam
; app = app
; lam = λ {Γ}{F}{G} pf → lam {Γ}{F}{G} pf
; app = λ {Γ}{F}{G} pf pf' → app {Γ}{F}{G} pf pf'
}
\end{code}
module U where
import ZOLInitial as I
@ -110,9 +109,9 @@ module ZOLCompleteness where
U : Kripke
U = record
{ World = I.Con
; _-w->_ = I.Sub
; _-w->_ = λ Γ Δ → I.Sub Δ Γ
; -w->id = I.id
; _∘-w->_ = λ σ σ' → σ' I.∘ σ
; _∘-w->_ = λ σ σ' → σ I.∘ σ'
; Ι = λ Γ → I.Pf Γ I.ι
; Ι≤ = λ s pf → pf I.[ s ]p
}
@ -121,78 +120,40 @@ module ZOLCompleteness where
y : Mapping I.zol zol
y = record
{ mCon = λ Γ Δ → I.Sub Δ Γ
{ mCon = λ Γ → (λ Δ → I.Sub Δ Γ) ,×'' λ σ δ → δ I.∘ σ
; mSub = λ σ Ξ δ → σ I.∘ δ
; mFor = λ A Ξ σ → I.Pf Ξ A
; mFor = λ A → (λ Ξ → I.Pf Ξ A) ,×'' λ σ pf → pf I.[ σ ]p
; mPf = λ pf Ξ σ → pf I.[ σ ]p
}
m : Morphism I.zol zol
m = I.InitialMorphism.mor zol
u : (Γ : I.Con) → Sub (Morphism.mCon m Γ) (Mapping.mCon y Γ)
q : (Γ : I.Con) → Sub (Mapping.mCon y Γ) (Morphism.mCon m Γ)
q : (Γ : I.Con) → Sub (Morphism.mCon m Γ) (Mapping.mCon y Γ)
u : (Γ : I.Con) → Sub (Mapping.mCon y Γ) (Morphism.mCon m Γ)
⟦_⟧c = Morphism.mCon m
⟦_,_⟧f = λ A Γ → Morphism.mFor m {Γ} A
⟦⟧f-mon : {Γ : I.Con}{A : I.For}{w w' : World}{γ : ⟦ Γ ⟧c w}{γ' : ⟦ Γ ⟧c w'} → w -w-> w' → ⟦ A , Γ ⟧f w' γ' → ⟦ A , Γ ⟧f w γ
⟦⟧f-mon {A = I.ι} s h = Ι≤ s h
⟦⟧f-mon {A = A I.⇒ B} s h w'' s' h' = {!h!}
q⁰ : {F : I.For} → {Γ Γ₀ : I.Con} → proj×''₁ ⟦ F , Γ₀ ⟧f Γ → I.Pf Γ F
u⁰ : {F : I.For} → {Γ Γ₀ : I.Con} → I.Pf Γ F → proj×''₁ ⟦ F , Γ₀ ⟧f Γ
⟦⟧c-mon : {Γ : I.Con}{w w' : I.Con} → w -w-> w' → ⟦ Γ ⟧c w → ⟦ Γ ⟧c w'
⟦⟧c-mon s h = {!!}
q⁰ {I.ι} {Γ} h = h
q⁰ {A I.⇒ B} {Γ} h = I.lam (q⁰ {B} (h (I.πₚ¹ I.id) (u⁰ {A} (I.var I.pvzero))))
u⁰ {I.ι} {Γ} pf = pf
u⁰ {A I.⇒ B} {Γ} pf iq hF = u⁰ {B} (I.app (pf I.[ iq ]p) (q⁰ hF) )
q⁰ : {F : I.For} → {Γ : I.Con} → Pf ⟦ Γ ⟧c ⟦ F , Γ ⟧f → I.Pf Γ F
u⁰ : {F : I.For} → {Γ : I.Con} → I.Pf Γ F → Pf ⟦ Γ ⟧c ⟦ F , Γ ⟧f
u⁰ {I.ι} h w γ = {!!}
u⁰ {A I.⇒ B} h Γ' γ Γ'' iq hF = u⁰ {B} (I.app {A = A} h (q⁰ (λ Ξ γ' → {!hF!}))) {!!} γ --{Γ'} iq hF = u {F₁} (app {Γ'} {F} {F₁} (⊢tran iq h) (q hF))
q I.◇ w γ = I.ε
q (Γ I.▹ₚ A) w γ = (q Γ w (proj₁ γ) I.,ₚ q⁰ (proj₂ γ))
u I.◇ w σ = tt
u (Γ I.▹ₚ A) w σ = ⟨ (u Γ w (I.πₚ¹ σ)) , u⁰ (I.πₚ² σ) ⟩
q⁰ {I.ι} {Γ} h = h Γ {!!}
q⁰ {A I.⇒ B} {Γ} h = I.lam (q⁰ (λ w γ → {!h ? ? ? (I.πₚ¹ I.id)!})) --lam (q (h (retro (Preorder.refl≤ o)) (u {F} {F ∷ Γ} zero)))
u I.◇ Δ x = I.ε
u (Γ I.▹ₚ I.ι) Δ (Γu ,×p Au) = u Γ Δ Γu I.,ₚ Au
--u (Γ I.▹ₚ (A I.⇒ B)) Δ (Γu ,×p ABu) = (u Γ Δ Γu) I.,ₚ I.lam (I.πₚ² (u (Γ I.▹ₚ B) (Δ I.▹ₚ A) ({!!} ,×p {!!})))
u (Γ I.▹ₚ (A I.⇒ B)) Δ (Γu ,×p ABu) = (u Γ Δ Γu) I.,ₚ {!!}
q .I.◇ Δ I.ε = tt
q (Γ I.▹ₚ I.ι) Δ σ = (q Γ Δ (I.πₚ¹ σ)) ,×p I.πₚ² σ
q (Γ I.▹ₚ (A I.⇒ B)) Δ σ = (q Γ Δ (I.πₚ¹ σ)) ,×p {!!}
{-
u {Var x} h = h
u {F ⇒ F₁} h {Γ'} iq hF = u {F₁} (app {Γ'} {F} {F₁} (⊢tran iq h) (q hF))
u {F ∧∧ G} h = ⟨ (u {F} (ande₁ h)) , (u {G} (ande₂ h)) ⟩
u {} h = tt
q {Var x} h = neu⁰ h
q {F ⇒ F₁} {Γ} h = lam (q (h (retro (Preorder.refl≤ o)) (u {F} {F ∷ Γ} zero)))
q {F ∧∧ G} ⟨ hF , hG ⟩ = andi (q {F} hF) (q {G} hG)
q {} h = true
-}
ηu : TrNat (Morphism.m m) y
ηu = record { f = u }
ηq : TrNat y (Morphism.m m)
ηq : TrNat (Morphism.m m) y
ηq = record { f = q }
ηu : TrNat y (Morphism.m m)
ηu = record { f = u }
eq : ηu ∘TrNat ηq ≡ idTrNat
eq = {!!}
-- Transformation naturelle
\end{code}
-- Completeness proof
-- We first build our universal Kripke model
module ComplenessProof where
-- We have a model, we construct the Universal Presheaf model of this model
import ZOLInitial as I
eq = refl
\end{code}

View File

@ -61,13 +61,13 @@ module ZOLNormalization (PV : Set) where
u : {F : Form} {Γ : Con} Γ ⊢⁰ F Γ ⊩ᶠ F
u {Var x} h = h
u {F F₁} h {Γ'} iq hF = {!!}
u {F F₁} h {Γ'} iq hF = {!retro (Preorder.refl≤ o)!}
--u {F ⇒ F₁} h {Γ'} iq hF = u {F₁} (app {Γ'} {F} {F₁} (⊢tran iq h) (q hF))
u {F ∧∧ G} h = (u {F} (ande₁ h)) , (u {G} (ande₂ h))
u {} h = tt
q {Var x} h = neu⁰ h
q {F F₁} {Γ} h = lam (q (h (retro (Preorder.refl≤ o)) (u {F} {F Γ} zero)))
q {F F₁} {Γ} h = lam (q {F₁} (h (retro (Preorder.refl≤ o)) (u {F} {F Γ} zero)))
q {F ∧∧ G} hF , hG = andi (q {F} hF) (q {G} hG)
q {} h = true

View File

@ -28,3 +28,14 @@
title={Why is equality interesting?},
author={Ambrus Kaposi},
url={https://akaposi.github.io/pres_wld.pdf}}
@phdthesis{UemuraThesis2021,
title = {Abstract and concrete type theories},
isbn = {9789464213768},
url = {https://dare.uva.nl/search?identifier=41ff0b60-64d4-4003-8182-c244a9afab3b},
language = {en},
urldate = {2023-08-04},
publisher = {AmsterdamInstitute for Logic, Language and Computation},
author = {Uemura, T.},
year = {2021},
}

View File

@ -11,7 +11,6 @@
\\[1ex] and Thorsten Altenkirsch (University of Notthingham, United Kingdom)}
\begin{document}
\doparttoc
\maketitle
@ -33,9 +32,15 @@
Then, our goal is for each logic to prove the completeness of a specific class of models. Completeness can be stated as such: \enquote{For any formula that is \emph{true} in all models of the specified class, then the formula has a proof in the syntax}. By being true in the model, one can understand that the formula has a proof from the model.
\subsection{Motivation}
Ambrus is currently studying Second Order Generalized Algebraic Theories (or SOGAT) and he is trying to state a better definition than that first defined in Taichi Uemura's thesis \cite{UemuraThesis2021}. He also wants to write a paper with examples to show why they are useful, and adding some examples for different frameworks of logic can help with that.
\subsection{Structure of this report}
\section{A first account of Completeness and Normalization}
\subsection{Normalization for Propositional Logic}
\subsection{Propositional Logic as a SOGAT}
The first and most simple logical framework we can work with is that of Propositional Logic (refered as Zero Order Logic or ZOL in the code). We also have only one axiom rule for creating formulæ: the $\iota$ rule. Propositional Logic is usually done with a fixed set of propositional variables instead of only one that is fixed, but adding them does not make the construction more interesting, only more complicated.
In order to state all the definition, functions and more importantly, all the equalities that a model of Propositional Logic has to verify, we will write down Propositional Logic as a SOGAT. It goes as described in \autoref{fig:zol-sogat}.
\begin{figure}
\begin{tcolorbox}
\[
@ -53,6 +58,27 @@
\caption{ZOL Sogat Presentation}
\label{fig:zol-sogat}
\end{figure}
We can see that in this Sogat, we have two sorts (\For and \Pf), each of which have two constructors. Althrough Sogat can have equations in them, i won't use any in that report.
A keen eye may have seen that there is a problem with the \lam constructor. Its type is indeed not strictly positive (i.e. the type \Pf appears to the left of an arrow in the arguments of the constructor). That's why we use a ${}^+$ on the arrow, and we use the same ${}^+$ on the sort of \Pf. These arrow means that \Pf should be \emph{locally representable}. It basically means that we have to use \emph{proof variables} to implement this Sogat.
\subsection{From SOGAT to GAT}
\begin{tcolorbox}
\agda{agda/ZOL-4.tex}
\end{tcolorbox}
Unfortunately, Agda cannot understand SOGATs directly (yet). So we have to convert this SOGAT into a GAT. I will describe the process in this section, each line of the SOGAT giving birth to a set of sorts, constructors and equations in the GAT.
\begin{tcolorbox}
\begin{AgdaSuppressSpace}
%\agda{agda/ZOL-Con.tex}
\end{AgdaSuppressSpace}
\vspace{-5.5ex}
\end{tcolorbox}
\subsection{Normalization for Infinitary First Order Logic}
\begin{figure}
\begin{tcolorbox}

View File

@ -92,22 +92,23 @@
% Macros caractères spécifiques au document
\newcommand\Tm{\operatorname{Tm}}
\newcommand\Set{\operatorname{Set}}
\newcommand\For{\operatorname{For}}
\newcommand\Prop{\operatorname{Prop}}
\newcommand\Tm{\ensuremath{\operatorname{Tm}}}
\newcommand\Set{\AgdaPrimitive{Set}}
\newcommand\For{\ensuremath{\operatorname{For}}}
\newcommand\Prop{\AgdaPrimitive{Prop}}
\newcommand\R{\operatorname{R}}
\newcommand\lam{\operatorname{lam}}
\newcommand\lam{\ensuremath{\operatorname{lam}}}
\newcommand\app{\operatorname{app}}
\newcommand\foralli{\operatorname{\operatorname{\forall i}}}
\newcommand\foralle{\operatorname{\operatorname{\forall e}}}
\newcommand\Pf{\operatorname{Pf}\;}
\newcommand\Pf{\ensuremath{\operatorname{Pf}\;}}
\newcommand\bCon{\textbf{Con}}
\newcommand\bSet{\textbf{Set}}
\newcommand\bProp{\textbf{Prop}}
% Agda Config
\usepackage{agda}
%\AgdaNoSpaceAroundCode{}
\usepackage{newunicodechar}
\newunicodechar{}{\ensuremath{\mathnormal{\circ}}}
\newunicodechar{}{\ensuremath{\mathnormal{\equiv}}}
@ -124,6 +125,7 @@
\newunicodechar{ι}{\textiota}
\newunicodechar{π}{\textpi}
\newunicodechar{λ}{\textlambda}
\newunicodechar{}{\ensuremath{\ell}}
\newunicodechar{}{\ensuremath{\mathnormal{\triangleright}}}
\newunicodechar{}{\ensuremath{\mathnormal{\vdash}}}
\newunicodechar{}{\ensuremath{\mathnormal{\Rightarrow}}}