From 6402b72747c153798b5a9ef5175038e5c1409be5 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Tue, 21 Aug 2018 14:37:22 +0200
Subject: Create LICENSE.md
---
LICENSE.md | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 165 insertions(+)
create mode 100644 LICENSE.md
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..65c5ca8
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
--
cgit v1.2.3
From 5193d4dd1ebef7fa000489710ff138ab98876c52 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Tue, 21 Aug 2018 14:38:28 +0200
Subject: Rename LICENSE.md to LICENSE
---
LICENSE | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LICENSE.md | 165 -------------------------------------------------------------
2 files changed, 165 insertions(+), 165 deletions(-)
create mode 100644 LICENSE
delete mode 100644 LICENSE.md
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..65c5ca8
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index 65c5ca8..0000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
--
cgit v1.2.3
From a7b46d4b0204571ba9124accebc84f77ae0bed26 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Thu, 30 Aug 2018 00:45:08 +0200
Subject: Add leq relation to meta-ordinals, it helps with proofs
---
Empty.thy | 2 +-
HoTT_Base.thy | 17 +++++++++++------
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/Empty.thy b/Empty.thy
index 1b339ba..8f5cc8c 100644
--- a/Empty.thy
+++ b/Empty.thy
@@ -17,7 +17,7 @@ axiomatization
Empty :: Term ("\") and
indEmpty :: "Term \ Term" ("(1ind\<^sub>\)")
where
- Empty_form: "\ : U(O)"
+ Empty_form: "\: U(O)"
and
Empty_elim: "\C: \ \ U(i); z: \\ \ ind\<^sub>\(z): C(z)"
diff --git a/HoTT_Base.thy b/HoTT_Base.thy
index 1110e14..269a3d9 100644
--- a/HoTT_Base.thy
+++ b/HoTT_Base.thy
@@ -35,13 +35,18 @@ typedecl Ord
axiomatization
O :: Ord and
S :: "Ord \ Ord" ("S_" [0] 1000) and
- lt :: "[Ord, Ord] \ prop" (infix "<-" 999)
+ lt :: "[Ord, Ord] \ prop" (infix "<" 999) and
+ leq :: "[Ord, Ord] \ prop" (infix "\" 999)
where
- Ord_min: "\n. O <- S(n)"
+ Ord_lt_min: "\n. O < S(n)"
and
- Ord_monotone: "\m n. m <- n \ S(m) <- S(n)"
+ Ord_lt_monotone: "\m n. m < n \ S(m) < S(n)"
+and
+ Ord_leq_min: "\n. n \ n"
+and
+ Ord_leq_monotone: "\m n. m \ n \ S(m) \ S(n)"
-lemmas Ord_rules [intro] = Ord_min Ord_monotone
+lemmas Ord_rules [intro] = Ord_lt_min Ord_lt_monotone Ord_leq_min Ord_leq_monotone
\ \Enables \standard\ to automatically solve inequalities.\
text "Define the universe types."
@@ -49,9 +54,9 @@ text "Define the universe types."
axiomatization
U :: "Ord \ Term"
where
- U_hierarchy: "\i j. i <- j \ U(i): U(j)"
+ U_hierarchy: "\i j. i < j \ U(i): U(j)"
and
- U_cumulative: "\A i j. \A: U(i); i <- j\ \ A: U(j)"
+ U_cumulative: "\A i j. \A: U(i); i \ j\ \ A: U(j)"
\ \WARNING: \rule Universe_cumulative\ can result in an infinite rewrite loop!\
--
cgit v1.2.3
From 2a2e8e46e0de6f99154a9421f75ae802557f22c7 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Thu, 30 Aug 2018 00:51:48 +0200
Subject: Should write the correct rule for Ord_leq_min. Another exercise.
---
HoTT_Base.thy | 8 ++++++--
ex/HoTT book/Ch1.thy | 12 ++++++++++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/HoTT_Base.thy b/HoTT_Base.thy
index 269a3d9..be4899c 100644
--- a/HoTT_Base.thy
+++ b/HoTT_Base.thy
@@ -42,7 +42,7 @@ where
and
Ord_lt_monotone: "\m n. m < n \ S(m) < S(n)"
and
- Ord_leq_min: "\n. n \ n"
+ Ord_leq_min: "\n. O \ n"
and
Ord_leq_monotone: "\m n. m \ n \ S(m) \ S(n)"
@@ -57,7 +57,11 @@ where
U_hierarchy: "\i j. i < j \ U(i): U(j)"
and
U_cumulative: "\A i j. \A: U(i); i \ j\ \ A: U(j)"
- \ \WARNING: \rule Universe_cumulative\ can result in an infinite rewrite loop!\
+
+text "
+ The rule \U_cumulative\ is very unsafe: if used as-is it will usually lead to an infinite rewrite loop!
+ It should be instantiated with the right ordinals \i\ and \j\ before being applied.
+"
section \Type families\
diff --git a/ex/HoTT book/Ch1.thy b/ex/HoTT book/Ch1.thy
index d5f05dd..a577fca 100644
--- a/ex/HoTT book/Ch1.thy
+++ b/ex/HoTT book/Ch1.thy
@@ -40,4 +40,16 @@ proof (rule Sum_elim[where ?p=p])
qed (derive lems: assms)
+section \Exercises\
+
+text "Exercise 1.13"
+
+abbreviation "not" ("\'(_')") where "\(A) \ A \ \"
+
+text "This proof requires the use of universe cumulativity."
+
+proposition assumes "A: U(i)" shows "\<^bold>\f. f`(inr(\<^bold>\a. f`inl(a))): \(\(A + \(A)))"
+by (derive lems: assms U_cumulative[where ?A=\ and ?i=O and ?j=i])
+
+
end
--
cgit v1.2.3
From 2b42b190b15dcf74f033347604ea5530f3428364 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Thu, 30 Aug 2018 00:53:09 +0200
Subject: Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 4747be7..68ede63 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ An experimental implementation of [homotopy type theory](https://en.wikipedia.or
### Installation & Usage
-Clone the contents of this repository into `/src/HoTT`.
+Clone the contents of this repository into `/src/Isabelle-HoTT`.
To use, set Isabelle's prover to Pure in the Theories panel, and import `HoTT`.
--
cgit v1.2.3
From d19ac110d976581b595acfa3b4bb573790a92e84 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Thu, 30 Aug 2018 02:47:05 +0200
Subject: Some higher groupoid structure proofs
---
EqualProps.thy | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
HoTT_Base.thy | 2 +-
2 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/EqualProps.thy b/EqualProps.thy
index a1d4c45..c114d37 100644
--- a/EqualProps.thy
+++ b/EqualProps.thy
@@ -194,7 +194,7 @@ qed fact
text "The raw object lambda term is cumbersome to use, so we define a simpler constant instead."
-axiomatization pathcomp :: "[Term, Term] \ Term" (infixl "\" 60) where
+axiomatization pathcomp :: "[Term, Term] \ Term" (infixl "\" 120) where
pathcomp_def: "\
A: U(i);
x: A; y: A; z: A;
@@ -205,10 +205,12 @@ axiomatization pathcomp :: "[Term, Term] \ Term" (infixl "\
lemma pathcomp_type:
assumes "A: U(i)" "x: A" "y: A" "z: A" "p: x =\<^sub>A y" "q: y =\<^sub>A z"
shows "p \ q: x =\<^sub>A z"
+
proof (subst pathcomp_def)
show "A: U(i)" "x: A" "y: A" "z: A" "p: x =\<^sub>A y" "q: y =\<^sub>A z" by fact+
qed (routine lems: assms rpathcomp_type)
+
lemma pathcomp_comp:
assumes "A : U(i)" and "a : A" shows "refl(a) \ refl(a) \ refl(a)"
by (subst pathcomp_def) (routine lems: assms rpathcomp_comp)
@@ -218,4 +220,56 @@ lemmas EqualProps_type [intro] = inv_type pathcomp_type
lemmas EqualProps_comp [comp] = inv_comp pathcomp_comp
+section \Higher groupoid structure of types\
+
+lemma
+ assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y"
+ shows
+ "ind\<^sub>= (\u. refl (refl u)) p: p =[x =\<^sub>A y] p \ refl(y)" and
+ "ind\<^sub>= (\u. refl (refl u)) p: p =[x =\<^sub>A y] refl(x) \ p"
+
+proof -
+ show "ind\<^sub>= (\u. refl (refl u)) p: p =[x =[A] y] p \ refl(y)"
+ by (rule Equal_elim[where ?p=p and ?x=x and ?y=y]) (derive lems: assms)+
+
+ show "ind\<^sub>= (\u. refl (refl u)) p: p =[x =[A] y] refl x \ p"
+ by (rule Equal_elim[where ?p=p and ?x=x and ?y=y]) (derive lems: assms)+
+qed
+
+
+lemma
+ assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y"
+ shows
+ "ind\<^sub>= (\u. refl (refl u)) p: p\ \ p =[y =\<^sub>A y] refl(y)" and
+ "ind\<^sub>= (\u. refl (refl u)) p: p \ p\ =[x =\<^sub>A x] refl(x)"
+
+proof -
+ show "ind\<^sub>= (\u. refl (refl u)) p: p\ \ p =[y =\<^sub>A y] refl(y)"
+ by (rule Equal_elim[where ?p=p and ?x=x and ?y=y]) (derive lems: assms)+
+
+ show "ind\<^sub>= (\u. refl (refl u)) p: p \ p\ =[x =\<^sub>A x] refl(x)"
+ by (rule Equal_elim[where ?p=p and ?x=x and ?y=y]) (derive lems: assms)+
+qed
+
+
+lemma
+ assumes "A: U(i)" "x: A" "y: A" "p: x =\<^sub>A y"
+ shows "ind\<^sub>= (\u. refl (refl u)) p: p\\ =[x =\<^sub>A y] p"
+by (rule Equal_elim[where ?p=p and ?x=x and ?y=y]) (derive lems: assms)
+
+
+schematic_goal
+ assumes
+ "A: U(i)"
+ "x: A" "y: A" "z: A" "w: A"
+ "p: x =\<^sub>A y" "q: y =\<^sub>A z" "r: z =\<^sub>A w"
+ shows
+ "?a: p \ (q \ r) =[x =\<^sub>A z] (p \ q) \ r"
+
+apply (rule Equal_elim[where ?p=p and ?x=x and ?y=y])
+apply (rule assms)+
+apply (subst pathcomp_comp)
+
+
+
end
diff --git a/HoTT_Base.thy b/HoTT_Base.thy
index be4899c..4e1a9be 100644
--- a/HoTT_Base.thy
+++ b/HoTT_Base.thy
@@ -60,7 +60,7 @@ and
text "
The rule \U_cumulative\ is very unsafe: if used as-is it will usually lead to an infinite rewrite loop!
- It should be instantiated with the right ordinals \i\ and \j\ before being applied.
+ To avoid this, it should be instantiated before being applied.
"
--
cgit v1.2.3
From 9b17aac85aa650a7a9d6463d3d01f1eb228d4572 Mon Sep 17 00:00:00 2001
From: Josh Chen
Date: Tue, 11 Sep 2018 08:59:16 +0200
Subject: Go back to higher-order application notation
---
Coprod.thy | 34 +++++++++++------------
Empty.thy | 4 +--
Equal.thy | 22 +++++++--------
EqualProps.thy | 85 +++++++++++++++++++++++++++++-----------------------------
HoTT_Base.thy | 14 +++++-----
Nat.thy | 28 +++++++++----------
Prod.thy | 22 +++++++--------
ProdProps.thy | 12 ++++-----
Proj.thy | 28 +++++++++----------
Sum.thy | 24 ++++++++---------
Unit.thy | 4 +--
11 files changed, 138 insertions(+), 139 deletions(-)
diff --git a/Coprod.thy b/Coprod.thy
index 4607d1d..b87958a 100644
--- a/Coprod.thy
+++ b/Coprod.thy
@@ -17,40 +17,40 @@ axiomatization
inr :: "Term \ Term" and
indCoprod :: "[Term \ Term, Term \ Term, Term] \ Term" ("(1ind\<^sub>+)")
where
- Coprod_form: "\A: U(i); B: U(i)\ \ A + B: U(i)"
+ Coprod_form: "\A: U i; B: U i\ \ A + B: U i"
and
- Coprod_intro_inl: "\a: A; B: U(i)\ \ inl(a): A + B"
+ Coprod_intro_inl: "\a: A; B: U i\ \ inl a: A + B"
and
- Coprod_intro_inr: "\b: B; A: U(i)\ \ inr(b): A + B"
+ Coprod_intro_inr: "\b: B; A: U i\ \ inr b: A + B"
and
Coprod_elim: "\
- C: A + B \ U(i);
- \x. x: A \ c(x): C(inl(x));
- \y. y: B \ d(y): C(inr(y));
+ C: A + B \ U i;
+ \x. x: A \ c x: C (inl x);
+ \y. y: B \ d y: C (inr y);
u: A + B
- \ \ ind\<^sub>+(c)(d)(u) : C(u)"
+ \ \ ind\<^sub>+ c d u : C u"
and
Coprod_comp_inl: "\
- C: A + B \ U(i);
- \x. x: A \ c(x): C(inl(x));
- \y. y: B \ d(y): C(inr(y));
+ C: A + B \ U i;
+ \x. x: A \ c x: C (inl x);
+ \y. y: B \ d y: C (inr y);
a: A
- \ \ ind\<^sub>+(c)(d)(inl(a)) \ c(a)"
+ \ \ ind\<^sub>+ c d (inl a) \ c a"
and
Coprod_comp_inr: "\
- C: A + B \ U(i);
- \x. x: A \ c(x): C(inl(x));
- \y. y: B \ d(y): C(inr(y));
+ C: A + B \ U i;
+ \x. x: A \ c x: C (inl x);
+ \y. y: B \ d y: C (inr y);
b: B
- \ \ ind\<^sub>+(c)(d)(inr(b)) \ d(b)"
+ \ \ ind\<^sub>+ c d (inr b) \ d b"
text "Admissible formation inference rules:"
axiomatization where
- Coprod_wellform1: "A + B: U(i) \ A: U(i)"
+ Coprod_wellform1: "A + B: U i \ A: U i"
and
- Coprod_wellform2: "A + B: U(i) \ B: U(i)"
+ Coprod_wellform2: "A + B: U i \ B: U i"
text "Rule attribute declarations:"
diff --git a/Empty.thy b/Empty.thy
index 8f5cc8c..a42f7ff 100644
--- a/Empty.thy
+++ b/Empty.thy
@@ -17,9 +17,9 @@ axiomatization
Empty :: Term ("\") and
indEmpty :: "Term \ Term" ("(1ind\<^sub>\)")
where
- Empty_form: "\: U(O)"
+ Empty_form: "\: U O"
and
- Empty_elim: "\C: \ \ U(i); z: \\ \ ind\<^sub>\(z): C(z)"
+ Empty_elim: "\C: \ \ U i; z: \\ \ ind\<^sub>\ z: C z"
text "Rule attribute declarations:"
diff --git a/Equal.thy b/Equal.thy
index 772072a..7254104 100644
--- a/Equal.thy
+++ b/Equal.thy
@@ -27,33 +27,33 @@ translations
section \Type rules\
axiomatization where
- Equal_form: "\A: U(i); a: A; b: A\ \ a =\<^sub>A b : U(i)"
+ Equal_form: "\A: U i; a: A; b: A\ \ a =\<^sub>A b : U i"
and
- Equal_intro: "a : A \ refl(a): a =\<^sub>A a"
+ Equal_intro: "a : A \ (refl a): a =\<^sub>A a"
and
Equal_elim: "\
x: A;
y: A;
p: x =\<^sub>A y;
- \x. x: A \ f(x) : C(x)(x)(refl x);
- \x y. \x: A; y: A\ \ C(x)(y): x =\<^sub>A y \