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

A constructive Cantor–Schröder–Bernstein theorem #1206

Draft
wants to merge 80 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
71282b5
move some lemmas for decidable dependent types
fredrik-bakke Oct 18, 2024
39535e4
edits
fredrik-bakke Oct 19, 2024
7dd26b3
additions double negation elimination
fredrik-bakke Oct 19, 2024
c96818b
Knaster–Tarski fixed point theorem for suplattices
fredrik-bakke Oct 19, 2024
478a321
pre-commit
fredrik-bakke Oct 19, 2024
76af929
inflattices
fredrik-bakke Oct 19, 2024
a2b91a5
Knaster–Tarski fixed point theorem for inflattices
fredrik-bakke Oct 19, 2024
2931aa2
edits
fredrik-bakke Oct 19, 2024
ebe30a4
imrpove proof `is-decidable-prop-Σ`
fredrik-bakke Oct 19, 2024
d6a81a3
edits
fredrik-bakke Oct 19, 2024
1fa059d
double negation eliminating
fredrik-bakke Oct 20, 2024
b40c770
wip double negation stable embeddings
fredrik-bakke Oct 20, 2024
c8d64e6
wip double negation stable embeddings
fredrik-bakke Oct 20, 2024
215cff5
wip double negation stable embeddings
fredrik-bakke Oct 20, 2024
06c3ca7
just edits
fredrik-bakke Oct 20, 2024
d06ea12
constructive analysis of perfect images
fredrik-bakke Oct 20, 2024
34a45e7
`untruncated-double-negation-elimination` -> `double-negation-elimina…
fredrik-bakke Oct 20, 2024
109c026
Composition of double negation eliminating maps
fredrik-bakke Oct 20, 2024
488c9ba
double negation stable subtypes
fredrik-bakke Oct 20, 2024
ac08a78
Cantor's theorem for double negation
fredrik-bakke Oct 20, 2024
6d05ab9
minor fixes
fredrik-bakke Oct 20, 2024
4524c35
some order theory
fredrik-bakke Oct 20, 2024
bab6557
some order theory on powersets
fredrik-bakke Oct 20, 2024
3e81207
pre-commit
fredrik-bakke Oct 20, 2024
1148b00
wip constructive csbe
fredrik-bakke Oct 20, 2024
801f7a1
Merge branch 'master' into csbe
fredrik-bakke Oct 20, 2024
bbc3136
pre-commit
fredrik-bakke Oct 20, 2024
a477494
edits dne
fredrik-bakke Oct 20, 2024
8c93ca3
fixes double negation stable embeddings
fredrik-bakke Oct 20, 2024
30acb17
fix
fredrik-bakke Oct 20, 2024
e942157
some additional opposites
fredrik-bakke Oct 20, 2024
b10fd18
more edits order theory
fredrik-bakke Oct 20, 2024
2ca4c2a
fix
fredrik-bakke Oct 20, 2024
91b4174
fix links
fredrik-bakke Oct 21, 2024
2ec613b
informal proof constructive csbe
fredrik-bakke Oct 21, 2024
f99c780
Double negation elimination is irrefutable
fredrik-bakke Oct 21, 2024
bce6686
wip logic
fredrik-bakke Oct 25, 2024
fb35a57
wip logic
fredrik-bakke Oct 25, 2024
773cea5
wip logic
fredrik-bakke Oct 25, 2024
37fc00e
dcpos
fredrik-bakke Oct 27, 2024
7b20895
edits
fredrik-bakke Oct 29, 2024
654571b
composition of decidable maps
fredrik-bakke Oct 29, 2024
2da0b76
a bunch of logic
fredrik-bakke Nov 1, 2024
d902d66
wip resizing orders
fredrik-bakke Nov 1, 2024
1e6e8bc
more lemmas about de morgan embeddings
fredrik-bakke Nov 1, 2024
2b169b1
propositional resizing
fredrik-bakke Nov 2, 2024
0bfd3c1
resizing suplattices
fredrik-bakke Nov 2, 2024
6806b9e
pre-commit
fredrik-bakke Nov 2, 2024
f603862
supremum preserving maps posets
fredrik-bakke Nov 2, 2024
3f4940e
deduplicate domain theory
fredrik-bakke Nov 2, 2024
43baf83
lemmas supremum preserving maps of posets
fredrik-bakke Nov 2, 2024
291cde7
Reindexing directed families in a poset
fredrik-bakke Nov 2, 2024
2d4fde2
scott continuous maps of posets
fredrik-bakke Nov 2, 2024
d921b43
complements of double negation stable subtypes
fredrik-bakke Nov 2, 2024
5276bcc
old wip constructive csb
fredrik-bakke Nov 2, 2024
ab02816
fixes cantor's theorem de morgan
fredrik-bakke Nov 2, 2024
15d990a
remove allow unsolved metas
fredrik-bakke Nov 2, 2024
f168e29
beginnings Kleene's fixed point theorem
fredrik-bakke Nov 2, 2024
2e9a891
complements of de morgan subtypes
fredrik-bakke Nov 2, 2024
366d922
de morgan disjunctions
fredrik-bakke Nov 3, 2024
060b6ad
inhabited chains
fredrik-bakke Nov 3, 2024
f366bf9
wip
fredrik-bakke Nov 3, 2024
36fc5f3
ω-Continuous maps preserve order
fredrik-bakke Nov 4, 2024
59ead07
a little renaming
fredrik-bakke Nov 4, 2024
f7a2351
kleene's fixed point construction
fredrik-bakke Nov 4, 2024
0f3aa23
finish Kleene's fixed point theorem for posets
fredrik-bakke Nov 4, 2024
16edf8d
Kleene's fixed point theorem for ω-complete posets
fredrik-bakke Nov 4, 2024
461d6c2
pre-commit
fredrik-bakke Nov 4, 2024
91c0cc5
Markov's principle
fredrik-bakke Nov 4, 2024
328087e
finitary De Morgan's law
fredrik-bakke Nov 5, 2024
0b9ea90
some wording kleene's fixed point theorem
fredrik-bakke Nov 5, 2024
5b54ec7
`is-decidable-map-section`
fredrik-bakke Nov 6, 2024
ce4bb00
fix a reference
fredrik-bakke Nov 18, 2024
e66ea7d
some additions to logic
fredrik-bakke Nov 18, 2024
e68907d
edits
fredrik-bakke Nov 18, 2024
4324b4a
Merge branch 'master' into csbe
fredrik-bakke Nov 18, 2024
679d03e
Merge remote-tracking branch 'upstream/master' into csbe
fredrik-bakke Jan 15, 2025
059ad59
fix merge issues
fredrik-bakke Jan 15, 2025
6328de8
cantor-schrøder-bernstein-WLPO
fredrik-bakke Jan 15, 2025
75aa9a2
edit
fredrik-bakke Jan 15, 2025
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
13 changes: 13 additions & 0 deletions src/foundation-core/contractible-maps.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ open import foundation-core.homotopies
open import foundation-core.identity-types
open import foundation-core.retractions
open import foundation-core.sections
open import foundation-core.torsorial-type-families
```

</details>
Expand Down Expand Up @@ -134,6 +135,18 @@ module _
is-contr-map-is-coherently-invertible ∘ is-coherently-invertible-is-equiv
```

### The identity function is contractible

```agda
module _
{l1 : Level} {A : UU l1}
where

abstract
is-contr-map-id : is-contr-map (id {A = A})
is-contr-map-id = is-torsorial-Id'
```

## See also

- For the notion of biinvertible maps see
Expand Down
83 changes: 83 additions & 0 deletions src/foundation-core/decidable-propositions.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ open import foundation.negation
open import foundation.propositional-truncations
open import foundation.transport-along-identifications
open import foundation.unit-type
open import foundation.universal-property-empty-type
open import foundation.universe-levels

open import foundation-core.cartesian-product-types
Expand Down Expand Up @@ -224,6 +225,16 @@ module _
is-decidable-prop-Σ : is-decidable-prop (Σ P Q)
is-decidable-prop-Σ =
( is-prop-is-decidable-prop-Σ , is-decidable-is-decidable-prop-Σ)

Σ-Decidable-Prop :
{l1 l2 : Level} →
(P : Decidable-Prop l1) →
(type-Decidable-Prop P → Decidable-Prop l2) → Decidable-Prop (l1 ⊔ l2)
Σ-Decidable-Prop P Q =
( Σ (type-Decidable-Prop P) (type-Decidable-Prop ∘ Q) ,
is-decidable-prop-Σ
( is-decidable-prop-type-Decidable-Prop P)
( is-decidable-prop-type-Decidable-Prop ∘ Q))
```

### The negation operation on decidable propositions
Expand Down Expand Up @@ -251,6 +262,78 @@ type-neg-Decidable-Prop :
type-neg-Decidable-Prop P = type-Decidable-Prop (neg-Decidable-Prop P)
```

### Function types between decidable propositions

```agda
module _
{l1 l2 : Level} {P : UU l1} {Q : UU l2}
where

is-decidable-prop-function-type' :
is-decidable P → (P → is-decidable-prop Q) → is-decidable-prop (P → Q)
is-decidable-prop-function-type' H K =
( rec-coproduct
( λ p → is-prop-function-type (is-prop-type-is-decidable-prop (K p)))
( λ np → is-prop-is-contr (universal-property-empty-is-empty P np Q))
( H)) ,
( is-decidable-function-type' H (is-decidable-type-is-decidable-prop ∘ K))

is-decidable-prop-function-type :
is-decidable P → is-decidable-prop Q → is-decidable-prop (P → Q)
is-decidable-prop-function-type H K =
( is-prop-function-type (is-prop-type-is-decidable-prop K)) ,
( is-decidable-function-type H (is-decidable-type-is-decidable-prop K))

hom-Decidable-Prop :
{l1 l2 : Level} →
Decidable-Prop l1 → Decidable-Prop l2 → Decidable-Prop (l1 ⊔ l2)
hom-Decidable-Prop P Q =
( type-Decidable-Prop P → type-Decidable-Prop Q) ,
( is-decidable-prop-function-type
( is-decidable-Decidable-Prop P)
( is-decidable-prop-type-Decidable-Prop Q))
```

### Dependent products of decidable propositions

```agda
module _
{l1 l2 : Level} {P : UU l1} {Q : P → UU l2}
where

is-decidable-Π-is-decidable-prop :
is-decidable-prop P →
((x : P) → is-decidable-prop (Q x)) →
is-decidable ((x : P) → Q x)
is-decidable-Π-is-decidable-prop H K =
rec-coproduct
( λ x →
rec-coproduct
( λ y →
inl (λ x' → tr Q (eq-is-prop (is-prop-type-is-decidable-prop H)) y))
( λ ny → inr (λ f → ny (f x)))
( is-decidable-type-is-decidable-prop (K x)))
( λ nx → inl (λ x' → ex-falso (nx x')))
( is-decidable-type-is-decidable-prop H)

is-decidable-prop-Π :
is-decidable-prop P →
((x : P) → is-decidable-prop (Q x)) →
is-decidable-prop ((x : P) → Q x)
is-decidable-prop-Π H K =
( is-prop-Π (is-prop-type-is-decidable-prop ∘ K)) ,
( is-decidable-Π-is-decidable-prop H K)

Π-Decidable-Prop :
{l1 l2 : Level} (P : Decidable-Prop l1) →
(type-Decidable-Prop P → Decidable-Prop l2) → Decidable-Prop (l1 ⊔ l2)
Π-Decidable-Prop P Q =
( (x : type-Decidable-Prop P) → type-Decidable-Prop (Q x)) ,
( is-decidable-prop-Π
( is-decidable-prop-type-Decidable-Prop P)
( is-decidable-prop-type-Decidable-Prop ∘ Q))
```

### Decidability of a propositional truncation

```agda
Expand Down
3 changes: 3 additions & 0 deletions src/foundation.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ open import foundation.binary-transport public
open import foundation.binary-type-duality public
open import foundation.booleans public
open import foundation.cantor-schroder-bernstein-escardo public
open import foundation.cantor-schroder-bernstein-wlpo public
open import foundation.cantors-theorem public
open import foundation.cartesian-morphisms-arrows public
open import foundation.cartesian-morphisms-span-diagrams public
Expand Down Expand Up @@ -89,6 +90,7 @@ open import foundation.connected-types public
open import foundation.constant-maps public
open import foundation.constant-span-diagrams public
open import foundation.constant-type-families public
open import foundation.constructive-cantor-schroder-bernstein public
open import foundation.continuations public
open import foundation.contractible-maps public
open import foundation.contractible-types public
Expand Down Expand Up @@ -229,6 +231,7 @@ open import foundation.identity-systems public
open import foundation.identity-truncated-types public
open import foundation.identity-types public
open import foundation.images public
open import foundation.images-embeddings public
open import foundation.images-subtypes public
open import foundation.implicit-function-types public
open import foundation.impredicative-encodings public
Expand Down
39 changes: 6 additions & 33 deletions src/foundation/booleans.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ module foundation.booleans where
<details><summary>Imports</summary>

```agda
open import foundation.decidable-equality
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.discrete-types
open import foundation.involutions
open import foundation.negated-equality
open import foundation.raising-universe-levels
Expand Down Expand Up @@ -196,30 +193,18 @@ abstract
( λ x y → eq-Eq-bool)

bool-Set : Set lzero
bool-Set = bool , is-set-bool
```

### The booleans have decidable equality

```agda
has-decidable-equality-bool : has-decidable-equality bool
has-decidable-equality-bool true true = inl refl
has-decidable-equality-bool true false = inr neq-true-false-bool
has-decidable-equality-bool false true = inr neq-false-true-bool
has-decidable-equality-bool false false = inl refl

bool-Discrete-Type : Discrete-Type lzero
bool-Discrete-Type = bool , has-decidable-equality-bool
pr1 bool-Set = bool
pr2 bool-Set = is-set-bool
```

### The "is true" predicate on booleans

```agda
is-true : bool → UU lzero
is-true = _= true
is-true = Eq-bool true

is-prop-is-true : (b : bool) → is-prop (is-true b)
is-prop-is-true b = is-set-bool b true
is-prop-is-true = is-prop-Eq-bool true

is-true-Prop : bool → Prop lzero
is-true-Prop b = is-true b , is-prop-is-true b
Expand All @@ -229,27 +214,15 @@ is-true-Prop b = is-true b , is-prop-is-true b

```agda
is-false : bool → UU lzero
is-false = _= false
is-false = Eq-bool false

is-prop-is-false : (b : bool) → is-prop (is-false b)
is-prop-is-false b = is-set-bool b false
is-prop-is-false = is-prop-Eq-bool false

is-false-Prop : bool → Prop lzero
is-false-Prop b = is-false b , is-prop-is-false b
```

### A boolean cannot be both true and false

```agda
not-is-false-is-true : (x : bool) → is-true x → ¬ (is-false x)
not-is-false-is-true true t ()
not-is-false-is-true false () f

not-is-true-is-false : (x : bool) → is-false x → ¬ (is-true x)
not-is-true-is-false true () f
not-is-true-is-false false t ()
```

### The type of booleans is equivalent to `Fin 2`

```agda
Expand Down
Loading
Loading