Skip to content

Pi types and Partial types should not be considered inter-convertible #6015

Closed

Description

@plt-amy

Partial φ A is essentially defined to be .(IsOne φ) → A, and indeed Agda thinks these types are equal, as can be checked with the following snippet.

data Bool : Set where
  tt ff : Bool

data Idₛ {ℓ} (A : SSet ℓ) (a : A) : A → SSet ℓ where
  reflₛ : Idₛ A a a

module _ (i : I) where
  _ : Idₛ (SSet _) (Partial (i ∨ ~ i) Bool) (.(IsOne (i ∨ ~ i)) → Bool)
  _ = reflₛ

But Partial φ A isn't literally the same as that pi-type, since the type Partial unfolds into has its domain marked domFinite = True, so that η-equality for elements of Partial φ A is checked by decomposing φ and checking that they agree on all possible substitutions that make φ = i1:

  _ : Idₛ (Partial (i ∨ ~ i) Bool) (primPOr i (~ i) (λ _ → tt) λ _ → tt) (λ _ → tt)
  _ = reflₛ

But this same tabulation is not performed for functions-whose-domain-is-IsOne:

  _ : Idₛ (.(IsOne (i ∨ ~ i)) → Bool) (primPOr i (~ i) (λ _ → tt) (λ _ → tt)) (λ _ → tt)
  -- _ = reflₛ -- does not type-check

Conversion checking of terms is not invariant under definitional equality of the types they are being compared as. Should Agda really think that (Partial (i ∨ ~ i) Bool) and (.(IsOne (i ∨ ~ i)) → Bool) are the same type? The same thing, verbatim, goes for PartialP vs (z : IsOne φ) → A z.

I also think that finite-domain-Π shouldn't be printed in the same way as ordinary Πs — or better yet, prevent the normal form of Partial from being printed as a Π type, somehow.

Activity

  1. self-assigned this
    on Aug 14, 2022
  2. added
    type: bug
    cubical
    subject reduction
    on Aug 14, 2022
  3. added a commit that references this issue on Aug 15, 2022
    8e2fff0
  4. added a commit that references this issue on Aug 16, 2022
    2862f99
  5. added this to the 2.6.3 milestone on Aug 23, 2022
  6. added 2 commits that reference this issue on Sep 5, 2022
    b25b77a
    c7e84f7
  7. added 3 commits that reference this issue on Sep 27, 2022
    29cf085
    58f3d76
    a46da0b
  8. added a commit that references this issue on Oct 7, 2022
    6ccaeee
  9. changed the title [-]Pi types with different domain finiteness should not be equal[/-] [+]Pi types and Partial types should not be considered inter-convertible[/+] on Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cubicalsubject reductiontype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions