Closed binghe closed 1 month ago
On a second thought, the name change of SNOC_LAST_FRONT
(in listTheory
) should be reverted for better backward compatibility (important if this PR is not going to merge before T1 release), and in this way all changes in examples/lambda
can be reverted too, reduced the total number of changed lists in the PR branch.
Per our offline discussions, the new files under src/algebra
are moved into src/algebra/base
(for number
, prime
and combinatorics
) and src/algebra/construction
(for monoid
and the small jcLib
). The directory "src/algebra" itself depends on the two subdirectories and will be reserved for the algebraTheory
containing the (combined) type-based algebra formalizations.
Thanks!
Hi,
The abstract algebra work (under
examples/algebra
, etc.) by (Joseph) Hing-Lun Chan is an important contribution to HOL4. The present huge PR moves this work (up to monoid, only) into the core library, under a new directory "src/algebra".Perhaps It's impossible to review all code changes (50k+ additions, 58k- deletions) in the commits. Below is just a summary of ideas behind those changes:
examples/algebra/lib
andexamples/fermat
:numberTheory
: theorems about numbers that involves new definitions beyondarithmeticTheory
,gcdTheory
, etc.combinatoricsTheory
: definitions and theorems usually considered as part of "Combinatorics" (e.g. thenecklaceTheory
and the originalcombinatoricsTheory
underexamples/fermat
)primeTheory
: theorems about prime numbers which depends oncombinatoricsTheory
.monoidTheory
is added as a combined theory of all theories underexamples/algebra/monoid
except for the one depending on real numbers.real_algebraTheory
is added (under "src/real") with the monoid of real numbers (for now). This theory will collect other algebra objects based on real numbers, in the future.arithmetic
,divides
,gcd
,gcdset
,list
,rich_list
,pred_set
,bag
, etc.) to enrich these theories with more supporting theorems. In the future, we should keep polishing the new theories under "src/algebra" to move some small theorems to upstream theories.SNOC_LAST_FRONT
(⊢ ∀l. l ≠ [] ⇒ SNOC (LAST l) (FRONT l) = l
)recently added intorich_listTheory
but is conflict with another similar theorem fromexamples/algebra
. I give the algebra materials the higher priority and renamed my theorem toSNOC_OF_LAST_FRONT
. (NOTE: this change is now reverted. The similar theorem from algebra materials is now calledSNOC_LAST_FRONT'
, which is used only 4 times inpolyWeakScript.sml
.)SQ = \n. n * n
,HALF
,TWICE
, etc.) which I consider not very necessary. I have changed them totemp_overload_on()
without touching their proofs.Once the present PR gets merged, the next steps would be moving also the
groupTheory
andringTheory
, etc. (after theory combinations) to "src/algebra", and then start making connections to other existing theories.Chun Tian