alias symbol "eq" = "setoid1 eq".
alias symbol "eq" = "setoid eq".
alias symbol "eq" = "setoid1 eq".
+alias symbol "eq" = "setoid eq".
+alias symbol "eq" = "setoid1 eq".
nrecord partition (A: setoid) : Type[1] ≝
{ support: setoid;
indexes: qpowerclass support;
∀g: isomorphism A' A T' T.
big_union A B T f = big_union A' B T' (λx.f (iso_f ???? g x)).
+naxiom le_to_lt_or_eq: ∀n,m. n ≤ m → n < m ∨ n = m.
+naxiom minus_canc: ∀n. O = minus n n.
+naxiom lt_to_ltb:
+ ∀n,m. ∀P: n < m ∨ ¬ (n < m) → CProp[0].
+ (∀H: n < m. P (or_introl ?? H)) → n < m → P (ltb n m).
+
nlemma partition_splits_card:
∀A. ∀P:partition A. ∀n,s.
∀f:isomorphism ?? (Nat_ n) (indexes ? P).
ngeneralize in match (f_sur ???? (fi nindex) y ?) in ⊢ ?
[##2: napply (. #‡(†?));##[##3: napply Hni2 |##2: ##skip | nassumption]##]
*; #nindex2; *; #Hni21; #Hni22;
- nletin xxx ≝ (plus match nindex return λ_.nat with [ O ⇒ O | S nn ⇒ big_plus nn (λi.λ_.s i)] nindex2);
+ nletin xxx ≝ (plus match minus n nindex return λ_.nat with [ O ⇒ O | S nn ⇒ big_plus nn (λi.λ_.s (S (plus i nindex)))] nindex2);
napply (ex_intro … xxx); napply conj
- [ nwhd in Hni1; nelim daemon
+ [ nwhd in Hni1; nwhd; nelim daemon
| nwhd in ⊢ (???%?);
+ nchange in Hni1 with (nindex < S n);
+ ngeneralize in match (le_S_S_to_le … Hni1) in ⊢ ?; #K;
+ nwhd in ⊢ (???(???????%?)?);
+ nelim (le_to_lt_or_eq … K)
+ [##2: #K'; nrewrite > K'; nrewrite < (minus_canc n); nnormalize;
+ napply (eq_rect_CProp0 nat nindex (λx:nat.λ_.partition_splits_card_map A P (S n) s f fi nindex2 x = y) ? n K');
+ nchange in Hni21 with (nindex2 < s nindex); ngeneralize in match Hni21 in ⊢ ?;
+ ngeneralize in match Hni22 in ⊢ ?;
+ nelim nindex
+ [ #X1; #X2; nwhd in ⊢ (??? % ?);
+ napply (lt_to_ltb ???? X2); #D; nwhd in ⊢ (??? % ?); nassumption
+ | #n0; #_; #X1; #X2; nwhd in ⊢ (??? % ?);
+ napply (lt_to_ltb ???? X2); #D; nwhd in ⊢ (??? % ?); nassumption]
+
+
(* BEL POSTO DOVE FARE UN LEMMA *)
(* invariante: Hni1; altre premesse: Hni1, Hni22 *)
- nchange in Hni1 with (nindex < S n); ngeneralize in match Hni1 in ⊢ ?;
nelim n in ⊢ (% → ??? (????????%) ?)
[ #A (* decompose *)
| #index'; #Hrec; #K; nwhd in ⊢ (???%?);