Skip to content

Instantly share code, notes, and snippets.

@bond15
Created May 21, 2022 23:24
Show Gist options
  • Save bond15/073ba0715e74938af50f11c22b0d5455 to your computer and use it in GitHub Desktop.
Save bond15/073ba0715e74938af50f11c22b0d5455 to your computer and use it in GitHub Desktop.
Question
    open import Data.Bool
    open import Data.Unit 
    open import Data.Empty
    open import Cubical.Core.Everything 

    ty : Bool → Set 
    ty false = ⊥
    ty true  = ⊤

    ex : (b₁ b₂ : Bool)(p : b₁ ≡ b₂)(e₁ : ty b₁)(e₂ : ty b₂) → PathP (λ i → ty (p i)) e₁ e₂ 
    ex true true p tt tt i = {! tt  !}

I would expect this proof to go though.. but instead I get this error

⊤ !=< ty (p i)
when checking that the expression tt has type ty (p i)

Why doesn't ty (p i) reduce to in this case? p : true ≡ true in this hole and p i0 normalizes to true..

@bond15
Copy link
Author

bond15 commented May 21, 2022

Answer:

    ex : (b₁ b₂ : Bool)(p : b₁ ≡ b₂)(e₁ : ty b₁)(e₂ : ty b₂) → PathP (λ i → ty (p i)) e₁ e₂ 
    ex true true p e₁ e₂ i = transp (λ j → ty (p (i ∧ j))) (~ i) e₁

@bond15
Copy link
Author

bond15 commented May 22, 2022

Answer by Dan Doel:
This isn't an available principle. Matching on the endpoints of this path doesn't tell you that the whole path is constant, even though it is in this case.

There's work on an extension of this sort of type theory that would probably allow this. Essentially what you'd do is introduce a generic point along p to match on, which must be either true or false. Then the fact that that generic point is one or the other tells you the whole path is, and this sort of proof works.

And by work I mean papers. I'm not sure anyone's thought about how to get it into Agda. I think it'd make a lot of situations nicer.

ex : (b₁ b₂ : Bool)(p : b₁ ≡ b₂)(e₁ : ty b₁)(e₂ : ty b₂) → PathP (λ i → ty (p i)) e₁ e₂ 
ex true true p e₁ e₂ i = transp (λ j → ty (p (i ∧ j))) (~ i) e₁

This only works because every value of ⊤ is automatically equal. Otherwise you'd have to prove that what you get by transporting is equal to your specified value by a composition or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment