Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sgdt
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gradual-typing
sgdt
Commits
d6c5af86
Commit
d6c5af86
authored
2 years ago
by
Max New
Browse files
Options
Downloads
Patches
Plain Diff
show symmetry can be replaced by reflexivity (at fix \theta)
parent
021a5e23
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
formalizations/guarded-cubical/ErrorDomains.agda
+35
-14
35 additions, 14 deletions
formalizations/guarded-cubical/ErrorDomains.agda
with
35 additions
and
14 deletions
formalizations/guarded-cubical/ErrorDomains.agda
+
35
−
14
View file @
d6c5af86
...
...
@@ -68,22 +68,18 @@ data L℧ (X : Set) : Set where
-- The following lemma proves this.
trivialize' : {X : Set} ->
((lx : L℧ X) -> θ (next lx)
≡ lx
) ->
((lx : L℧ X) ->
lx ≡
θ (next lx)) ->
▹ ((lx : L℧ X) -> lx ≡ fix θ) → (lx : L℧ X) -> lx ≡ fix θ
trivialize' hθ IH lx =
lx ≡⟨ sym (hθ lx) ⟩
θ (next lx) ≡⟨ refl ⟩
θ (λ t -> lx) ≡⟨ ( λ i -> θ λ t -> IH t lx i) ⟩
θ (λ t -> fix θ) ≡⟨ refl ⟩
θ (next (fix θ)) ≡⟨ hθ (fix θ) ⟩
lx ≡⟨ hθ lx ⟩
θ (next lx) ≡⟨ ( λ i -> θ λ t -> IH t lx i) ⟩
θ (next (fix θ)) ≡⟨ sym (fix-eq θ) ⟩
(fix θ ∎)
trivialize : {X : Set} ->
((lx : L℧ X) -> θ (next lx) ≡ lx) ->
((lx : L℧ X) -> (lx ≡ fix θ))
trivialize hθ = fix (trivialize' hθ)
-- trivialize : {X : Set} ->
-- ((lx : L℧ X) -> θ (next lx) ≡ lx) ->
-- ((lx : L℧ X) -> (lx ≡ fix θ))
-- trivialize hθ = fix (trivialize' hθ)
-- We can prove a similar fact for an arbitrary relation R,
-- so long as it is symmetric, transitive, and a congruence
...
...
@@ -98,8 +94,13 @@ symmetric {X} _R_ =
{x y : X} -> x R y -> y R x
congruence : {X : Type} -> (_R_ : L℧ X -> L℧ X -> Type) -> Type
congruence {X} _R_ = {lx ly : L℧ X} ->
▹
(lx R ly) -> (θ
(next
lx)
)
R (θ
(next
ly)
)
congruence {X} _R_ = {lx ly :
▹ (
L℧ X
)
} ->
▸ (λ t →
(lx
t)
R
(
ly
t)
) -> (θ lx) R (θ ly)
congruence' : {X : Type} -> (_R_ : L℧ X -> L℧ X -> Type) -> Type
congruence' {X} _R_ = {lx ly : L℧ X} -> ▹ (lx R ly) -> (θ (next lx)) R (θ (next ly))
cong→cong' : ∀ {X}{_R_ : L℧ X -> L℧ X -> Type} → congruence _R_ → congruence' _R_
cong→cong' cong ▹R = cong ▹R
trivialize2 : {X : Type} (_R_ : L℧ X -> L℧ X -> Type) ->
symmetric _R_ ->
...
...
@@ -118,13 +119,33 @@ trivialize2 {X} _R_ hSym hTrans hCong hθ = fix trivialize2'
(hCong (λ t → IH t lx))
(hθ (fix θ)))
-- lx R
-- (θ (next lx)) R
-- (θ (λ t -> fix θ) ≡
-- (θ (next (fix θ))) R
-- (fix θ)
-- alternatively, we can drop symmetry if we assume that the relation
-- is reflexive, or at least that fix θ is related to itself.
trivialize3 : {X : Type} (_R_ : L℧ X -> L℧ X -> Type) ->
transitive _R_ ->
congruence _R_ ->
fix θ R fix θ ->
((x : L℧ X) -> x R (θ (next x))) ->
((x : L℧ X) -> x R (fix θ))
trivialize3 {X} _R_ hTrans hCong fix-ok hθR = fix trivialize3'
where
lem : θ (next (fix θ)) R fix θ
lem = subst (λ x → x R fix θ) (fix-eq θ) fix-ok
trivialize3' :
▹ ((x : L℧ X) -> x R (fix θ)) → (x : L℧ X) -> x R (fix θ)
trivialize3' IH lx =
hTrans
(hθR lx)
(hTrans
(hCong (λ t → IH t lx))
lem)
--------------------------------------------------------------------------
...
...
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