qiitBag
data [a : 𝕌] ( Bag : U
; nil : El Bag
; ins : El a → El Bag → El Bag
; swp : (x : El a) (y : El a) (m : El Bag) → ins x (ins y m) ≡ ins y (ins x m) ∈ El Bag )
def swapG : (a : 𝕌) (x : El a) (y : El a) (m : El (Bag a)) →
ins _ x (ins _ y m) ≡ ins _ y (ins _ x m) ∈ _ ≔
λa. λx. λy. λm. ⋆
def size : (a : 𝕌) → El (Bag a) → ℕ ≔
λa. λm. BagElim _ (λb. ℕ) Z (λx. λr. λih. S ih) (λx. λy. λr. λih. ⋆) m
def swapN : ins _ Z (ins _ (S Z) (nil _)) ≡ ins _ (S Z) (ins _ Z (nil _)) ∈ _ ≔
swapG _ Z (S Z) (nil _)
def sizeTwoN : size _ (ins _ Z (ins _ (S Z) (nil _))) ≡ S (S Z) ∈ _ ≔ ⋆
def sizeOneU : size _ (ins _ () (nil _)) ≡ S Z ∈ _ ≔ ⋆