https://github.com/jaycech3n/Isabelle-HoTT
Revision 0bceaa97dfc4899ec2489dc3f2cd2ea11f5ae358 authored by Josh Chen on 20 September 2018, 12:14:17 UTC, committed by Josh Chen on 20 September 2018, 12:14:17 UTC
1 parent 19eb191
Raw File
Tip revision: 0bceaa97dfc4899ec2489dc3f2cd2ea11f5ae358 authored by Josh Chen on 20 September 2018, 12:14:17 UTC
Application should bind tighter than composition
Tip revision: 0bceaa9
Equal.thy
(*
Title:  Equal.thy
Author: Joshua Chen
Date:   2018

Equality type
*)

theory Equal
imports HoTT_Base

begin


section \<open>Basic definitions\<close>

axiomatization
  Equal    :: "[t, t, t] \<Rightarrow> t" and
  refl     :: "t \<Rightarrow> t" and
  indEqual :: "[t \<Rightarrow> t, t] \<Rightarrow> t"  ("(1ind\<^sub>=)")

syntax
  "_equal" :: "[t, t, t] \<Rightarrow> t"        ("(3_ =\<^sub>_/ _)" [101, 0, 101] 100)
  "_equal_ascii" :: "[t, t, t] \<Rightarrow> t"  ("(3_ =[_]/ _)" [101, 0, 101] 100)

translations
  "a =[A] b" \<rightleftharpoons> "CONST Equal A a b"
  "a =\<^sub>A b" \<rightharpoonup> "CONST Equal A a b"

axiomatization where
  Equal_form: "\<lbrakk>A: U i; a: A; b: A\<rbrakk> \<Longrightarrow> a =\<^sub>A b : U i" and

  Equal_intro: "a : A \<Longrightarrow> (refl a): a =\<^sub>A a" and

  Equal_elim: "\<lbrakk>
    p: x =\<^sub>A y;
    x: A;
    y: A;
    \<And>x. x: A \<Longrightarrow> f x: C x x (refl x);
    \<And>x y. \<lbrakk>x: A; y: A\<rbrakk> \<Longrightarrow> C x y: x =\<^sub>A y \<longrightarrow> U i \<rbrakk> \<Longrightarrow> ind\<^sub>= f p : C x y p" and

  Equal_comp: "\<lbrakk>
    a: A;
    \<And>x. x: A \<Longrightarrow> f x: C x x (refl x);
    \<And>x y. \<lbrakk>x: A; y: A\<rbrakk> \<Longrightarrow> C x y: x =\<^sub>A y \<longrightarrow> U i \<rbrakk> \<Longrightarrow> ind\<^sub>= f (refl a) \<equiv> f a"

lemmas Equal_form [form]
lemmas Equal_routine [intro] = Equal_form Equal_intro Equal_elim
lemmas Equal_comp [comp]


end
back to top