@@ -993,7 +993,7 @@ \subsection{\tt contradiction
993
993
\tacindex {contradict}
994
994
995
995
This tactic allows to manipulate negated hypothesis and goals. The
996
- name \ident \ should correspond to an hypothesis. With
996
+ name \ident \ should correspond to a hypothesis. With
997
997
{\tt contradict H}, the current goal and context is transformed in
998
998
the following way:
999
999
\begin {itemize }
@@ -2395,17 +2395,20 @@ \subsection{\tt compare \term$_1$ \term$_2$
2395
2395
of \term $ _1 $ and \term $ _2 $ must satisfy the same restrictions as in the tactic
2396
2396
\texttt {decide equality }.
2397
2397
2398
- \subsection {\tt discriminate {\ident }
2398
+ \subsection {\tt discriminate {\term }
2399
2399
\label {discriminate }
2400
- \tacindex {discriminate} }
2400
+ \tacindex {discriminate}
2401
+ \tacindex {ediscriminate} }
2401
2402
2402
- This tactic proves any goal from an absurd hypothesis stating that two
2403
+ This tactic proves any goal from an assumption stating that two
2403
2404
structurally different terms of an inductive set are equal. For
2404
- example, from the hypothesis {\tt (S (S O))=(S O)} we can derive by
2405
- absurdity any proposition. Let {\ident } be a hypothesis of type
2406
- {\tt {\term $ _1 $ } = {\term $ _2 $ }} in the local context, {\term $ _1 $ } and
2405
+ example, from {\tt (S (S O))=(S O)} we can derive by absurdity any
2406
+ proposition.
2407
+
2408
+ The argument {\term } is assumed to be a proof of a statement
2409
+ of conclusion {\tt {\term $ _1 $ } = {\term $ _2 $ }} with {\term $ _1 $ } and
2407
2410
{\term $ _2 $ } being elements of an inductive set. To build the proof,
2408
- the tactic traverses the normal forms\footnote {Recall : opaque
2411
+ the tactic traverses the normal forms\footnote {Reminder : opaque
2409
2412
constants will not be expanded by $ \delta $ reductions} of
2410
2413
{\term $ _1 $ } and {\term $ _2 $ } looking for a couple of subterms {\tt u}
2411
2414
and {\tt w} ({\tt u} subterm of the normal form of {\term $ _1 $ } and
@@ -2414,55 +2417,70 @@ \subsection{\tt discriminate {\ident}
2414
2417
such a couple of subterms exists, then the proof of the current goal
2415
2418
is completed, otherwise the tactic fails.
2416
2419
2417
- \Rem If { \ ident } does not denote an hypothesis in the local context
2418
- but refers to an hypothesis quantified in the goal, then the
2419
- latter is first introduced in the local context using
2420
- \texttt {intros until \ident }.
2420
+ \Rem The syntax { \tt discriminate { \ ident }} can be used to refer to a
2421
+ hypothesis quantified in the goal. In this case, the quantified
2422
+ hypothesis whose name is { \ident } is first introduced in the local
2423
+ context using \texttt {intros until \ident }.
2421
2424
2422
2425
\begin {ErrMsgs }
2423
- \item { \ident } \ errindex {Not a discriminable equality} \\
2424
- occurs when the type of the specified hypothesis is not an equation.
2426
+ \item \ errindex {No primitive equality found}
2427
+ \item \errindex {Not a discriminable equality}
2425
2428
\end {ErrMsgs }
2426
2429
2427
2430
\begin {Variants }
2428
- \item \texttt {discriminate } \num \\
2429
- This does the same thing as \texttt {intros until \num } then
2430
- \texttt {discriminate \ident } where {\ident } is the identifier for the last
2431
- introduced hypothesis.
2432
- \item {\tt discriminate}\\
2433
- It applies to a goal of the form {\tt
2434
- \verb =~ ={\term $ _1 $ }={\term $ _2 $ }} and it is equivalent to:
2435
- {\tt unfold not; intro {\ident }}; {\tt discriminate
2436
- {\ident }}.
2431
+ \item \texttt {discriminate } \num
2432
+
2433
+ This does the same thing as \texttt {intros until \num } followed by
2434
+ \texttt {discriminate \ident } where {\ident } is the identifier for
2435
+ the last introduced hypothesis.
2436
+
2437
+ \item \texttt {discriminate } {\term } {\tt with} {\bindinglist }
2438
+
2439
+ This does the same thing as \texttt {discriminate {\term } } but using
2440
+ the given bindings to instantiate parameters or hypotheses of {\term }.
2441
+
2442
+ \item \texttt {ediscriminate } \num \\
2443
+ \texttt {ediscriminate } {\term } \zeroone {{\tt with} {\bindinglist }}
2444
+
2445
+ This works the same as {\tt discriminate} but if the type of {\term },
2446
+ or the type of the hypothesis referred to by {\num }, has uninstantiated
2447
+ parameters, these parameters are left as existential variables.
2448
+
2449
+ \item \texttt {discriminate }
2450
+
2451
+ This looks for a quantified or not quantified hypothesis {\ident } on
2452
+ which {\tt discriminate {\ident }} is applicable.
2437
2453
2438
2454
\begin {ErrMsgs }
2439
2455
\item \errindex {No discriminable equalities} \\
2440
2456
occurs when the goal does not verify the expected preconditions.
2441
2457
\end {ErrMsgs }
2442
2458
\end {Variants }
2443
2459
2444
- \subsection {\tt injection {\ident }
2460
+ \subsection {\tt injection {\term }
2445
2461
\label {injection }
2446
- \tacindex {injection} }
2462
+ \tacindex {injection}
2463
+ \tacindex {einjection} }
2447
2464
2448
2465
The {\tt injection} tactic is based on the fact that constructors of
2449
2466
inductive sets are injections. That means that if $ c$ is a constructor
2450
2467
of an inductive set, and if $ (c~\vec {t_1})$ and $ (c~\vec {t_2})$ are two
2451
2468
terms that are equal then $ ~\vec {t_1}$ and $ ~\vec {t_2}$ are equal
2452
2469
too.
2453
2470
2454
- If {\ident } is an hypothesis of type {\tt {\term $ _1 $ } = {\term $ _2 $ }},
2455
- then {\tt injection} behaves as applying injection as deep as possible to
2471
+ If {\term } is a proof of a statement of conclusion
2472
+ {\tt {\term $ _1 $ } = {\term $ _2 $ }},
2473
+ then {\tt injection} applies injectivity as deep as possible to
2456
2474
derive the equality of all the subterms of {\term $ _1 $ } and {\term $ _2 $ }
2457
- placed in the same positions. For example, from the hypothesis {\tt (S
2475
+ placed in the same positions. For example, from {\tt (S
2458
2476
(S n))=(S (S (S m))} we may derive {\tt n=(S m)}. To use this
2459
2477
tactic {\term $ _1 $ } and {\term $ _2 $ } should be elements of an inductive
2460
2478
set and they should be neither explicitly equal, nor structurally
2461
2479
different. We mean by this that, if {\tt n$ _1 $ } and {\tt n$ _2 $ } are
2462
2480
their respective normal forms, then:
2463
2481
\begin {itemize }
2464
2482
\item {\tt n$ _1 $ } and {\tt n$ _2 $ } should not be syntactically equal,
2465
- \item there must not exist any couple of subterms {\tt u} and {\tt w},
2483
+ \item there must not exist any pair of subterms {\tt u} and {\tt w},
2466
2484
{\tt u} subterm of {\tt n$ _1 $ } and {\tt w} subterm of {\tt n$ _2 $ } ,
2467
2485
placed in the same positions and having different constructors as
2468
2486
head symbols.
@@ -2501,69 +2519,94 @@ \subsection{\tt injection {\ident}
2501
2519
To define such an equality, you have to use the {\tt Scheme} command
2502
2520
(see \ref {Scheme }).
2503
2521
2504
- \Rem If {\ident } does not denote an hypothesis in the local context
2505
- but refers to an hypothesis quantified in the goal, then the
2506
- latter is first introduced in the local context using
2507
- \texttt {intros until \ident }.
2522
+ \Rem If some quantified hypothesis of the goal is named {\ident }, then
2523
+ {\tt injection {\ident }} first introduces the hypothesis in the local
2524
+ context using \texttt {intros until \ident }.
2508
2525
2509
2526
\begin {ErrMsgs }
2510
- \item {\ident } \errindex {is not a projectable equality}
2511
- occurs when the type of
2512
- the hypothesis $ id$ does not verify the preconditions.
2513
- \item \errindex {Not an equation} occurs when the type of the
2514
- hypothesis $ id$ is not an equation.
2527
+ \item \errindex {Not a projectable equality but a discriminable one}
2528
+ \item \errindex {Nothing to do, it is an equality between convertible terms}
2529
+ \item \errindex {Not a primitive equality}
2515
2530
\end {ErrMsgs }
2516
2531
2517
2532
\begin {Variants }
2518
2533
\item \texttt {injection } \num {}
2519
2534
2520
- This does the same thing as \texttt {intros until \num } then
2535
+ This does the same thing as \texttt {intros until \num } followed by
2521
2536
\texttt {injection \ident } where {\ident } is the identifier for the last
2522
2537
introduced hypothesis.
2523
2538
2524
- \item {\tt injection}\tacindex {injection}
2539
+ \item \texttt {injection } \term {} {\tt with} {\bindinglist }
2540
+
2541
+ This does the same as \texttt {injection {\term } } but using
2542
+ the given bindings to instantiate parameters or hypotheses of {\term }.
2543
+
2544
+ \item \texttt {einjection } \num \\
2545
+ \texttt {einjection } \term {} \zeroone {{\tt with} {\bindinglist }}
2546
+
2547
+ This works the same as {\tt injection} but if the type of {\term },
2548
+ or the type of the hypothesis referred to by {\num }, has uninstantiated
2549
+ parameters, these parameters are left as existential variables.
2550
+
2551
+ \item {\tt injection}
2525
2552
2526
2553
If the current goal is of the form {\term $ _1 $ } {\tt <>} {\term $ _2 $ },
2527
- the tactic computes the head normal form of the goal and then
2528
- behaves as the sequence: {\tt unfold not; intro {\ident }; injection
2529
- {\ident }}.
2554
+ this behaves as {\tt intro {\ident }; injection {\ident }}.
2530
2555
2531
2556
\ErrMsg \errindex {goal does not satisfy the expected preconditions}
2532
2557
2533
- \item \texttt {injection } \ident { } \texttt {as } \nelist {\intropattern }{}\\
2558
+ \item \texttt {injection } \term {} \zeroone {{ \tt with} { \bindinglist } } \texttt {as } \nelist {\intropattern }{}\\
2534
2559
\texttt {injection } \num {} \texttt {as } {\intropattern } {\ldots } {\intropattern }\\
2535
2560
\texttt {injection } \texttt {as } {\intropattern } {\ldots } {\intropattern }\\
2561
+ \texttt {einjection } \term {} \zeroone {{\tt with} {\bindinglist }} \texttt {as } \nelist {\intropattern }{}\\
2562
+ \texttt {einjection } \num {} \texttt {as } {\intropattern } {\ldots } {\intropattern }\\
2563
+ \texttt {einjection } \texttt {as } {\intropattern } {\ldots } {\intropattern }\\
2536
2564
\tacindex {injection \ldots {} as}
2537
2565
2538
- These variants apply \texttt {intros } \nelist {\intropattern }{} after the call to \texttt {injection }.
2566
+ These variants apply \texttt {intros } \nelist {\intropattern }{} after
2567
+ the call to \texttt {injection } or \texttt {einjection }.
2539
2568
2540
2569
\end {Variants }
2541
2570
2542
- \subsection {\tt simplify\_ eq {\ident }
2571
+ \subsection {\tt simplify\_ eq {\term }
2543
2572
\tacindex {simplify\_ eq}
2573
+ \tacindex {esimplify\_ eq}
2544
2574
\label {simplify-eq } }
2545
2575
2546
- Let {\ident } be the name of an hypothesis of type {\tt
2547
- {\term $ _1 $ }={\term $ _2 $ }} in the local context . If {\term $ _1 $ } and
2576
+ Let {\term } be the proof of a statement of conclusion {\tt
2577
+ {\term $ _1 $ }={\term $ _2 $ }}. If {\term $ _1 $ } and
2548
2578
{\term $ _2 $ } are structurally different (in the sense described for the
2549
2579
tactic {\tt discriminate}), then the tactic {\tt simplify\_ eq} behaves as {\tt
2550
- discriminate {\ident }} otherwise it behaves as {\tt injection
2551
- {\ident }}.
2580
+ discriminate {\term }}, otherwise it behaves as {\tt injection
2581
+ {\term }}.
2552
2582
2553
- \Rem If {\ident } does not denote an hypothesis in the local context
2554
- but refers to an hypothesis quantified in the goal, then the
2555
- latter is first introduced in the local context using
2556
- \texttt {intros until \ident }.
2583
+ \Rem If some quantified hypothesis of the goal is named {\ident }, then
2584
+ {\tt simplify\_ eq {\ident }} first introduces the hypothesis in the local
2585
+ context using \texttt {intros until \ident }.
2557
2586
2558
2587
\begin {Variants }
2559
2588
\item \texttt {simplify\_ eq } \num
2560
2589
2561
2590
This does the same thing as \texttt {intros until \num } then
2562
2591
\texttt {simplify\_ eq \ident } where {\ident } is the identifier for the last
2563
2592
introduced hypothesis.
2593
+
2594
+ \item \texttt {simplify\_ eq } \term {} {\tt with} {\bindinglist }
2595
+
2596
+ This does the same as \texttt {simplify\_ eq {\term } } but using
2597
+ the given bindings to instantiate parameters or hypotheses of {\term }.
2598
+
2599
+ \item \texttt {esimplify\_ eq } \num \\
2600
+ \texttt {esimplify\_ eq } \term {} \zeroone {{\tt with} {\bindinglist }}
2601
+
2602
+ This works the same as {\tt simplify\_ eq} but if the type of {\term },
2603
+ or the type of the hypothesis referred to by {\num }, has uninstantiated
2604
+ parameters, these parameters are left as existential variables.
2605
+
2564
2606
\item {\tt simplify\_ eq}
2565
- If the current goal has form $ \verb =~=t_1 =t_2 $ , then this tactic does
2566
- \texttt {hnf; intro {\ident }; simplify\_ eq {\ident } }.
2607
+
2608
+ If the current goal has form $ t_1 \verb =<>=t_2 $ , it behaves as
2609
+ \texttt {intro {\ident }; simplify\_ eq {\ident } }.
2567
2610
\end {Variants }
2568
2611
2569
2612
\subsection {\tt dependent rewrite -> {\ident }
@@ -2599,8 +2642,8 @@ \subsection{\tt inversion {\ident}
2599
2642
conditions that should hold for the instance $ (I~\vec {t})$ to be
2600
2643
proved by $ c_i$ .
2601
2644
2602
- \Rem If {\ident } does not denote an hypothesis in the local context
2603
- but refers to an hypothesis quantified in the goal, then the
2645
+ \Rem If {\ident } does not denote a hypothesis in the local context
2646
+ but refers to a hypothesis quantified in the goal, then the
2604
2647
latter is first introduced in the local context using
2605
2648
\texttt {intros until \ident }.
2606
2649
@@ -3242,7 +3285,7 @@ \subsection{\tt congruence
3242
3285
(see \ref {injection } and \ref {discriminate }).
3243
3286
If the goal is a non-quantified equality, {\tt congruence} tries to
3244
3287
prove it with non-quantified equalities in the context. Otherwise it
3245
- tries to infer a discriminable equality from those in the context. Alternatively, congruence tries to prove that an hypothesis is equal to the goal or to the negation of another hypothesis.
3288
+ tries to infer a discriminable equality from those in the context. Alternatively, congruence tries to prove that a hypothesis is equal to the goal or to the negation of another hypothesis.
3246
3289
3247
3290
{\tt congruence} is also able to take advantage of hypotheses stating quantified equalities, you have to provide a bound for the number of extra equalities generated that way. Please note that one of the members of the equality must contain all the quantified variables in order for {\tt congruence} to match against it.
3248
3291
0 commit comments