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

Cleanup of @spcfox's modal logic pull request #1170

Draft
wants to merge 68 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
8a92a52
first syntax and semantics draft
spcfox Oct 1, 2023
63b0e15
add soundness
spcfox Oct 8, 2023
5f89c97
- Change Hilbert system
spcfox Oct 8, 2023
49f2cf6
Kripke fram should be not empty
spcfox Oct 8, 2023
517fc91
Refactor soundness
spcfox Oct 8, 2023
6053173
Add finite model
spcfox Oct 9, 2023
d1744d9
simplify finite-is-classical proof
spcfox Oct 9, 2023
1f8f53f
- Rewrite valuate to Propositions
spcfox Oct 22, 2023
661adc6
Small fixes, and refactor kripke-frame
spcfox Oct 22, 2023
3b3ba68
Refactor modal logic
spcfox Oct 22, 2023
957e112
- Refactor
spcfox Oct 23, 2023
341456a
Change operators levels and associativity
spcfox Oct 23, 2023
9db88ca
Refactor universe levels
spcfox Oct 23, 2023
30056ba
Small fixes
spcfox Oct 23, 2023
0d22369
Refactor
spcfox Oct 23, 2023
21d74ce
Add logics as sets of formulas
spcfox Oct 26, 2023
8ecf60e
Remove old K definition
spcfox Oct 26, 2023
bb2f31b
Fix index file
spcfox Oct 26, 2023
41d20ab
Add K soundness
spcfox Oct 26, 2023
03d2142
Refactor kripke-models
spcfox Oct 27, 2023
88cb89f
Add finite models
spcfox Oct 27, 2023
ef73d85
Experiments with axioms definitions
spcfox Oct 28, 2023
28fc80e
Add completeness definition
spcfox Oct 29, 2023
2ddac8e
Refactor axioms
spcfox Nov 6, 2023
e17134d
Add uncompleted proof of completeness K
spcfox Nov 10, 2023
c1ae1ff
Run pre-commit
spcfox Nov 10, 2023
b358d85
Proof canonical model theorem
spcfox Feb 5, 2024
9e3bb01
fix pre-commit
spcfox Feb 5, 2024
fd1cc31
Prove the second point of canonical model theorem
spcfox Feb 6, 2024
39bccd5
Prove completeness K
spcfox Feb 6, 2024
200901a
fix renamed functions
spcfox Feb 14, 2024
77f1901
fix pre-commit
spcfox Feb 14, 2024
f31d02d
Small refactor and add canonical axioms
spcfox Mar 25, 2024
eb31291
Add S5 soundness and refactor kripke-frame
spcfox Mar 27, 2024
0e1fd0e
Proof completeness of S5
spcfox Mar 29, 2024
b019f5b
Add filtrations and finite approximability
spcfox Apr 5, 2024
f41eaff
Rename map-list to dependent-map-list
spcfox Apr 6, 2024
53eb3bf
Small fixes
spcfox Apr 30, 2024
e51080a
Refactor weak-deduction and L-complete theories
spcfox May 2, 2024
317fd29
Refactor Lindanbaum's lemma
spcfox May 3, 2024
998bd15
Remove old code from weak-deduction
spcfox May 3, 2024
8d29db3
Refactor canonical kripke model
spcfox May 3, 2024
02b75b6
Refactor canonical model theorem
spcfox May 5, 2024
7696793
Fix types in filtrations
spcfox May 5, 2024
89951d2
Remove upper characters from file names
spcfox May 5, 2024
c60b49b
Make pre-commit one more time
spcfox May 5, 2024
706ff33
Refactor after rebase
spcfox May 5, 2024
424667a
Small refactor filtrations
spcfox May 5, 2024
873449a
Refactor subtypes
spcfox May 5, 2024
4111374
Refactor formulas and module names
spcfox May 5, 2024
662bc0f
Refactor var
spcfox May 5, 2024
29eed33
Fix filtration lemma and deduction theorem
spcfox May 5, 2024
b2d85c4
Fix filtratiom lemma file name
spcfox May 5, 2024
294ae82
Add recurser for equivalence classes and refactor
spcfox May 5, 2024
b978ed1
Prove inductor for equivalence classes
spcfox May 6, 2024
e44f24f
Replace zorn lemma in canonical model theorem
spcfox May 7, 2024
081aa53
Refactor kripke semantics
spcfox May 8, 2024
0df9fd4
Fix filtration definition
spcfox May 9, 2024
3555784
Complete eliminators for equivalence class
spcfox May 11, 2024
e1bc75f
Refactor finite approximability
spcfox May 16, 2024
a9d4e80
Refactor
spcfox May 25, 2024
2cc2b80
Refactor filtrations
spcfox May 31, 2024
ba35873
Fix import in finite-approximability
spcfox May 31, 2024
a3e78f7
working on Viktor's pull request
EgbertRijke Aug 27, 2024
ac7925a
comp-injection
EgbertRijke Aug 27, 2024
28b576d
contraposition
EgbertRijke Aug 27, 2024
ab01d8d
dependent reflecting maps for equivalence relations
EgbertRijke Aug 28, 2024
2f1f6b4
work on dependent universal property of set quotients
EgbertRijke Aug 29, 2024
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
5 changes: 5 additions & 0 deletions CONTRIBUTORS.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,8 @@ github = "UlrikBuchholtz"
displayName = "Garrett Figueroa"
usernames = [ "Garrett Figueroa", "djspacewhale" ]
github = "djspacewhale"

[[contributors]]
displayName = "Viktor Yudov"
usernames = [ "Viktor Yudov" ]
github = "spcfox"
14 changes: 13 additions & 1 deletion src/foundation-core/decidable-propositions.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ open import foundation.coproduct-types
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.double-negation
open import foundation.empty-types
open import foundation.equivalences
open import foundation.logical-equivalences
open import foundation.negation
open import foundation.propositional-truncations
open import foundation.small-types
open import foundation.unit-type
open import foundation.universe-levels

open import foundation-core.cartesian-product-types
open import foundation-core.empty-types
open import foundation-core.function-types
open import foundation-core.functoriality-dependent-pair-types
open import foundation-core.propositions
Expand Down Expand Up @@ -189,3 +192,12 @@ is-merely-decidable-is-decidable-trunc-Prop A (inl x) =
is-merely-decidable-is-decidable-trunc-Prop A (inr f) =
unit-trunc-Prop (inr (f ∘ unit-trunc-Prop))
```

### Any decidable proposition is small with respect to any universe level

```agda
is-small-is-decidable-prop :
{l1 : Level} (l2 : Level) (A : UU l1) → is-decidable-prop A → is-small l2 A
is-small-is-decidable-prop l2 A (H , inl a) = is-small-is-contr l2 (is-proof-irrelevant-is-prop H a)
is-small-is-decidable-prop l2 A (H , inr f) = is-small-is-empty l2 f
```
16 changes: 16 additions & 0 deletions src/foundation-core/injective-maps.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ is-injective {l1} {l2} {A} {B} f = {x y : A} → f x = f y → x = y

injection : {l1 l2 : Level} (A : UU l1) (B : UU l2) → UU (l1 ⊔ l2)
injection A B = Σ (A → B) is-injective

module _
{l1 l2 : Level} {A : UU l1} {B : UU l2} (f : injection A B)
where

map-injection : A → B
map-injection = pr1 f

is-injective-injection : is-injective map-injection
is-injective-injection = pr2 f
```

## Examples
Expand Down Expand Up @@ -90,6 +100,12 @@ module _
is-injective h → is-injective g → is-injective (g ∘ h)
is-injective-comp is-inj-h is-inj-g = is-inj-h ∘ is-inj-g

injection-comp :
injection B C → injection A B → injection A C
pr1 (injection-comp g f) = map-injection g ∘ map-injection f
pr2 (injection-comp g f) =
is-injective-comp (is-injective-injection f) (is-injective-injection g)

is-injective-left-map-triangle :
(f : A → C) (g : B → C) (h : A → B) → f ~ (g ∘ h) →
is-injective h → is-injective g → is-injective f
Expand Down
19 changes: 19 additions & 0 deletions src/foundation-core/small-types.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ open import foundation.universe-levels
open import foundation-core.cartesian-product-types
open import foundation-core.contractible-types
open import foundation-core.coproduct-types
open import foundation.empty-types
open import foundation.function-types
open import foundation-core.functoriality-dependent-pair-types
open import foundation-core.identity-types
open import foundation-core.propositions
Expand Down Expand Up @@ -202,6 +204,23 @@ is-small-unit : {l : Level} → is-small l unit
is-small-unit = is-small-is-contr _ is-contr-unit
```

### Any empty type is small with respect to any universe

```agda
is-small-is-empty :
(l : Level) {l1 : Level} {A : UU l1} → is-empty A → is-small l A
pr1 (is-small-is-empty l H) = raise-empty l
pr2 (is-small-is-empty l H) = equiv-is-empty H is-empty-raise-empty
```

### The empty type is small with respect to any universe

```agda
is-small-empty :
(l : Level) → is-small l empty
is-small-empty l = is-small-is-empty l id
```

### Small types are closed under dependent pair types

```agda
Expand Down
1 change: 1 addition & 0 deletions src/foundation.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ open import foundation.binary-homotopies public
open import foundation.binary-operations-unordered-pairs-of-types public
open import foundation.binary-reflecting-maps-equivalence-relations public
open import foundation.binary-relations public
open import foundation.transitive-closures-binary-relations public
open import foundation.binary-relations-with-extensions public
open import foundation.binary-relations-with-lifts public
open import foundation.binary-transport public
Expand Down
10 changes: 10 additions & 0 deletions src/foundation/decidable-types.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,13 @@ module _
is-decidable-raise (inl p) = inl (map-raise p)
is-decidable-raise (inr np) = inr (λ p' → np (map-inv-raise p'))
```

### If `Q` is a decidable type, then any implication `P → Q` can be proven by contraposition

```agda
contraposition-is-decidable :
{l1 l2 : Level} {P : UU l1} {Q : UU l2} →
is-decidable Q → (¬ Q → ¬ P) → P → Q
contraposition-is-decidable (inl q) f p = q
contraposition-is-decidable (inr nq) f p = ex-falso (f nq p)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
# Dependent reflecting maps for equivalence relations

```agda
module foundation.dependent-reflecting-maps-equivalence-relations where
```

<details><summary>Imports</summary>

```agda
open import foundation.dependent-pair-types
open import foundation.equality-dependent-pair-types
open import foundation.functoriality-dependent-function-types
open import foundation.functoriality-dependent-pair-types
open import foundation.fundamental-theorem-of-identity-types
open import foundation.homotopy-induction
open import foundation.reflecting-maps-equivalence-relations
open import foundation.subtype-identity-principle
open import foundation.type-arithmetic-dependent-pair-types
open import foundation.type-theoretic-principle-of-choice
open import foundation.universe-levels

open import foundation-core.dependent-identifications
open import foundation-core.equivalence-relations
open import foundation-core.equivalences
open import foundation-core.function-types
open import foundation-core.homotopies
open import foundation-core.identity-types
open import foundation-core.propositions
open import foundation-core.sets
open import foundation-core.torsorial-type-families
```

</details>

## Idea

Consider a type `A` equipped with an [equivalence relation](foundation.equivalence-relations.md) `R`, and consider a [reflecting map](foundation.reflecting-maps-equivalence-relations.md) `f : A → B` with

```text
ρ : {x y : A} → R x y → f x = f y.
```

Furthermore, consider a type family `C` over `B`. A dependent function `g : (x : A) → C (f x)` is said to be a {{#concept "dependent reflecting map" Disambiguation="equivalence relations" Agda=reflecting-map-equivalence-relation}} if we there is a [dependent identification](foundation-core.dependent-identifications.md) `dependent-identification C (ρ r) (g x) (g y)` for every `r : R x y` and every `x y : A`.

## Definitions

### The predicate of being a dependent reflecting map

```agda
module _
{l1 l2 l3 : Level} {A : UU l1} (R : equivalence-relation l2 A)
{B : UU l3} (f : reflecting-map-equivalence-relation R B)
where

is-dependent-reflecting-map-equivalence-relation :
{l4 : Level} (C : B → UU l4) →
((x : A) → C (map-reflecting-map-equivalence-relation R f x)) →
UU (l1 ⊔ l2 ⊔ l4)
is-dependent-reflecting-map-equivalence-relation C g =
{x y : A} (r : sim-equivalence-relation R x y) →
dependent-identification C
( reflects-map-reflecting-map-equivalence-relation R f r)
( g x)
( g y)
```

### Dependent reflecting maps

```agda
module _
{l1 l2 l3 l4 : Level} {A : UU l1} (R : equivalence-relation l2 A)
{B : UU l3} (f : reflecting-map-equivalence-relation R B)
(C : B → UU l4)
where

dependent-reflecting-map-equivalence-relation : UU (l1 ⊔ l2 ⊔ l4)
dependent-reflecting-map-equivalence-relation =
Σ ( (x : A) → C (map-reflecting-map-equivalence-relation R f x))
( is-dependent-reflecting-map-equivalence-relation R f C)

map-dependent-reflecting-map-equivalence-relation :
dependent-reflecting-map-equivalence-relation →
(x : A) → C (map-reflecting-map-equivalence-relation R f x)
map-dependent-reflecting-map-equivalence-relation = pr1

reflects-map-dependent-reflecting-map-equivalence-relation :
(g : dependent-reflecting-map-equivalence-relation) →
is-dependent-reflecting-map-equivalence-relation R f C
( map-dependent-reflecting-map-equivalence-relation g)
reflects-map-dependent-reflecting-map-equivalence-relation = pr2
```

## Properties

### Being a dependent reflecting map into a family of sets is a proposition

```agda
module _
{l1 l2 l3 l4 : Level} {A : UU l1} (R : equivalence-relation l2 A)
{B : UU l3} (f : reflecting-map-equivalence-relation R B)
(C : B → Set l4)
(g : (x : A) → type-Set (C (map-reflecting-map-equivalence-relation R f x)))
where

is-prop-is-dependent-reflecting-map-equivalence-relation :
is-prop
( is-dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C) g)
is-prop-is-dependent-reflecting-map-equivalence-relation =
is-prop-implicit-Π
( λ x →
is-prop-implicit-Π
( λ y → is-prop-Π (λ r → is-set-type-Set (C _) _ _)))

is-dependent-reflecting-map-prop-equivalence-relation :
Prop (l1 ⊔ l2 ⊔ l4)
pr1 is-dependent-reflecting-map-prop-equivalence-relation =
is-dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C) g
pr2 is-dependent-reflecting-map-prop-equivalence-relation =
is-prop-is-dependent-reflecting-map-equivalence-relation
```

### Characterizing the identity type of dependent reflecting maps into families of sets

```agda
module _
{l1 l2 l3 l4 : Level} {A : UU l1} (R : equivalence-relation l2 A)
{B : UU l3} (f : reflecting-map-equivalence-relation R B)
(C : B → Set l4)
(g : dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C))
where

htpy-dependent-reflecting-map-equivalence-relation :
(h : dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C)) →
UU (l1 ⊔ l4)
htpy-dependent-reflecting-map-equivalence-relation h =
map-dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C) g ~
map-dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C) h

refl-htpy-dependent-reflecting-map-equivalence-relation :
htpy-dependent-reflecting-map-equivalence-relation g
refl-htpy-dependent-reflecting-map-equivalence-relation = refl-htpy

htpy-eq-dependent-reflecting-map-equivalence-relation :
(h : dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C)) →
g = h → htpy-dependent-reflecting-map-equivalence-relation h
htpy-eq-dependent-reflecting-map-equivalence-relation h refl =
refl-htpy-dependent-reflecting-map-equivalence-relation

is-torsorial-htpy-dependent-reflecting-map-equivalence-relation :
is-torsorial htpy-dependent-reflecting-map-equivalence-relation
is-torsorial-htpy-dependent-reflecting-map-equivalence-relation =
is-torsorial-Eq-subtype
( is-torsorial-htpy
( map-dependent-reflecting-map-equivalence-relation R f
( type-Set ∘ C)
( g)))
( is-prop-is-dependent-reflecting-map-equivalence-relation R f C)
( map-dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C) g)
( refl-htpy)
( reflects-map-dependent-reflecting-map-equivalence-relation R f
( type-Set ∘ C)
( g))

is-equiv-htpy-eq-dependent-reflecting-map-equivalence-relation :
(h : dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C)) →
is-equiv (htpy-eq-dependent-reflecting-map-equivalence-relation h)
is-equiv-htpy-eq-dependent-reflecting-map-equivalence-relation =
fundamental-theorem-id
is-torsorial-htpy-dependent-reflecting-map-equivalence-relation
htpy-eq-dependent-reflecting-map-equivalence-relation

extensionality-dependent-reflecting-map-equivalence-relation :
(h : dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C)) →
(g = h) ≃ htpy-dependent-reflecting-map-equivalence-relation h
pr1 (extensionality-dependent-reflecting-map-equivalence-relation h) =
htpy-eq-dependent-reflecting-map-equivalence-relation h
pr2 (extensionality-dependent-reflecting-map-equivalence-relation h) =
is-equiv-htpy-eq-dependent-reflecting-map-equivalence-relation h

eq-htpy-dependent-reflecting-map-equivalence-relation :
(h : dependent-reflecting-map-equivalence-relation R f (type-Set ∘ C)) →
htpy-dependent-reflecting-map-equivalence-relation h → g = h
eq-htpy-dependent-reflecting-map-equivalence-relation h =
map-inv-is-equiv
( is-equiv-htpy-eq-dependent-reflecting-map-equivalence-relation h)
```

### The type of dependent reflecting maps into a family `C` is equivalent to the type of reflecting maps into `Σ B C` that give `f` after composing with the first projection

```agda
module _
{l1 l2 l3 l4 : Level} {A : UU l1} (R : equivalence-relation l2 A)
{B : UU l3} (f : reflecting-map-equivalence-relation R B)
{C : B → UU l4}
where

map-compute-dependent-reflecting-map-equivalence-relation :
dependent-reflecting-map-equivalence-relation R f C →
Σ ( reflecting-map-equivalence-relation R (Σ B C))
( λ g →
pr1 ∘ map-reflecting-map-equivalence-relation R g ~
map-reflecting-map-equivalence-relation R f)
pr1 (pr1 (map-compute-dependent-reflecting-map-equivalence-relation g)) x =
( map-reflecting-map-equivalence-relation R f x ,
map-dependent-reflecting-map-equivalence-relation R f C g x)
pr2 (pr1 (map-compute-dependent-reflecting-map-equivalence-relation g)) r =
eq-pair-Σ
( reflects-map-reflecting-map-equivalence-relation R f r)
( reflects-map-dependent-reflecting-map-equivalence-relation R f C g r)
pr2 (map-compute-dependent-reflecting-map-equivalence-relation g) =
refl-htpy

compute-dependent-reflecting-map-equivalence-relation :
Σ ( reflecting-map-equivalence-relation R (Σ B C))
( λ g →
pr1 ∘ map-reflecting-map-equivalence-relation R g ~
map-reflecting-map-equivalence-relation R f) ≃
dependent-reflecting-map-equivalence-relation R f C
compute-dependent-reflecting-map-equivalence-relation =
{!!} ∘e
( equiv-Σ _
( inv-distributive-Π-Σ)
( λ t → {!equiv-implicit-Π!})) ∘e
( equiv-right-swap-Σ)
```

## See also

- [Reflecting maps](foundation.reflecting-maps-equivalence-relations.md)
Loading