@@ -25,7 +25,9 @@ open import Relation.Binary.PropositionalEquality
25
25
26
26
private
27
27
variable
28
- r : Level
28
+ a b r : Level
29
+ A : Set a
30
+ B : Set b
29
31
30
32
------------------------------------------------------------------------
31
33
-- Re-exporting the basic operations
@@ -50,15 +52,31 @@ lreplicate n ℓ = ltabulate n (const ℓ)
50
52
51
53
module _ n {ls} {as : Sets n ls} {R : Set r} (f : as ⇉ R) where
52
54
55
+ private
56
+ g : Product n as → R
57
+ g = uncurryₙ n f
58
+
53
59
-- Congruentₙ : ∀ n. ∀ a₁₁ a₁₂ ⋯ aₙ₁ aₙ₂ →
54
60
-- a₁₁ ≡ a₁₂ → ⋯ → aₙ₁ ≡ aₙ₂ →
55
61
-- f a₁₁ ⋯ aₙ₁ ≡ f a₁₂ ⋯ aₙ₂
56
62
57
63
Congruentₙ : Set (r Level.⊔ ⨆ n ls)
58
- Congruentₙ = ∀ {l r} → Equalₙ n l r ⇉ (uncurryₙ n f l ≡ uncurryₙ n f r)
64
+ Congruentₙ = ∀ {l r} → Equalₙ n l r ⇉ (g l ≡ g r)
59
65
60
66
congₙ : Congruentₙ
61
- congₙ = curryₙ n (cong (uncurryₙ n f) ∘′ fromEqualₙ n)
67
+ congₙ = curryₙ n (cong g ∘′ fromEqualₙ n)
68
+
69
+ -- Congruence at a specific location
70
+
71
+ module _ m n {ls ls'} {as : Sets m ls} {bs : Sets n ls'}
72
+ (f : as ⇉ (A → bs ⇉ B)) where
73
+
74
+ private
75
+ g : Product m as → A → Product n bs → B
76
+ g vs a ws = uncurryₙ n (uncurryₙ m f vs a) ws
77
+
78
+ congAt : ∀ {vs ws a₁ a₂} → a₁ ≡ a₂ → g vs a₁ ws ≡ g vs a₂ ws
79
+ congAt {vs} {ws} = cong (λ a → g vs a ws)
62
80
63
81
------------------------------------------------------------------------
64
82
-- Injectivitiy
@@ -69,9 +87,12 @@ module _ n {ls} {as : Sets n ls} {R : Set r} (con : as ⇉ R) where
69
87
-- con a₁₁ ⋯ aₙ₁ ≡ con a₁₂ ⋯ aₙ₂ →
70
88
-- a₁₁ ≡ a₁₂ × ⋯ × aₙ₁ ≡ aₙ₂
71
89
90
+ private
91
+ c : Product n as → R
92
+ c = uncurryₙ n con
93
+
72
94
Injectiveₙ : Set (r Level.⊔ ⨆ n ls)
73
- Injectiveₙ = ∀ {l r} → uncurryₙ n con l ≡ uncurryₙ n con r → Product n (Equalₙ n l r)
95
+ Injectiveₙ = ∀ {l r} → c l ≡ c r → Product n (Equalₙ n l r)
74
96
75
- injectiveₙ : (∀ {l r} → uncurryₙ n con l ≡ uncurryₙ n con r → l ≡ r) →
76
- Injectiveₙ
97
+ injectiveₙ : (∀ {l r} → c l ≡ c r → l ≡ r) → Injectiveₙ
77
98
injectiveₙ con-inj eq = toEqualₙ n (con-inj eq)
0 commit comments