generated from rzk-lang/rzk-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split formalizations from seminar into proper files
- Loading branch information
Showing
5 changed files
with
208 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/1-foundations/3-sets-and-logic/02-propositions-as-types.rzk copy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Propositions as types? | ||
|
||
This is a literate Rzk file: | ||
|
||
```rzk | ||
#lang rzk-1 | ||
``` |
41 changes: 41 additions & 0 deletions
41
src/1-foundations/3-sets-and-logic/03-mere-propositions.rzk.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Mere propositions | ||
|
||
This is a literate Rzk file: | ||
|
||
```rzk | ||
#lang rzk-1 | ||
``` | ||
|
||
This module assumes function extensionality: | ||
|
||
```rzk | ||
#assume funext : FunExt | ||
``` | ||
|
||
!!! note "Definition 3.3.1" | ||
|
||
A type $P$ is a __mere proposition__ if for all $x, y : P$ we have $x = y$. | ||
|
||
```rzk | ||
#define isProp | ||
( A : U) | ||
: U | ||
:= (x : A) → (y : A) → x = y | ||
``` | ||
|
||
## Examples | ||
|
||
```rzk | ||
#define isProp-Unit | ||
: isProp Unit | ||
:= \ unit unit → refl | ||
``` | ||
|
||
```rzk | ||
#define isProp-function uses (funext) | ||
( A : U) | ||
( B : A → U) | ||
( isProp-B : (a : A) → isProp (B a)) | ||
: isProp ((a : A) → B a) | ||
:= \ f g → map-funext funext A B f g (\ a → isProp-B a (f a) (g a)) | ||
``` |
33 changes: 33 additions & 0 deletions
33
src/1-foundations/3-sets-and-logic/11-contractibility.rzk.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Contractibility | ||
|
||
This is a literate Rzk file: | ||
|
||
```rzk | ||
#lang rzk-1 | ||
``` | ||
|
||
!!! note "Definition 3.11.1" | ||
|
||
A type $A$ is __contractible__, or a __singleton__, | ||
if there is $a : A$, called the __center of contraction__, | ||
such that $a = x$ for all $x : A$. | ||
We denote the specified path $a = x$ by $\mathsf{contr}_{x}$. | ||
|
||
```rzk | ||
#define isContr | ||
( A : U) | ||
: U | ||
:= Σ (a : A) , (x : A) → a = x | ||
#define center | ||
( A : U) | ||
: isContr A → A | ||
:= \ (a , _) → a | ||
#define contr | ||
( A : U) | ||
( isContr-A : isContr A) | ||
( x : A) | ||
: center A isContr-A = x | ||
:= second isContr-A x | ||
``` |
Oops, something went wrong.