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
fff8aeb2
Commit
fff8aeb2
authored
5 years ago
by
gabrielhdt
Browse files
Options
Downloads
Patches
Plain Diff
finished proof of right cancellation
parent
3a3769fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sandbox/rat.lp
+46
-5
46 additions, 5 deletions
sandbox/rat.lp
with
46 additions
and
5 deletions
sandbox/rat.lp
+
46
−
5
View file @
fff8aeb2
...
...
@@ -43,18 +43,59 @@ proof
apply N.prod_comm a (fst b)
qed
symbol trans {T} (x y z: Term T):
Term (x = y) ⇒ Term (y = z) ⇒ Term (x = z)
// theorem one_neutral (a: Term N.nat) (b: Term N.nznat):
// Term (rateq (times (a / b) (1 / onz)) (1 / onz))
// proof
// qed
// NOTE: we use this rewriting rule because in the proof below, calling simpl
// causes protected [opair] to appear, and we cannot use refl since it requires
// the user to input the protected opair, which is forbidden.
// Perhaps using [hints] could help, using [refl Nat _] and the unification
// engine would instantiate _ accordingly, but it is not likely since it is
// based on non linearity, and hints are linear.
// We rather reduce the proof to the trivial proof
rule &x = &x → true
theorem right_cancel (a: Term N.Nat) (b: Term N.Nznat):
Term (rateq (times (a / b) ((fst b) / onz)) (a / onz))
proof
assume a b
// We execute simplifications one by one because [simpl] unfolds too much
// reducing the beta redex [(λx, fst x) onz]
refine
trans
(N.times (N.times a (fst b)) ((λx, fst x) onz))
(N.times (N.times a (fst b)) (fst onz))
(N.times ((λx, fst x) (N.nznat (N.times (fst b) (fst onz)) (N.prod_not_zero (fst b) (fst onz) (snd b) (snd onz)))) a)
_ _
simpl
refine λx, x
// reducing beta redex [(λx, fst x) ...]
refine trans
(N.times (N.times a (fst b)) (fst onz))
(N.times (fst (N.nznat (N.times (fst b) (fst onz)) (N.prod_not_zero (fst b) (fst onz) (snd b) (snd onz)))) a)
(N.times ((λx, fst x) (N.nznat (N.times (fst b) (fst onz)) (N.prod_not_zero (fst b) (fst onz) (snd b) (snd onz)))) a)
_ _
focus 1
refine λx, x
simpl
refine N.prod_comm a (fst b)
qed
type Term (N.Nznat ⊑ N.Nat)
type λ(b: Term N.Nznat) (pr: Term (N.Nznat ⊑ N.Nat)),
↑ N.Nat pr b
theorem right_cancellation (a: Term N.Nat) (b: Term N.Nznat)
(pr: Term (N.Nznat ⊑ N.Nat)):
Term (rateq (times (a / b) ((↑ N.Nat pr b) / onz)) (a / onz))
proof
qed
//theorem cright_cancellation (a: Term N.Nat) (b: Term N.Nznat)
// (pr: Term (N.Nznat ⊑ N.Nat)):
// Term (rateq (times (a / b) ((↑ N.Nat pr b) / onz)) (a / onz))
//proof
//
//qed
// Should generate a TCC to provide [pr]
// theorem right_cancel (a b: Term N.Nat) ()
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