Apa hukum persamaan untuk tipe nol?

13

Penafian : sementara saya peduli tentang teori jenis, saya tidak menganggap diri saya ahli dalam teori jenis.

Dalam kalkulus lambda yang diketik sederhana, tipe nol tidak memiliki konstruktor dan eliminator unik:

ΓM:0Γinitial(M):A

Dari sudut pandang denotasional, persamaan jelas (ketika jenisnya masuk akal).initial(M1)=initial(M2)

Namun, dari perspektif itu saya juga dapat menyimpulkan bahwa, ketika , maka: M = M . Pengurangan ini tampaknya lebih kuat, meskipun model tertentu yang menunjukkannya tidak bisa saya dapatkan.M,M:0M=M

(Saya punya beberapa intuisi teori-bukti: tidak masalah kontradiksi yang Anda gunakan untuk mendapatkan penghuni, tetapi mungkin ada bukti kontradiksi yang berbeda.)

Jadi pertanyaan saya adalah:

  1. Apa hukum persamaan standar untuk tipe nol?
  2. Apakah ada yang diklasifikasikan sebagai hukum atau β ?ηβ
Ohad Kammar
sumber

Jawaban:

12
  1. Aturan persamaan standar untuk tipe kosong adalah, seperti yang Anda duga, . Pikirkan model set-theoretic standar, di mana set diinterpretasikan berdasarkan tipe: tipe penjumlahan adalah serikat yang terpisah, dan tipe kosong adalah set kosong. Jadi setiap dua fungsi e , e : Γ 0 juga harus sama, karena mereka memiliki grafik yang sama (yaitu, grafik kosong). .Γe=e:0e,e:Γ0

  2. Jenis kosong tidak memiliki aturan , karena tidak ada formulir pengantar untuk itu. Satu-satunya aturan persamaannya adalah aturan- η . Namun, tergantung pada seberapa ketat Anda ingin menafsirkan apa itu aturan eta, Anda dapat memecahnya menjadi η plus konversi komuter. Aturan η yang ketat adalah:βηηη

    e=initial(e)

    Penutup komuter adalah:

    C[initial(e)]=initial(e)

EDIT:

Inilah mengapa distribusi pada tipe nol menyiratkan kesetaraan semua peta .A0

Untuk memperbaiki notasi, mari menulis menjadi peta unik dari 0 hingga A , dan mari kita tulis e : A 0 untuk menjadi beberapa peta dari A hingga 0 .!A:0A0Ae:A0A0

Sekarang, kondisi distribusi mengatakan bahwa ada isomorfisme . Karena objek awal unik hingga isomorfisma, ini berarti bahwa A × 0 sendiri merupakan objek awal. Kita sekarang dapat menggunakan ini untuk menunjukkan bahwa A itu sendiri adalah objek awal.i:0A×0A×0A

Karena adalah objek awal, kita tahu peta π 1 : A × 0 A dan ! Aπ 2 sama.A×0π1:A×0A!Aπ2

Sekarang, untuk menunjukkan bahwa adalah objek awal, kita perlu menunjukkan isomorfisme antara itu dan 0 . Mari kita pilih e : A 0 dan ! A : 0 A sebagai komponen isomorfisme. Kami ingin menunjukkan bahwa e ! A = i d 0 dan ! Sebuahe = i d A .A0e:A0!A:0Ae!A=id0!Ae=idA

Menunjukkan langsung, karena hanya ada satu peta tipe 0 0 , dan kita tahu bahwa selalu ada peta identitas.e!A=id000

Untuk menunjukkan arah lain, catat

idA=π1(idA,e)Product equations=!Aπ2(idA,e)Since A×0 is initial=!AeProduct equations

Karenanya kita memiliki isomorfisme , dan A adalah objek awal. Karenanya peta A 0 unik, dan jadi jika Anda memiliki e , e : A 0 , maka e = e .A0AA0e,e:A0e=e

EDIT 2: Ternyata situasinya lebih cantik dari yang saya kira sebelumnya. Saya belajar dari Ulrich Bucholz bahwa sudah jelas (dalam pengertian matematika "jelas secara retrospektif") bahwa setiap biCCC bersifat distributif. Ini bukti kecil yang lucu:

Hom((A+B)×C,(A+B)×C)Hom((A+B)×C,(A+B)×C)Hom((A+B),C(A+B)×C)Hom(A,C(A+B)×C)×Hom(B,C(A+B)×C)Hom(A×C,(A+B)×C)×Hom(B×C,(A+B)×C)Hom((A×C)+(B×C),(A+B)×C)
Neel Krishnaswami
sumber
1
Regarding 1: I think of a zero type as an initial object. Initial objects may have multiple arrows into them, but can only have one arrow out of them. In other words, I don't immediately see any reason why being bi-CCC implies 0 to be subterminal. Is there one?
Ohad Kammar
Yes: the fact that the STLC with sums needs a distributive bi-CCC ((X×A)+(X×B)X×(A+B)) to interpret it, and the uniqueness for the 0 type comes as the nullary version of that. (Try to write down the interpretation of the elimination rule for sums, and you'll see it.)
Neel Krishnaswami
I don't follow. The distributivity amounts to initial:0A×0 having an inverse. Why does that imply that 0 is subterminal?
Ohad Kammar
Aha! Thanks for that proof! And for the patience, too!
Ohad Kammar
regarding edit 2: Left adjoints preserve colimits. If the category is Cartesian closed, then ()×C is left adjoint to ()C so (A+B)×C is the sum A×C+B×C.
Ohad Kammar
8

The equation e=e:0 only captures the fact that 0 has at most one element so I don't think Neel is capturing the whole story. I would axiomatize the empty type 0 as follows.

There are no introduction rules. The elimination rule is

e:0magicτ(e):τ.
The equation is
magicτ(e)=e:τ
where e:0 and e:τ. Throughout τ is any type. The equation is motivated as follows: if you managed to form the term magicτ(e) then 0 is inhabited by e, but this is absurd so all equations hold. So another way of achieving the same effect would be to pose the equation
x:0,Γe1=e2:τ
which is perhaps not so nice because it fiddles with the context. On the other hand, it shows more clearly that we are stating the fact that any two morphisms from 0 to τ are equal (the Γ is a distraction in a CCC).
Andrej Bauer
sumber
1
Hi Andrej, the equation you suggest is derivable from the commuting conversion I gave. magic(e)=e is derivable from C[magic(e)]=magic(e), since magic(e) does not actually have to occur on the left term. The analogy is to C[case(e,x.e,y.e)]=case(e,x.C[e],y.C[e]), where not using the result of a case-analysis is ok if you do the same in both branches.
Neel Krishnaswami
I should add, though, that I like the presentation with contexts better -- indeed, I think in general it's cleanest if you actually allow equations on sum values in the context! That's much nicer for actual proofs than games with commuting conversions, IMO. (IIRC, this is equivalent to adding the additional assumption of stable coproducts, but for all the models I can reasonably see caring about this holds.)
Neel Krishnaswami
Ah yes, excellent. It was too late for me to think about commuting conversions so I pretended you did not write that part. Now Ohad can have his pick.
Andrej Bauer
1
I was validating some structural (η, β, etc) rules in a class of models. While I know the set of equations I gave wasn't complete (you need CBPV with complex values and stacks for that), I wanted to at least capture the standard equations that will be used to prove completeness if I did have enough equations. In other words, I wanted the standard equational laws for zero types.
Ohad Kammar
1
There are no standard equational laws for zero types. Logicians have always been afraid of the empty universe of discourse, and computer scientists have always been afraid of the empty type. They even named a non-empty type "void" to deny the empty type.
Andrej Bauer