closes#1814
@kenmcmil: the error messages will now list aliased variables.
For example, in your file, the new error message is:
```
invalid type ascription, term has type
triple (ctxpre c' s_1 ∧ ctxpre c'_1 s_1) (bndngapp b s_1) (ctxpost c' s_1 ∧ ctxpost c'_1 s_1)
but is expected to have type
triple (ctxpre c' s_1 ∧ ctxpre c'_1 s_1) (bndngapp b s_1) (ctxpost c' s_1 ∧ ctxpost c'_1 s_1)
types contain aliased name(s): c'
remark: the tactic `dedup` can be used to rename aliases
state:
...
```
This is the equivalent of the `ginduction` tactic for cases, but rolled into the same syntax as `cases` itself. `cases h : term` is the syntax, and it will introduce a hypothesis `h : term = C a b...` demonstrating that the original term is equal to the current case.
I considered the possibility of calling `injection` on the generated equalities, but it's useless in the casaes when the equality carries some real information (such as `f x = C1 a`), and when the input term is a local constant, `injection` will do subst, which will undo the effect of the `cases`. If the input term is a constructor, then `injection` would do something interesting, but you would never want to call `cases` in this case because the constructor is already exposed.
As described at issue #1760, the new error message is:
```
1760.lean:6:18: error: type mismatch at application
f x
term
x
has type
big_type : Type 1
but is expected to have type
?m_1 : Type
```
Remarks:
- Some tests do not produce error messages anymore because they can be
processed using the new equation compiler preprocessor.
- Some error messages got worse because of the preprocessing step.
We use metavariables in the preprocessing step. This information
may "leak" to users. Another problem is that some variable names
are lost. Example: in the following definition
def to_nat : ∀ {n}, fi n → nat
| (succ n) f0 := 0
| (succ n) (fs i) := succ (to_nat i)
The preprocessing step uses metavariables for pattern variables.
Thus, we have
def to_nat : ∀ {n}, fi n → nat
| (succ ?n) (@f0 ?x) := 0
| (succ ?n) (@fs ?x ?i) := succ (to_nat i)
when solving the constraint `succ ?n =?= succ ?x`, Lean assigns
?n := ?x
after solving these constraints, the preprocessor converts
metavariables into pattern variables again, and we have
def to_nat : ∀ {n}, fi n → nat
| (succ x) (@f0 x) := 0
| (succ x) (@fs x i) := succ (to_nat i)
So, we get the following equation lemmas:
to_nat.equations._eqn_1 : ∀ (x : ℕ), @to_nat (succ x) (@f0 x) = 0
to_nat.equations._eqn_2 : ∀ (x : ℕ) (i : fi x), @to_nat (succ x) (@fs x i) = succ (@to_nat x i)
instead of
to_nat.equations._eqn_1 : ∀ (n : ℕ), @to_nat (succ n) (@f0 n) = 0
to_nat.equations._eqn_2 : ∀ (n : ℕ) (i : fi n), @to_nat (succ n) (@fs n i) = succ (@to_nat n i)