<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Lemma Extraction Criteria Based on Properties of Theorem Statements ?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Karol P¡k</string-name>
          <email>pakkarol@uwb.edu.pl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Informatics, University of Bia“ystok</institution>
          ,
          <addr-line>Bia“ystok</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Both easily readable and obscure proof scripts can be found in the Mizar Mathematical Library (MML). Many authors do not want to invest additional eorts in improving readability of their deductions, once the computer accepts their scripts. In their opinion, text of the proofs are ignored by most of the readers and the readability is essential only at the top level of scripts where statements of theorems are formulated. However, the analysis of such scripts is unavoidable if we have to rebuild some theorems to make them stronger or more easily applicable. Therefore, it is important to develop tools that can improve legibility of proofs, in particular those that shorten reasoning by removing technical sub-deductions, and this requires development of criteria that lead to extraction of statements which, in the opinion of human readers, describe well the extracted reasoning. We propose characteristics of formula complexity that can be applied to determine which sub-deductions should be extracted so that resulting lemmas are more comprehensible. To better understand their signicance we study the distribution of these characteristics on statements of theorems that are collected in the MML.</p>
      </abstract>
      <kwd-group>
        <kwd>Lemma extraction</kwd>
        <kwd>Complexity of formulas</kwd>
        <kwd>Legibility of proofs</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1.1</p>
    </sec>
    <sec id="sec-2">
      <title>Introduction</title>
      <p>
        Motivations
The legibility of proof scripts might be considered as one of the most important
factors of formalization quality, but in practice the growth of proof databases is
not always accompanied by the improvement of the formalization quality of the
articles. Analyzing proof scripts developed with proof assistants, especially the
longer and more complex deductions, leads to a conclusion that their legibility
often seems to be of the secondary importance to their authors since computer
assisted proof development frameworks can check the correctness of such
deductions. According to the opinion of some proof authors any attempt to analyze
? The paper has been nanced by the resources of the Polish National Science Center
granted by decision n DEC-2012/07/N/ST6/02147.
details of the proofs scripts created in this way is extremely dicult or even
impossible. However, analysis of such proofs is unavoidable if we try to adapt or
modify them [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].1
      </p>
      <p>
        This concerns especially systems such as Mizar [
        <xref ref-type="bibr" rid="ref10 ref2">2, 10</xref>
        ], where the proof script
language is close to the natural language, which makes it possible to create
legible deductions. Therefore, authors of Mizar proof scripts can manually try to
improve the comprehensibility of their work spending a lot of time over their
readability [
        <xref ref-type="bibr" rid="ref13 ref6">13, 6</xref>
        ], similar as it is done for informal mathematical proofs.
However, many authors do not want to invest additional eorts in this process and
assume that the task can be handled automatically for them, since having a
digital form of structured formal proof, a computer can not only automatically
verify the correctness, but also automatically enhance proof scripts. Therefore,
it comes as no surprise that Mizar is being developed in many directions to meet
these needs of users, similar to the way people work on informal mathematical
proofs.
      </p>
      <p>
        We can identify three main directions of development to improve legibility.
The rst one is based on improving the representation of proof scripts in HTML
format [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] by adding selected information that is automatically generated by
Mizar and also by bringing the formal mathematical language to the informal one
by introduction to the formal language idioms that stem from informal
mathematical practice [79]. The second direction is based on the simplication of
deductions in proof scripts by nding and removing irrelevant parts of reasoning
or by elimination of redundant premises from the justication of steps,
preserving the correctness of the modied proof scripts. The third direction is based
on rebuilding the deduction structure in proof scripts by changing the order of
independent steps in reasoning and also by detecting reasoning passages (called
packets) that are, e.g., technical and repeated many times in a reasoning, and
extracting them as lemmas or encapsulating them on a deeper level of a proof
in the form of a nested lemma.
      </p>
      <p>
        The last direction is still the least developed. SMT solvers can be used to
choose a better order of independent proof steps [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. A method of extracting
packets as external or nested lemmas so that the correctness of proof scripts is
preserved has also been developed [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. However, an additional challenge remains
to formulate packet extraction criteria so that resulting new lemmas can be
accepted as ones that deserve readers’ attention and are worth extracting. In
this paper we concentrate on this aspect.
1.2
      </p>
      <p>
        Proposed approach
The ability to nd such passages automatically is crucial, since the extraction of
carelessly selected packets can drastically reduce the proof scripts legibility even
if the modication reduces the length of the proof. Additionally, the statements
associated with the reasoning in a packet has usually a more complicated form
1 Actually this is mentioned in Page 3 of an unpublished preliminary version of the
article [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
than a plain implication premises =) conclusions preceded by a sequence of
universal quantiers. It turns out that a mathematical statement can be
perceivably more complex than another one, even if both have the same number of
assumptions and theses; or their prenex normal forms are at the same level of
the same arithmetic hierarchy [
        <xref ref-type="bibr" rid="ref1 ref11">1, 11</xref>
        ].
      </p>
      <p>In this paper we analyze the selected characteristic of sentence complexity
of theorems and lemmas in the Mizar Mathematical Library (MML) to get the
most typical values. and then apply them in the context of lemma extraction
based upon the notion of proof graph. In Section 2 we introduce the notion of
an abstract model of proofs and packets. In Section 3 we discuss selected
indicators of the packet’s statement complexity that describe a structure generated by
premises and conclusion in a packet. We discuss also the impact of the positions
of quantiers in a formula for the complexity of a deduction that justies the
formula. Then in Section 4 we report the statistical results obtained on statements
of theorems and lemmas occurring in the MML. Finally, Section 5 concludes the
paper and discusses future work.
2</p>
    </sec>
    <sec id="sec-3">
      <title>Packets in Abstract Proof Graph</title>
      <p>To formulate the notion of a packet, we have to x the terminology and notation.</p>
      <p>Let G = hV; Ei be a DAG, E1 be a subset of E, V1 be as subset of V . An arc
is called E1arc if it belongs to E1. A path P = hu1; u2; : : : ; uni of G is called
an E1path if hui; ui+1i is an E1arc for i = 1; 2; : : : ; n 1. Additionally, we
say that P passes V1 if u2; u3; : : : ; un 1 belong to V1. For vertices u; v in V , the
notation u ! v means that hu; vi is an E1arc. Moreover, the notation u ! v</p>
      <p>E1 E1
means that there exists an E1path that leads from u to v. Additionally, we say
that vertices u; v are connected only by passing V1 and denoted this by u v,
V1
if there exists a path that leads from u to v and every path that leads from u to
v passes V1.</p>
      <p>
        An abstract model of proofs was considered in detail in an earlier work [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
For our purposes we recall only the part of its denition that is the most relevant
for our purposes. We illustrate it with an example on Fig. 1, where P, Q, R, S,
T represent predicate symbols with two arguments and F represents a functor
with one argument. Note also that the additional packet P is analyzed in the
further part of this article. Generally, we call a DAG P = hV; O [ Mi an abstract
proof graph if O and M are disjointed families of arcs, called ordered arcs and
metaedges respectively, hV; Mi is a forest, and O contains a distinguished set
of arcs R(P) O, the elements of which are called references. Additionally,
the contents of a nested reasoning are closed outside, i.e., introduced variables
and formulated statements in a sub-reasoning cannot be used outside the
subreasoning, i.e., from areas of the proof in which the sub-reasoning is nested (for
each u; v; w 2 V if u ! v, u ! w then v ! w and v 6= w). The vertices
      </p>
      <p>O M M
of P represent steps of the reasoning, Oarcs represent the ow of information
between dierent steps of the reasoning, and Marcs represent the dependence
: let x be set;
: A1: P[x];
: consider y be set such that</p>
      <p>A2:y=F(x) by A1;
: A3: Q[y] by A2;
: consider z be Subset of y such that</p>
      <p>A4: R[z] by A3;
: consider r be Relation of y,z such that</p>
      <p>A5: S[r] by A4;
: A6: T[r] by A5;
:
x
:
:
z
:
A5</p>
      <p>x
A1
y y
A3</p>
      <p>A4
:
A2
:
:
r
packet P
y
between each step from areas of the proof and a proving fact. R(P)arcs that
correspond to solid arrows represent the information ow between a premise
(e.g., the fact labeled by A1 in ) and a place of its use ( ). The other O-arcs
that correspond to dashed arrows represent all kinds of additional constraints
that force one step to precede another one, e.g., the dependence between a step
that introduces a variable (the variable v in ) into the reasoning and a step
that uses this variable in its expression ( , ). Note also that arcs and vertices
of abstract proof graphs are not labeled (arcs and nodes in Fig. 1 are labeled
only to simplify their identication).</p>
      <p>
        Using the notion of meta-edges we can dene formally the notion of packet
introduced in an earlier study [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Let us x the notation D = hVD; EDi for
a subgraph of P induced by a set of vertices. We call D a packet, if D is induced
by the set of all roots in the forest hV; Mi or every vertex of D has a common
successor in hV; Mi. Note that in an earlier denition (see [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]) the packet was
a subset of steps in a one-level deduction, where we ignored each nested local
lemma that was a justication of a step in the deduction. To consider the set of
a packet steps together with steps of such supplementing lemmas we dene an
area of the packet by A(D) := fv 2 V : 9u2VD v ! ug. A vertex v of P is called
M
a Dpremise , if v 2= VD and hv; ui is a R(P)arc for some u 2 A(D). Similarly,
we call a vertex v of P a Dconclusion , if v 2 VD and hv; ui is a R(P)arc for
some u 2 VD n A(D). Let v be a vertex of V. A Dpremise p is called vnecessary
if there exists O [ Mpath that passes A(D) and connects p with v. Note that
to explore every dependency between a premise and a conclusion, we cannot
be limited only to R(P)paths, even if reference arcs are sucient to dene
premises and conclusions. As an illustration note that the step presented in
Fig. 1 is necessary, even if the reference arcs h ; i, h ; i do not occur in the
proof graph of the packet, since there exists ordered arc h ; i. Note that the
packet P has also necessary premises , and is also necessary.
      </p>
      <p>In our research, we distinguished also a set of vertices V(P) that correspond
to steps that introduce variables into a reasoning in both cases of steps that
introduce an universal or an existential quantier and of steps that introduce
a new constant. A vertex v of V(P) is called a Duniversal , if v 2= VD and hv; ui
is a O n R(P)arc for some u 2 A(D). Similarly, we call a vertex v of V(P)
Dexistential , if v 2 VD and hv; ui is a O n R(P)arc for some u 2 VD n A(D).
In Fig. 1, the packet P has two universal vertices: , and also two existential
vertices: , . Additionally, the order of these steps in graph suggests that the
packet’s statement must have the following form 8x9y8z9r : : : .
3</p>
      <p>
        Properties of the Packet’s Statement
A method of extracting an arbitrary packet as an external or a nested lemma
has been described in an earlier work [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. However, the question of the packet’s
property which determines the choice of the extraction method is omitted. In
this Section we describe the characteristic of the packet’s statement complexity
that describes a packet considered as a subgraph position in an abstract proof
graph, i.e., the information ow between the packet and the rest of a reasoning
that contains the packet.
      </p>
      <p>
        Let us focus on the packet P presented in Fig. 1, the reachability relation
between packet’s premises and conclusions, and also the reachability relation
between ones that are connected only by passing the packet’s area. Using the
reasoning in a packet we can provide a packet’s statement in the form "
quantiers premises ! conclusions" (e.g., : : : (P (x) ^ R(z)) =) (Q(y) ^ S(r)).
However, we cannot preserve the correctness of the modied reasoning, since
(Q(y)) is necessary ( R(z)) or more precisely, there exists an outgoing path
h ; ; i that generates a circle if we replace the packet by a single step (for more
detail see the denition of lemma extraction procedure [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]). Since, the packet’s
statement has to preserve the necessary relation, we have at least two options
for the formulation of the packet’s statement:
... (P[x] implies Q[y]) &amp; (R[z] implies S[r])
... P[x] implies (Q[y] &amp; (R[z] implies S[r]))
(1)
Obviously, the rst proposition is more general than the second one. However we
can extract P preserving the correctness in both cases. Analyzing the structure
of implications we can observe that a deduction justifying the rst statement
should have a form of two disjoint proofs (corresponding to each implication)
and the skeleton of a deduction justifying the second one has the form assume
P[x];, thus Q[y];, assume R[z], thus S[r], (see Fig. 3).
      </p>
      <p>Analyzing the structure of implications we assume that the formula contains
only negation, conjunction, implication; where negation can precede only a
literal. Additionally, we eliminate every formula of the form =) ( =) )
using the Exportation low ((( ^ ) =) ) () ( =) ( =) ))) and
also we eliminate repetitions of formulas as ( =) ) ^ ( =) ). We say
that such formula is implicational. Generally, we can transform a formula to
several expected forms. However, this nondeterministic does not occur in majority
statements of theorem occuring in the MML. Note that the equivalence in the
Mizar system is a syntactic sugar for two implications, the disjunction is used
only in 2% of all theorem statements in the MML, and the negation precedes
a non-literal formula only in justied cases where it facilitates the understanding
of a theorem’s statement in the Mizar reviewer’s opinion.</p>
      <p>Note also that when proving an implication, the most natural proof is the one
where we rst assume the antecedent. Obviously, we can conclude the consequent
directly or using the reductio ad absurdum method. However, in both cases, the
complexity of the antecedent has a negligible impact on the proof graph that
describes the information ow in a reasoning. The only exception is when the
antecedent is a conjunction of several facts, but even in that case the number of
facts plays an important role than the complexity of each of them. Therefore,
we omit the complexity of antecedents (accordingly, packet’s premises) in our
structure that describes implicational formulas (see P[x], R[z] in Fig. 1).</p>
      <p>Let us consider an implicational formula . Then to each sub-formula of
that has the form:
( 0 =) (
^ ( 1 =)
1) ^ ( 2 =)
2) ^ ( k =)
k))
we can associate a vertex of a directed rooted tree as follows
0
1; 2; : : : ; k
The height of obtained tree is called the depth of and the number of leafs there
the breadth of . The rst formula presented in (1) has depth 1 and breadth
2; and the second one has depth 2 and breadth 1 (see Fig. 2). We show that
P[x];R[z]</p>
      <p>Q[x]
S[r]</p>
      <p>P[x]</p>
      <p>Q[y] R[z]</p>
      <p>
        S[r]
depth and breadth represent the generality level of formula that distinguishes
statements of lemmas and theorems. Note that in the most general packet’s
statement, the formula is equivalent to the basic packet’s statement (for more detail
see [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]), i.e., a conjunction of implications, where the consequent of a given
implication is one of the packet’s conclusions c, and the antecedent is a
conjunction of cnecessary the packet’s assumptions. In consequence, the breadth of the
packet’s statement should be close to the number of packet’s assumptions and
the depth of the packet’s statement should be close to one or even 0 if the packet
has no assumptions. However, the modication of the reasoning part left after
the extraction of a packet with such statement is more complicated and a
generated proof of the statement based upon the packet’s reasoning is extremely
long and has repeated passages that do not occur in existing proof scripts in
the MML. Therefore, we analyze the depth and the breadth of the statement of
a theorem that is collected in the MML in the context of a situation, where the
statement is as general as possible and a generated proof does not have repeated
passages. Obviously, the optimal values of depth and breadth are determined
by properties of packets. Note also that we can indicate the formula that has
breadth 1 (see (3)). However, the generality level of the formula is low. As an
illustration, let us denote by Pre(D) the set of Dpremises and similarly denote
by Con(D) the set of Dconclusions. We dene two recursive families of vertices
fPre(D)igi1=1, fCon(D)igi1=1 as follows:
      </p>
      <p>Pre(D)0 = fp 2 Pre(D) : :</p>
      <p>Con(D)i = fc 2 Con(D) :
Pre(D)i+1 = fp 2 Pre(D) :
u2Co9n(D)u M![O pg;</p>
      <p>9 p c ;
p2Pre(D)i A(D) g</p>
      <p>9 c p :
c2Con(D)i (A(D))0 g
Note that only a nite number of elements in the families can be non-empty,
since Pre(D) [ Con(D) is nite. Additionally, there exists a number d such that
Con(D)0 6= ;, Pre(D)i 6= ;, Con(D)i 6= ;, for i = 1; : : : ; d, and Pre(D)i =
Con(D)i = ;, for i &gt; d, since for each Dpremise p there exists at least one
Dconclusion c that p is cnecessary. Then the following formula has breadth 1.
(2)
(3)
Pre(D)0 implies ( Con(D)0 &amp; (</p>
      <p>Pre(D)1 implies ( Con(D)1 &amp; (
: : :</p>
      <p>( Pre(D)m implies Con(D)d ) : : : ))));
Additionally, the formula has the minimal depth among these statements of
packet D that have the breadth equal 1.</p>
      <p>
        So far in this section we ignore information about variables. Generally, the
packet’s statement has to be preceded by a sequence of quantiers that bind
occurring variables. The packet extraction methods that take into consideration
variables has been described in an earlier paper [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Obviously, the number of
universal and existential vertices of a packet suggest two natural characteristics
that correspond to the number of variables, which are bound by universal and
existential quantiers in the packet’s statement. The arithmetical hierarchy of
a theorem’s statements, considered in the work of Alama [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], takes into
consideration the complexity of the antecedent that we omit in considerations. It is
important to note that in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] only packet’s statements not in prenex normal
form were considered. Moreover, there is an a priori assumption that the
existential quantier corresponding to a Dexistential vertex e has to be preceded
by every corresponding statement of enecessary Dpremises. In this section we
present only a simple justication of this assumption, i.e., without this
assumption modication of reasoning is extremely complicated and generates unnatural
proof scripts.
      </p>
      <p>According to the a priori assumption, in every statement of the packet P
presented in Fig. 1, the premise P[x] ( ) has to precede both existential
quantiers ex y be set; ex r be Relation of y,z ( , ) and the premise R[z]
( ) has to precede only the second one. In consequence, we obtain the following
formula:</p>
      <p>forRx[zb]e hsoeltdsstexP[rx]beexReylbaetisoetn sotf Qy[,yz]s&amp;t fSo[rr]z be Subset of y st (4)
that corresponds to the second formula in (1). A generated deduction that
demonstrates the formula and a modied part of reasoning remaining after the
packet’s extraction is presented in Fig. 3. Note that the generated deduction has
to contain six skeleton steps that correspond to universal ( 1, 4) and existential
( 3, 6) quantiers; and correspond to antecedents ( 2, 5). Similarly, variables
(y, r) that are introduced to a reasoning in the area of a packet have to be
reintroduced in the remaining parts of the reasoning after the packet’s extraction
( 1, 2). It is important to note that the resulting proof script, see Fig. 3, is the
shortest of all proofs where the packet P is extracted as a lemma.
4</p>
      <p>
        Statistical Results and Discussion
In our study we analyze 55160 theorems and 53839 lemmas that are collected in
the MML version 5.32.1234. For us, a theorem is only this item in the MML
that is explicitly called theorem in the Mizar syntax. Every other step that
has a nested deduction as a justication, not only on the top level of its proof
script, is called a preselected lemma. We call a preselected lemma lemma if
the statement does not constitute a correctness condition or a property, where
the statement is imposed by the Mizar syntax (for more detail see the current
overview of the Mizar system [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]), e.g., in every denition of a functor, we have
to demostrate the existence and the uniqueness conditions, if the functor value
is not dened by a term.
4.1
      </p>
      <p>Premises and Conclusions
As we have expected, the analysis of the number of explicitly formulated premises
in theorems and lemmas shows that lemmas have on average 1.8 times less
premises than theorems do. Note that the average number of premises in lemmas
is equal 0.76. Additionally, more than half of lemmas does not have premises
and only 6.25% do not have more then 2, whereas for comparison 19.82% of
theorems have more than 2 (see Fig. 4). The results for the average number of
conclusions are not signicantly dierent for lemmas and theorems (1.15 and
1.38 respectively), and in both cases the percentage of statements dramatically
decreases with the increase of the number of conclusions. Obviously, not all
premises are visible in the statement of a lemma. Indeed, if the statement of
a step (1) is used as a premise in one of the steps of the nested reasoning that
is the justication of a step (2), and both steps (1) and (2) are in the same
level of nesting, then the premise does not occur in the statement of the step
(2). Such hidden premises (1) are called implicit premises , in contrast to these
that are formulated in the statement of the step (2), and these are called explicit
premises. However, a similar situation occurs in the case of theorems if we use
the previously proven facts that are formulated on the top level of proof scripts.
Obviously, these facts can also be used in lemmas. But if we sum up explicit
and implicit premises, then the percent of formulas in the MML with the same
number of such premises does not distinguish statements of lemmas and theorems
(see the ratio of percents (solid line) at the diagram that represent number of
all premises presented at Fig. 4). However, the set of implicit premises can be
dened in terms of the notion of packet D and is equal to Pre(D)0 (see (2)).
Therefore, as an appropriate numerical characteristic of a packet we choose the
cardinality of Pre(D) n Pre(D)0.</p>
      <p>We can also analyze the arithmetical hierarchy of explicit and implicit premises.
However, the main part of premises contains identiers of local constants (mainly
lemmas) or reserved variables (theorems). In consequence, the main part of
implicit lemma’s premises is at 0level on the arithmetic hierarchy. Therefore, in
our study, we preceded by a sequence of necessary universal quantiers every
implicit premise that contains such identifers. But then the percent of implicit
premises on the level of the arithmetic hierarchy that occurs in lemmas and
theorems is almost identical.</p>
      <p>A bit dierent is the case of implicit premises, since according to the
assumptions of Section 3, we should analyze explicit premises as they were originally
formulated by the author of a proof script. In that case the average level of
s
t
n
e 40
m
e
t
a
t
S
fo 20
t
n
e
c
r
e
P 0
s
t
n
e
em101
t
a
t
S
f
o
tn 100
e
c
r
e
P
ts20
n
e
m
e
t
a
t
S
f10
o
t
n
e
c
r
e
P 0
102
101
t
i
c
li
arithmetic hierarchy is 0.116 and 0.027 for ; 0.0572 and 0.0196 for in
explicit premises occurring in lemmas and theorems, respectively, where for
simplicity of notation a formula is ( ) if is i ( i) formula for some i.
Note also that non-literal premises, if they are ( ), then they occur 1.92
(1.32) times more often in theorems then in lemmas. Additionally, the number
of premises drastically decreases with increasing level of arithmetical hierarchy,
on average 10.9 and 18.2 times in lemmas and theorems, respectively. Therefore,
as a characteristic of a packet D we should take into consideration not only the
cardinality of Pre(D) n Pre(D)0, but also the level of arithmetical hierarchy of
statements formulated in vertices of Pre(D) n Pre(D)0, to reduce the number of
more complex one.
4.2</p>
      <p>Variables bounded by universal and existential quantiers
As in the previous section, we assume that every formula is preceded by a
sequence of necessary universal quantiers, which x all local constants (mainly
lemmas) or reserved variables, called together parameters. Note that the average
number of parameters in lemmas and theorems is equal 3.40 and 1.54,
respectively (see Fig. 6). Additionally, 54.26% of theorems have less than 2 parameters
and only 4.64% have more than 4 parameters, whereas for comparison 48.36%
of lemmas have 3 1 parameters and 36.75% have more than 4 parameters.</p>
      <p>For simplicity of notation, we called a variable universally quantied if it is
a parameter or it is bounded by a universal quantier and we call a variable
existentially quantied if is bounded by an existential quantier. Analyzing the
number of variables bounded by universal quantiers in formula, we obtain that
percent of lemmas and theorems with the same value is almost identical, for
the most popular values (3, 4, see Fig. 6). However, the ratios of these percents
for theorems to lemmas is less then 1 for popular values (25). Note also that
existentially quantied variables occur very rarely in formulas and the rations of
the statement percents with the same number of such variable for theorems to
lemmas is less then 1 if and only if the number is less then 2.
4.3</p>
      <p>
        The Depth and Breadth
As we have expected, the main part of statements have depth less than or equal
to 1. Additionally only 7 theorems in the MML have the depth greater than 3
(3 of them describe dierentiability in higher dimensions, for more detail see the
relevant Mizar article [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]). Similarly, the main part of statements have breadth
equal 1 and 42% of them are formulated without premises (37.25% theorems and
51.34% lemmas with breadth equal 1). Moreover, only 23.42% of formulas that
have the depth greater than 0 or the breadth greater than 1 are used as lemmas
(see Fig. 7).
      </p>
      <p>We are aware that the described result is only a small step forward. However
this is the rst promising result concerning this questions. Analysis of human
readers’ opinions, especially the Mizar’s users, does not make it possible to obtain
more important results, which can be summarized by the statement: a lemma
s
t
enm101
e
t
a
t
S
fo 100
t
n
e
c
r
eP10 1
s
ten 102
m
te 101
a
t
fS 100
o
ten10 1
c
re10 2
P
0 1 2 3 4 5 6 7 8 9 10 11</p>
      <p>
        Number of Parameters
corresponds to a separate fragment of reasoning between two throats in the
proof that correspond to the premise and the thesis of the lemma (A.Trybulec).
Additionally in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] an articial property of the package (the closeness of packets
with respect to directed paths) has been described.
      </p>
      <p>It is crucial in the process of packets’ extraction, but the determination of
the inuence of this property on the statement of existing lemmas was extremely
counterintuitive. This impact is our small step forward and is described in
Section 3 as a depth and breadth of formula. These two parameters seem to be
also non-intuitive but they can be easily calculated for formulas and they well
improve the result of a method that distinguishes formulas that occur in lemmas
and theorems, and base only on the number of premises, conclusions and bound
variables.
5</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>
        In this paper we describe a next stage in the research on methods that improve
proof legibility realized in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] that base on rebuilding the proof structure, either
tn 102
s
e
m
te 101
a
t
S
fo 100
t
ec10 1
n
r
e
P
      </p>
      <p>100
s
a
m 75
m
e
L
fo 50
t
n
e
c
re 25
P
0
0
1
2
3
4
5
6
7
8
9</p>
      <p>10</p>
      <sec id="sec-4-1">
        <title>Value of Characterization</title>
        <p>encapsulating sub-deductions (packets) in the form of a nested lemma or
extracting them as lemma. We dene characteristics of the packet’s statement and
also we indicate the most appropriate values that are helpful in deciding whether
to extract a packet as a lemma or not. Moreover, the proposed characteristics
based on the packet’s statement determine a packet position in an abstract proof
graph. This dependence is crucial, since in our approach we analyze the
probability that in human readers’ opinions, a package should be extracted basing on the
lemmas and theorems statement collected in the MML that are not generated
from packets.</p>
        <p>This research showed that for every packet we can calculate the
probability of using in the MML the that the packet’ statement is used in the MML
to formulate a theorem or a lemma; and also it indicates which of these two
types is more probable, in respect to each proposed characteristic. The two
nonintuitive characteristics of a statement have proved to be especially important.
The depth and the breadth well improve distinction that based only on the
num</p>
      </sec>
      <sec id="sec-4-2">
        <title>Explicit Premises</title>
        <p>All Premises</p>
        <p>Conclusions
Explicit Premises
and Conclusions</p>
        <p>Parameters
9 Variables
8 Variables</p>
        <p>Depth
Breadth
ber of premises, conclusions and bound variables. However, still an open problem
to investigate is to determine impact of individual characteristics on the nal
qualitative assessment of a packet.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J.</given-names>
            <surname>Alama</surname>
          </string-name>
          .
          <article-title>Sentence Complexity of Theorems in Mizar</article-title>
          . CoRR, abs/1311.
          <year>1915</year>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>G.</given-names>
            <surname>Bancerek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Bylinski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Grabowski</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . Korni“owicz,
          <string-name>
            <given-names>R.</given-names>
            <surname>Matuszewski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Naumowicz</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.</surname>
          </string-name>
          <article-title>P¡k, and</article-title>
          <string-name>
            <given-names>J.</given-names>
            <surname>Urban</surname>
          </string-name>
          . Mizar:
          <article-title>State-of-the-art and Beyond</article-title>
          . In M. Kerber,
          <string-name>
            <given-names>J.</given-names>
            <surname>Carette</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Kaliszyk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Rabe</surname>
          </string-name>
          , and V. Sorge, editors,
          <source>Intelligent Computer Mathematics - International Conference</source>
          , vol.
          <volume>9150</volume>
          of LNCS,
          <volume>261279</volume>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>N.</given-names>
            <surname>Endou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Okazaki</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Shidama.</surname>
          </string-name>
          Higher-Order Partial Dierentiation.
          <source>Formalized Mathematics</source>
          ,
          <volume>20</volume>
          (
          <issue>2</issue>
          ):
          <fpage>113124</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>G.</given-names>
            <surname>Gonthier</surname>
          </string-name>
          .
          <article-title>A Computer-Checked Proof of the Four Colour Theorem</article-title>
          . http://research.microsoft.com/en-us/um/people/gonthier/4colproof. pdf,
          <year>2005</year>
          . [Online; accessed 19-May-2016].
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>G.</given-names>
            <surname>Gonthier. Formal ProofThe Four-Color Theorem</surname>
          </string-name>
          .
          <source>Notices of the AMS</source>
          ,
          <volume>55</volume>
          (
          <issue>11</issue>
          ):
          <fpage>13821393</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>A.</given-names>
            <surname>Grabowski</surname>
          </string-name>
          .
          <article-title>On the Computer-assisted Reasoning About Rough Sets</article-title>
          . In B.
          <string-name>
            <surname>Dunin-Kƒplicz</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Jankowski</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Skowron</surname>
          </string-name>
          , and M. Szczuka, editors,
          <source>International Workshop on Monitoring, Security, and Rescue Techniques in Multiagent Systems Location</source>
          , vol.
          <volume>28</volume>
          of Advances in Soft Computing ,
          <volume>215226</volume>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>A.</given-names>
            <surname>Korni</surname>
          </string-name>
          <article-title>“owicz. Tentative Experiments with Ellipsis in Mizar</article-title>
          . In J. Jeuring,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Campbell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Carette</surname>
          </string-name>
          , Gabriel G. Dos Reis,
          <string-name>
            <given-names>P.</given-names>
            <surname>Sojka</surname>
          </string-name>
          , M. Wenzel, and V. Sorge, editors,
          <source>Intelligent Computer Mathematics 11th International Conference</source>
          , vol.
          <volume>7362</volume>
          of LNAI,
          <volume>453457</volume>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>A.</given-names>
            <surname>Kornilowicz</surname>
          </string-name>
          .
          <article-title>On Rewriting Rules in Mizar</article-title>
          .
          <source>Journal of Automated Reasoning</source>
          ,
          <volume>50</volume>
          (
          <issue>2</issue>
          ):
          <fpage>203201</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>A.</given-names>
            <surname>Naumowicz</surname>
          </string-name>
          and
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>Byli«ski. Improving Mizar Texts with Properties and Requirements</article-title>
          . In A. Asperti,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Bancerek, and</article-title>
          <string-name>
            <surname>A</surname>
          </string-name>
          . Trybulec, editors,
          <source>Mathematical Knowledge Management, Third International Conference</source>
          , vol.
          <volume>3119</volume>
          of LNCS,
          <volume>290</volume>
          <fpage>301</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>A.</given-names>
            <surname>Naumowicz</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Korni</surname>
          </string-name>
          <article-title>“owicz. A Brief Overview of Mizar</article-title>
          . In S. Berghofer,
          <string-name>
            <given-names>T.</given-names>
            <surname>Nipkow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Urban</surname>
          </string-name>
          , and M. Wenzel, editors,
          <source>Proceedings of the 22nd International Conference on Theorem Proving in Higher Order Logics</source>
          , vol.
          <volume>5674</volume>
          of LNCS,
          <volume>6772</volume>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>K. P¡</surname>
          </string-name>
          <article-title>k. Methods of Lemma Extraction in Natural Deduction Proofs</article-title>
          .
          <source>Journal of Automated Reasoning</source>
          ,
          <volume>50</volume>
          (
          <issue>2</issue>
          ):
          <fpage>217228</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>K. P¡</surname>
          </string-name>
          <article-title>k. Automated Improving of Proof Legibility in the Mizar System</article-title>
          . In S. M.
          <string-name>
            <surname>Watt</surname>
            ,
            <given-names>J. H.</given-names>
          </string-name>
          <string-name>
            <surname>Davenport</surname>
            ,
            <given-names>A. P.</given-names>
          </string-name>
          <string-name>
            <surname>Sexton</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Sojka</surname>
          </string-name>
          , and J. Urban, editors,
          <source>Intelligent Computer Mathematics - International Conference</source>
          , vol.
          <volume>9150</volume>
          of LNCS,
          <volume>373387</volume>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>K. P¡</surname>
          </string-name>
          <article-title>k. Readable Formalization of Euler's Partition Theorem in Mizar</article-title>
          . In M. Kerber,
          <string-name>
            <given-names>J.</given-names>
            <surname>Carette</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Kaliszyk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Rabe</surname>
          </string-name>
          , and V. Sorge, editors,
          <source>Intelligent Computer Mathematics - International Conference</source>
          , vol.
          <volume>9150</volume>
          of LNCS,
          <volume>211226</volume>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>J.</given-names>
            <surname>Urban</surname>
          </string-name>
          .
          <article-title>XML-izing Mizar: Making Semantic Processing and Presentation of MML Easy</article-title>
          . In M. P. Bonacina, editor,
          <source>4th International Conference Mathematical Knowledge Management</source>
          <year>2005</year>
          , vol.
          <volume>3863</volume>
          of LNCS,
          <volume>346360</volume>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>