# HG changeset patch # User Shinji KONO # Date 1574328862 -32400 # Node ID ee43fecd3f3489e10df3cae307402ea7fdd232c3 # Parent 481691ffc7107876b831db41e5149f414c6a7d15 ... diff -r 481691ffc710 -r ee43fecd3f34 agda/finiteSet.agda --- a/agda/finiteSet.agda Wed Nov 20 22:31:54 2019 +0900 +++ b/agda/finiteSet.agda Thu Nov 21 18:34:22 2019 +0900 @@ -202,8 +202,6 @@ iso→ (case2 x) = refl fin-∨2 {B} (suc a) {b} fb = iso-fin (fin-∨1 (fin-∨2 a fb) ) iso where - fin : FiniteSet (Fin a ∨ B) {a Data.Nat.+ b} - fin = fin-∨2 a fb iso : ISO (One ∨ (Fin a ∨ B) ) (Fin (suc a) ∨ B) ISO.A←B iso (case1 zero) = case1 one ISO.A←B iso (case1 (suc f)) = case2 (case1 f) @@ -226,8 +224,8 @@ ISO.iso→ (FiniteSet→Fin fin) = FiniteSet.finiso→ fin -fin-∨' : {A B : Set} → { a b : ℕ } → FiniteSet A {a} → FiniteSet B {b} → FiniteSet (A ∨ B) {a Data.Nat.+ b} -fin-∨' {A} {B} {a} {b} fa fb = iso-fin (fin-∨2 a fb ) iso2 where +fin-∨ : {A B : Set} → { a b : ℕ } → FiniteSet A {a} → FiniteSet B {b} → FiniteSet (A ∨ B) {a Data.Nat.+ b} +fin-∨ {A} {B} {a} {b} fa fb = iso-fin (fin-∨2 a fb ) iso2 where ia = FiniteSet→Fin fa iso2 : ISO (Fin a ∨ B ) (A ∨ B) ISO.A←B iso2 (case1 x) = case1 ( ISO.A←B ia x ) @@ -279,7 +277,7 @@ finiso→ [] = refl finiso← : (f : Fin (exp 2 zero)) → # 0 ≡ f finiso← zero = refl -fin2List {suc n} = subst (λ k → FiniteSet (Vec Bool (suc n)) {k} ) (sym (exp2 n)) ( iso-fin (fin-∨' (fin2List {n}) (fin2List {n})) iso ) +fin2List {suc n} = subst (λ k → FiniteSet (Vec Bool (suc n)) {k} ) (sym (exp2 n)) ( iso-fin (fin-∨ (fin2List {n}) (fin2List {n})) iso ) where QtoR : Vec Bool (suc n) → Vec Bool n ∨ Vec Bool n QtoR ( true ∷ x ) = case1 x @@ -301,24 +299,42 @@ Func2List {Q} {suc n} {m} (s≤s n