fix(library/constructions/brec_on): make motive explicit in *.below

Otherwise you can't figure out the type from the pretty-printed output
`nat.below n`.
This commit is contained in:
Gabriel Ebner 2017-07-23 09:38:44 +01:00
parent 537b11f358
commit 25aa847aba
4 changed files with 72 additions and 63 deletions

View file

@ -96,6 +96,8 @@ static environment mk_below(environment const & env, name const & n, bool ibelow
args.push_back(ref_args[i]);
typeformer_names.push_back(mlocal_name(ref_args[i]));
}
// make motive explicit
args[0] = update_local(args[0], {});
// we ignore minor premises in below/ibelow
for (unsigned i = nparams + ntypeformers + nminors; i < ref_args.size(); i++)
args.push_back(ref_args[i]);

View file

@ -1,9 +1,9 @@
succ
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (succ a_1)), succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (succ a_1)), succ ((_F.fst).fst a))
_F)
a_1
a
@ -11,11 +11,11 @@ succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (succ a_1)), succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (succ a_1)), succ ((_F.fst).fst a))
_F)
a_1
a
@ -29,10 +29,10 @@ succ
3
succ
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (succ a_1)), succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (succ a_1)), succ ((_F.fst).fst a))
_F)
a_1
a
@ -40,11 +40,11 @@ succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (succ a_1)), succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (succ a_1)), succ ((_F.fst).fst a))
_F)
a_1
a

View file

@ -1,10 +1,10 @@
?m_1
nat.succ
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)), nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -12,11 +12,12 @@ nat.succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a

View file

@ -1,9 +1,9 @@
nat.succ
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)), nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -11,11 +11,12 @@ nat.succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -24,10 +25,11 @@ nat.succ
⟨ih_1, punit.star⟩,
⟨ih_1, punit.star⟩⟩)
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -35,11 +37,12 @@ nat.succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -54,10 +57,10 @@ nat.succ
a)
nat.succ
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)), nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -65,11 +68,12 @@ nat.succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -78,10 +82,11 @@ nat.succ
⟨ih_1, punit.star⟩,
⟨ih_1, punit.star⟩⟩)
((⟨nat.rec
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a
@ -89,11 +94,12 @@ nat.succ
0
punit.star,
punit.star⟩
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below a)),
⟨(λ (a : ) (_F : nat.below a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below a_1),
nat.cases_on a_1 (λ (_F : nat.below 0), a)
(λ (a_1 : ) (_F : nat.below (nat.succ a_1)), nat.succ ((_F.fst).fst a))
(λ (a : ) (ih_1 : pprod ((λ (a : ), ) a) (nat.below (λ (a : ), ) a)),
⟨(λ (a : ) (_F : nat.below (λ (a : ), ) a) (a_1 : ),
(λ (a a_1 : ) (_F : nat.below (λ (a : ), ) a_1),
nat.cases_on a_1 (λ (_F : nat.below (λ (a : ), ) 0), a)
(λ (a_1 : ) (_F : nat.below (λ (a : ), ) (nat.succ a_1)),
nat.succ ((_F.fst).fst a))
_F)
a_1
a