Skip to content

Proof of ⊥ with sized types #6002

@YellPika

Description

@YellPika

The following code is accepted by both the latest release and master.

{-# OPTIONS --sized-types #-}

module Fix where

open import Agda.Builtin.Size
open import Agda.Primitive

private variable
  a : Level

record Thunk (F : Size  Set a) i : Set a where
  coinductive
  field force : {j : Size< i}  F j

open Thunk

data Embed :  {i}  Thunk (λ _  Set) i  Set where
  [_] :  {i A}  force A  Embed {↑ i} A

expel : {A : Thunk (λ _  Set) ∞}  Embed A  force A
expel [ x ] = x

Fix′ : Size  (Set  Set)  Set
Fix′ i F = F (Embed {i} λ where .force {j}  Fix′ j F)

Fix = Fix′ ∞

data  : Set where

⊥-elim :  {a} {A : Set a}  A
⊥-elim ()

data Bad (A : Set) : Set where
  bad : (A  ⊥)  Bad A

app : Fix Bad  Fix Bad  ⊥
app (bad f) x = f [ x ]

self : Fix Bad
self = bad λ x  app (expel x) (expel x)

example : ⊥
example = app self self

The fishiest thing to me is the definition of Embed, which seems like it should belong to Set₁ instead of Set. It would appear that Agda treats A like a parameter instead of an index, despite the fact that its type depends on an index (i).

Metadata

Metadata

Assignees

No one assigned

    Labels

    falseProof of the empty type which checks without known-unsafe flags (e.g. without --type-in-type)infinity-less-than-infinityBugs relating to the ∞ < ∞ rulesized typesSized types, termination checking with sized types, size inference

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions