(enum_sum A B (enum A) (enum B))
(enumAB_unique … (enum_unique A) (enum_unique B)).
+include alias "basics/types.ma".
+
unification hint 0 ≔ C1,C2;
T1 ≟ FinSetcarr C1,
T2 ≟ FinSetcarr C2,
| cons a tl ⇒ (x == a) ∨ memb S x tl
].
-notation < "\memb x l" non associative with precedence 90 for @{'memb $x $l}.
-interpretation "boolean membership" 'memb a l = (memb ? a l).
+interpretation "boolean membership" 'mem a l = (memb ? a l).
lemma memb_hd: ∀S,a,l. memb S a (a::l) = true.
#S #a #l normalize >(proj2 … (eqb_true S …) (refl S a)) //
(* rhs = a::w1∈\sem{i1}\sem{|i2|} ∨ a::w∈\sem{i2} *)
@iff_trans[||@(iff_or_l … (HI2 w))]
(* rhs = a::w1∈\sem{i1}\sem{|i2|} ∨ w∈\sem{move S a i2} *)
- @iff_or_r
- check deriv_middot
+ @iff_or_r
(* we are left to prove that
w∈\sem{move S a i1}·\sem{|i2|} ↔ a::w∈\sem{i1}\sem{|i2|}
we use deriv_middot on the rhs *)
#S #w elim w
[* #i #b >moves_empty cases b % /2/
|#a #w1 #Hind #e >moves_cons
- check not_epsilon_sem
@iff_trans [||@iff_sym @not_epsilon_sem]
@iff_trans [||@move_ok] @Hind
]