Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
personoj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
koizel
personoj
Commits
70173b00
Commit
70173b00
authored
4 years ago
by
hondet
Browse files
Options
Downloads
Patches
Plain Diff
examples for proof irrelevance, refl eq
parent
03747b58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
encodings/bool_hol.lp
+7
-2
7 additions, 2 deletions
encodings/bool_hol.lp
paper/proof_irr.lp
+56
-0
56 additions, 0 deletions
paper/proof_irr.lp
with
63 additions
and
2 deletions
encodings/bool_hol.lp
+
7
−
2
View file @
70173b00
...
...
@@ -25,10 +25,15 @@ set builtin "or" ≔ or
symbol if {s: Set} p: (Prf p → El s) → (Prf (¬ p) → El s) → El s
rule if {bool} $p $then $else ↪ ($p ⊃ $then) ⊃ (λ_, (¬ $p) ⊃ $else)
definition iff P Q ≔ (P ⊃ (λ_, Q)) ∧ ((λ_, Q ⊃ (λ_, P)))
symbol eq {s: Set}: El s → El s → El bool
set infix 2 "=" ≔ eq
set builtin "eq" ≔ eq // FIXME emacs indentation
rule Prf ($x = $y) ↪ Πp: El (_ ~> bool), Prf (p $x) → Prf (p $y)
definition iff P Q ≔ (P ⊃ (λ_, Q)) ∧ ((λ_, Q ⊃ (λ_, P)))
theorem eq_refl {a: Set} (x: El a): Prf (x = x)
proof
assume a x p h
apply h
qed
This diff is collapsed.
Click to expand it.
paper/proof_irr.lp
0 → 100644
+
56
−
0
View file @
70173b00
require open personoj.encodings.lhol
require open personoj.encodings.pvs_cert
require open personoj.encodings.bool_hol
set declared "ℕ"
constant symbol ℕ: Set
constant symbol z: El ℕ
constant symbol s (_: El ℕ): El ℕ
constant symbol leq: El ℕ → El ℕ → Bool
set infix left 3 "≤" ≔ leq
// Agda manual
symbol p1: Prf (z ≤ s z)
symbol p2: Prf (z ≤ s z)
definition bounded (k: El ℕ) ≔ psub (λn, n ≤ k)
constant symbol slist (bound: El ℕ): Set
constant symbol snil (bound: El ℕ): El (slist bound)
constant symbol scons {bound: El ℕ} (head: El (bounded bound))
(tail: El (slist (fst head)))
: El (slist bound)
set declared "l₁"
set declared "l₂"
definition l₁: El (slist (s z)) ≔ scons (pair z p1) (snil z)
definition l₂: El (slist (s z)) ≔ scons (pair z p2) (snil z)
theorem listeq: Prf (l₁ = l₂)
proof
refine eq_refl l₁
qed
// Proof irrelevance without K
symbol plus: El ℕ → El ℕ → El ℕ
set infix left 10 "+" ≔ plus
constant symbol even_p: El ℕ → Bool
definition even ≔ psub even_p
symbol plus_closed_even (n m: El even): Prf (even_p ((fst n) + (fst m)))
definition add (n m: El even) : El even
≔ pair ((fst n) + (fst m)) (plus_closed_even n m)
symbol app_thm (a b: Set) (f: El (a ~> b))
(x y: El a) (_: Prf (x = y))
: Prf (f x = f y)
symbol fun_ext (a b: Set) (f g: El (a ~> b)) (_: Prf (∀ (λx, f x = g x))): Prf (f = g)
symbol plus_commutativity (n m: El ℕ): Prf (n + m = m + n)
theorem even_add_commutativity (n m: El even): Prf (add n m = add m n)
proof
admit
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment