Skip to content

Commit eabe423

Browse files
gallaisMatthewDaggitt
authored andcommitted
[ new ] congAt : a = b -> f vs a ws = f vs b ws (#824)
1 parent a0256a9 commit eabe423

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

src/Function/Nary/NonDependent.agda

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ open import Relation.Binary.PropositionalEquality
2525

2626
private
2727
variable
28-
r : Level
28+
a b r : Level
29+
A : Set a
30+
B : Set b
2931

3032
------------------------------------------------------------------------
3133
-- Re-exporting the basic operations
@@ -50,15 +52,31 @@ lreplicate n ℓ = ltabulate n (const ℓ)
5052

5153
module _ n {ls} {as : Sets n ls} {R : Set r} (f : as ⇉ R) where
5254

55+
private
56+
g : Product n as R
57+
g = uncurryₙ n f
58+
5359
-- Congruentₙ : ∀ n. ∀ a₁₁ a₁₂ ⋯ aₙ₁ aₙ₂ →
5460
-- a₁₁ ≡ a₁₂ → ⋯ → aₙ₁ ≡ aₙ₂ →
5561
-- f a₁₁ ⋯ aₙ₁ ≡ f a₁₂ ⋯ aₙ₂
5662

5763
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)
5965

6066
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)
6280

6381
------------------------------------------------------------------------
6482
-- Injectivitiy
@@ -69,9 +87,12 @@ module _ n {ls} {as : Sets n ls} {R : Set r} (con : as ⇉ R) where
6987
-- con a₁₁ ⋯ aₙ₁ ≡ con a₁₂ ⋯ aₙ₂ →
7088
-- a₁₁ ≡ a₁₂ × ⋯ × aₙ₁ ≡ aₙ₂
7189

90+
private
91+
c : Product n as R
92+
c = uncurryₙ n con
93+
7294
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)
7496

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ₙ
7798
injectiveₙ con-inj eq = toEqualₙ n (con-inj eq)

0 commit comments

Comments
 (0)