The Proving Perspective (Rodin User Manual)

From Event-B
Revision as of 15:40, 29 January 2009 by imported>Frederic (→‎Rewrite Rules)
Jump to navigationJump to search

The Proving Perspective is made of a number of windows: the proof tree, the goal, the selected hypotheses, the proof control, the proof information, and the searched hypotheses. In subsequent sections, we study these windows, but before that let us see how one can load a proof.

Loading a Proof

In order to load a proof, enter the Proof Obligation window, select the project, select and expand the component, finally select the proof obligation: the corresponding proof will be loaded. As a consequence:

  • the proof tree is loaded in the Proof Tree window. As we shall see in section 6.2, each node of the proof tree is associated with a sequent.
  • In case the proof tree has some "pending" nodes (whose sequents are not discharged yet) then the sequent corresponding to the first pending node is decomposed: its goal is loaded in the Goal window (section 6.3), whereas parts of its hypotheses (the "selected" ones) are loaded in the Selected Hypotheses window (section 6.3).
  • In case the proof tree has no pending node, then the sequent of the root node is loaded as explained previously.

The Proof Tree

Description of the Proof Tree

The proof tree can be seen in the corresponding window as shown in the following screen shot:

Each line in the proof tree corresponds to a node which is a sequent. A line is right shifted when the corresponding node is a direct descendant of the node of the previous line. Here is an illustration of the previous tree:

Each node is labelled with a comment explaining how it can be discharged. By selecting a node in the proof tree, the corresponding sequent is decomposed and loaded in the Goal and Selected Hypotheses windows as explained in section 6.1.

Decoration

The leaves of the tree are decorated with three kinds of logos:

  • a green logo with a "\surd " in it means that this leaf is discharged,
  • a red logo with a "?" in it means that this leaf is not discharged,
  • a blue logo with a "R" in it means that this leaf has been reviewed.

Internal nodes in the proof tree are decorated in the same (but lighter) way. Note that a "reviewed" leaf is one that is not discharged yet by the prover. Instead, it has been "seen" by the user who decided to have it discharged later. Marking nodes as "reviewed" is very convenient in order to perform an interactive proof in a gradual fashion. In order to discharge a "reviewed" node, select it and prune the tree at that node (section 6.2.5): the node will become "red" again (undischarged) and you can now try to discharge it.

Navigation within the Proof Tree

On top of the proof tree window one can see three buttons:

  • the "G" buttons allows you to see the goal of the sequent corresponding to the node
  • the "+" button allows you to fully expand the proof tree
  • the "-" allows you to fully collapse the tree: only the root stays visible.

Hiding

The little triangle next to each node in the proof tree allows you to expand or collapse the subtree starting at that node.

Pruning

The proof tree can be pruned from a node: it means that the subtree starting at that node is eliminated. The node in question becomes a leaf and is red decorated. This allows you to resume the proof from that node. After selecting a sequent in the proof tree, pruning can be performed in two ways:

  • by right-clicking and then selecting "Prune",
  • by pressing the "Scissors" button in the proof control window (section 6.4).

Note that after pruning, the post-tactic (section 6.8) is not applied to the new current sequent: if needed you have to press the "post-tactic" button in the Proof Control window (section 6.4). This happens in particular when you want to redo a proof from the beginning: you prune the proof tree from the root node and then you have to press the "post-tactic" button in order to be in exactly the same situation as the one delivered automatically initially.

When you want to redo a proof from a certain node, it might be advisable to do it after copying the tree so that in case your new proof fails you can still resume the previous situation by pasting the copied version (see next section).

Copy/Paste

By selecting a node in the proof tree and then clicking on the right key of the mouse, you can copy the part of the proof tree starting at that sequent: it can later be pasted in the same way. This allows you to reuse part of a proof tree in the same (or even another) proof.

Goal and Selected Hypotheses

The "Goal" and "Selected Hypotheses" windows display the current sequent you have to prove at a given moment in the proof. Here is an example:

A selected hypothesis can be deselected by first clicking in the box situated next to it (you can click on several boxes) and then by pressing the red (-) button at the top of the selected hypothesis window:

Here is the result:

Notice that the deselected hypotheses are not lost: you can get them back by means of the Searched Hypotheses window (section 6.7).

The three other buttons next to the red (-) button allow you to do the reverse operation, namely keeping some hypotheses. The (ct) button next to the goal allows you to do a proof by contradiction: pressing it makes the negation of the goal being a selected hypothesis whereas the goal becomes "false". The (ct) button next to a selected hypothesis allows you to do another kind of proof by contradiction: pressing it makes the negation of the hypothesis the goal whereas the negated goal becomes an hypothesis.

Rewrite rules

Rewrite rules are applied either automatically (A) or manually (M).

A rule may be applied:

  • Automatically (A), when post tactics are enabled. These rules are equivalence simplification laws.
  • Manually (M), through an interactive command. These rules gathers non equivalence laws, definition laws, distributivity laws and derived laws.

Rewrite rules are applied from left to right either in the goal or in the selected hypotheses, when their side condition hold.

Each rule is named after the following elements:

  • The law category: simplification law (SIMP), definition law (DEF), distributivity law (DISTRI), or else derived law (DERIV).
  • Particularity on terminal elements of the left part of the rule (optional): special element (SPECIAL) such as the empty-set, type expression (TYPE), same element occurring more then once (MULTI), literal (LIT). A type expression is either a basic type (\intg, \Bool, any carrier set), or \pow(type expression), or type expression\cprodtype expression.
  • One or more elements describing from top to down the left part of the rule, eg. predicate AND, expression BUNION.
  • Detail to localize those elements (optional): left (L), right (R).

Rewrite rules having an equivalence operator in their left part may also describe other rules. eg: the rule:

  \True  = \False  \;\;\defi\;\;  \bfalse

should also produce the rule:

  \False  = \True  \;\;\defi\;\;  \bfalse


For associative operators in connection with distributive laws as in:

 P \land (Q \lor \ldots \lor R)

it has been decided to put the "button" on the first associative/commutative operator (here \lor ). Pressing that button will generate a menu: the first option of this menu will be to distribute all associative/commutative operators, the second option will be to distribute only the first associative/commutative operator. In the following presentation, to simplify matters, we write associative/commutative operators with two parameters only, but it must always be understood implicitly that we have a sequence of them. For instance, we shall never write  Q \lor \ldots \lor R but  Q \lor R instead. Rules are sorted according to their purpose.


Rewrite rules are split into:

They are also available in a single large page All Rewrite Rules.

The Proof Control Window

The Proof Control window contains the buttons which you can use to perform an interactive proof. Next is a screen shot where you can see successively from top to bottom:

  • some selected hypotheses,
  • the goal,
  • the "Proof Control" window,
  • a small editing area within which you can enter parameters used by some buttons of the Proof Control window
  • the smiley (section 6.5)

The Proof Control window offers a number of buttons which we succinctly describe from left to right:

  • (p0): the prover PP attempts to prove the goal (other cases in the list)
  • (R) review: the user forces the current sequent to be discharged, it is marked as being reviewed (it’s logo is blue-colored)
  • (dc) proof by cases: the goal is proved first under the predicate written in the editing area and then under its negation,
  • (ah) lemma: the predicate in the editing area is proved and then added as a new selected hypothesis,
  • (ae) abstract expression: the expression in the editing area is given a fresh name,
  • the auto-prover attempts to discharge the goal. The auto-prover is the one which is applied automatically on all proof obligations (as generated automatically by the proof obligation generator after a "save") without any intervention of the user. With this button, you can call yourself the auto-prover within an interactive proof.
  • the post-tactic is executed (see section 6.8),
  • lasso: load in the Selected Hypotheses window those unseen hypotheses containing identifiers which are common with identifiers in the goal and selected hypotheses,
  • backtrack form the current node (i.e., prune its parent),
  • scissors: prune the proof tree from the node selected in the proof tree,
  • show (in the Search Hypotheses window) hypotheses containing the character string as in the editing area,
  • show the Cache Hypotheses window,
  • load the previous non-discharged proof obligation,
  • load the next undischarged proof obligation,
  • (i) show information corresponding to the current proof obligation in the corresponding window. This information correspond to the elements that took directly part in the proof obligation generation (events, invariant, etc.),
  • goto the next pending node of the current proof tree,
  • load the next reviewed node of the current proof tree.

The Smiley

The smiley can take three different colors: (1) red, meaning that the proof tree contains one or more non-discharged sequents, (2) blue, meaning that all non-discharged sequents of the proof tree have been reviewed, (3) green, meaning that all sequents of the proof tree are discharged.

The Operator "Buttons"

In the goal and in the selected, searched, or cache hypotheses some operators are colored in red. It means that they are "buttons" you can press. When doing so, the meaning (sometimes several) is shown in a menu where you can select various options. The operation performed by these options is described in sections 6.9.1 and 6.9.2.

The Search Hypotheses Window

A window is provided which contains the hypotheses having a character string in common with the one in the editing area. For example, if we search for hypotheses involving the character string "cr", then after pressing the "search hypothesis" button in the proof control window, we obtain the following:

Such hypotheses can be moved to the "Selected Hypotheses" window (button (+)) or removed from the "Search Hypotheses" window (button (-)). As for the selected hypotheses, other buttons situated next to the previous ones, allow you to move or remove all hypotheses. By pressing the (ct) button the negation of the corresponding hypothesis becomes the new goal.

The Automatic Post-tactic

In this section, we present the various rewrite or inference rules which are applied automatically as a systematic post-tactic after each proof step. Note that the post-tactic can be disabled by using the "P\! \! \! \! /" button situated on the right of the proof control window.

The post-tactic is made of two different rules: rewrite rules, which are applied on any sub-formula of the goal or selected hypotheses (section 6.8.1) and inference rules which are applied on the current sequent (section 6.8.2).


Automatic Inference Rules

The following inference rules are applied automatically in a systematic fashion at the end of each proof step. They have the following possible effects:

  • they discharge the goal,
  • they simplify the goal and add a selected hypothesis,
  • they simplify the goal by decomposing it into several simpler goals,
  • they simplify a selected hypothesis,
  • they simplify a selected hypothesis by decomposing it into several simpler selected hypotheses.


Axioms

\frac{}{\textbf{H},\textbf{P} \;\;\vdash \;\; \textbf{P}} HYP
\frac{}{\textbf{H},\textbf{Q} \;\;\vdash \;\; 
\textbf{P} \lor \ldots \lor  \textbf{Q} \lor \ldots \lor \textbf{R}} HYP_OR
\frac{}{\textbf{H},\;\textbf{P},\;\neg\,\textbf{P}  
\;\;\vdash \;\; \textbf{Q}} CNTR
\frac{}{\textbf{H},\bfalse \;\;\vdash \;\; \textbf{P}} FALSE_HYP
\frac{}{\textbf{H} \;\;\vdash \;\; \btrue} TRUE_GOAL


Simplification

\frac{\textbf{H},\;\textbf{P} \;\;\vdash \;\; 
\textbf{Q}}{\textbf{H},\;\textbf{P},\;\textbf{P}  \;\;\vdash \;\; 
\textbf{Q}} DBL_HYP

Conjunction

\frac{\textbf{H},\textbf{P},\textbf{Q} \; \; \vdash \; 
\;  \textbf{R}}{\textbf{H},\; \textbf{P} \land \textbf{Q} \; \; \vdash \; \;  
\textbf{R}} AND_L
\frac{\textbf{H} \; \; 
\vdash \; \;  \textbf{P} \qquad \textbf{H} \; \; \vdash \; \;  
\textbf{Q}}{\textbf{H} \; \; \vdash \; \;  \textbf{P} \; \land \;  
\textbf{Q}} AND_R

Implication

\frac{\textbf{H},\; \textbf{Q},\; \textbf{P} \land \ldots \land \textbf{R} \limp \textbf{S} \;\;\vdash \;\; \textbf{T}}{\textbf{H},\; \textbf{Q},\; \textbf{P} \land \ldots \land \textbf{Q} \land \ldots \land \textbf{R} \limp \textbf{S} \;\;\vdash \;\; \textbf{T} } IMP_L1
\frac{\textbf{H}, \textbf{P} \;\;\vdash \;\; \textbf{Q}}{\textbf{H} \;\;\vdash \;\; \textbf{P} \limp \textbf{Q}} IMP_R


\frac{\textbf{H},\textbf{P} \limp \textbf{Q},  \textbf{P} \limp \textbf{R}\;\;\vdash \;\; \textbf{S}}{\textbf{H},\;\textbf{P} \limp  \textbf{Q} \land \textbf{R}  \;\;\vdash \;\; \textbf{S}} IMP_AND_L
\frac{
\textbf{H},\textbf{P} \limp \textbf{R},  \textbf{Q} \limp \textbf{R}\;\;\vdash \;\; \textbf{S} 
}{
\textbf{H},\;\textbf{P} \lor  \textbf{Q} \limp \textbf{R}  \;\;\vdash \;\; \textbf{S}
} IMP_OR_L

Negation

\frac{\textbf{H},\; E \in \{ a,\ldots , c\}  \; \; \vdash \; \;  \; \;  \textbf{P} }{\textbf{H},\; E \in \{ a,\ldots , b, \ldots , c\} , \neg \, (E=b) \; \; \vdash \; \;  \textbf{P} }
\frac{\textbf{H},\; E \in \{ a,\ldots , c\}  \; \; \vdash \; \;  \; \;  \textbf{P} }{\textbf{H},\; E \in \{ a,\ldots , b, \ldots , c\} , \neg \, (b=E) \; \; \vdash \; \;  \textbf{P} }

Quantification


\frac{\textbf{H},\;  \textbf{P(x)} \; \; \vdash \; \;  \textbf{Q}
}{
\textbf{H},\;  \exists \, \textbf{x}\, \qdot\, \textbf{P(x)} \; \; \vdash \; \;  \textbf{Q}
} XST_L

x not free in H and Q

\frac{\textbf{H}\; \; \vdash \; \;  \textbf{P(x)} 
}{
\textbf{H} \; \; \vdash \; \;  \forall \textbf{x}\, \qdot\, \textbf{P(x)}
} ALL_R

x not free in H and Q

Equality

\frac{\textbf{H(E)} \; \; \vdash \; \;  \; \;  \textbf{P(E)} }{\textbf{H(x)},\; x=E \; \; \vdash \; \;  \textbf{P(x)} } EQL\_ LR
\frac{\textbf{H(E)} \; \; \vdash \; \;  \; \;  \textbf{P(E)} }{\textbf{H(x)},\; E=x \; \; \vdash \; \;  \textbf{P(x)} } EQL\_ RL

In these two rules x is a variable which is not free in E

Preferences for the Post-tactic

The post-tactic can be configured by means of a preference page which can be obtained as follows: press the "Window" button on the top tooolbar. On the coming menu, press the "Preferences" button. On the coming menu, press the "Event-B" menue, then the "Sequent Prover’, and finally the "Post-Tactic" button. This yilds the following window:

In the left part you can see the ordered sequence of individual tactics composing the post-tactic, whereas the right part contains further tactics you can incorporate in the left part. By selecting a tactic you can move it from on part to the other or change the order in the left part.

Interactive Tactics

In this section, the rewrite rules and inference rules, which you can use to perform an interactive proof, are presented. Each of these rules can be invoked by pressing "buttons" which corresponds to emphasized (red) operators in the goal or the hypotheses. A menu is proposed when there are several options.

Interactive Rewrite Rules

Most of the rewrite rules correspond to distributive laws. For associative operators in connection with such laws as in:


P \land (Q \lor \ldots \lor R)

it has been decided to put the "button" on the first associative/commutative operator (here \lor ). Pressing that button will generate a menu: the first option of this menu will be to distribute all associative/commutative operators, the second option will be to distribute only the first associative/commutative operator. In the following presentation, to simplify matters, we write associative/commutative operators with two parameters only, but it must always be understood implicitly that we have a sequence of them. For instance, we shall never write  Q \lor \ldots \lor R but  Q \lor R instead. Rules are sorted according to their purpose.


Conjunction


\begin{array}{l} P \land (Q \lor R) \; \; ==\; \;  (P \land Q) \lor (P \land R) \end{array}

Disjunction



\begin{array}{l}
P \lor (Q \land R) \;\;==\;\; (P \lor Q) \land (P \lor R) \\ \\
P \lor Q \lor \ldots \lor R \;\;==\;\; \neg\, P \limp (Q \lor \ldots \lor R)
\end{array}

Implication


\begin{array}{l}
P \limp Q \;\;==\;\; \neg\,Q \limp \neg P \\ \\
P \limp (Q \limp R) \;\;==\;\; P \land Q \limp R \\ \\
P \limp (Q \land R) \;\;==\;\; (P \limp Q) \;\land\;  (P \limp R) \\ \\
P \lor Q \;\limp\; R\;\;==\;\; (P \limp R)  \;\land\;  (Q \limp R)
\end{array}

Equivalence


\begin{array}{l}
P \leqv Q \;\;==\;\; (P \limp Q) \;\land\; (Q \limp P)
\end{array}

Negation


\begin{array}{l}
\neg\,(P \land Q) \;\;==\;\; \neg\,P \lor \neg\,Q \\ \\
\neg\,(P \lor Q) \;\;==\;\; \neg\,P \land \neg\,Q \\ \\
\neg\,(P \limp Q)\;\;==\;\; P \land \neg\,Q \\ \\
\neg\,\forall x \,\qdot\, P \;\;==\;\; \exists x \,\qdot\, \neg\,P \\ \\
\neg\,\exists x \,\qdot\, P \;\;==\;\; \forall x \,\qdot\, \neg\,P \\ \\
\neg \,(S = \emptyset) \;\;==\;\; \exists x \,\qdot\, x \in S
\end{array}

Set Theory

Most of the rules are concerned with simplifying set membership predicates.


\begin{array}{l}
E \mapsto F \;\in\; S \cprod T \;\;==\;\; E \in S \;\land\; F \in T \\ \\
E \in \pow(S) \;\;==\;\; E \subseteq S \\ \\
S \subseteq T \;\;==\;\; \forall x\,\qdot\,(\, x\in S \;\limp\; x \in T\,)
\end{array}

In the previous rule, x denotes several variables when the type of S and T is a Cartesian product.


\begin{array}{l}
E \in S \bunion T \;\;==\;\; E \in S \;\lor\; E \in T \\ \\
E \in S \binter T \;\;==\;\; E \in S \;\land\; E \in T \\ \\
E \in S \setminus T \;\;==\;\; E \in S \;\land\; \neg\, (E \in T) \\ \\
E \in \{A, \ldots, B\} \;\;\;==\;\;\; E=A \;\lor\;  \ldots \;\lor\; E=B \\ \\
E \in \union\,(S)\;\;==\;\; \exists s \,\qdot\, s \in S \;\land\; E \in s \\ \\
\;E \in (\Union\; x \,\qdot\,x \in S \;\land\; P\;|\; T\,) \;\;==\;\; \exists x \,\qdot\,x \in S \;\land\; P \;\land\; E \in T \\ \\
\;E \;\in\;  \inter\,(S) \;\;==\;\;  \forall s \,\qdot\, s \in S \;\limp\; E \in s \\ \\
\;E \;\in\;  (\Inter\; x \,\qdot \,x \in S \;\land\; P\;|\; T\,)\;\;==\;\;    \forall x \,\qdot\,x \in S \;\land\; P \;\limp\; E \in T \\ \\
E \in \dom(r)\;\;==\;\; \exists y \,\qdot \, E \mapsto y \;\in\; r \\ \\
F \in \ran(r) \;\;==\;\;\exists x \,\qdot \, x \mapsto F \;\in\; r \\ \\
E \mapsto F \in r^{-1}\;\;==\;\;  F \mapsto E \in r
\\ \\
E \mapsto F \;\in\; S \domres r \;\;==\;\; E \in S \;\;\land\;\;  E \mapsto F \in r  \\ \\
E \mapsto F \;\in\; r \ranres T \;\;==\;\;  E \mapsto F \in r \;\;\land\;\; F \in T   \\ \\
E \mapsto F \;\in\; S \domsub r \;\;==\;\; E \notin S \;\;\land\;\;  E \mapsto F \in r \\ \\
E \mapsto F \;\in\; r \ransub T\;\;==\;\;  E \mapsto F \in r \;\;\land\;\; F \notin T \\ \\
F \in r[w]\;\;==\;\; \exists x \,\qdot\,  x \in w \;\;\land\;\;  x \mapsto F \in r \\ \\
E \mapsto F \in (p \fcomp q)\;\;==\;\; \exists x \,\qdot \, E \mapsto x \in p \;\;\land\;\;  x \mapsto F \in q \\ \\
p \ovl q\;\;==\;\; (\dom\,(q) \domsub p) \;\bunion\; q \\ \\
E \mapsto F \in \id(S)\;\;==\;\; E \in S  \;\;\land\;\; F=E \\ \\
E \mapsto (F \mapsto G)  \in p \dprod q\;\;==\;\; E \mapsto F \in p \;\;\land\;\; E \mapsto G \in q \\ \\
(E \mapsto G) \mapsto (F \mapsto H)  \in p \pprod q\;\;==\;\; E \mapsto F \in p \;\;\land\;\; G \mapsto H \in q \\ \\
r \in S \trel T \;\;==\;\; r \in S \rel T \;\land\; \dom(r) = S \\ \\
 r \in S \srel T \;\;==\;\; r \in S \rel T \;\land\; \ran(r) = T \\ \\
 r \in S \strel T \;\;==\;\; r \in S \rel T \;\land\;  \dom(r) = S \;\land\; \ran(r) = T
\\ \\
 f \in S \pfun T \;\;==\;\; f \in S \rel T \;\land\; \forall x,y,z \qdot x\mapsto y \in f \;\land\; x \mapsto z  \in f \;\limp\; y=z \\ \\
 f \in S \tfun T \;\;==\;\; f \in S \pfun T \;\land\; \dom(f)=S \\ \\
 f \in S \pinj T \;\;==\;\; f \in S \pfun T \;\land\; f^{-1} \in T \pfun S
\end{array}

\begin{array}{l}
 f \in S \tinj T \;\;==\;\; f \in S \pinj T \;\land\; \dom(f) = S \\ \\
 f \in S \psur T \;\;==\;\; f \in S \pfun T \;\land\; \ran(f) = T  \\ \\
 f \in S \tsur T \;\;==\;\; f \in S \psur T \;\land\; \dom(f) = S\\ \\
 f \in S \tbij T \;\;==\;\; f \in S \tinj T \;\land\; \ran(f)=T \\ \\
(p \bunion q)^{-1} \;\;==\;\; p^{-1} \bunion q^{-1} \\ \\
(p \binter q)^{-1} \;\;==\;\; p^{-1} \binter q^{-1} \\ \\
(s \domres r)^{-1} \;\;==\;\; r^{-1} \ranres s \\ \\
(s \domsub r)^{-1} \;\;==\;\; r^{-1} \ransub s \\ \\
(r \ranres s)^{-1} \;\;==\;\; s \domres r^{-1} \\ \\
(r \ransub s)^{-1} \;\;==\;\; s \domres r^{-1} \\ \\
(p \fcomp q)^{-1} \;\;==\;\; q^{-1} \fcomp p^{-1} \\ \\
 (s \bunion t) \domres r \;\;==\;\; (s \domres r) \bunion (t \domres r) \\ \\
(s \binter t) \domres r \;\;==\;\; (s \domres r) \binter (t \domres r) \\ \\
(s \bunion t) \domsub r \;\;==\;\; (s \domsub r) \binter (t \domsub r) \\ \\
(s \binter t) \domsub r \;\;==\;\; (s \domsub r) \bunion (t \domsub r) \\ \\
s \domres (p \bunion q) \;\;==\;\; (s \domres p) \bunion (s \domres q) \\ \\
s \domres (p \binter q) \;\;==\;\; (s \domres p) \binter (s \domres q) \\ \\
s \domsub (p \bunion q) \;\;==\;\; (s \domsub p) \bunion (s \domsub q) \\ \\
s \domsub (p \binter q) \;\;==\;\; (s \domsub p) \binter (s \domsub q) \\ \\
r \ranres (s \bunion t) \;\;==\;\; (r \ranres s) \bunion (r \ranres t) \\ \\
r \ranres (s \binter t) \;\;==\;\; (r \ranres s) \binter (r \ranres t) \\ \\
r \ransub (s \bunion t) \;\;==\;\; (r \ransub s) \binter (r \ransub t) \\ \\
r \ransub (s \binter t) \;\;==\;\; (r \ransub s) \bunion (r \ransub t) \\ \\
(p \bunion q) \ranres s \;\;==\;\; (p \ranres s) \bunion (q \ranres s) \\ \\
(p \binter q) \ranres s \;\;==\;\; (p \ranres s) \binter (q \ranres s) \\ \\
(p \bunion q) \ransub s \;\;==\;\; (p \ransub s) \bunion (q \ransub s) \\ \\
(p \binter q) \ransub s \;\;==\;\; (p \ransub s) \binter (q \ransub s) \\ \\
r[S \bunion T] \;\;==\;\; r[S] \bunion r[T]
\end{array}

\begin{array}{l}
(p \bunion q)[S] \;\;==\;\; p[S] \bunion q[S] \\ \\
\dom(p \bunion q) \;\;==\;\; \dom(p) \bunion \dom(q) \\ \\
\ran(p \bunion q) \;\;==\;\; \ran(p) \bunion \ran(q) \\ \\
S \subseteq T \;\;==\;\; (U \setminus T) \subseteq (U \setminus S)
\end{array}

In the previous rule, the type of S and T is \pow(U).


\begin{array}{l} S = T \; \; ==\; \;  S \subseteq T \; \land \;  T \subseteq S \end{array}

In the previous rule, S and T are sets


\begin{array}{l}
S \;\subseteq\; A \setminus B \;\;==\;\; S \subseteq A \;\,\land\;\, S \binter B = \emptyset  \\ \\
p \fcomp (q \bunion r) \;\;==\;\; (p \fcomp q) \bunion (p \fcomp r) \\ \\
(q \bunion r) \fcomp p \;\;==\;\; (q \fcomp p) \bunion (r \fcomp p) \\ \\
(p \fcomp q)[s] \;\;==\;\; q[p[s]] \\ \\
(s \domres p) \fcomp q \;\;==\;\; s \domres (p \fcomp q)  \\ \\
(s \domsub p) \fcomp q \;\;==\;\; s \domsub (p \fcomp q)  \\ \\
p \fcomp (q \ranres s) \;\;==\;\; (p \fcomp q) \ranres s  \\ \\
p \fcomp (q \ransub s) \;\;==\;\; (p \fcomp q) \ransub s \\ \\
U \setminus (S \binter T) \;\;==\;\; (U\setminus S) \bunion (U \setminus T) \\ \\
U \setminus (S \bunion T) \;\;==\;\; (U\setminus S) \binter (U \setminus T) \\ \\
U \setminus (S \setminus T) \;\;==\;\; (U\setminus S) \bunion T \\ \\
\end{array}

In the three previous rules, S and T are supposed to be of type \pow(U).

Cardinality


\begin{array}{l}
\card\,(S) \leq \card(T) \;\;==\;\; S \subseteq T \\ \\
\card\,(S) \geq \card(T) \;\;==\;\; T \subseteq S \\ \\
\card\,(S) < \card(T) \;\;==\;\; S \subset T \\ \\
\card\,(S) > \card(T) \;\;==\;\; T \subset S \\ \\
\card\,(S) = \card(T) \;\;==\;\; S = T
\end{array}

In the five previous rules, S and T must be of the same type.

Interactive Inference Rules

Disjunction

\frac{\textbf{H}, \; \textbf{P} \; \; \vdash \; \;  \textbf{R} \  \  \  \  \ldots \  \  \  \   \textbf{H}, \; \textbf{Q} \; \; \vdash \; \;  \textbf{R} }{\textbf{H},\; \textbf{P} \lor \ldots \lor \textbf{Q} \; \; \vdash \; \;  \textbf{R} } CASE

Implication

\frac{\textbf{H} \;\;\vdash\;\;\textbf{P} \qquad \textbf{H},\;\textbf{P},\; \textbf{Q} \;\;\vdash \;\; \textbf{R} }{\textbf{H},\;\textbf{P} \limp \textbf{Q} \;\;\vdash \;\; \textbf{R} \ \ \ \ \ } MH
\frac{\textbf{H} \;\;\vdash\;\;\neg\,\textbf{Q} \qquad \textbf{H},\;\neg\,\textbf{Q},\; \neg\,\textbf{P} \;\;\vdash \;\; \textbf{R} }{\textbf{H},\;\textbf{P} \limp \textbf{Q} \;\;\vdash \;\; \textbf{R} \ \ \ \ \ } HM

Equivalence

\frac{\textbf{H(Q)}, \textbf{P} \leqv \textbf{Q} 
\;\;\vdash\;\; \textbf{G(Q)}}{\textbf{H(P)},\;\textbf{P} \leqv \textbf{Q} 
\;\;\vdash \;\; \textbf{G(P)} \ \ \ \ \ } EQV}
postponed

Set Theory

\frac{\textbf{H},\; G=E  
,\;\textbf{P}(F)\;\;\vdash\;\;\textbf{Q} \qquad \textbf{H},\; \neg\,(G=E)  
,\;\textbf{P}(f(G))\;\;\vdash\;\;\textbf{Q}}{\textbf{H},\;\textbf{P}((f\ovl\{E 
\mapsto F\})(G)) \;\;\vdash \;\; \textbf{Q}} OV_L
\frac{\textbf{H},\; G=E \;\;\vdash\;\;\textbf{Q}(F) 
\qquad \textbf{H},\; \neg\,(G=E)  \;\;\vdash\;\;\textbf{Q}(f(G))}{\textbf{H} 
\;\;\vdash \;\; \textbf{Q}((f\ovl\{E \mapsto F\})(G)) \ \ \ \ \ } OV_R
\frac{\textbf{H},\; G \in \dom(g)  ,\;\textbf{P}(g(G))\;\;\vdash\;\;\textbf{Q} \qquad \textbf{H},\; \neg\,G \in \dom(g)  ,\;\textbf{P}(f(G))\;\;\vdash\;\;\textbf{Q}}{\textbf{H},\;\textbf{P}((f\ovl g)(G)) \;\;\vdash \;\; \textbf{Q} \ \ \ \ \ } OV_L
\frac{\textbf{H},\; G \in \dom(g) \;\;\vdash\;\;\textbf{Q}(g(G)) \qquad \textbf{H},\; \neg\, G \in \dom(g) \;\;\vdash\;\;\textbf{Q}(f(G))}{\textbf{H} \;\;\vdash \;\; \textbf{Q}((f\ovl g)(G)) \ \ \ \ \ } OV_R

In the four previous rules the \ovl operator must appear at the "top level"

\frac{\textbf{H} \;\;\vdash\;\; f^{-1} \in A \pfun B    \qquad\textbf{H} \;\;\vdash\;\;\textbf{Q}(f[S] \binter f[T]) }{\textbf{H} \;\;\vdash \;\; \textbf{Q}(f[S \binter T]) \ \ \ \ \ } \binterDIS_R
\frac{\textbf{H} \;\;\vdash\;\; f \in A \pfun B    \qquad\textbf{H} \;\;\vdash\;\;\textbf{Q}(f^{-1}[S] \setminus f^{-1}[T]) }{\textbf{H} \;\;\vdash \;\; \textbf{Q}(f^{-1}[S \setminus T]) \ \ \ \ \ } \setminusDIS_R

In the two previous rules, the occurrence of f^{-1} must appear at the "top level". Moreover A and B denote some type. Similar left distribution rules exist

\frac{\textbf{H} \; \; \vdash \; \; {WD}(\textbf{Q}(\{ 
    f(E)\} )) \qquad\textbf{H} \; \; \vdash \; \; \textbf{Q}(\{ f(E)\} ) 
    }{\textbf{H} \; \; \vdash \; \;  \textbf{Q}(f[\{ E\} ])} SIM_R

In the previous rule, the occurrence of f must appear at the "top level". A similar left simplification rule exists.

\frac{\textbf{H} \;\;\vdash\;\;{WD}(\textbf{Q}(g(f(x))))    \qquad\textbf{H} \;\;\vdash\;\;\textbf{Q}(g(f(x))) }{\textbf{H} \;\;\vdash \;\; \textbf{Q}((f \fcomp g)(x)) \ \ \ \ \ } SIM_R

In the previous rule, the occurrence of f \fcomp g must appear at the "top level". A similar left simplification rule exists.

Finiteness

\frac{\textbf{H} \;\;\vdash \;\; S \subseteq T \qquad; \textbf{H} \;\;\vdash \;\; \finite\,(T)}{\textbf{H} \;\;\vdash \;\; \finite\,(S) \ \ \ \ \ \ \ } fin\subseteq_R

For applying the previous rule, the user has to write the set corresponding to T in the editing area of the Proof Control Window.

\frac{\textbf{H} \;\;\vdash 
\;\;\finite\,(S) \;\lor\;\ldots \;\lor\; \finite\,(T)}{\textbf{H} \;\;\vdash 
\;\; \finite\,(S \;\binter\;\ldots \;\binter\; T)} fin\binter_R
\frac{\textbf{H} \;\;\vdash 
\;\;\finite\,(S)}{\textbf{H} \;\;\vdash \;\; \finite\,(S \;\setminus\; T) \ \ 
\ \ \ \ \ } fin\setminus_R
\frac{\textbf{H} \;\;\vdash \;\; r \;\in\; S \rel T 
\qquad \textbf{H} \;\;\vdash \;\; \finite\,(S) \qquad \textbf{H} \;\;\vdash 
\;\; \finite\,(T)}{\textbf{H} \;\;\vdash \;\; \finite\,(r)} fin_rel_R

For applying the previous rule, the user has to write the set corresponding to S \rel T in the editing area of the Proof Control Window.

\frac{\textbf{H} \;\;\vdash \;\; \finite\,(r) }{\textbf{H} \;\;\vdash \;\; \finite\,(r[s]) \ \ \ \ \ \ \ } fin_rel_img_R
\frac{\textbf{H} \;\;\vdash \;\; \finite\,(r) }{\textbf{H} \;\;\vdash \;\; \finite\,(\ran(r)) \ \ \ \ \ \ \ } fin_rel_ran_R
\frac{\textbf{H} \;\;\vdash \;\; \finite\,(r) }{\textbf{H} \;\;\vdash \;\; \finite\,(\dom(r)) \ \ \ \ \ \ \ } fin_rel_dom_R
\frac{\textbf{H} \;\;\vdash \;\; f \;\in\; S \pfun T \qquad \textbf{H} \;\;\vdash \;\; \finite\,(S) }{\textbf{H} \;\;\vdash \;\; \finite\,(f) \ \ \ \ \ \ \ } fin_fun1_R

For applying the previous rule, the user has to write the set corresponding to S  \pfun T in the editing area of the Proof Control Window.

\frac{\textbf{H} \;\;\vdash \;\; f^{-1} \;\in\; S \pfun T \qquad \textbf{H} \;\;\vdash \;\; \finite\,(S) }{\textbf{H} \;\;\vdash \;\; \finite\,(f) \ \ \ \ \ \ \ } fin_fun2_R

For applying the previous rule, the user has to write the set corresponding to S  \pfun T in the editing area of the Proof Control Window.

\frac{\textbf{H} \;\;\vdash \;\; f \;\in\; S \pfun T \qquad \textbf{H} \;\;\vdash \;\; \finite\,(s) }{\textbf{H} \;\;\vdash \;\; \finite\,(f[s]) \ \ \ \ \ \ \ } fin_fun_img_R
\frac{\textbf{H} \;\;\vdash \;\; f \;\in\; S \pfun T \qquad \textbf{H} \;\;\vdash \;\; \finite\,(S) }{\textbf{H} \;\;\vdash \;\; \finite\,(\ran(f)) \ \ \ \ \ \ \ } fin_fun_ran_R

For applying the previous rule, the user has to write the set corresponding to S  \pfun T in the editing area of the Proof Control Window.

\frac{\textbf{H} \;\;\vdash \;\; f^{-1} \;\in\; S \pfun T \qquad \textbf{H} \;\;\vdash \;\; \finite\,(S) }{\textbf{H} \;\;\vdash \;\; \finite\,(\dom(f)) \ \ \ \ \ \ \ } fin_fun_dom_R

For applying the previous rule, the user has to write the set corresponding to S  \pfun T in the editing area of the Proof Control Window.

\frac{\textbf{H} \;\;\vdash \;\; \finite(S)  }{\textbf{H} \;\;\vdash \;\; \exists n\,\qdot\, (\forall x \,\qdot\, x \in S \;\limp\; n \leq x)}
\frac{\textbf{H} \;\;\vdash \;\; \finite(S)  }{\textbf{H} \;\;\vdash \;\; \exists n\,\qdot\, (\forall x \,\qdot\, x \in S \;\limp\; x \geq n)}
\frac{\textbf{H} \;\;\vdash \;\; \finite(S)  }{\textbf{H} \;\;\vdash \;\; \exists n\,\qdot\, (\forall x \,\qdot\, x \in S \;\limp\; n \geq x)}
\frac{\textbf{H} \;\;\vdash \;\; \finite(S)  }{\textbf{H} \;\;\vdash \;\; \exists n\,\qdot\, (\forall x \,\qdot\, x \in S \;\limp\; x \leq n)}

In the four previous rules, S must not contain any bound variable.

\frac{\textbf{H} \;\;\vdash \;\; \exists n\,\qdot\, (\forall x \,\qdot\, x \in S \;\limp\; n \leq x)  \qquad \textbf{H} \;\;\vdash \;\; S \subseteq \intg \setminus \natn }{\textbf{H} \;\;\vdash \;\; \finite(S)}
\frac{\textbf{H} \;\;\vdash \;\; \exists n\,\qdot\, (\forall x \,\qdot\, x \in S \;\limp\; x \leq n)  \qquad \textbf{H} \;\;\vdash \;\; S \subseteq \nat }{\textbf{H} \;\;\vdash \;\; \finite(S)}

Cardinality

\frac{\textbf{H},\, a \leq b \;\;\vdash \;\; \textbf{Q}(b-a+1) \qquad \textbf{H},\, b < a \;\;\vdash \;\; \textbf{Q}(0) }{\textbf{H} \;\;\vdash\;\; \textbf{Q}(\card\,(a\upto b))}
\frac{\textbf{H},\, a \leq b,\,\textbf{P}(a-b+1)  \;\;\vdash \;\; \textbf{Q} \qquad \textbf{H},\, b < a ,\, \textbf{P}(0)\;\;\vdash \;\; \textbf{Q} }{\textbf{H},\,\textbf{P}(\card\,(a\upto b))  \;\;\vdash\;\; \textbf{Q}}

In the two previous rules, \card (a \upto b) must appear at "top-level".

\frac{\textbf{H}  \;\;\vdash \;\; \textbf{P}(S \subseteq T)  }{\textbf{H} \;\;\vdash\;\; \textbf{P}(\card\,(S) \leq \card(T))}

There are similar rules for other cases