hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
163 values
lang
stringclasses
53 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
112
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
113
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
113
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
3
1.05M
avg_line_length
float64
1
966k
max_line_length
int64
1
977k
alphanum_fraction
float64
0
1
5e331f24778a8cbb58e3adf33a9015b8a038f13a
7,303
agda
Agda
src/Categories/Category/Construction/Properties/Presheaves/CartesianClosed.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
5
2020-10-07T12:07:53.000Z
2020-10-10T21:41:32.000Z
src/Categories/Category/Construction/Properties/Presheaves/CartesianClosed.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
null
null
null
src/Categories/Category/Construction/Properties/Presheaves/CartesianClosed.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
1
2021-11-04T06:54:45.000Z
2021-11-04T06:54:45.000Z
{-# OPTIONS --without-K --safe #-} module Categories.Category.Construction.Properties.Presheaves.CartesianClosed where open import Level open import Data.Unit open import Data.Product using (_,_; proj₁; proj₂) open import Function.Equality using (Π) renaming (_∘_ to _∙_) open import Relation.Binary open import Categories.Category.Core using (Category) open import Categories.Category.CartesianClosed open import Categories.Category.CartesianClosed.Canonical renaming (CartesianClosed to CCartesianClosed) open import Categories.Category.Construction.Presheaves open import Categories.Category.Instance.Setoids open import Categories.Functor open import Categories.Functor.Hom open import Categories.Functor.Properties open import Categories.Functor.Presheaf open import Categories.NaturalTransformation import Categories.Category.Construction.Properties.Presheaves.Cartesian as Preₚ import Categories.Morphism.Reasoning as MR import Relation.Binary.Reasoning.Setoid as SetoidR open Π using (_⟨$⟩_) module HasClosed {o ℓ e} (C : Category o ℓ e) where private module C = Category C open C module _ (F G : Presheaf C (Setoids ℓ e)) where private module F = Functor F module G = Functor G open Preₚ C open IsCartesian o o Presheaf^ : Presheaf C (Setoids (o ⊔ ℓ ⊔ e) (o ⊔ ℓ ⊔ e)) Presheaf^ = record { F₀ = λ X → Hom[ Presheaves C ][ Presheaves× Hom[ C ][-, X ] G , F ] ; F₁ = λ {A B} f → record { _⟨$⟩_ = λ α → let module α = NaturalTransformation α using (η; commute) in ntHelper record { η = λ X → record { _⟨$⟩_ = λ where (g , S) → α.η X ⟨$⟩ (f ∘ g , S) ; cong = λ where (eq₁ , eq₂) → Π.cong (α.η X) (∘-resp-≈ʳ eq₁ , eq₂) } ; commute = λ { {Z} {W} g {h , x} {i , y} (eq₁ , eq₂) → let open SetoidR (F.₀ W) in begin α.η W ⟨$⟩ (f ∘ C.id ∘ h ∘ g , G.₁ g ⟨$⟩ x) ≈⟨ Π.cong (α.η W) (Equiv.trans (pullˡ id-comm) (center Equiv.refl) , Setoid.refl (G.₀ W)) ⟩ α.η W ⟨$⟩ (C.id ∘ (f ∘ h) ∘ g , G.₁ g ⟨$⟩ x) ≈⟨ α.commute g (∘-resp-≈ʳ eq₁ , eq₂) ⟩ F.₁ g ⟨$⟩ (α.η Z ⟨$⟩ (f ∘ i , y)) ∎ } } ; cong = λ eq (eq₁ , eq₂) → eq (∘-resp-≈ʳ eq₁ , eq₂) } ; identity = λ eq (eq₁ , eq₂) → eq (Equiv.trans identityˡ eq₁ , eq₂) ; homomorphism = λ eq (eq₁ , eq₂) → eq (pullʳ (∘-resp-≈ʳ eq₁) , eq₂) ; F-resp-≈ = λ where eq eq′ (eq₁ , eq₂) → eq′ (∘-resp-≈ eq eq₁ , eq₂) } where open MR C module IsCartesianClosed {o} (C : Category o o o) where private module C = Category C using (id; _∘_; _≈_; identityˡ; identityʳ; module Equiv) P = Presheaves′ o o C open HasClosed C using (Presheaf^) open Preₚ.IsCartesian C o o using (Presheaves-Cartesian) open MR C CanonicalCCC : CCartesianClosed P CanonicalCCC = record { ⊤ = PC.terminal.⊤ ; _×_ = PC._×_ ; ! = PC.! ; π₁ = PC.π₁ ; π₂ = PC.π₂ ; ⟨_,_⟩ = PC.⟨_,_⟩ ; !-unique = PC.!-unique ; π₁-comp = λ {_ _ f} {_ g} → PC.project₁ {h = f} {g} ; π₂-comp = λ {_ _ f} {_ g} → PC.project₂ {h = f} {g} ; ⟨,⟩-unique = λ {_ _ _ f g h} → PC.unique {h = h} {i = f} {j = g} ; _^_ = Presheaf^ ; eval = λ {F G} → let module F = Functor F module G = Functor G in ntHelper record { η = λ X → record { _⟨$⟩_ = λ { (α , x) → let module α = NaturalTransformation α in α.η X ⟨$⟩ (C.id , x) } ; cong = λ where (eq₁ , eq₂) → eq₁ (C.Equiv.refl , eq₂) } ; commute = λ { {Y} {Z} f {α , x} {β , y} (eq₁ , eq₂) → let module α = NaturalTransformation α module β = NaturalTransformation β open SetoidR (F.₀ Z) in begin α.η Z ⟨$⟩ (f C.∘ C.id , G.₁ f ⟨$⟩ x) ≈⟨ eq₁ ((C.Equiv.trans id-comm (C.Equiv.sym C.identityˡ)) , Setoid.refl (G.₀ Z)) ⟩ β.η Z ⟨$⟩ (C.id C.∘ C.id C.∘ f , G.₁ f ⟨$⟩ x) ≈⟨ β.commute f (C.Equiv.refl , eq₂) ⟩ F.₁ f ⟨$⟩ (β.η Y ⟨$⟩ (C.id , y)) ∎ } } ; curry = λ {F G H} α → let module F = Functor F module G = Functor G module H = Functor H module α = NaturalTransformation α in ntHelper record { η = λ X → record { _⟨$⟩_ = λ x → ntHelper record { η = λ Y → record { _⟨$⟩_ = λ where (f , y) → α.η Y ⟨$⟩ (F.₁ f ⟨$⟩ x , y) ; cong = λ where (eq₁ , eq₂) → Π.cong (α.η _) (F.F-resp-≈ eq₁ (Setoid.refl (F.₀ _)) , eq₂) } ; commute = λ { {Y} {Z} f {g , y} {h , z} (eq₁ , eq₂) → let open SetoidR (H.₀ Z) open Setoid (G.₀ Z) in begin α.η Z ⟨$⟩ (F.F₁ (C.id C.∘ g C.∘ f) ⟨$⟩ x , G.F₁ f ⟨$⟩ y) ≈⟨ Π.cong (α.η Z) (F.F-resp-≈ C.identityˡ (Setoid.refl (F.₀ X)) , refl) ⟩ α.η Z ⟨$⟩ (F.F₁ (g C.∘ f) ⟨$⟩ x , G.F₁ f ⟨$⟩ y) ≈⟨ Π.cong (α.η Z) (F.homomorphism (Setoid.refl (F.₀ X)) , refl) ⟩ α.η Z ⟨$⟩ (F.F₁ f ⟨$⟩ (F.F₁ g ⟨$⟩ x) , G.F₁ f ⟨$⟩ y) ≈⟨ α.commute f (F.F-resp-≈ eq₁ (Setoid.refl (F.₀ X)) , eq₂) ⟩ H.F₁ f ⟨$⟩ (α.η Y ⟨$⟩ (F.F₁ h ⟨$⟩ x , z)) ∎ } } ; cong = λ where eq (eq₁ , eq₂) → Π.cong (α.η _) (F.F-resp-≈ eq₁ eq , eq₂) } ; commute = λ { {X} {Y} f {x} {y} eq {Z} {g , z} {h , w} (eq₁ , eq₂) → let open SetoidR (F.₀ Z) helper : g C.≈ h → Setoid._≈_ (F.₀ X) x y → Setoid._≈_ (F.₀ Z) (F.₁ g ⟨$⟩ (F.₁ f ⟨$⟩ x)) (F.₁ (f C.∘ h) ⟨$⟩ y) helper eq eq′ = begin F.₁ g ⟨$⟩ (F.₁ f ⟨$⟩ x) ≈⟨ F.F-resp-≈ eq (Setoid.refl (F.₀ Y)) ⟩ F.₁ h ⟨$⟩ (F.₁ f ⟨$⟩ x) ≈˘⟨ F.homomorphism (Setoid.sym (F.₀ X) eq′) ⟩ F.₁ (f C.∘ h) ⟨$⟩ y ∎ in Π.cong (α.η _) (helper eq₁ eq , eq₂) } } ; eval-comp = λ {F G H} {α} → λ { (eq₁ , eq₂) → let module H = Functor H module α = NaturalTransformation α in Π.cong (α.η _) (H.identity eq₁ , eq₂) } ; curry-resp-≈ = λ { {F} {G} eq eq₁ (eq₂ , eq₃) → let module G = Functor G in eq (G.F-resp-≈ eq₂ eq₁ , eq₃) } ; curry-unique = λ {F G H} {α β} eq {X} {x y} eq₁ → λ { {Y} {f , z} {g , w} (eq₂ , eq₃) → let module F = Functor F module G = Functor G module H = Functor H module α = NaturalTransformation α module β = NaturalTransformation β module αXx = NaturalTransformation (α.η X ⟨$⟩ x) open Setoid (H.₀ Y) open SetoidR (G.₀ Y) in begin αXx.η Y ⟨$⟩ (f , z) ≈⟨ Π.cong (αXx.η _) (C.Equiv.sym C.identityʳ , refl) ⟩ αXx.η Y ⟨$⟩ (f C.∘ C.id , z) ≈⟨ α.sym-commute f (Setoid.refl (F.₀ X)) (C.Equiv.refl , refl) ⟩ NaturalTransformation.η (α.η Y ⟨$⟩ (F.F₁ f ⟨$⟩ x)) Y ⟨$⟩ (C.id , z) ≈⟨ eq (F.F-resp-≈ eq₂ eq₁ , eq₃) ⟩ β.η Y ⟨$⟩ (F.F₁ g ⟨$⟩ y , w) ∎ } } where module PC = Presheaves-Cartesian Presheaves-CartesianClosed : CartesianClosed P Presheaves-CartesianClosed = Equivalence.fromCanonical P CanonicalCCC
42.459302
150
0.492537
1995a0d548e39e6ce21c554cd05fed5ff87c5345
3,466
agda
Agda
Cubical/Algebra/Polynomials/Multivariate/EquivCarac/AB-An[X]Bn[X].agda
guilhermehas/cubical
ce3120d3f8d692847b2744162bcd7a01f0b687eb
[ "MIT" ]
1
2021-10-31T17:32:49.000Z
2021-10-31T17:32:49.000Z
Cubical/Algebra/Polynomials/Multivariate/EquivCarac/AB-An[X]Bn[X].agda
guilhermehas/cubical
ce3120d3f8d692847b2744162bcd7a01f0b687eb
[ "MIT" ]
null
null
null
Cubical/Algebra/Polynomials/Multivariate/EquivCarac/AB-An[X]Bn[X].agda
guilhermehas/cubical
ce3120d3f8d692847b2744162bcd7a01f0b687eb
[ "MIT" ]
null
null
null
{-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.Algebra.Polynomials.Multivariate.EquivCarac.AB-An[X]Bn[X] where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Data.Nat renaming (_+_ to _+n_; _·_ to _·n_) open import Cubical.Data.Vec open import Cubical.Data.Vec.OperationsNat open import Cubical.Data.Sigma open import Cubical.Algebra.Ring open import Cubical.Algebra.CommRing open import Cubical.Algebra.Polynomials.Univariate.Base open import Cubical.Algebra.Polynomials.Multivariate.Base open import Cubical.Algebra.Polynomials.Multivariate.Properties open import Cubical.Algebra.CommRing.Instances.MultivariatePoly open Nth-Poly-structure private variable ℓ : Level ----------------------------------------------------------------------------- -- Lift open IsRingHom makeCommRingHomPoly : (A' B' : CommRing ℓ) → (f : CommRingHom A' B') → (n : ℕ) → CommRingHom (PolyCommRing A' n) (PolyCommRing B' n) fst (makeCommRingHomPoly A' B' (f , fcrhom) n) = Poly-Rec-Set.f A' n (Poly B' n) trunc 0P (λ v a → base v (f a)) _poly+_ poly+Assoc poly+IdR poly+Comm (λ v → (cong (base v) (pres0 fcrhom)) ∙ (base-0P v)) λ v a b → (base-poly+ v (f a) (f b)) ∙ (cong (base v) (sym (pres+ fcrhom a b))) snd (makeCommRingHomPoly A' B' (f , fcrhom) n) = makeIsRingHom (cong (base (replicate zero)) (pres1 fcrhom)) (λ P Q → refl) (Poly-Ind-Prop.f A' n _ (λ P p q i Q j → trunc _ _ (p Q) (q Q) i j) (λ Q → refl) (λ v a → Poly-Ind-Prop.f A' n _ (λ _ → trunc _ _) refl (λ v' a' → cong (base (v +n-vec v')) (pres· fcrhom a a')) λ {U V} ind-U ind-V → cong₂ _poly+_ ind-U ind-V) λ {U V} ind-U ind-V Q → cong₂ _poly+_ (ind-U Q) (ind-V Q)) ----------------------------------------------------------------------------- -- Lift preserve equivalence open RingEquivs lift-equiv-poly : (A' B' : CommRing ℓ) → (e : CommRingEquiv A' B') → (n : ℕ) → CommRingEquiv (PolyCommRing A' n) (PolyCommRing B' n) fst (lift-equiv-poly A' B' e n) = isoToEquiv is where et = fst e fcrh = snd e f = fst et g = invEq et gcrh : IsRingHom (snd (CommRing→Ring B')) g (snd (CommRing→Ring A')) gcrh = isRingHomInv (et , fcrh) is : Iso _ _ Iso.fun is = fst (makeCommRingHomPoly A' B' (f , fcrh) n) Iso.inv is = fst (makeCommRingHomPoly B' A' (g , gcrh) n) Iso.rightInv is = (Poly-Ind-Prop.f B' n _ (λ _ → trunc _ _) refl (λ v a → cong (base v) (secEq et a)) λ {U V} ind-U ind-V → cong₂ _poly+_ ind-U ind-V) Iso.leftInv is = (Poly-Ind-Prop.f A' n _ (λ _ → trunc _ _) refl (λ v a → cong (base v) (retEq et a)) λ {U V} ind-U ind-V → cong₂ _poly+_ ind-U ind-V) snd (lift-equiv-poly A' B' e n) = snd (makeCommRingHomPoly A' B' (fst (fst e) , snd e) n)
42.268293
132
0.505193
301b90621d4a0f1322c69f97d4331f10821dbc3c
198
agda
Agda
Cubical/HITs/MappingCones.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
null
null
null
Cubical/HITs/MappingCones.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2022-01-27T02:07:48.000Z
2022-01-27T02:07:48.000Z
Cubical/HITs/MappingCones.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2021-11-22T02:02:01.000Z
2021-11-22T02:02:01.000Z
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.MappingCones where open import Cubical.HITs.MappingCones.Base public open import Cubical.HITs.MappingCones.Properties public
28.285714
55
0.792929
57d6779025865bb01c6625382e4fb15264eed648
3,681
agda
Agda
src/Polynomial/Simple/Solver.agda
mckeankylej/agda-ring-solver
f18d9c6bdfae5b4c3ead9a83e06f16a0b7204500
[ "MIT" ]
36
2019-01-25T16:40:52.000Z
2022-02-15T00:57:55.000Z
src/Polynomial/Simple/Solver.agda
oisdk/agda-algebra
7e4ee048dab68ccb0a8673a6a663a37c1d1f4080
[ "MIT" ]
5
2019-04-17T20:48:48.000Z
2022-03-12T01:55:42.000Z
src/Polynomial/Simple/Solver.agda
oisdk/agda-algebra
7e4ee048dab68ccb0a8673a6a663a37c1d1f4080
[ "MIT" ]
4
2019-04-16T02:23:16.000Z
2022-01-20T07:07:11.000Z
{-# OPTIONS --without-K --safe #-} module Polynomial.Simple.Solver where open import Polynomial.Expr public open import Polynomial.Simple.AlmostCommutativeRing public hiding (-raw-almostCommutative⟶) open import Data.Vec hiding (_⊛_) open import Algebra.Solver.Ring.AlmostCommutativeRing using (-raw-almostCommutative⟶) open import Polynomial.Parameters open import Function open import Data.Maybe open import Data.Vec.N-ary open import Data.Bool using (Bool; true; false; T; if_then_else_) open import Data.Empty using (⊥-elim) module Ops {ℓ₁ ℓ₂} (ring : AlmostCommutativeRing ℓ₁ ℓ₂) where open AlmostCommutativeRing ring zero-homo : ∀ x → T (is-just (0≟ x)) → 0# ≈ x zero-homo x _ with 0≟ x zero-homo x _ | just p = p zero-homo x () | nothing homo : Homomorphism ℓ₁ ℓ₂ ℓ₁ ℓ₂ homo = record { coeffs = record { coeffs = AlmostCommutativeRing.rawRing ring ; Zero-C = λ x → is-just (0≟ x) } ; ring = record { isAlmostCommutativeRing = record { isCommutativeSemiring = isCommutativeSemiring ; -‿cong = -‿cong ; -‿*-distribˡ = -‿*-distribˡ ; -‿+-comm = -‿+-comm } } ; morphism = -raw-almostCommutative⟶ _ ; Zero-C⟶Zero-R = zero-homo } ⟦_⟧ : ∀ {n} → Expr Carrier n → Vec Carrier n → Carrier ⟦ Κ x ⟧ ρ = x ⟦ Ι x ⟧ ρ = lookup ρ x ⟦ x ⊕ y ⟧ ρ = ⟦ x ⟧ ρ + ⟦ y ⟧ ρ ⟦ x ⊗ y ⟧ ρ = ⟦ x ⟧ ρ * ⟦ y ⟧ ρ ⟦ ⊝ x ⟧ ρ = - ⟦ x ⟧ ρ ⟦ x ⊛ i ⟧ ρ = ⟦ x ⟧ ρ ^ i open import Polynomial.NormalForm.Definition (Homomorphism.coeffs homo) open import Polynomial.NormalForm.Operations (Homomorphism.coeffs homo) norm : ∀ {n} → Expr Carrier n → Poly n norm = go where go : ∀ {n} → Expr Carrier n → Poly n go (Κ x) = κ x go (Ι x) = ι x go (x ⊕ y) = go x ⊞ go y go (x ⊗ y) = go x ⊠ go y go (⊝ x) = ⊟ go x go (x ⊛ i) = go x ⊡ i ⟦_⇓⟧ : ∀ {n} → Expr Carrier n → Vec Carrier n → Carrier ⟦ expr ⇓⟧ = ⟦ norm expr ⟧ₚ where open import Polynomial.NormalForm.Semantics homo renaming (⟦_⟧ to ⟦_⟧ₚ) correct : ∀ {n} (expr : Expr Carrier n) ρ → ⟦ expr ⇓⟧ ρ ≈ ⟦ expr ⟧ ρ correct {n = n} = go where open import Polynomial.Homomorphism homo go : ∀ (expr : Expr Carrier n) ρ → ⟦ expr ⇓⟧ ρ ≈ ⟦ expr ⟧ ρ go (Κ x) ρ = κ-hom x ρ go (Ι x) ρ = ι-hom x ρ go (x ⊕ y) ρ = ⊞-hom (norm x) (norm y) ρ ⟨ trans ⟩ (go x ρ ⟨ +-cong ⟩ go y ρ) go (x ⊗ y) ρ = ⊠-hom (norm x) (norm y) ρ ⟨ trans ⟩ (go x ρ ⟨ *-cong ⟩ go y ρ) go (⊝ x) ρ = ⊟-hom (norm x) ρ ⟨ trans ⟩ -‿cong (go x ρ) go (x ⊛ i) ρ = ⊡-hom (norm x) i ρ ⟨ trans ⟩ pow-cong i (go x ρ) open import Relation.Binary.Reflection setoid Ι ⟦_⟧ ⟦_⇓⟧ correct public open import Data.Nat using (ℕ) open import Data.Product solve : ∀ {ℓ₁ ℓ₂} → (ring : AlmostCommutativeRing ℓ₁ ℓ₂) → (n : ℕ) → (f : N-ary n (Expr (AlmostCommutativeRing.Carrier ring) n) (Expr (AlmostCommutativeRing.Carrier ring) n × Expr (AlmostCommutativeRing.Carrier ring) n)) → Eqʰ n (AlmostCommutativeRing._≈_ ring) (curryⁿ (Ops.⟦_⇓⟧ ring (proj₁ (Ops.close ring n f)))) (curryⁿ (Ops.⟦_⇓⟧ ring (proj₂ (Ops.close ring n f)))) → Eq n (AlmostCommutativeRing._≈_ ring) (curryⁿ (Ops.⟦_⟧ ring (proj₁ (Ops.close ring n f)))) (curryⁿ (Ops.⟦_⟧ ring (proj₂ (Ops.close ring n f)))) solve ring = solve′ where open Ops ring renaming (solve to solve′) {-# INLINE solve #-} _⊜_ : ∀ {ℓ₁ ℓ₂} → (ring : AlmostCommutativeRing ℓ₁ ℓ₂) → (n : ℕ) → Expr (AlmostCommutativeRing.Carrier ring) n → Expr (AlmostCommutativeRing.Carrier ring) n → Expr (AlmostCommutativeRing.Carrier ring) n × Expr (AlmostCommutativeRing.Carrier ring) n _⊜_ _ _ = _,_ {-# INLINE _⊜_ #-}
34.401869
159
0.599294
ada986f14981666d635f4225de246176bce8855d
1,294
agda
Agda
Definition/Conversion/Reduction.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
2
2018-06-21T08:39:01.000Z
2022-01-17T16:13:53.000Z
Definition/Conversion/Reduction.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
null
null
null
Definition/Conversion/Reduction.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
2
2022-01-26T14:55:51.000Z
2022-02-15T19:42:19.000Z
{-# OPTIONS --safe #-} module Definition.Conversion.Reduction where open import Definition.Untyped open import Definition.Typed open import Definition.Typed.Properties open import Definition.Conversion -- Weak head expansion of algorithmic equality of types. reductionConv↑ : ∀ {A A′ B B′ r Γ} → Γ ⊢ A ⇒* A′ ^ r → Γ ⊢ B ⇒* B′ ^ r → Whnf A′ → Whnf B′ → Γ ⊢ A′ [conv↑] B′ ^ r → Γ ⊢ A [conv↑] B ^ r reductionConv↑ x x₁ x₂ x₃ ([↑] A″ B″ D D′ whnfA′ whnfB′ A′<>B′) rewrite whnfRed* D x₂ | whnfRed* D′ x₃ = [↑] A″ B″ x x₁ whnfA′ whnfB′ A′<>B′ -- Weak head expansion of algorithmic equality of terms. reductionConv↑Term : ∀ {t t′ u u′ A B Γ l} → Γ ⊢ A ⇒* B ^ [ ! , l ] → Γ ⊢ t ⇒* t′ ∷ B ^ l → Γ ⊢ u ⇒* u′ ∷ B ^ l → Whnf B → Whnf t′ → Whnf u′ → Γ ⊢ t′ [conv↑] u′ ∷ B ^ l → Γ ⊢ t [conv↑] u ∷ A ^ l reductionConv↑Term x x₁ x₂ x₃ x₄ x₅ ([↑]ₜ B₁ t″ u″ D d d′ whnfB whnft′ whnfu′ t<>u) rewrite whnfRed* D x₃ | whnfRed*Term d x₄ | whnfRed*Term d′ x₅ = [↑]ₜ B₁ t″ u″ x x₁ x₂ whnfB whnft′ whnfu′ t<>u
34.052632
83
0.454405
5ed9d8834e7bb2887b13275384609c242450cb5b
123
agda
Agda
test/Fail/Issue481InstantiatedImportOnly.agda
pthariensflame/agda
222c4c64b2ccf8e0fc2498492731c15e8fef32d4
[ "BSD-3-Clause" ]
3
2015-03-28T14:51:03.000Z
2015-12-07T20:14:00.000Z
test/fail/Issue481InstantiatedImportOnly.agda
np/agda-git-experiment
20596e9dd9867166a64470dd24ea68925ff380ce
[ "MIT" ]
null
null
null
test/fail/Issue481InstantiatedImportOnly.agda
np/agda-git-experiment
20596e9dd9867166a64470dd24ea68925ff380ce
[ "MIT" ]
1
2022-03-12T11:35:18.000Z
2022-03-12T11:35:18.000Z
module Issue481InstantiatedImportOnly where import Common.Issue481ParametrizedModule Set -- pointless, should yield error
24.6
44
0.869919
571675b7d1578c9a001465d0f31e546ca498773f
1,160
agda
Agda
Base/Syntax/Vars.agda
inc-lc/ilc-agda
39bb081c6f192bdb87bd58b4a89291686d2d7d03
[ "MIT" ]
10
2015-03-04T06:09:20.000Z
2019-07-19T07:06:59.000Z
Base/Syntax/Vars.agda
inc-lc/ilc-agda
39bb081c6f192bdb87bd58b4a89291686d2d7d03
[ "MIT" ]
6
2015-07-01T18:09:31.000Z
2017-05-04T13:53:59.000Z
Base/Syntax/Vars.agda
inc-lc/ilc-agda
39bb081c6f192bdb87bd58b4a89291686d2d7d03
[ "MIT" ]
1
2016-02-18T12:26:44.000Z
2016-02-18T12:26:44.000Z
------------------------------------------------------------------------ -- INCREMENTAL λ-CALCULUS -- -- Sets of variables ------------------------------------------------------------------------ module Base.Syntax.Vars (Type : Set) where -- The notion of sets of variables -- -- This module is calculus-independent. open import Base.Syntax.Context Type open import Relation.Binary.PropositionalEquality open import Data.Unit open import Data.Sum open import Data.Bool -- Sets of variables open import Base.Data.DependentList Free : Type → Set Free _ = Bool Vars : Context → Set Vars = DependentList Free none : {Γ : Context} → Vars Γ none = tabulate (λ _ → false) singleton : ∀ {τ Γ} → Var Γ τ → Vars Γ singleton {Γ = τ • Γ₀} this = true • none singleton (that x) = false • singleton x -- Union of variable sets infixl 6 _∪_ -- just like _+_ _∪_ : ∀ {Γ} → Vars Γ → Vars Γ → Vars Γ _∪_ = zipWith _∨_ -- Test if a set of variables is empty empty? : ∀ {Γ} → (vs : Vars Γ) → (vs ≡ none) ⊎ ⊤ empty? ∅ = inj₁ refl empty? (true • vs) = inj₂ tt empty? (false • vs) with empty? vs ... | inj₁ vs=∅ = inj₁ (cong₂ _•_ refl vs=∅) ... | inj₂ _ = inj₂ tt
22.745098
72
0.574138
c7dbb810b893f1c03fa888c485c388bb8421bf8c
803
agda
Agda
Groups/Actions/Definition.agda
Smaug123/agdaproofs
0f4230011039092f58f673abcad8fb0652e6b562
[ "MIT" ]
4
2019-08-08T12:44:19.000Z
2022-01-28T06:04:15.000Z
Groups/Actions/Definition.agda
Smaug123/agdaproofs
0f4230011039092f58f673abcad8fb0652e6b562
[ "MIT" ]
14
2019-01-06T21:11:59.000Z
2020-04-11T11:03:39.000Z
Groups/Actions/Definition.agda
Smaug123/agdaproofs
0f4230011039092f58f673abcad8fb0652e6b562
[ "MIT" ]
1
2021-11-29T13:23:07.000Z
2021-11-29T13:23:07.000Z
{-# OPTIONS --safe --warning=error --without-K #-} open import Setoids.Setoids open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import Groups.Definition module Groups.Actions.Definition where record GroupAction {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·_ : A → A → A} {B : Set n} (G : Group S _·_) (X : Setoid {n} {p} B) : Set (m ⊔ n ⊔ o ⊔ p) where open Group G open Setoid S renaming (_∼_ to _∼G_) open Setoid X renaming (_∼_ to _∼X_) field action : A → B → B actionWellDefined1 : {g h : A} → {x : B} → (g ∼G h) → action g x ∼X action h x actionWellDefined2 : {g : A} → {x y : B} → (x ∼X y) → action g x ∼X action g y identityAction : {x : B} → action 0G x ∼X x associativeAction : {x : B} → {g h : A} → action (g · h) x ∼X action g (action h x)
42.263158
166
0.589041
3d262a18d164c441c2b1be348ecbf528128f7a4b
874
agda
Agda
src/Data/Quiver.agda
yourboynico/agda-categories
6a087c592dbe58fc4bd9d02e1be9b94a9e138aca
[ "MIT" ]
279
2019-06-01T14:36:40.000Z
2022-03-22T00:40:14.000Z
src/Data/Quiver.agda
seanpm2001/agda-categories
d9e4f578b126313058d105c61707d8c8ae987fa8
[ "MIT" ]
236
2019-06-01T14:53:54.000Z
2022-03-28T14:31:43.000Z
src/Data/Quiver.agda
seanpm2001/agda-categories
d9e4f578b126313058d105c61707d8c8ae987fa8
[ "MIT" ]
64
2019-06-02T16:58:15.000Z
2022-03-14T02:00:59.000Z
{-# OPTIONS --without-K --safe #-} module Data.Quiver where -- A Quiver, also known as a multidigraph, is the "underlying graph" of -- a category. Note how a Quiver has a *setoid* of edges. open import Level open import Relation.Binary using (Rel; IsEquivalence; Setoid) import Relation.Binary.Reasoning.Setoid as EqR -- a Quiver has vertices Obj and edges _⇒_, where edges form a setoid over _≈_. record Quiver o ℓ e : Set (suc (o ⊔ ℓ ⊔ e)) where infix 4 _≈_ _⇒_ field Obj : Set o _⇒_ : Rel Obj ℓ _≈_ : ∀ {A B} → Rel (A ⇒ B) e equiv : ∀ {A B} → IsEquivalence (_≈_ {A} {B}) setoid : {A B : Obj} → Setoid _ _ setoid {A} {B} = record { Carrier = A ⇒ B ; _≈_ = _≈_ ; isEquivalence = equiv } module Equiv {A B : Obj} = IsEquivalence (equiv {A} {B}) module EdgeReasoning {A B : Obj} = EqR (setoid {A} {B})
28.193548
79
0.601831
04307bf6ed48f8b4b4dceb4c1c1acf06dcdea730
945
agda
Agda
core/lib/types/Subtype.agda
mikeshulman/HoTT-Agda
e7d663b63d89f380ab772ecb8d51c38c26952dbb
[ "MIT" ]
null
null
null
core/lib/types/Subtype.agda
mikeshulman/HoTT-Agda
e7d663b63d89f380ab772ecb8d51c38c26952dbb
[ "MIT" ]
null
null
null
core/lib/types/Subtype.agda
mikeshulman/HoTT-Agda
e7d663b63d89f380ab772ecb8d51c38c26952dbb
[ "MIT" ]
1
2018-12-26T21:31:57.000Z
2018-12-26T21:31:57.000Z
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.NType2 -- [Subtype] is defined in lib.NType. module lib.types.Subtype where infix 40 _⊆_ _⊆_ : ∀ {i j₁ j₂} {A : Type i} → SubtypeProp A j₁ → SubtypeProp A j₂ → Type (lmax i (lmax j₁ j₂)) P₁ ⊆ P₂ = ∀ a → SubtypeProp.prop P₁ a → SubtypeProp.prop P₂ a infix 80 _∘sub_ _∘sub_ : ∀ {i j k} {A : Type i} {B : Type j} → SubtypeProp B k → (A → B) → SubtypeProp A k P ∘sub f = SubtypeProp.prop P ∘ f , level where abstract level = SubtypeProp.level P ∘ f {- Dependent paths in a Σ-type -} module _ {i j k} {A : Type i} {B : A → Type j} (subB : (a : A) → SubtypeProp (B a) k) where ↓-Subtype-in : {x x' : A} {p : x == x'} {r : B x} {r' : B x'} {s : SubtypeProp.prop (subB x) r} {s' : SubtypeProp.prop (subB x') r'} (q : r == r' [ B ↓ p ]) → (r , s) == (r' , s') [ (λ x → Subtype (subB x)) ↓ p ] ↓-Subtype-in {p = idp} q = Subtype=-out (subB _) q
31.5
85
0.565079
207e82bc85da54b13f56bdba2db9ef5e28f847d2
12,353
agda
Agda
Cubical/Algebra/CommRingSolver/EvalHom.agda
thomas-lamiaux/cubical
58c0b83bb0fed0dc683f3d29b1709effe51c1689
[ "MIT" ]
null
null
null
Cubical/Algebra/CommRingSolver/EvalHom.agda
thomas-lamiaux/cubical
58c0b83bb0fed0dc683f3d29b1709effe51c1689
[ "MIT" ]
null
null
null
Cubical/Algebra/CommRingSolver/EvalHom.agda
thomas-lamiaux/cubical
58c0b83bb0fed0dc683f3d29b1709effe51c1689
[ "MIT" ]
null
null
null
{-# OPTIONS --safe #-} module Cubical.Algebra.CommRingSolver.EvalHom where open import Cubical.Foundations.Prelude open import Cubical.Data.Nat using (ℕ) open import Cubical.Data.Int.Base hiding (_+_ ; _·_ ; -_) open import Cubical.Data.FinData open import Cubical.Data.Vec open import Cubical.Data.Bool open import Cubical.Relation.Nullary.Base open import Cubical.Algebra.CommRingSolver.Utility open import Cubical.Algebra.CommRingSolver.RawAlgebra open import Cubical.Algebra.CommRingSolver.IntAsRawRing open import Cubical.Algebra.CommRingSolver.HornerForms open import Cubical.Algebra.CommRingSolver.HornerEval open import Cubical.Algebra.CommRing open import Cubical.Algebra.Ring private variable ℓ : Level module HomomorphismProperties (R : CommRing ℓ) where private νR = CommRing→RawℤAlgebra R open CommRingStr (snd R) open RingTheory (CommRing→Ring R) open IteratedHornerOperations νR EvalHom+0 : {n : ℕ} (P : IteratedHornerForms νR n) (xs : Vec ⟨ νR ⟩ n) → eval (0ₕ +ₕ P) xs ≡ eval P xs EvalHom+0 {n = ℕ.zero} (const x) [] = cong (scalar R) (+Ridℤ x) EvalHom+0 {n = ℕ.suc _} P xs = refl Eval0H : {n : ℕ} (xs : Vec ⟨ νR ⟩ n) → eval {A = νR} 0ₕ xs ≡ 0r Eval0H [] = refl Eval0H (x ∷ xs) = refl Eval1ₕ : {n : ℕ} (xs : Vec ⟨ νR ⟩ n) → eval {A = νR} 1ₕ xs ≡ 1r Eval1ₕ [] = refl Eval1ₕ (x ∷ xs) = eval 1ₕ (x ∷ xs) ≡⟨ refl ⟩ eval (0H ·X+ 1ₕ) (x ∷ xs) ≡⟨ combineCasesEval R 0H 1ₕ x xs ⟩ eval {A = νR} 0H (x ∷ xs) · x + eval 1ₕ xs ≡⟨ cong (λ u → u · x + eval 1ₕ xs) (Eval0H (x ∷ xs)) ⟩ 0r · x + eval 1ₕ xs ≡⟨ cong (λ u → 0r · x + u) (Eval1ₕ xs) ⟩ 0r · x + 1r ≡⟨ cong (λ u → u + 1r) (0LeftAnnihilates _) ⟩ 0r + 1r ≡⟨ +IdL _ ⟩ 1r ∎ -EvalDist : {n : ℕ} (P : IteratedHornerForms νR n) (xs : Vec ⟨ νR ⟩ n) → eval (-ₕ P) xs ≡ - eval P xs -EvalDist (const x) [] = -DistScalar R x -EvalDist 0H xs = eval (-ₕ 0H) xs ≡⟨ Eval0H xs ⟩ 0r ≡⟨ sym 0Selfinverse ⟩ - 0r ≡⟨ cong -_ (sym (Eval0H xs)) ⟩ - eval 0H xs ∎ -EvalDist (P ·X+ Q) (x ∷ xs) = eval (-ₕ (P ·X+ Q)) (x ∷ xs) ≡⟨ refl ⟩ eval ((-ₕ P) ·X+ (-ₕ Q)) (x ∷ xs) ≡⟨ combineCasesEval R (-ₕ P) (-ₕ Q) x xs ⟩ (eval (-ₕ P) (x ∷ xs)) · x + eval (-ₕ Q) xs ≡⟨ cong (λ u → u · x + eval (-ₕ Q) xs) (-EvalDist P _) ⟩ (- eval P (x ∷ xs)) · x + eval (-ₕ Q) xs ≡⟨ cong (λ u → (- eval P (x ∷ xs)) · x + u) (-EvalDist Q _) ⟩ (- eval P (x ∷ xs)) · x + - eval Q xs ≡[ i ]⟨ -DistL· (eval P (x ∷ xs)) x i + - eval Q xs ⟩ - ((eval P (x ∷ xs)) · x) + (- eval Q xs) ≡⟨ -Dist _ _ ⟩ - ((eval P (x ∷ xs)) · x + eval Q xs) ≡[ i ]⟨ - combineCasesEval R P Q x xs (~ i) ⟩ - eval (P ·X+ Q) (x ∷ xs) ∎ combineCases+ : {n : ℕ} (P Q : IteratedHornerForms νR (ℕ.suc n)) (r s : IteratedHornerForms νR n) (x : fst R) (xs : Vec (fst R) n) → eval ((P ·X+ r) +ₕ (Q ·X+ s)) (x ∷ xs) ≡ eval ((P +ₕ Q) ·X+ (r +ₕ s)) (x ∷ xs) combineCases+ {n = n} P Q r s x xs with (isZero νR (P +ₕ Q) and isZero νR (r +ₕ s)) ≟ true ... | yes p = compute+ₕEvalBothZero R n P Q r s x xs p ... | no p = compute+ₕEvalNotBothZero R n P Q r s x xs (¬true→false _ p) +Homeval : {n : ℕ} (P Q : IteratedHornerForms νR n) (xs : Vec ⟨ νR ⟩ n) → eval (P +ₕ Q) xs ≡ (eval P xs) + (eval Q xs) +Homeval (const x) (const y) [] = +HomScalar R x y +Homeval 0H Q xs = eval (0H +ₕ Q) xs ≡⟨ refl ⟩ eval Q xs ≡⟨ sym (+IdL _) ⟩ 0r + eval Q xs ≡⟨ cong (λ u → u + eval Q xs) (sym (Eval0H xs)) ⟩ eval 0H xs + eval Q xs ∎ +Homeval (P ·X+ Q) 0H xs = eval ((P ·X+ Q) +ₕ 0H) xs ≡⟨ refl ⟩ eval (P ·X+ Q) xs ≡⟨ sym (+IdR _) ⟩ eval (P ·X+ Q) xs + 0r ≡⟨ cong (λ u → eval (P ·X+ Q) xs + u) (sym (Eval0H xs)) ⟩ eval (P ·X+ Q) xs + eval 0H xs ∎ +Homeval (P ·X+ Q) (S ·X+ T) (x ∷ xs) = eval ((P ·X+ Q) +ₕ (S ·X+ T)) (x ∷ xs) ≡⟨ combineCases+ P S Q T x xs ⟩ eval ((P +ₕ S) ·X+ (Q +ₕ T)) (x ∷ xs) ≡⟨ combineCasesEval R (P +ₕ S) (Q +ₕ T) x xs ⟩ (eval (P +ₕ S) (x ∷ xs)) · x + eval (Q +ₕ T) xs ≡⟨ cong (λ u → (eval (P +ₕ S) (x ∷ xs)) · x + u) (+Homeval Q T xs) ⟩ (eval (P +ₕ S) (x ∷ xs)) · x + (eval Q xs + eval T xs) ≡⟨ cong (λ u → u · x + (eval Q xs + eval T xs)) (+Homeval P S (x ∷ xs)) ⟩ (eval P (x ∷ xs) + eval S (x ∷ xs)) · x + (eval Q xs + eval T xs) ≡⟨ cong (λ u → u + (eval Q xs + eval T xs)) (·DistL+ _ _ _) ⟩ (eval P (x ∷ xs)) · x + (eval S (x ∷ xs)) · x + (eval Q xs + eval T xs) ≡⟨ +ShufflePairs _ _ _ _ ⟩ ((eval P (x ∷ xs)) · x + eval Q xs) + ((eval S (x ∷ xs)) · x + eval T xs) ≡[ i ]⟨ combineCasesEval R P Q x xs (~ i) + combineCasesEval R S T x xs (~ i) ⟩ eval (P ·X+ Q) (x ∷ xs) + eval (S ·X+ T) (x ∷ xs) ∎ ⋆Homeval : {n : ℕ} (r : IteratedHornerForms νR n) (P : IteratedHornerForms νR (ℕ.suc n)) (x : ⟨ νR ⟩) (xs : Vec ⟨ νR ⟩ n) → eval (r ⋆ P) (x ∷ xs) ≡ eval r xs · eval P (x ∷ xs) ⋆0LeftAnnihilates : {n : ℕ} (P : IteratedHornerForms νR (ℕ.suc n)) (xs : Vec ⟨ νR ⟩ (ℕ.suc n)) → eval (0ₕ ⋆ P) xs ≡ 0r ⋆0LeftAnnihilates 0H xs = Eval0H xs ⋆0LeftAnnihilates {n = ℕ.zero} (P ·X+ Q) (x ∷ xs) = refl ⋆0LeftAnnihilates {n = ℕ.suc _} (P ·X+ Q) (x ∷ xs) = refl ⋆isZeroLeftAnnihilates : {n : ℕ} (r : IteratedHornerForms νR n) (P : IteratedHornerForms νR (ℕ.suc n)) (xs : Vec ⟨ νR ⟩ (ℕ.suc n)) → isZero νR r ≡ true → eval (r ⋆ P) xs ≡ 0r ⋆isZeroLeftAnnihilates r P xs isZero-r = evalIsZero R (r ⋆ P) xs (isZeroPresLeft⋆ r P isZero-r) ·0LeftAnnihilates : {n : ℕ} (P : IteratedHornerForms νR n) (xs : Vec ⟨ νR ⟩ n) → eval (0ₕ ·ₕ P) xs ≡ 0r ·0LeftAnnihilates (const x) xs = eval (const _) xs ≡⟨ Eval0H xs ⟩ 0r ∎ ·0LeftAnnihilates 0H xs = Eval0H xs ·0LeftAnnihilates (P ·X+ P₁) xs = Eval0H xs ·isZeroLeftAnnihilates : {n : ℕ} (P Q : IteratedHornerForms νR n) (xs : Vec (fst R) n) → isZero νR P ≡ true → eval (P ·ₕ Q) xs ≡ 0r ·isZeroLeftAnnihilates P Q xs isZeroP = evalIsZero R (P ·ₕ Q) xs (isZeroPresLeft·ₕ P Q isZeroP) ·Homeval : {n : ℕ} (P Q : IteratedHornerForms νR n) (xs : Vec ⟨ νR ⟩ n) → eval (P ·ₕ Q) xs ≡ (eval P xs) · (eval Q xs) combineCases⋆ : {n : ℕ} (x : fst R) (xs : Vec (fst R) n) → (r : IteratedHornerForms νR n) → (P : IteratedHornerForms νR (ℕ.suc n)) → (Q : IteratedHornerForms νR n) → eval (r ⋆ (P ·X+ Q)) (x ∷ xs) ≡ eval ((r ⋆ P) ·X+ (r ·ₕ Q)) (x ∷ xs) combineCases⋆ x xs r P Q with isZero νR r ≟ true ... | yes p = eval (r ⋆ (P ·X+ Q)) (x ∷ xs) ≡⟨ ⋆isZeroLeftAnnihilates r (P ·X+ Q) (x ∷ xs) p ⟩ 0r ≡⟨ someCalculation R ⟩ 0r · x + 0r ≡⟨ step1 ⟩ eval (r ⋆ P) (x ∷ xs) · x + eval (r ·ₕ Q) xs ≡⟨ sym (combineCasesEval R (r ⋆ P) (r ·ₕ Q) x xs) ⟩ eval ((r ⋆ P) ·X+ (r ·ₕ Q)) (x ∷ xs) ∎ where step1 : 0r · x + 0r ≡ eval (r ⋆ P) (x ∷ xs) · x + eval (r ·ₕ Q) xs step1 i = ⋆isZeroLeftAnnihilates r P (x ∷ xs) p (~ i) · x + ·isZeroLeftAnnihilates r Q xs p (~ i) ... | no p with isZero νR r ... | true = byAbsurdity (p refl) ... | false = refl ⋆Homeval r 0H x xs = eval (r ⋆ 0H) (x ∷ xs) ≡⟨ refl ⟩ 0r ≡⟨ sym (0RightAnnihilates _) ⟩ eval r xs · 0r ≡⟨ refl ⟩ eval r xs · eval {A = νR} 0H (x ∷ xs) ∎ ⋆Homeval r (P ·X+ Q) x xs = eval (r ⋆ (P ·X+ Q)) (x ∷ xs) ≡⟨ combineCases⋆ x xs r P Q ⟩ eval ((r ⋆ P) ·X+ (r ·ₕ Q)) (x ∷ xs) ≡⟨ combineCasesEval R (r ⋆ P) (r ·ₕ Q) x xs ⟩ (eval (r ⋆ P) (x ∷ xs)) · x + eval (r ·ₕ Q) xs ≡⟨ cong (λ u → u · x + eval (r ·ₕ Q) xs) (⋆Homeval r P x xs) ⟩ (eval r xs · eval P (x ∷ xs)) · x + eval (r ·ₕ Q) xs ≡⟨ cong (λ u → (eval r xs · eval P (x ∷ xs)) · x + u) (·Homeval r Q xs) ⟩ (eval r xs · eval P (x ∷ xs)) · x + eval r xs · eval Q xs ≡⟨ cong (λ u → u + eval r xs · eval Q xs) (sym (·Assoc _ _ _)) ⟩ eval r xs · (eval P (x ∷ xs) · x) + eval r xs · eval Q xs ≡⟨ sym (·DistR+ _ _ _) ⟩ eval r xs · ((eval P (x ∷ xs) · x) + eval Q xs) ≡[ i ]⟨ eval r xs · combineCasesEval R P Q x xs (~ i) ⟩ eval r xs · eval (P ·X+ Q) (x ∷ xs) ∎ lemmaForCombineCases· : {n : ℕ} (Q : IteratedHornerForms νR n) (P S : IteratedHornerForms νR (ℕ.suc n)) (xs : Vec (fst R) (ℕ.suc n)) → isZero νR (P ·ₕ S) ≡ true → eval ((P ·X+ Q) ·ₕ S) xs ≡ eval (Q ⋆ S) xs lemmaForCombineCases· Q P S xs isZeroProd with isZero νR (P ·ₕ S) ... | true = refl ... | false = byBoolAbsurdity isZeroProd combineCases· : {n : ℕ} (Q : IteratedHornerForms νR n) (P S : IteratedHornerForms νR (ℕ.suc n)) (xs : Vec (fst R) (ℕ.suc n)) → eval ((P ·X+ Q) ·ₕ S) xs ≡ eval (((P ·ₕ S) ·X+ 0ₕ) +ₕ (Q ⋆ S)) xs combineCases· Q P S (x ∷ xs) with isZero νR (P ·ₕ S) ≟ true ... | yes p = eval ((P ·X+ Q) ·ₕ S) (x ∷ xs) ≡⟨ lemmaForCombineCases· Q P S (x ∷ xs) p ⟩ eval (Q ⋆ S) (x ∷ xs) ≡⟨ sym (+IdL _) ⟩ 0r + eval (Q ⋆ S) (x ∷ xs) ≡⟨ step1 ⟩ eval ((P ·ₕ S) ·X+ 0ₕ) (x ∷ xs) + eval (Q ⋆ S) (x ∷ xs) ≡⟨ step2 ⟩ eval (((P ·ₕ S) ·X+ 0ₕ) +ₕ (Q ⋆ S)) (x ∷ xs) ∎ where lemma = eval ((P ·ₕ S) ·X+ 0ₕ) (x ∷ xs) ≡⟨ combineCasesEval R (P ·ₕ S) 0ₕ x xs ⟩ eval (P ·ₕ S) (x ∷ xs) · x + eval 0ₕ xs ≡[ i ]⟨ evalIsZero R (P ·ₕ S) (x ∷ xs) p i · x + Eval0H xs i ⟩ 0r · x + 0r ≡⟨ sym (someCalculation R) ⟩ 0r ∎ step1 : _ ≡ _ step1 i = lemma (~ i) + eval (Q ⋆ S) (x ∷ xs) step2 = sym (+Homeval ((P ·ₕ S) ·X+ 0ₕ) (Q ⋆ S) (x ∷ xs)) ... | no p with isZero νR (P ·ₕ S) ... | true = byAbsurdity (p refl) ... | false = refl ·Homeval (const x) (const y) [] = ·HomScalar R x y ·Homeval 0H Q xs = eval (0H ·ₕ Q) xs ≡⟨ Eval0H xs ⟩ 0r ≡⟨ sym (0LeftAnnihilates _) ⟩ 0r · eval Q xs ≡⟨ cong (λ u → u · eval Q xs) (sym (Eval0H xs)) ⟩ eval 0H xs · eval Q xs ∎ ·Homeval (P ·X+ Q) S (x ∷ xs) = eval ((P ·X+ Q) ·ₕ S) (x ∷ xs) ≡⟨ combineCases· Q P S (x ∷ xs) ⟩ eval (((P ·ₕ S) ·X+ 0ₕ) +ₕ (Q ⋆ S)) (x ∷ xs) ≡⟨ +Homeval ((P ·ₕ S) ·X+ 0ₕ) (Q ⋆ S) (x ∷ xs) ⟩ eval ((P ·ₕ S) ·X+ 0ₕ) (x ∷ xs) + eval (Q ⋆ S) (x ∷ xs) ≡⟨ cong (λ u → u + eval (Q ⋆ S) (x ∷ xs)) (combineCasesEval R (P ·ₕ S) 0ₕ x xs) ⟩ (eval (P ·ₕ S) (x ∷ xs) · x + eval 0ₕ xs) + eval (Q ⋆ S) (x ∷ xs) ≡⟨ cong (λ u → u + eval (Q ⋆ S) (x ∷ xs)) ((eval (P ·ₕ S) (x ∷ xs) · x + eval 0ₕ xs) ≡⟨ cong (λ u → eval (P ·ₕ S) (x ∷ xs) · x + u) (Eval0H xs) ⟩ (eval (P ·ₕ S) (x ∷ xs) · x + 0r) ≡⟨ +IdR _ ⟩ (eval (P ·ₕ S) (x ∷ xs) · x) ≡⟨ cong (λ u → u · x) (·Homeval P S (x ∷ xs)) ⟩ ((eval P (x ∷ xs) · eval S (x ∷ xs)) · x) ≡⟨ sym (·Assoc _ _ _) ⟩ (eval P (x ∷ xs) · (eval S (x ∷ xs) · x)) ≡⟨ cong (λ u → eval P (x ∷ xs) · u) (·Comm _ _) ⟩ (eval P (x ∷ xs) · (x · eval S (x ∷ xs))) ≡⟨ ·Assoc _ _ _ ⟩ (eval P (x ∷ xs) · x) · eval S (x ∷ xs) ∎) ⟩ (eval P (x ∷ xs) · x) · eval S (x ∷ xs) + eval (Q ⋆ S) (x ∷ xs) ≡⟨ cong (λ u → (eval P (x ∷ xs) · x) · eval S (x ∷ xs) + u) (⋆Homeval Q S x xs) ⟩ (eval P (x ∷ xs) · x) · eval S (x ∷ xs) + eval Q xs · eval S (x ∷ xs) ≡⟨ sym (·DistL+ _ _ _) ⟩ ((eval P (x ∷ xs) · x) + eval Q xs) · eval S (x ∷ xs) ≡⟨ cong (λ u → u · eval S (x ∷ xs)) (sym (combineCasesEval R P Q x xs)) ⟩ eval (P ·X+ Q) (x ∷ xs) · eval S (x ∷ xs) ∎
44.757246
115
0.450255
50ea512167d17fa8715712bad4528b69a0d128d8
163
agda
Agda
Thesis/Environments.agda
inc-lc/ilc-agda
39bb081c6f192bdb87bd58b4a89291686d2d7d03
[ "MIT" ]
10
2015-03-04T06:09:20.000Z
2019-07-19T07:06:59.000Z
Thesis/Environments.agda
inc-lc/ilc-agda
39bb081c6f192bdb87bd58b4a89291686d2d7d03
[ "MIT" ]
6
2015-07-01T18:09:31.000Z
2017-05-04T13:53:59.000Z
Thesis/Environments.agda
inc-lc/ilc-agda
39bb081c6f192bdb87bd58b4a89291686d2d7d03
[ "MIT" ]
1
2016-02-18T12:26:44.000Z
2016-02-18T12:26:44.000Z
module Thesis.Environments where open import Thesis.Types open import Base.Data.DependentList public open import Base.Denotation.Environment Type ⟦_⟧Type public
23.285714
59
0.840491
4bb7cff6a1fe984ea35cd1fd7e761a5ab2722c88
259
agda
Agda
unit.agda
heades/AUGL
b33c6a59d664aed46cac8ef77d34313e148fecc2
[ "MIT" ]
null
null
null
unit.agda
heades/AUGL
b33c6a59d664aed46cac8ef77d34313e148fecc2
[ "MIT" ]
null
null
null
unit.agda
heades/AUGL
b33c6a59d664aed46cac8ef77d34313e148fecc2
[ "MIT" ]
null
null
null
module unit where open import level open import eq data ⊤ {ℓ : Level} : Set ℓ where triv : ⊤ {-# COMPILE GHC ⊤ = data () (()) #-} single-range : ∀{ℓ}{U : Set ℓ}{g : U → ⊤ {ℓ}} → ∀{u : U} → g u ≡ triv single-range {_}{U}{g}{u} with g u ... | triv = refl
18.5
69
0.525097
047e6ccf63ab657a1092c5c452ac4912c403c3b7
150
agda
Agda
Tools/List.agda
loic-p/logrel-mltt
2251b8da423be0c6fb916f2675d7bd8537e4cd96
[ "MIT" ]
null
null
null
Tools/List.agda
loic-p/logrel-mltt
2251b8da423be0c6fb916f2675d7bd8537e4cd96
[ "MIT" ]
null
null
null
Tools/List.agda
loic-p/logrel-mltt
2251b8da423be0c6fb916f2675d7bd8537e4cd96
[ "MIT" ]
null
null
null
{-# OPTIONS --without-K --safe #-} module Tools.List where infixr 30 _∷_ data List (A : Set) : Set where [] : List A _∷_ : A → List A → List A
15
34
0.58
5e92923cd8051b9cd4a094292faacbe3cc5099be
632
agda
Agda
Cubical/HITs/MappingCones/Base.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
null
null
null
Cubical/HITs/MappingCones/Base.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2022-01-27T02:07:48.000Z
2022-01-27T02:07:48.000Z
Cubical/HITs/MappingCones/Base.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2021-11-22T02:02:01.000Z
2021-11-22T02:02:01.000Z
{- Mapping cones or the homotopy cofiber/cokernel -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.MappingCones.Base where open import Cubical.Foundations.Prelude private variable ℓ ℓ' ℓ'' : Level data Cone {X : Type ℓ} {Y : Type ℓ'} (f : X → Y) : Type (ℓ-max ℓ ℓ') where inj : Y → Cone f hub : Cone f spoke : (x : X) → hub ≡ inj (f x) -- the attachment of multiple mapping cones data Cones {X : Type ℓ} {Y : Type ℓ'} (A : Type ℓ'') (f : A → X → Y) : Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') where inj : Y → Cones A f hub : A → Cones A f spoke : (a : A) (x : X) → hub a ≡ inj (f a x)
23.407407
106
0.575949
5e521278e5316e83e43e0d0db20e20db2f71bf77
5,435
agda
Agda
Cubical/Structures/Relational/Maybe.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
null
null
null
Cubical/Structures/Relational/Maybe.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2022-01-27T02:07:48.000Z
2022-01-27T02:07:48.000Z
Cubical/Structures/Relational/Maybe.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
null
null
null
{- Maybe structure: X ↦ Maybe (S X) -} {-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-} module Cubical.Structures.Relational.Maybe where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Structure open import Cubical.Foundations.RelationalStructure open import Cubical.Data.Unit open import Cubical.Data.Empty open import Cubical.Data.Maybe open import Cubical.Data.Sigma open import Cubical.HITs.PropositionalTruncation as Trunc open import Cubical.HITs.SetQuotients open import Cubical.Structures.Maybe private variable ℓ ℓ₁ ℓ₁' ℓ₁'' : Level -- Structured relations MaybeRelStr : {S : Type ℓ → Type ℓ₁} {ℓ₁' : Level} → StrRel S ℓ₁' → StrRel (λ X → Maybe (S X)) ℓ₁' MaybeRelStr ρ R = MaybeRel (ρ R) maybeSuitableRel : {S : Type ℓ → Type ℓ₁} {ρ : StrRel S ℓ₁'} → SuitableStrRel S ρ → SuitableStrRel (MaybeStructure S) (MaybeRelStr ρ) maybeSuitableRel θ .quo (X , nothing) R _ .fst = nothing , _ maybeSuitableRel θ .quo (X , nothing) R _ .snd (nothing , _) = refl maybeSuitableRel θ .quo (X , just s) R c .fst = just (θ .quo (X , s) R c .fst .fst) , θ .quo (X , s) R c .fst .snd maybeSuitableRel θ .quo (X , just s) R c .snd (just s' , r) = cong (λ {(t , r') → just t , r'}) (θ .quo (X , s) R c .snd (s' , r)) maybeSuitableRel θ .symmetric R {nothing} {nothing} r = _ maybeSuitableRel θ .symmetric R {just s} {just t} r = θ .symmetric R r maybeSuitableRel θ .transitive R R' {nothing} {nothing} {nothing} r r' = _ maybeSuitableRel θ .transitive R R' {just s} {just t} {just u} r r' = θ .transitive R R' r r' maybeSuitableRel θ .set setX = isOfHLevelMaybe 0 (θ .set setX) maybeSuitableRel θ .prop propR nothing nothing = isOfHLevelLift 1 isPropUnit maybeSuitableRel θ .prop propR nothing (just y) = isOfHLevelLift 1 isProp⊥ maybeSuitableRel θ .prop propR (just x) nothing = isOfHLevelLift 1 isProp⊥ maybeSuitableRel θ .prop propR (just x) (just y) = θ .prop propR x y maybeRelMatchesEquiv : {S : Type ℓ → Type ℓ₁} (ρ : StrRel S ℓ₁') {ι : StrEquiv S ℓ₁''} → StrRelMatchesEquiv ρ ι → StrRelMatchesEquiv (MaybeRelStr ρ) (MaybeEquivStr ι) maybeRelMatchesEquiv ρ μ (X , nothing) (Y , nothing) _ = Lift≃Lift (idEquiv _) maybeRelMatchesEquiv ρ μ (X , nothing) (Y , just y) _ = Lift≃Lift (idEquiv _) maybeRelMatchesEquiv ρ μ (X , just x) (Y , nothing) _ = Lift≃Lift (idEquiv _) maybeRelMatchesEquiv ρ μ (X , just x) (Y , just y) = μ (X , x) (Y , y) maybeRelAction : {S : Type ℓ → Type ℓ₁} {ρ : StrRel S ℓ₁'} → StrRelAction ρ → StrRelAction (MaybeRelStr ρ) maybeRelAction α .actStr f = map-Maybe (α .actStr f) maybeRelAction α .actStrId s = funExt⁻ (cong map-Maybe (funExt (α .actStrId))) s ∙ map-Maybe-id s maybeRelAction α .actRel h nothing nothing = _ maybeRelAction α .actRel h (just s) (just t) r = α .actRel h s t r maybePositiveRel : {S : Type ℓ → Type ℓ₁} {ρ : StrRel S ℓ₁'} {θ : SuitableStrRel S ρ} → PositiveStrRel θ → PositiveStrRel (maybeSuitableRel θ) maybePositiveRel σ .act = maybeRelAction (σ .act) maybePositiveRel σ .reflexive nothing = _ maybePositiveRel σ .reflexive (just s) = σ .reflexive s maybePositiveRel σ .detransitive R R' {nothing} {nothing} r = ∣ nothing , _ , _ ∣ maybePositiveRel σ .detransitive R R' {just s} {just u} rr' = Trunc.map (λ {(t , r , r') → just t , r , r'}) (σ .detransitive R R' rr') maybePositiveRel {S = S} {ρ = ρ} {θ = θ} σ .quo {X} R = subst isEquiv (funExt (elimProp (λ _ → maybeSuitableRel θ .set squash/ _ _) (λ {nothing → refl; (just _) → refl}))) (compEquiv (isoToEquiv isom) (congMaybeEquiv (_ , σ .quo R)) .snd) where fwd : Maybe (S X) / MaybeRel (ρ (R .fst .fst)) → Maybe (S X / ρ (R .fst .fst)) fwd [ nothing ] = nothing fwd [ just s ] = just [ s ] fwd (eq/ nothing nothing r i) = nothing fwd (eq/ (just s) (just t) r i) = just (eq/ s t r i) fwd (squash/ _ _ p q i j) = isOfHLevelMaybe 0 squash/ _ _ (cong fwd p) (cong fwd q) i j bwd : Maybe (S X / ρ (R .fst .fst)) → Maybe (S X) / MaybeRel (ρ (R .fst .fst)) bwd nothing = [ nothing ] bwd (just [ s ]) = [ just s ] bwd (just (eq/ s t r i)) = eq/ (just s) (just t) r i bwd (just (squash/ _ _ p q i j)) = squash/ _ _ (cong (bwd ∘ just) p) (cong (bwd ∘ just) q) i j open Iso isom : Iso (Maybe (S X) / MaybeRel (ρ (R .fst .fst))) (Maybe (S X / ρ (R .fst .fst))) isom .fun = fwd isom .inv = bwd isom .rightInv nothing = refl isom .rightInv (just x) = elimProp {B = λ x → fwd (bwd (just x)) ≡ just x} (λ _ → isOfHLevelMaybe 0 squash/ _ _) (λ _ → refl) x isom .leftInv = elimProp (λ _ → squash/ _ _) (λ {nothing → refl; (just _) → refl}) maybeRelMatchesTransp : {S : Type ℓ → Type ℓ₁} (ρ : StrRel S ℓ₁') (α : EquivAction S) → StrRelMatchesEquiv ρ (EquivAction→StrEquiv α) → StrRelMatchesEquiv (MaybeRelStr ρ) (EquivAction→StrEquiv (maybeEquivAction α)) maybeRelMatchesTransp _ _ μ (X , nothing) (Y , nothing) _ = isContr→Equiv (isOfHLevelLift 0 isContrUnit) isContr-nothing≡nothing maybeRelMatchesTransp _ _ μ (X , nothing) (Y , just y) _ = uninhabEquiv lower ¬nothing≡just maybeRelMatchesTransp _ _ μ (X , just x) (Y , nothing) _ = uninhabEquiv lower ¬just≡nothing maybeRelMatchesTransp _ _ μ (X , just x) (Y , just y) e = compEquiv (μ (X , x) (Y , y) e) (_ , isEmbedding-just _ _)
42.460938
93
0.664581
8b59ae6ca94d694c5fbc27a55ad1ad3b0d2bbac4
603
agda
Agda
test/Succeed/Issue2606.agda
zgrannan/agda
5953ce337eb6b77b29ace7180478f49c541aea1c
[ "BSD-3-Clause" ]
1
2021-07-07T10:49:57.000Z
2021-07-07T10:49:57.000Z
test/Succeed/Issue2606.agda
andersk/agda
56928ff709dcb931cb9a48c4790e5ed3739e3032
[ "BSD-3-Clause" ]
null
null
null
test/Succeed/Issue2606.agda
andersk/agda
56928ff709dcb931cb9a48c4790e5ed3739e3032
[ "BSD-3-Clause" ]
1
2019-03-05T20:02:38.000Z
2019-03-05T20:02:38.000Z
-- 2017-06-16, reported by Ambrus Kaposi on the Agda mailing list -- WAS: -- β is not a legal rewrite rule, since the left-hand side -- f a reduces to f a -- when checking the pragma REWRITE β -- SHOULD: succeed {-# OPTIONS --rewriting #-} module _ where module a where postulate _~_ : {A : Set} → A → A → Set {-# BUILTIN REWRITE _~_ #-} module m1 (X : Set) where postulate A B : Set a : A b : B f : A → B module m2 (X : Set) where open m1 X postulate β : f a ~ b {-# REWRITE β #-} postulate refl : {A : Set}{a : A} → a ~ a p : f a ~ b p = refl
14.023256
65
0.563847
13e7efcdde6457a23d52e36534cf023b043f8a51
966
agda
Agda
src/Categories/Category/Instance/SingletonSet.agda
turion/agda-categories
ad0f94b6cf18d8a448b844b021aeda58e833d152
[ "MIT" ]
5
2020-10-07T12:07:53.000Z
2020-10-10T21:41:32.000Z
src/Categories/Category/Instance/SingletonSet.agda
turion/agda-categories
ad0f94b6cf18d8a448b844b021aeda58e833d152
[ "MIT" ]
null
null
null
src/Categories/Category/Instance/SingletonSet.agda
turion/agda-categories
ad0f94b6cf18d8a448b844b021aeda58e833d152
[ "MIT" ]
1
2021-11-04T06:54:45.000Z
2021-11-04T06:54:45.000Z
{-# OPTIONS --without-K --safe #-} open import Level -- This is really a degenerate version of Categories.Category.Instance.One -- Here SingletonSet is not given an explicit name, it is an alias for Lift o ⊤ module Categories.Category.Instance.SingletonSet where open import Data.Unit using (⊤; tt) open import Relation.Binary using (Setoid) open import Relation.Binary.PropositionalEquality using (refl) open import Categories.Category.Instance.Sets open import Categories.Category.Instance.Setoids import Categories.Object.Terminal as Term module _ {o : Level} where open Term (Sets o) SingletonSet-⊤ : Terminal SingletonSet-⊤ = record { ⊤ = Lift o ⊤ ; ⊤-is-terminal = record { !-unique = λ _ → refl } } module _ {c ℓ : Level} where open Term (Setoids c ℓ) SingletonSetoid : Setoid c ℓ SingletonSetoid = record { Carrier = Lift c ⊤ ; _≈_ = λ _ _ → Lift ℓ ⊤ } SingletonSetoid-⊤ : Terminal SingletonSetoid-⊤ = record { ⊤ = SingletonSetoid }
31.16129
93
0.723602
5e6bf8236baee8836719fb21533e75513a26fe5d
198
agda
Agda
Cubical/HITs/SetQuotients.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
null
null
null
Cubical/HITs/SetQuotients.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2022-01-27T02:07:48.000Z
2022-01-27T02:07:48.000Z
Cubical/HITs/SetQuotients.agda
kiana-S/univalent-foundations
8bdb0766260489f9c89a14f4c0f2ad26e5190dec
[ "MIT" ]
1
2021-11-22T02:02:01.000Z
2021-11-22T02:02:01.000Z
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.SetQuotients where open import Cubical.HITs.SetQuotients.Base public open import Cubical.HITs.SetQuotients.Properties public
33
55
0.792929
5757092dd683ca58f6a3306039168b5fd1e0e5ea
58,027
agda
Agda
agda/Text/Greek/SBLGNT/2Tim.agda
scott-fleischman/GreekGrammar
915c46c27c7f8aad5907474d8484f2685a4cd6a7
[ "MIT" ]
44
2015-05-29T14:48:51.000Z
2022-03-06T15:41:57.000Z
agda/Text/Greek/SBLGNT/2Tim.agda
scott-fleischman/GreekGrammar
915c46c27c7f8aad5907474d8484f2685a4cd6a7
[ "MIT" ]
13
2015-05-28T20:04:08.000Z
2020-09-07T11:58:38.000Z
agda/Text/Greek/SBLGNT/2Tim.agda
scott-fleischman/GreekGrammar
915c46c27c7f8aad5907474d8484f2685a4cd6a7
[ "MIT" ]
5
2015-02-27T22:34:13.000Z
2017-06-11T11:25:09.000Z
module Text.Greek.SBLGNT.2Tim where open import Data.List open import Text.Greek.Bible open import Text.Greek.Script open import Text.Greek.Script.Unicode ΠΡΟΣ-ΤΙΜΟΘΕΟΝ-Β : List (Word) ΠΡΟΣ-ΤΙΜΟΘΕΟΝ-Β = word (Π ∷ α ∷ ῦ ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.1.1" ∷ word (ἀ ∷ π ∷ ό ∷ σ ∷ τ ∷ ο ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.1.1" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.1" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.1" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.1.1" ∷ word (θ ∷ ε ∷ ∙λ ∷ ή ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.1" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.1.1" ∷ word (κ ∷ α ∷ τ ∷ []) "2Tim.1.1" ∷ word (ἐ ∷ π ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.1.1" ∷ word (ζ ∷ ω ∷ ῆ ∷ ς ∷ []) "2Tim.1.1" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.1.1" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.1" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.1.1" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.1" ∷ word (Τ ∷ ι ∷ μ ∷ ο ∷ θ ∷ έ ∷ ῳ ∷ []) "2Tim.1.2" ∷ word (ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ῷ ∷ []) "2Tim.1.2" ∷ word (τ ∷ έ ∷ κ ∷ ν ∷ ῳ ∷ []) "2Tim.1.2" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ς ∷ []) "2Tim.1.2" ∷ word (ἔ ∷ ∙λ ∷ ε ∷ ο ∷ ς ∷ []) "2Tim.1.2" ∷ word (ε ∷ ἰ ∷ ρ ∷ ή ∷ ν ∷ η ∷ []) "2Tim.1.2" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.1.2" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.1.2" ∷ word (π ∷ α ∷ τ ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.1.2" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.2" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.2" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.2" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.2" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.1.2" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "2Tim.1.2" ∷ word (Χ ∷ ά ∷ ρ ∷ ι ∷ ν ∷ []) "2Tim.1.3" ∷ word (ἔ ∷ χ ∷ ω ∷ []) "2Tim.1.3" ∷ word (τ ∷ ῷ ∷ []) "2Tim.1.3" ∷ word (θ ∷ ε ∷ ῷ ∷ []) "2Tim.1.3" ∷ word (ᾧ ∷ []) "2Tim.1.3" ∷ word (∙λ ∷ α ∷ τ ∷ ρ ∷ ε ∷ ύ ∷ ω ∷ []) "2Tim.1.3" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.1.3" ∷ word (π ∷ ρ ∷ ο ∷ γ ∷ ό ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.1.3" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.3" ∷ word (κ ∷ α ∷ θ ∷ α ∷ ρ ∷ ᾷ ∷ []) "2Tim.1.3" ∷ word (σ ∷ υ ∷ ν ∷ ε ∷ ι ∷ δ ∷ ή ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.1.3" ∷ word (ὡ ∷ ς ∷ []) "2Tim.1.3" ∷ word (ἀ ∷ δ ∷ ι ∷ ά ∷ ∙λ ∷ ε ∷ ι ∷ π ∷ τ ∷ ο ∷ ν ∷ []) "2Tim.1.3" ∷ word (ἔ ∷ χ ∷ ω ∷ []) "2Tim.1.3" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.1.3" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "2Tim.1.3" ∷ word (σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.3" ∷ word (μ ∷ ν ∷ ε ∷ ί ∷ α ∷ ν ∷ []) "2Tim.1.3" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.3" ∷ word (τ ∷ α ∷ ῖ ∷ ς ∷ []) "2Tim.1.3" ∷ word (δ ∷ ε ∷ ή ∷ σ ∷ ε ∷ σ ∷ ί ∷ ν ∷ []) "2Tim.1.3" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.1.3" ∷ word (ν ∷ υ ∷ κ ∷ τ ∷ ὸ ∷ ς ∷ []) "2Tim.1.3" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.3" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ α ∷ ς ∷ []) "2Tim.1.3" ∷ word (ἐ ∷ π ∷ ι ∷ π ∷ ο ∷ θ ∷ ῶ ∷ ν ∷ []) "2Tim.1.4" ∷ word (σ ∷ ε ∷ []) "2Tim.1.4" ∷ word (ἰ ∷ δ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.1.4" ∷ word (μ ∷ ε ∷ μ ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.1.4" ∷ word (σ ∷ ο ∷ υ ∷ []) "2Tim.1.4" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "2Tim.1.4" ∷ word (δ ∷ α ∷ κ ∷ ρ ∷ ύ ∷ ω ∷ ν ∷ []) "2Tim.1.4" ∷ word (ἵ ∷ ν ∷ α ∷ []) "2Tim.1.4" ∷ word (χ ∷ α ∷ ρ ∷ ᾶ ∷ ς ∷ []) "2Tim.1.4" ∷ word (π ∷ ∙λ ∷ η ∷ ρ ∷ ω ∷ θ ∷ ῶ ∷ []) "2Tim.1.4" ∷ word (ὑ ∷ π ∷ ό ∷ μ ∷ ν ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.1.5" ∷ word (∙λ ∷ α ∷ β ∷ ὼ ∷ ν ∷ []) "2Tim.1.5" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.1.5" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.5" ∷ word (σ ∷ ο ∷ ὶ ∷ []) "2Tim.1.5" ∷ word (ἀ ∷ ν ∷ υ ∷ π ∷ ο ∷ κ ∷ ρ ∷ ί ∷ τ ∷ ο ∷ υ ∷ []) "2Tim.1.5" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ω ∷ ς ∷ []) "2Tim.1.5" ∷ word (ἥ ∷ τ ∷ ι ∷ ς ∷ []) "2Tim.1.5" ∷ word (ἐ ∷ ν ∷ ῴ ∷ κ ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "2Tim.1.5" ∷ word (π ∷ ρ ∷ ῶ ∷ τ ∷ ο ∷ ν ∷ []) "2Tim.1.5" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.5" ∷ word (τ ∷ ῇ ∷ []) "2Tim.1.5" ∷ word (μ ∷ ά ∷ μ ∷ μ ∷ ῃ ∷ []) "2Tim.1.5" ∷ word (σ ∷ ο ∷ υ ∷ []) "2Tim.1.5" ∷ word (Λ ∷ ω ∷ ΐ ∷ δ ∷ ι ∷ []) "2Tim.1.5" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.5" ∷ word (τ ∷ ῇ ∷ []) "2Tim.1.5" ∷ word (μ ∷ η ∷ τ ∷ ρ ∷ ί ∷ []) "2Tim.1.5" ∷ word (σ ∷ ο ∷ υ ∷ []) "2Tim.1.5" ∷ word (Ε ∷ ὐ ∷ ν ∷ ί ∷ κ ∷ ῃ ∷ []) "2Tim.1.5" ∷ word (π ∷ έ ∷ π ∷ ε ∷ ι ∷ σ ∷ μ ∷ α ∷ ι ∷ []) "2Tim.1.5" ∷ word (δ ∷ ὲ ∷ []) "2Tim.1.5" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.1.5" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.5" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.5" ∷ word (σ ∷ ο ∷ ί ∷ []) "2Tim.1.5" ∷ word (δ ∷ ι ∷ []) "2Tim.1.6" ∷ word (ἣ ∷ ν ∷ []) "2Tim.1.6" ∷ word (α ∷ ἰ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.1.6" ∷ word (ἀ ∷ ν ∷ α ∷ μ ∷ ι ∷ μ ∷ ν ∷ ῄ ∷ σ ∷ κ ∷ ω ∷ []) "2Tim.1.6" ∷ word (σ ∷ ε ∷ []) "2Tim.1.6" ∷ word (ἀ ∷ ν ∷ α ∷ ζ ∷ ω ∷ π ∷ υ ∷ ρ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.1.6" ∷ word (τ ∷ ὸ ∷ []) "2Tim.1.6" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ σ ∷ μ ∷ α ∷ []) "2Tim.1.6" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.6" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.1.6" ∷ word (ὅ ∷ []) "2Tim.1.6" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.1.6" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.6" ∷ word (σ ∷ ο ∷ ὶ ∷ []) "2Tim.1.6" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.1.6" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.1.6" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ έ ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "2Tim.1.6" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "2Tim.1.6" ∷ word (χ ∷ ε ∷ ι ∷ ρ ∷ ῶ ∷ ν ∷ []) "2Tim.1.6" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.1.6" ∷ word (ο ∷ ὐ ∷ []) "2Tim.1.7" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.1.7" ∷ word (ἔ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "2Tim.1.7" ∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "2Tim.1.7" ∷ word (ὁ ∷ []) "2Tim.1.7" ∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "2Tim.1.7" ∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "2Tim.1.7" ∷ word (δ ∷ ε ∷ ι ∷ ∙λ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.1.7" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.1.7" ∷ word (δ ∷ υ ∷ ν ∷ ά ∷ μ ∷ ε ∷ ω ∷ ς ∷ []) "2Tim.1.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.7" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ς ∷ []) "2Tim.1.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.7" ∷ word (σ ∷ ω ∷ φ ∷ ρ ∷ ο ∷ ν ∷ ι ∷ σ ∷ μ ∷ ο ∷ ῦ ∷ []) "2Tim.1.7" ∷ word (Μ ∷ ὴ ∷ []) "2Tim.1.8" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "2Tim.1.8" ∷ word (ἐ ∷ π ∷ α ∷ ι ∷ σ ∷ χ ∷ υ ∷ ν ∷ θ ∷ ῇ ∷ ς ∷ []) "2Tim.1.8" ∷ word (τ ∷ ὸ ∷ []) "2Tim.1.8" ∷ word (μ ∷ α ∷ ρ ∷ τ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.1.8" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.8" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.1.8" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "2Tim.1.8" ∷ word (μ ∷ η ∷ δ ∷ ὲ ∷ []) "2Tim.1.8" ∷ word (ἐ ∷ μ ∷ ὲ ∷ []) "2Tim.1.8" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.1.8" ∷ word (δ ∷ έ ∷ σ ∷ μ ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.1.8" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.8" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.1.8" ∷ word (σ ∷ υ ∷ γ ∷ κ ∷ α ∷ κ ∷ ο ∷ π ∷ ά ∷ θ ∷ η ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.1.8" ∷ word (τ ∷ ῷ ∷ []) "2Tim.1.8" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ ῳ ∷ []) "2Tim.1.8" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "2Tim.1.8" ∷ word (δ ∷ ύ ∷ ν ∷ α ∷ μ ∷ ι ∷ ν ∷ []) "2Tim.1.8" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.1.8" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.9" ∷ word (σ ∷ ώ ∷ σ ∷ α ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.9" ∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "2Tim.1.9" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.9" ∷ word (κ ∷ α ∷ ∙λ ∷ έ ∷ σ ∷ α ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.9" ∷ word (κ ∷ ∙λ ∷ ή ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.1.9" ∷ word (ἁ ∷ γ ∷ ί ∷ ᾳ ∷ []) "2Tim.1.9" ∷ word (ο ∷ ὐ ∷ []) "2Tim.1.9" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "2Tim.1.9" ∷ word (τ ∷ ὰ ∷ []) "2Tim.1.9" ∷ word (ἔ ∷ ρ ∷ γ ∷ α ∷ []) "2Tim.1.9" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "2Tim.1.9" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.1.9" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "2Tim.1.9" ∷ word (ἰ ∷ δ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.1.9" ∷ word (π ∷ ρ ∷ ό ∷ θ ∷ ε ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.1.9" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.9" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ν ∷ []) "2Tim.1.9" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.1.9" ∷ word (δ ∷ ο ∷ θ ∷ ε ∷ ῖ ∷ σ ∷ α ∷ ν ∷ []) "2Tim.1.9" ∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "2Tim.1.9" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.9" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.1.9" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.9" ∷ word (π ∷ ρ ∷ ὸ ∷ []) "2Tim.1.9" ∷ word (χ ∷ ρ ∷ ό ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.1.9" ∷ word (α ∷ ἰ ∷ ω ∷ ν ∷ ί ∷ ω ∷ ν ∷ []) "2Tim.1.9" ∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ω ∷ θ ∷ ε ∷ ῖ ∷ σ ∷ α ∷ ν ∷ []) "2Tim.1.10" ∷ word (δ ∷ ὲ ∷ []) "2Tim.1.10" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "2Tim.1.10" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.1.10" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.1.10" ∷ word (ἐ ∷ π ∷ ι ∷ φ ∷ α ∷ ν ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.1.10" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.10" ∷ word (σ ∷ ω ∷ τ ∷ ῆ ∷ ρ ∷ ο ∷ ς ∷ []) "2Tim.1.10" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "2Tim.1.10" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.10" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.10" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ρ ∷ γ ∷ ή ∷ σ ∷ α ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.10" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "2Tim.1.10" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.1.10" ∷ word (θ ∷ ά ∷ ν ∷ α ∷ τ ∷ ο ∷ ν ∷ []) "2Tim.1.10" ∷ word (φ ∷ ω ∷ τ ∷ ί ∷ σ ∷ α ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.10" ∷ word (δ ∷ ὲ ∷ []) "2Tim.1.10" ∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "2Tim.1.10" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.10" ∷ word (ἀ ∷ φ ∷ θ ∷ α ∷ ρ ∷ σ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.1.10" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.1.10" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.10" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.1.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.1.11" ∷ word (ὃ ∷ []) "2Tim.1.11" ∷ word (ἐ ∷ τ ∷ έ ∷ θ ∷ η ∷ ν ∷ []) "2Tim.1.11" ∷ word (ἐ ∷ γ ∷ ὼ ∷ []) "2Tim.1.11" ∷ word (κ ∷ ῆ ∷ ρ ∷ υ ∷ ξ ∷ []) "2Tim.1.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.11" ∷ word (ἀ ∷ π ∷ ό ∷ σ ∷ τ ∷ ο ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.1.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.11" ∷ word (δ ∷ ι ∷ δ ∷ ά ∷ σ ∷ κ ∷ α ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.1.11" ∷ word (δ ∷ ι ∷ []) "2Tim.1.12" ∷ word (ἣ ∷ ν ∷ []) "2Tim.1.12" ∷ word (α ∷ ἰ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.1.12" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.12" ∷ word (τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "2Tim.1.12" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ω ∷ []) "2Tim.1.12" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "2Tim.1.12" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "2Tim.1.12" ∷ word (ἐ ∷ π ∷ α ∷ ι ∷ σ ∷ χ ∷ ύ ∷ ν ∷ ο ∷ μ ∷ α ∷ ι ∷ []) "2Tim.1.12" ∷ word (ο ∷ ἶ ∷ δ ∷ α ∷ []) "2Tim.1.12" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.1.12" ∷ word (ᾧ ∷ []) "2Tim.1.12" ∷ word (π ∷ ε ∷ π ∷ ί ∷ σ ∷ τ ∷ ε ∷ υ ∷ κ ∷ α ∷ []) "2Tim.1.12" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.12" ∷ word (π ∷ έ ∷ π ∷ ε ∷ ι ∷ σ ∷ μ ∷ α ∷ ι ∷ []) "2Tim.1.12" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.1.12" ∷ word (δ ∷ υ ∷ ν ∷ α ∷ τ ∷ ό ∷ ς ∷ []) "2Tim.1.12" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.1.12" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.1.12" ∷ word (π ∷ α ∷ ρ ∷ α ∷ θ ∷ ή ∷ κ ∷ η ∷ ν ∷ []) "2Tim.1.12" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.1.12" ∷ word (φ ∷ υ ∷ ∙λ ∷ ά ∷ ξ ∷ α ∷ ι ∷ []) "2Tim.1.12" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.1.12" ∷ word (ἐ ∷ κ ∷ ε ∷ ί ∷ ν ∷ η ∷ ν ∷ []) "2Tim.1.12" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.1.12" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ α ∷ ν ∷ []) "2Tim.1.12" ∷ word (ὑ ∷ π ∷ ο ∷ τ ∷ ύ ∷ π ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.1.13" ∷ word (ἔ ∷ χ ∷ ε ∷ []) "2Tim.1.13" ∷ word (ὑ ∷ γ ∷ ι ∷ α ∷ ι ∷ ν ∷ ό ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "2Tim.1.13" ∷ word (∙λ ∷ ό ∷ γ ∷ ω ∷ ν ∷ []) "2Tim.1.13" ∷ word (ὧ ∷ ν ∷ []) "2Tim.1.13" ∷ word (π ∷ α ∷ ρ ∷ []) "2Tim.1.13" ∷ word (ἐ ∷ μ ∷ ο ∷ ῦ ∷ []) "2Tim.1.13" ∷ word (ἤ ∷ κ ∷ ο ∷ υ ∷ σ ∷ α ∷ ς ∷ []) "2Tim.1.13" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.13" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ι ∷ []) "2Tim.1.13" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.13" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ ῃ ∷ []) "2Tim.1.13" ∷ word (τ ∷ ῇ ∷ []) "2Tim.1.13" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.13" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.1.13" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.1.13" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.1.14" ∷ word (κ ∷ α ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "2Tim.1.14" ∷ word (π ∷ α ∷ ρ ∷ α ∷ θ ∷ ή ∷ κ ∷ η ∷ ν ∷ []) "2Tim.1.14" ∷ word (φ ∷ ύ ∷ ∙λ ∷ α ∷ ξ ∷ ο ∷ ν ∷ []) "2Tim.1.14" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.1.14" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.14" ∷ word (ἁ ∷ γ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.1.14" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.1.14" ∷ word (ἐ ∷ ν ∷ ο ∷ ι ∷ κ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.1.14" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.14" ∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "2Tim.1.14" ∷ word (Ο ∷ ἶ ∷ δ ∷ α ∷ ς ∷ []) "2Tim.1.15" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "2Tim.1.15" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.1.15" ∷ word (ἀ ∷ π ∷ ε ∷ σ ∷ τ ∷ ρ ∷ ά ∷ φ ∷ η ∷ σ ∷ ά ∷ ν ∷ []) "2Tim.1.15" ∷ word (μ ∷ ε ∷ []) "2Tim.1.15" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.1.15" ∷ word (ο ∷ ἱ ∷ []) "2Tim.1.15" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.15" ∷ word (τ ∷ ῇ ∷ []) "2Tim.1.15" ∷ word (Ἀ ∷ σ ∷ ί ∷ ᾳ ∷ []) "2Tim.1.15" ∷ word (ὧ ∷ ν ∷ []) "2Tim.1.15" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.1.15" ∷ word (Φ ∷ ύ ∷ γ ∷ ε ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.1.15" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.15" ∷ word (Ἑ ∷ ρ ∷ μ ∷ ο ∷ γ ∷ έ ∷ ν ∷ η ∷ ς ∷ []) "2Tim.1.15" ∷ word (δ ∷ ῴ ∷ η ∷ []) "2Tim.1.16" ∷ word (ἔ ∷ ∙λ ∷ ε ∷ ο ∷ ς ∷ []) "2Tim.1.16" ∷ word (ὁ ∷ []) "2Tim.1.16" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.1.16" ∷ word (τ ∷ ῷ ∷ []) "2Tim.1.16" ∷ word (Ὀ ∷ ν ∷ η ∷ σ ∷ ι ∷ φ ∷ ό ∷ ρ ∷ ο ∷ υ ∷ []) "2Tim.1.16" ∷ word (ο ∷ ἴ ∷ κ ∷ ῳ ∷ []) "2Tim.1.16" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.1.16" ∷ word (π ∷ ο ∷ ∙λ ∷ ∙λ ∷ ά ∷ κ ∷ ι ∷ ς ∷ []) "2Tim.1.16" ∷ word (μ ∷ ε ∷ []) "2Tim.1.16" ∷ word (ἀ ∷ ν ∷ έ ∷ ψ ∷ υ ∷ ξ ∷ ε ∷ ν ∷ []) "2Tim.1.16" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.16" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.1.16" ∷ word (ἅ ∷ ∙λ ∷ υ ∷ σ ∷ ί ∷ ν ∷ []) "2Tim.1.16" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.1.16" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "2Tim.1.16" ∷ word (ἐ ∷ π ∷ α ∷ ι ∷ σ ∷ χ ∷ ύ ∷ ν ∷ θ ∷ η ∷ []) "2Tim.1.16" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.1.17" ∷ word (γ ∷ ε ∷ ν ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.1.17" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.17" ∷ word (Ῥ ∷ ώ ∷ μ ∷ ῃ ∷ []) "2Tim.1.17" ∷ word (σ ∷ π ∷ ο ∷ υ ∷ δ ∷ α ∷ ί ∷ ω ∷ ς ∷ []) "2Tim.1.17" ∷ word (ἐ ∷ ζ ∷ ή ∷ τ ∷ η ∷ σ ∷ έ ∷ ν ∷ []) "2Tim.1.17" ∷ word (μ ∷ ε ∷ []) "2Tim.1.17" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.17" ∷ word (ε ∷ ὗ ∷ ρ ∷ ε ∷ ν ∷ []) "2Tim.1.17" ∷ word (δ ∷ ῴ ∷ η ∷ []) "2Tim.1.18" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "2Tim.1.18" ∷ word (ὁ ∷ []) "2Tim.1.18" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.1.18" ∷ word (ε ∷ ὑ ∷ ρ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.1.18" ∷ word (ἔ ∷ ∙λ ∷ ε ∷ ο ∷ ς ∷ []) "2Tim.1.18" ∷ word (π ∷ α ∷ ρ ∷ ὰ ∷ []) "2Tim.1.18" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.1.18" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.18" ∷ word (ἐ ∷ κ ∷ ε ∷ ί ∷ ν ∷ ῃ ∷ []) "2Tim.1.18" ∷ word (τ ∷ ῇ ∷ []) "2Tim.1.18" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ ᾳ ∷ []) "2Tim.1.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.1.18" ∷ word (ὅ ∷ σ ∷ α ∷ []) "2Tim.1.18" ∷ word (ἐ ∷ ν ∷ []) "2Tim.1.18" ∷ word (Ἐ ∷ φ ∷ έ ∷ σ ∷ ῳ ∷ []) "2Tim.1.18" ∷ word (δ ∷ ι ∷ η ∷ κ ∷ ό ∷ ν ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "2Tim.1.18" ∷ word (β ∷ έ ∷ ∙λ ∷ τ ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.1.18" ∷ word (σ ∷ ὺ ∷ []) "2Tim.1.18" ∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ε ∷ ι ∷ ς ∷ []) "2Tim.1.18" ∷ word (Σ ∷ ὺ ∷ []) "2Tim.2.1" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "2Tim.2.1" ∷ word (τ ∷ έ ∷ κ ∷ ν ∷ ο ∷ ν ∷ []) "2Tim.2.1" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.2.1" ∷ word (ἐ ∷ ν ∷ δ ∷ υ ∷ ν ∷ α ∷ μ ∷ ο ∷ ῦ ∷ []) "2Tim.2.1" ∷ word (ἐ ∷ ν ∷ []) "2Tim.2.1" ∷ word (τ ∷ ῇ ∷ []) "2Tim.2.1" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ τ ∷ ι ∷ []) "2Tim.2.1" ∷ word (τ ∷ ῇ ∷ []) "2Tim.2.1" ∷ word (ἐ ∷ ν ∷ []) "2Tim.2.1" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.2.1" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.2.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.2" ∷ word (ἃ ∷ []) "2Tim.2.2" ∷ word (ἤ ∷ κ ∷ ο ∷ υ ∷ σ ∷ α ∷ ς ∷ []) "2Tim.2.2" ∷ word (π ∷ α ∷ ρ ∷ []) "2Tim.2.2" ∷ word (ἐ ∷ μ ∷ ο ∷ ῦ ∷ []) "2Tim.2.2" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.2.2" ∷ word (π ∷ ο ∷ ∙λ ∷ ∙λ ∷ ῶ ∷ ν ∷ []) "2Tim.2.2" ∷ word (μ ∷ α ∷ ρ ∷ τ ∷ ύ ∷ ρ ∷ ω ∷ ν ∷ []) "2Tim.2.2" ∷ word (τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "2Tim.2.2" ∷ word (π ∷ α ∷ ρ ∷ ά ∷ θ ∷ ο ∷ υ ∷ []) "2Tim.2.2" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.2.2" ∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ώ ∷ π ∷ ο ∷ ι ∷ ς ∷ []) "2Tim.2.2" ∷ word (ο ∷ ἵ ∷ τ ∷ ι ∷ ν ∷ ε ∷ ς ∷ []) "2Tim.2.2" ∷ word (ἱ ∷ κ ∷ α ∷ ν ∷ ο ∷ ὶ ∷ []) "2Tim.2.2" ∷ word (ἔ ∷ σ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.2" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.2" ∷ word (ἑ ∷ τ ∷ έ ∷ ρ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.2.2" ∷ word (δ ∷ ι ∷ δ ∷ ά ∷ ξ ∷ α ∷ ι ∷ []) "2Tim.2.2" ∷ word (σ ∷ υ ∷ γ ∷ κ ∷ α ∷ κ ∷ ο ∷ π ∷ ά ∷ θ ∷ η ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.2.3" ∷ word (ὡ ∷ ς ∷ []) "2Tim.2.3" ∷ word (κ ∷ α ∷ ∙λ ∷ ὸ ∷ ς ∷ []) "2Tim.2.3" ∷ word (σ ∷ τ ∷ ρ ∷ α ∷ τ ∷ ι ∷ ώ ∷ τ ∷ η ∷ ς ∷ []) "2Tim.2.3" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.3" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.2.3" ∷ word (ο ∷ ὐ ∷ δ ∷ ε ∷ ὶ ∷ ς ∷ []) "2Tim.2.4" ∷ word (σ ∷ τ ∷ ρ ∷ α ∷ τ ∷ ε ∷ υ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.2.4" ∷ word (ἐ ∷ μ ∷ π ∷ ∙λ ∷ έ ∷ κ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.4" ∷ word (τ ∷ α ∷ ῖ ∷ ς ∷ []) "2Tim.2.4" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.4" ∷ word (β ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.2.4" ∷ word (π ∷ ρ ∷ α ∷ γ ∷ μ ∷ α ∷ τ ∷ ε ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "2Tim.2.4" ∷ word (ἵ ∷ ν ∷ α ∷ []) "2Tim.2.4" ∷ word (τ ∷ ῷ ∷ []) "2Tim.2.4" ∷ word (σ ∷ τ ∷ ρ ∷ α ∷ τ ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ή ∷ σ ∷ α ∷ ν ∷ τ ∷ ι ∷ []) "2Tim.2.4" ∷ word (ἀ ∷ ρ ∷ έ ∷ σ ∷ ῃ ∷ []) "2Tim.2.4" ∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "2Tim.2.5" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.5" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.5" ∷ word (ἀ ∷ θ ∷ ∙λ ∷ ῇ ∷ []) "2Tim.2.5" ∷ word (τ ∷ ι ∷ ς ∷ []) "2Tim.2.5" ∷ word (ο ∷ ὐ ∷ []) "2Tim.2.5" ∷ word (σ ∷ τ ∷ ε ∷ φ ∷ α ∷ ν ∷ ο ∷ ῦ ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.5" ∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "2Tim.2.5" ∷ word (μ ∷ ὴ ∷ []) "2Tim.2.5" ∷ word (ν ∷ ο ∷ μ ∷ ί ∷ μ ∷ ω ∷ ς ∷ []) "2Tim.2.5" ∷ word (ἀ ∷ θ ∷ ∙λ ∷ ή ∷ σ ∷ ῃ ∷ []) "2Tim.2.5" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.6" ∷ word (κ ∷ ο ∷ π ∷ ι ∷ ῶ ∷ ν ∷ τ ∷ α ∷ []) "2Tim.2.6" ∷ word (γ ∷ ε ∷ ω ∷ ρ ∷ γ ∷ ὸ ∷ ν ∷ []) "2Tim.2.6" ∷ word (δ ∷ ε ∷ ῖ ∷ []) "2Tim.2.6" ∷ word (π ∷ ρ ∷ ῶ ∷ τ ∷ ο ∷ ν ∷ []) "2Tim.2.6" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "2Tim.2.6" ∷ word (κ ∷ α ∷ ρ ∷ π ∷ ῶ ∷ ν ∷ []) "2Tim.2.6" ∷ word (μ ∷ ε ∷ τ ∷ α ∷ ∙λ ∷ α ∷ μ ∷ β ∷ ά ∷ ν ∷ ε ∷ ι ∷ ν ∷ []) "2Tim.2.6" ∷ word (ν ∷ ό ∷ ε ∷ ι ∷ []) "2Tim.2.7" ∷ word (ὃ ∷ []) "2Tim.2.7" ∷ word (∙λ ∷ έ ∷ γ ∷ ω ∷ []) "2Tim.2.7" ∷ word (δ ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.2.7" ∷ word (γ ∷ ά ∷ ρ ∷ []) "2Tim.2.7" ∷ word (σ ∷ ο ∷ ι ∷ []) "2Tim.2.7" ∷ word (ὁ ∷ []) "2Tim.2.7" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.2.7" ∷ word (σ ∷ ύ ∷ ν ∷ ε ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.7" ∷ word (ἐ ∷ ν ∷ []) "2Tim.2.7" ∷ word (π ∷ ᾶ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.7" ∷ word (Μ ∷ ν ∷ η ∷ μ ∷ ό ∷ ν ∷ ε ∷ υ ∷ ε ∷ []) "2Tim.2.8" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ν ∷ []) "2Tim.2.8" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.8" ∷ word (ἐ ∷ γ ∷ η ∷ γ ∷ ε ∷ ρ ∷ μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ []) "2Tim.2.8" ∷ word (ἐ ∷ κ ∷ []) "2Tim.2.8" ∷ word (ν ∷ ε ∷ κ ∷ ρ ∷ ῶ ∷ ν ∷ []) "2Tim.2.8" ∷ word (ἐ ∷ κ ∷ []) "2Tim.2.8" ∷ word (σ ∷ π ∷ έ ∷ ρ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.2.8" ∷ word (Δ ∷ α ∷ υ ∷ ί ∷ δ ∷ []) "2Tim.2.8" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "2Tim.2.8" ∷ word (τ ∷ ὸ ∷ []) "2Tim.2.8" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ έ ∷ ∙λ ∷ ι ∷ ό ∷ ν ∷ []) "2Tim.2.8" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.2.8" ∷ word (ἐ ∷ ν ∷ []) "2Tim.2.9" ∷ word (ᾧ ∷ []) "2Tim.2.9" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ π ∷ α ∷ θ ∷ ῶ ∷ []) "2Tim.2.9" ∷ word (μ ∷ έ ∷ χ ∷ ρ ∷ ι ∷ []) "2Tim.2.9" ∷ word (δ ∷ ε ∷ σ ∷ μ ∷ ῶ ∷ ν ∷ []) "2Tim.2.9" ∷ word (ὡ ∷ ς ∷ []) "2Tim.2.9" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ ῦ ∷ ρ ∷ γ ∷ ο ∷ ς ∷ []) "2Tim.2.9" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.2.9" ∷ word (ὁ ∷ []) "2Tim.2.9" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ς ∷ []) "2Tim.2.9" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.9" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.2.9" ∷ word (ο ∷ ὐ ∷ []) "2Tim.2.9" ∷ word (δ ∷ έ ∷ δ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.9" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.2.10" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "2Tim.2.10" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ α ∷ []) "2Tim.2.10" ∷ word (ὑ ∷ π ∷ ο ∷ μ ∷ έ ∷ ν ∷ ω ∷ []) "2Tim.2.10" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.2.10" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "2Tim.2.10" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ε ∷ κ ∷ τ ∷ ο ∷ ύ ∷ ς ∷ []) "2Tim.2.10" ∷ word (ἵ ∷ ν ∷ α ∷ []) "2Tim.2.10" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.10" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ὶ ∷ []) "2Tim.2.10" ∷ word (σ ∷ ω ∷ τ ∷ η ∷ ρ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.10" ∷ word (τ ∷ ύ ∷ χ ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.10" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.2.10" ∷ word (ἐ ∷ ν ∷ []) "2Tim.2.10" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.2.10" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.2.10" ∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "2Tim.2.10" ∷ word (δ ∷ ό ∷ ξ ∷ η ∷ ς ∷ []) "2Tim.2.10" ∷ word (α ∷ ἰ ∷ ω ∷ ν ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.2.10" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ς ∷ []) "2Tim.2.11" ∷ word (ὁ ∷ []) "2Tim.2.11" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ς ∷ []) "2Tim.2.11" ∷ word (ε ∷ ἰ ∷ []) "2Tim.2.11" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.2.11" ∷ word (σ ∷ υ ∷ ν ∷ α ∷ π ∷ ε ∷ θ ∷ ά ∷ ν ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "2Tim.2.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.11" ∷ word (σ ∷ υ ∷ ζ ∷ ή ∷ σ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "2Tim.2.11" ∷ word (ε ∷ ἰ ∷ []) "2Tim.2.12" ∷ word (ὑ ∷ π ∷ ο ∷ μ ∷ έ ∷ ν ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "2Tim.2.12" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.12" ∷ word (σ ∷ υ ∷ μ ∷ β ∷ α ∷ σ ∷ ι ∷ ∙λ ∷ ε ∷ ύ ∷ σ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "2Tim.2.12" ∷ word (ε ∷ ἰ ∷ []) "2Tim.2.12" ∷ word (ἀ ∷ ρ ∷ ν ∷ η ∷ σ ∷ ό ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "2Tim.2.12" ∷ word (κ ∷ ἀ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.2.12" ∷ word (ἀ ∷ ρ ∷ ν ∷ ή ∷ σ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.12" ∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "2Tim.2.12" ∷ word (ε ∷ ἰ ∷ []) "2Tim.2.13" ∷ word (ἀ ∷ π ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "2Tim.2.13" ∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.2.13" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ς ∷ []) "2Tim.2.13" ∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "2Tim.2.13" ∷ word (ἀ ∷ ρ ∷ ν ∷ ή ∷ σ ∷ α ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "2Tim.2.13" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.13" ∷ word (ο ∷ ὐ ∷ []) "2Tim.2.13" ∷ word (δ ∷ ύ ∷ ν ∷ α ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.13" ∷ word (Τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "2Tim.2.14" ∷ word (ὑ ∷ π ∷ ο ∷ μ ∷ ί ∷ μ ∷ ν ∷ ῃ ∷ σ ∷ κ ∷ ε ∷ []) "2Tim.2.14" ∷ word (δ ∷ ι ∷ α ∷ μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.2.14" ∷ word (ἐ ∷ ν ∷ ώ ∷ π ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.2.14" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.14" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.2.14" ∷ word (μ ∷ ὴ ∷ []) "2Tim.2.14" ∷ word (∙λ ∷ ο ∷ γ ∷ ο ∷ μ ∷ α ∷ χ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.2.14" ∷ word (ἐ ∷ π ∷ []) "2Tim.2.14" ∷ word (ο ∷ ὐ ∷ δ ∷ ὲ ∷ ν ∷ []) "2Tim.2.14" ∷ word (χ ∷ ρ ∷ ή ∷ σ ∷ ι ∷ μ ∷ ο ∷ ν ∷ []) "2Tim.2.14" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "2Tim.2.14" ∷ word (κ ∷ α ∷ τ ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ῇ ∷ []) "2Tim.2.14" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "2Tim.2.14" ∷ word (ἀ ∷ κ ∷ ο ∷ υ ∷ ό ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "2Tim.2.14" ∷ word (σ ∷ π ∷ ο ∷ ύ ∷ δ ∷ α ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.2.15" ∷ word (σ ∷ ε ∷ α ∷ υ ∷ τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.15" ∷ word (δ ∷ ό ∷ κ ∷ ι ∷ μ ∷ ο ∷ ν ∷ []) "2Tim.2.15" ∷ word (π ∷ α ∷ ρ ∷ α ∷ σ ∷ τ ∷ ῆ ∷ σ ∷ α ∷ ι ∷ []) "2Tim.2.15" ∷ word (τ ∷ ῷ ∷ []) "2Tim.2.15" ∷ word (θ ∷ ε ∷ ῷ ∷ []) "2Tim.2.15" ∷ word (ἐ ∷ ρ ∷ γ ∷ ά ∷ τ ∷ η ∷ ν ∷ []) "2Tim.2.15" ∷ word (ἀ ∷ ν ∷ ε ∷ π ∷ α ∷ ί ∷ σ ∷ χ ∷ υ ∷ ν ∷ τ ∷ ο ∷ ν ∷ []) "2Tim.2.15" ∷ word (ὀ ∷ ρ ∷ θ ∷ ο ∷ τ ∷ ο ∷ μ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ α ∷ []) "2Tim.2.15" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.15" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ν ∷ []) "2Tim.2.15" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.2.15" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.15" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "2Tim.2.16" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.16" ∷ word (β ∷ ε ∷ β ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.2.16" ∷ word (κ ∷ ε ∷ ν ∷ ο ∷ φ ∷ ω ∷ ν ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.16" ∷ word (π ∷ ε ∷ ρ ∷ ι ∷ ΐ ∷ σ ∷ τ ∷ α ∷ σ ∷ ο ∷ []) "2Tim.2.16" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "2Tim.2.16" ∷ word (π ∷ ∙λ ∷ ε ∷ ῖ ∷ ο ∷ ν ∷ []) "2Tim.2.16" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.2.16" ∷ word (π ∷ ρ ∷ ο ∷ κ ∷ ό ∷ ψ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.16" ∷ word (ἀ ∷ σ ∷ ε ∷ β ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.16" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.17" ∷ word (ὁ ∷ []) "2Tim.2.17" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ς ∷ []) "2Tim.2.17" ∷ word (α ∷ ὐ ∷ τ ∷ ῶ ∷ ν ∷ []) "2Tim.2.17" ∷ word (ὡ ∷ ς ∷ []) "2Tim.2.17" ∷ word (γ ∷ ά ∷ γ ∷ γ ∷ ρ ∷ α ∷ ι ∷ ν ∷ α ∷ []) "2Tim.2.17" ∷ word (ν ∷ ο ∷ μ ∷ ὴ ∷ ν ∷ []) "2Tim.2.17" ∷ word (ἕ ∷ ξ ∷ ε ∷ ι ∷ []) "2Tim.2.17" ∷ word (ὧ ∷ ν ∷ []) "2Tim.2.17" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.2.17" ∷ word (Ὑ ∷ μ ∷ έ ∷ ν ∷ α ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.2.17" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.17" ∷ word (Φ ∷ ί ∷ ∙λ ∷ η ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.2.17" ∷ word (ο ∷ ἵ ∷ τ ∷ ι ∷ ν ∷ ε ∷ ς ∷ []) "2Tim.2.18" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "2Tim.2.18" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.2.18" ∷ word (ἀ ∷ ∙λ ∷ ή ∷ θ ∷ ε ∷ ι ∷ α ∷ ν ∷ []) "2Tim.2.18" ∷ word (ἠ ∷ σ ∷ τ ∷ ό ∷ χ ∷ η ∷ σ ∷ α ∷ ν ∷ []) "2Tim.2.18" ∷ word (∙λ ∷ έ ∷ γ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.2.18" ∷ word (ἀ ∷ ν ∷ ά ∷ σ ∷ τ ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.18" ∷ word (ἤ ∷ δ ∷ η ∷ []) "2Tim.2.18" ∷ word (γ ∷ ε ∷ γ ∷ ο ∷ ν ∷ έ ∷ ν ∷ α ∷ ι ∷ []) "2Tim.2.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.18" ∷ word (ἀ ∷ ν ∷ α ∷ τ ∷ ρ ∷ έ ∷ π ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.18" ∷ word (τ ∷ ή ∷ ν ∷ []) "2Tim.2.18" ∷ word (τ ∷ ι ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.2.18" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.2.18" ∷ word (ὁ ∷ []) "2Tim.2.19" ∷ word (μ ∷ έ ∷ ν ∷ τ ∷ ο ∷ ι ∷ []) "2Tim.2.19" ∷ word (σ ∷ τ ∷ ε ∷ ρ ∷ ε ∷ ὸ ∷ ς ∷ []) "2Tim.2.19" ∷ word (θ ∷ ε ∷ μ ∷ έ ∷ ∙λ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.2.19" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.19" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.2.19" ∷ word (ἕ ∷ σ ∷ τ ∷ η ∷ κ ∷ ε ∷ ν ∷ []) "2Tim.2.19" ∷ word (ἔ ∷ χ ∷ ω ∷ ν ∷ []) "2Tim.2.19" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.2.19" ∷ word (σ ∷ φ ∷ ρ ∷ α ∷ γ ∷ ῖ ∷ δ ∷ α ∷ []) "2Tim.2.19" ∷ word (τ ∷ α ∷ ύ ∷ τ ∷ η ∷ ν ∷ []) "2Tim.2.19" ∷ word (Ἔ ∷ γ ∷ ν ∷ ω ∷ []) "2Tim.2.19" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.2.19" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "2Tim.2.19" ∷ word (ὄ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "2Tim.2.19" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.19" ∷ word (κ ∷ α ∷ ί ∷ []) "2Tim.2.19" ∷ word (Ἀ ∷ π ∷ ο ∷ σ ∷ τ ∷ ή ∷ τ ∷ ω ∷ []) "2Tim.2.19" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.2.19" ∷ word (ἀ ∷ δ ∷ ι ∷ κ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.19" ∷ word (π ∷ ᾶ ∷ ς ∷ []) "2Tim.2.19" ∷ word (ὁ ∷ []) "2Tim.2.19" ∷ word (ὀ ∷ ν ∷ ο ∷ μ ∷ ά ∷ ζ ∷ ω ∷ ν ∷ []) "2Tim.2.19" ∷ word (τ ∷ ὸ ∷ []) "2Tim.2.19" ∷ word (ὄ ∷ ν ∷ ο ∷ μ ∷ α ∷ []) "2Tim.2.19" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.2.19" ∷ word (Ἐ ∷ ν ∷ []) "2Tim.2.20" ∷ word (μ ∷ ε ∷ γ ∷ ά ∷ ∙λ ∷ ῃ ∷ []) "2Tim.2.20" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.20" ∷ word (ο ∷ ἰ ∷ κ ∷ ί ∷ ᾳ ∷ []) "2Tim.2.20" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "2Tim.2.20" ∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.2.20" ∷ word (μ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "2Tim.2.20" ∷ word (σ ∷ κ ∷ ε ∷ ύ ∷ η ∷ []) "2Tim.2.20" ∷ word (χ ∷ ρ ∷ υ ∷ σ ∷ ᾶ ∷ []) "2Tim.2.20" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.20" ∷ word (ἀ ∷ ρ ∷ γ ∷ υ ∷ ρ ∷ ᾶ ∷ []) "2Tim.2.20" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.2.20" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.20" ∷ word (ξ ∷ ύ ∷ ∙λ ∷ ι ∷ ν ∷ α ∷ []) "2Tim.2.20" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.20" ∷ word (ὀ ∷ σ ∷ τ ∷ ρ ∷ ά ∷ κ ∷ ι ∷ ν ∷ α ∷ []) "2Tim.2.20" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.20" ∷ word (ἃ ∷ []) "2Tim.2.20" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "2Tim.2.20" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.2.20" ∷ word (τ ∷ ι ∷ μ ∷ ὴ ∷ ν ∷ []) "2Tim.2.20" ∷ word (ἃ ∷ []) "2Tim.2.20" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.20" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.2.20" ∷ word (ἀ ∷ τ ∷ ι ∷ μ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.2.20" ∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "2Tim.2.21" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "2Tim.2.21" ∷ word (τ ∷ ι ∷ ς ∷ []) "2Tim.2.21" ∷ word (ἐ ∷ κ ∷ κ ∷ α ∷ θ ∷ ά ∷ ρ ∷ ῃ ∷ []) "2Tim.2.21" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.21" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.2.21" ∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ω ∷ ν ∷ []) "2Tim.2.21" ∷ word (ἔ ∷ σ ∷ τ ∷ α ∷ ι ∷ []) "2Tim.2.21" ∷ word (σ ∷ κ ∷ ε ∷ ῦ ∷ ο ∷ ς ∷ []) "2Tim.2.21" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.2.21" ∷ word (τ ∷ ι ∷ μ ∷ ή ∷ ν ∷ []) "2Tim.2.21" ∷ word (ἡ ∷ γ ∷ ι ∷ α ∷ σ ∷ μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ []) "2Tim.2.21" ∷ word (ε ∷ ὔ ∷ χ ∷ ρ ∷ η ∷ σ ∷ τ ∷ ο ∷ ν ∷ []) "2Tim.2.21" ∷ word (τ ∷ ῷ ∷ []) "2Tim.2.21" ∷ word (δ ∷ ε ∷ σ ∷ π ∷ ό ∷ τ ∷ ῃ ∷ []) "2Tim.2.21" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.2.21" ∷ word (π ∷ ᾶ ∷ ν ∷ []) "2Tim.2.21" ∷ word (ἔ ∷ ρ ∷ γ ∷ ο ∷ ν ∷ []) "2Tim.2.21" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ὸ ∷ ν ∷ []) "2Tim.2.21" ∷ word (ἡ ∷ τ ∷ ο ∷ ι ∷ μ ∷ α ∷ σ ∷ μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ []) "2Tim.2.21" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "2Tim.2.22" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.22" ∷ word (ν ∷ ε ∷ ω ∷ τ ∷ ε ∷ ρ ∷ ι ∷ κ ∷ ὰ ∷ ς ∷ []) "2Tim.2.22" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.22" ∷ word (φ ∷ ε ∷ ῦ ∷ γ ∷ ε ∷ []) "2Tim.2.22" ∷ word (δ ∷ ί ∷ ω ∷ κ ∷ ε ∷ []) "2Tim.2.22" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.22" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ν ∷ []) "2Tim.2.22" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.2.22" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ν ∷ []) "2Tim.2.22" ∷ word (ε ∷ ἰ ∷ ρ ∷ ή ∷ ν ∷ η ∷ ν ∷ []) "2Tim.2.22" ∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "2Tim.2.22" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "2Tim.2.22" ∷ word (ἐ ∷ π ∷ ι ∷ κ ∷ α ∷ ∙λ ∷ ο ∷ υ ∷ μ ∷ έ ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.2.22" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.2.22" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.2.22" ∷ word (ἐ ∷ κ ∷ []) "2Tim.2.22" ∷ word (κ ∷ α ∷ θ ∷ α ∷ ρ ∷ ᾶ ∷ ς ∷ []) "2Tim.2.22" ∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.22" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "2Tim.2.23" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.23" ∷ word (μ ∷ ω ∷ ρ ∷ ὰ ∷ ς ∷ []) "2Tim.2.23" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.23" ∷ word (ἀ ∷ π ∷ α ∷ ι ∷ δ ∷ ε ∷ ύ ∷ τ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.2.23" ∷ word (ζ ∷ η ∷ τ ∷ ή ∷ σ ∷ ε ∷ ι ∷ ς ∷ []) "2Tim.2.23" ∷ word (π ∷ α ∷ ρ ∷ α ∷ ι ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.23" ∷ word (ε ∷ ἰ ∷ δ ∷ ὼ ∷ ς ∷ []) "2Tim.2.23" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.2.23" ∷ word (γ ∷ ε ∷ ν ∷ ν ∷ ῶ ∷ σ ∷ ι ∷ []) "2Tim.2.23" ∷ word (μ ∷ ά ∷ χ ∷ α ∷ ς ∷ []) "2Tim.2.23" ∷ word (δ ∷ ο ∷ ῦ ∷ ∙λ ∷ ο ∷ ν ∷ []) "2Tim.2.24" ∷ word (δ ∷ ὲ ∷ []) "2Tim.2.24" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "2Tim.2.24" ∷ word (ο ∷ ὐ ∷ []) "2Tim.2.24" ∷ word (δ ∷ ε ∷ ῖ ∷ []) "2Tim.2.24" ∷ word (μ ∷ ά ∷ χ ∷ ε ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "2Tim.2.24" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.2.24" ∷ word (ἤ ∷ π ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.2.24" ∷ word (ε ∷ ἶ ∷ ν ∷ α ∷ ι ∷ []) "2Tim.2.24" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.2.24" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "2Tim.2.24" ∷ word (δ ∷ ι ∷ δ ∷ α ∷ κ ∷ τ ∷ ι ∷ κ ∷ ό ∷ ν ∷ []) "2Tim.2.24" ∷ word (ἀ ∷ ν ∷ ε ∷ ξ ∷ ί ∷ κ ∷ α ∷ κ ∷ ο ∷ ν ∷ []) "2Tim.2.24" ∷ word (ἐ ∷ ν ∷ []) "2Tim.2.25" ∷ word (π ∷ ρ ∷ α ∷ ΰ ∷ τ ∷ η ∷ τ ∷ ι ∷ []) "2Tim.2.25" ∷ word (π ∷ α ∷ ι ∷ δ ∷ ε ∷ ύ ∷ ο ∷ ν ∷ τ ∷ α ∷ []) "2Tim.2.25" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "2Tim.2.25" ∷ word (ἀ ∷ ν ∷ τ ∷ ι ∷ δ ∷ ι ∷ α ∷ τ ∷ ι ∷ θ ∷ ε ∷ μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.2.25" ∷ word (μ ∷ ή ∷ π ∷ ο ∷ τ ∷ ε ∷ []) "2Tim.2.25" ∷ word (δ ∷ ώ ∷ ῃ ∷ []) "2Tim.2.25" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.2.25" ∷ word (ὁ ∷ []) "2Tim.2.25" ∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "2Tim.2.25" ∷ word (μ ∷ ε ∷ τ ∷ ά ∷ ν ∷ ο ∷ ι ∷ α ∷ ν ∷ []) "2Tim.2.25" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.2.25" ∷ word (ἐ ∷ π ∷ ί ∷ γ ∷ ν ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.25" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.2.25" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.2.26" ∷ word (ἀ ∷ ν ∷ α ∷ ν ∷ ή ∷ ψ ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.2.26" ∷ word (ἐ ∷ κ ∷ []) "2Tim.2.26" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.2.26" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.26" ∷ word (δ ∷ ι ∷ α ∷ β ∷ ό ∷ ∙λ ∷ ο ∷ υ ∷ []) "2Tim.2.26" ∷ word (π ∷ α ∷ γ ∷ ί ∷ δ ∷ ο ∷ ς ∷ []) "2Tim.2.26" ∷ word (ἐ ∷ ζ ∷ ω ∷ γ ∷ ρ ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.2.26" ∷ word (ὑ ∷ π ∷ []) "2Tim.2.26" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.2.26" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.2.26" ∷ word (τ ∷ ὸ ∷ []) "2Tim.2.26" ∷ word (ἐ ∷ κ ∷ ε ∷ ί ∷ ν ∷ ο ∷ υ ∷ []) "2Tim.2.26" ∷ word (θ ∷ έ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "2Tim.2.26" ∷ word (Τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "2Tim.3.1" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.1" ∷ word (γ ∷ ί ∷ ν ∷ ω ∷ σ ∷ κ ∷ ε ∷ []) "2Tim.3.1" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.3.1" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.1" ∷ word (ἐ ∷ σ ∷ χ ∷ ά ∷ τ ∷ α ∷ ι ∷ ς ∷ []) "2Tim.3.1" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ α ∷ ι ∷ ς ∷ []) "2Tim.3.1" ∷ word (ἐ ∷ ν ∷ σ ∷ τ ∷ ή ∷ σ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.3.1" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ο ∷ ὶ ∷ []) "2Tim.3.1" ∷ word (χ ∷ α ∷ ∙λ ∷ ε ∷ π ∷ ο ∷ ί ∷ []) "2Tim.3.1" ∷ word (ἔ ∷ σ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.3.2" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.3.2" ∷ word (ο ∷ ἱ ∷ []) "2Tim.3.2" ∷ word (ἄ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (φ ∷ ί ∷ ∙λ ∷ α ∷ υ ∷ τ ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (φ ∷ ι ∷ ∙λ ∷ ά ∷ ρ ∷ γ ∷ υ ∷ ρ ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (ἀ ∷ ∙λ ∷ α ∷ ζ ∷ ό ∷ ν ∷ ε ∷ ς ∷ []) "2Tim.3.2" ∷ word (ὑ ∷ π ∷ ε ∷ ρ ∷ ή ∷ φ ∷ α ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (β ∷ ∙λ ∷ ά ∷ σ ∷ φ ∷ η ∷ μ ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (γ ∷ ο ∷ ν ∷ ε ∷ ῦ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.2" ∷ word (ἀ ∷ π ∷ ε ∷ ι ∷ θ ∷ ε ∷ ῖ ∷ ς ∷ []) "2Tim.3.2" ∷ word (ἀ ∷ χ ∷ ά ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (ἀ ∷ ν ∷ ό ∷ σ ∷ ι ∷ ο ∷ ι ∷ []) "2Tim.3.2" ∷ word (ἄ ∷ σ ∷ τ ∷ ο ∷ ρ ∷ γ ∷ ο ∷ ι ∷ []) "2Tim.3.3" ∷ word (ἄ ∷ σ ∷ π ∷ ο ∷ ν ∷ δ ∷ ο ∷ ι ∷ []) "2Tim.3.3" ∷ word (δ ∷ ι ∷ ά ∷ β ∷ ο ∷ ∙λ ∷ ο ∷ ι ∷ []) "2Tim.3.3" ∷ word (ἀ ∷ κ ∷ ρ ∷ α ∷ τ ∷ ε ∷ ῖ ∷ ς ∷ []) "2Tim.3.3" ∷ word (ἀ ∷ ν ∷ ή ∷ μ ∷ ε ∷ ρ ∷ ο ∷ ι ∷ []) "2Tim.3.3" ∷ word (ἀ ∷ φ ∷ ι ∷ ∙λ ∷ ά ∷ γ ∷ α ∷ θ ∷ ο ∷ ι ∷ []) "2Tim.3.3" ∷ word (π ∷ ρ ∷ ο ∷ δ ∷ ό ∷ τ ∷ α ∷ ι ∷ []) "2Tim.3.4" ∷ word (π ∷ ρ ∷ ο ∷ π ∷ ε ∷ τ ∷ ε ∷ ῖ ∷ ς ∷ []) "2Tim.3.4" ∷ word (τ ∷ ε ∷ τ ∷ υ ∷ φ ∷ ω ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.3.4" ∷ word (φ ∷ ι ∷ ∙λ ∷ ή ∷ δ ∷ ο ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.3.4" ∷ word (μ ∷ ᾶ ∷ ∙λ ∷ ∙λ ∷ ο ∷ ν ∷ []) "2Tim.3.4" ∷ word (ἢ ∷ []) "2Tim.3.4" ∷ word (φ ∷ ι ∷ ∙λ ∷ ό ∷ θ ∷ ε ∷ ο ∷ ι ∷ []) "2Tim.3.4" ∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.5" ∷ word (μ ∷ ό ∷ ρ ∷ φ ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.5" ∷ word (ε ∷ ὐ ∷ σ ∷ ε ∷ β ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.3.5" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.3.5" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.5" ∷ word (δ ∷ ύ ∷ ν ∷ α ∷ μ ∷ ι ∷ ν ∷ []) "2Tim.3.5" ∷ word (α ∷ ὐ ∷ τ ∷ ῆ ∷ ς ∷ []) "2Tim.3.5" ∷ word (ἠ ∷ ρ ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.3.5" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.5" ∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.3.5" ∷ word (ἀ ∷ π ∷ ο ∷ τ ∷ ρ ∷ έ ∷ π ∷ ο ∷ υ ∷ []) "2Tim.3.5" ∷ word (ἐ ∷ κ ∷ []) "2Tim.3.6" ∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ω ∷ ν ∷ []) "2Tim.3.6" ∷ word (γ ∷ ά ∷ ρ ∷ []) "2Tim.3.6" ∷ word (ε ∷ ἰ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.6" ∷ word (ο ∷ ἱ ∷ []) "2Tim.3.6" ∷ word (ἐ ∷ ν ∷ δ ∷ ύ ∷ ν ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.6" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.3.6" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "2Tim.3.6" ∷ word (ο ∷ ἰ ∷ κ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.3.6" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.6" ∷ word (α ∷ ἰ ∷ χ ∷ μ ∷ α ∷ ∙λ ∷ ω ∷ τ ∷ ί ∷ ζ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.6" ∷ word (γ ∷ υ ∷ ν ∷ α ∷ ι ∷ κ ∷ ά ∷ ρ ∷ ι ∷ α ∷ []) "2Tim.3.6" ∷ word (σ ∷ ε ∷ σ ∷ ω ∷ ρ ∷ ε ∷ υ ∷ μ ∷ έ ∷ ν ∷ α ∷ []) "2Tim.3.6" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "2Tim.3.6" ∷ word (ἀ ∷ γ ∷ ό ∷ μ ∷ ε ∷ ν ∷ α ∷ []) "2Tim.3.6" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "2Tim.3.6" ∷ word (π ∷ ο ∷ ι ∷ κ ∷ ί ∷ ∙λ ∷ α ∷ ι ∷ ς ∷ []) "2Tim.3.6" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ο ∷ τ ∷ ε ∷ []) "2Tim.3.7" ∷ word (μ ∷ α ∷ ν ∷ θ ∷ ά ∷ ν ∷ ο ∷ ν ∷ τ ∷ α ∷ []) "2Tim.3.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.7" ∷ word (μ ∷ η ∷ δ ∷ έ ∷ π ∷ ο ∷ τ ∷ ε ∷ []) "2Tim.3.7" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.3.7" ∷ word (ἐ ∷ π ∷ ί ∷ γ ∷ ν ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.7" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.3.7" ∷ word (ἐ ∷ ∙λ ∷ θ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.3.7" ∷ word (δ ∷ υ ∷ ν ∷ ά ∷ μ ∷ ε ∷ ν ∷ α ∷ []) "2Tim.3.7" ∷ word (ὃ ∷ ν ∷ []) "2Tim.3.8" ∷ word (τ ∷ ρ ∷ ό ∷ π ∷ ο ∷ ν ∷ []) "2Tim.3.8" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.8" ∷ word (Ἰ ∷ ά ∷ ν ∷ ν ∷ η ∷ ς ∷ []) "2Tim.3.8" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.8" ∷ word (Ἰ ∷ α ∷ μ ∷ β ∷ ρ ∷ ῆ ∷ ς ∷ []) "2Tim.3.8" ∷ word (ἀ ∷ ν ∷ τ ∷ έ ∷ σ ∷ τ ∷ η ∷ σ ∷ α ∷ ν ∷ []) "2Tim.3.8" ∷ word (Μ ∷ ω ∷ ϋ ∷ σ ∷ ε ∷ ῖ ∷ []) "2Tim.3.8" ∷ word (ο ∷ ὕ ∷ τ ∷ ω ∷ ς ∷ []) "2Tim.3.8" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.8" ∷ word (ο ∷ ὗ ∷ τ ∷ ο ∷ ι ∷ []) "2Tim.3.8" ∷ word (ἀ ∷ ν ∷ θ ∷ ί ∷ σ ∷ τ ∷ α ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.3.8" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.8" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ ᾳ ∷ []) "2Tim.3.8" ∷ word (ἄ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ ι ∷ []) "2Tim.3.8" ∷ word (κ ∷ α ∷ τ ∷ ε ∷ φ ∷ θ ∷ α ∷ ρ ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.3.8" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.3.8" ∷ word (ν ∷ ο ∷ ῦ ∷ ν ∷ []) "2Tim.3.8" ∷ word (ἀ ∷ δ ∷ ό ∷ κ ∷ ι ∷ μ ∷ ο ∷ ι ∷ []) "2Tim.3.8" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "2Tim.3.8" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.3.8" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.3.8" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "2Tim.3.9" ∷ word (ο ∷ ὐ ∷ []) "2Tim.3.9" ∷ word (π ∷ ρ ∷ ο ∷ κ ∷ ό ∷ ψ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.9" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "2Tim.3.9" ∷ word (π ∷ ∙λ ∷ ε ∷ ῖ ∷ ο ∷ ν ∷ []) "2Tim.3.9" ∷ word (ἡ ∷ []) "2Tim.3.9" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.3.9" ∷ word (ἄ ∷ ν ∷ ο ∷ ι ∷ α ∷ []) "2Tim.3.9" ∷ word (α ∷ ὐ ∷ τ ∷ ῶ ∷ ν ∷ []) "2Tim.3.9" ∷ word (ἔ ∷ κ ∷ δ ∷ η ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.3.9" ∷ word (ἔ ∷ σ ∷ τ ∷ α ∷ ι ∷ []) "2Tim.3.9" ∷ word (π ∷ ᾶ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.9" ∷ word (ὡ ∷ ς ∷ []) "2Tim.3.9" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.9" ∷ word (ἡ ∷ []) "2Tim.3.9" ∷ word (ἐ ∷ κ ∷ ε ∷ ί ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.3.9" ∷ word (ἐ ∷ γ ∷ έ ∷ ν ∷ ε ∷ τ ∷ ο ∷ []) "2Tim.3.9" ∷ word (Σ ∷ ὺ ∷ []) "2Tim.3.10" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.10" ∷ word (π ∷ α ∷ ρ ∷ η ∷ κ ∷ ο ∷ ∙λ ∷ ο ∷ ύ ∷ θ ∷ η ∷ σ ∷ ά ∷ ς ∷ []) "2Tim.3.10" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (δ ∷ ι ∷ δ ∷ α ∷ σ ∷ κ ∷ α ∷ ∙λ ∷ ί ∷ ᾳ ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (ἀ ∷ γ ∷ ω ∷ γ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (π ∷ ρ ∷ ο ∷ θ ∷ έ ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ι ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (μ ∷ α ∷ κ ∷ ρ ∷ ο ∷ θ ∷ υ ∷ μ ∷ ί ∷ ᾳ ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ ῃ ∷ []) "2Tim.3.10" ∷ word (τ ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (ὑ ∷ π ∷ ο ∷ μ ∷ ο ∷ ν ∷ ῇ ∷ []) "2Tim.3.10" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.3.11" ∷ word (δ ∷ ι ∷ ω ∷ γ ∷ μ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.3.11" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.3.11" ∷ word (π ∷ α ∷ θ ∷ ή ∷ μ ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.11" ∷ word (ο ∷ ἷ ∷ ά ∷ []) "2Tim.3.11" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.3.11" ∷ word (ἐ ∷ γ ∷ έ ∷ ν ∷ ε ∷ τ ∷ ο ∷ []) "2Tim.3.11" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.11" ∷ word (Ἀ ∷ ν ∷ τ ∷ ι ∷ ο ∷ χ ∷ ε ∷ ί ∷ ᾳ ∷ []) "2Tim.3.11" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.11" ∷ word (Ἰ ∷ κ ∷ ο ∷ ν ∷ ί ∷ ῳ ∷ []) "2Tim.3.11" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.11" ∷ word (Λ ∷ ύ ∷ σ ∷ τ ∷ ρ ∷ ο ∷ ι ∷ ς ∷ []) "2Tim.3.11" ∷ word (ο ∷ ἵ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.3.11" ∷ word (δ ∷ ι ∷ ω ∷ γ ∷ μ ∷ ο ∷ ὺ ∷ ς ∷ []) "2Tim.3.11" ∷ word (ὑ ∷ π ∷ ή ∷ ν ∷ ε ∷ γ ∷ κ ∷ α ∷ []) "2Tim.3.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.11" ∷ word (ἐ ∷ κ ∷ []) "2Tim.3.11" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "2Tim.3.11" ∷ word (μ ∷ ε ∷ []) "2Tim.3.11" ∷ word (ἐ ∷ ρ ∷ ρ ∷ ύ ∷ σ ∷ α ∷ τ ∷ ο ∷ []) "2Tim.3.11" ∷ word (ὁ ∷ []) "2Tim.3.11" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.3.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.12" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.12" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.12" ∷ word (ο ∷ ἱ ∷ []) "2Tim.3.12" ∷ word (θ ∷ έ ∷ ∙λ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.12" ∷ word (ζ ∷ ῆ ∷ ν ∷ []) "2Tim.3.12" ∷ word (ε ∷ ὐ ∷ σ ∷ ε ∷ β ∷ ῶ ∷ ς ∷ []) "2Tim.3.12" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.12" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.3.12" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.3.12" ∷ word (δ ∷ ι ∷ ω ∷ χ ∷ θ ∷ ή ∷ σ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.3.12" ∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ο ∷ ὶ ∷ []) "2Tim.3.13" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.13" ∷ word (ἄ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ ι ∷ []) "2Tim.3.13" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.13" ∷ word (γ ∷ ό ∷ η ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.13" ∷ word (π ∷ ρ ∷ ο ∷ κ ∷ ό ∷ ψ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.13" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "2Tim.3.13" ∷ word (τ ∷ ὸ ∷ []) "2Tim.3.13" ∷ word (χ ∷ ε ∷ ῖ ∷ ρ ∷ ο ∷ ν ∷ []) "2Tim.3.13" ∷ word (π ∷ ∙λ ∷ α ∷ ν ∷ ῶ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.3.13" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.13" ∷ word (π ∷ ∙λ ∷ α ∷ ν ∷ ώ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.3.13" ∷ word (σ ∷ ὺ ∷ []) "2Tim.3.14" ∷ word (δ ∷ ὲ ∷ []) "2Tim.3.14" ∷ word (μ ∷ έ ∷ ν ∷ ε ∷ []) "2Tim.3.14" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.14" ∷ word (ο ∷ ἷ ∷ ς ∷ []) "2Tim.3.14" ∷ word (ἔ ∷ μ ∷ α ∷ θ ∷ ε ∷ ς ∷ []) "2Tim.3.14" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.14" ∷ word (ἐ ∷ π ∷ ι ∷ σ ∷ τ ∷ ώ ∷ θ ∷ η ∷ ς ∷ []) "2Tim.3.14" ∷ word (ε ∷ ἰ ∷ δ ∷ ὼ ∷ ς ∷ []) "2Tim.3.14" ∷ word (π ∷ α ∷ ρ ∷ ὰ ∷ []) "2Tim.3.14" ∷ word (τ ∷ ί ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.3.14" ∷ word (ἔ ∷ μ ∷ α ∷ θ ∷ ε ∷ ς ∷ []) "2Tim.3.14" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.15" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "2Tim.3.15" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.3.15" ∷ word (β ∷ ρ ∷ έ ∷ φ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.3.15" ∷ word (ἱ ∷ ε ∷ ρ ∷ ὰ ∷ []) "2Tim.3.15" ∷ word (γ ∷ ρ ∷ ά ∷ μ ∷ μ ∷ α ∷ τ ∷ α ∷ []) "2Tim.3.15" ∷ word (ο ∷ ἶ ∷ δ ∷ α ∷ ς ∷ []) "2Tim.3.15" ∷ word (τ ∷ ὰ ∷ []) "2Tim.3.15" ∷ word (δ ∷ υ ∷ ν ∷ ά ∷ μ ∷ ε ∷ ν ∷ ά ∷ []) "2Tim.3.15" ∷ word (σ ∷ ε ∷ []) "2Tim.3.15" ∷ word (σ ∷ ο ∷ φ ∷ ί ∷ σ ∷ α ∷ ι ∷ []) "2Tim.3.15" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.3.15" ∷ word (σ ∷ ω ∷ τ ∷ η ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.3.15" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "2Tim.3.15" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ω ∷ ς ∷ []) "2Tim.3.15" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.3.15" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.15" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "2Tim.3.15" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.3.15" ∷ word (π ∷ ᾶ ∷ σ ∷ α ∷ []) "2Tim.3.16" ∷ word (γ ∷ ρ ∷ α ∷ φ ∷ ὴ ∷ []) "2Tim.3.16" ∷ word (θ ∷ ε ∷ ό ∷ π ∷ ν ∷ ε ∷ υ ∷ σ ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.3.16" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.3.16" ∷ word (ὠ ∷ φ ∷ έ ∷ ∙λ ∷ ι ∷ μ ∷ ο ∷ ς ∷ []) "2Tim.3.16" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.3.16" ∷ word (δ ∷ ι ∷ δ ∷ α ∷ σ ∷ κ ∷ α ∷ ∙λ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.3.16" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.3.16" ∷ word (ἐ ∷ ∙λ ∷ ε ∷ γ ∷ μ ∷ ό ∷ ν ∷ []) "2Tim.3.16" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.3.16" ∷ word (ἐ ∷ π ∷ α ∷ ν ∷ ό ∷ ρ ∷ θ ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.3.16" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.3.16" ∷ word (π ∷ α ∷ ι ∷ δ ∷ ε ∷ ί ∷ α ∷ ν ∷ []) "2Tim.3.16" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.3.16" ∷ word (ἐ ∷ ν ∷ []) "2Tim.3.16" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ ῃ ∷ []) "2Tim.3.16" ∷ word (ἵ ∷ ν ∷ α ∷ []) "2Tim.3.17" ∷ word (ἄ ∷ ρ ∷ τ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.3.17" ∷ word (ᾖ ∷ []) "2Tim.3.17" ∷ word (ὁ ∷ []) "2Tim.3.17" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.3.17" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.3.17" ∷ word (ἄ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ ς ∷ []) "2Tim.3.17" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.3.17" ∷ word (π ∷ ᾶ ∷ ν ∷ []) "2Tim.3.17" ∷ word (ἔ ∷ ρ ∷ γ ∷ ο ∷ ν ∷ []) "2Tim.3.17" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ὸ ∷ ν ∷ []) "2Tim.3.17" ∷ word (ἐ ∷ ξ ∷ η ∷ ρ ∷ τ ∷ ι ∷ σ ∷ μ ∷ έ ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.3.17" ∷ word (Δ ∷ ι ∷ α ∷ μ ∷ α ∷ ρ ∷ τ ∷ ύ ∷ ρ ∷ ο ∷ μ ∷ α ∷ ι ∷ []) "2Tim.4.1" ∷ word (ἐ ∷ ν ∷ ώ ∷ π ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.4.1" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.1" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (μ ∷ έ ∷ ∙λ ∷ ∙λ ∷ ο ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.4.1" ∷ word (κ ∷ ρ ∷ ί ∷ ν ∷ ε ∷ ι ∷ ν ∷ []) "2Tim.4.1" ∷ word (ζ ∷ ῶ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "2Tim.4.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.1" ∷ word (ν ∷ ε ∷ κ ∷ ρ ∷ ο ∷ ύ ∷ ς ∷ []) "2Tim.4.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.1" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.1" ∷ word (ἐ ∷ π ∷ ι ∷ φ ∷ ά ∷ ν ∷ ε ∷ ι ∷ α ∷ ν ∷ []) "2Tim.4.1" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.1" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.1" ∷ word (β ∷ α ∷ σ ∷ ι ∷ ∙λ ∷ ε ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.1" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.1" ∷ word (κ ∷ ή ∷ ρ ∷ υ ∷ ξ ∷ ο ∷ ν ∷ []) "2Tim.4.2" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.4.2" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ν ∷ []) "2Tim.4.2" ∷ word (ἐ ∷ π ∷ ί ∷ σ ∷ τ ∷ η ∷ θ ∷ ι ∷ []) "2Tim.4.2" ∷ word (ε ∷ ὐ ∷ κ ∷ α ∷ ί ∷ ρ ∷ ω ∷ ς ∷ []) "2Tim.4.2" ∷ word (ἀ ∷ κ ∷ α ∷ ί ∷ ρ ∷ ω ∷ ς ∷ []) "2Tim.4.2" ∷ word (ἔ ∷ ∙λ ∷ ε ∷ γ ∷ ξ ∷ ο ∷ ν ∷ []) "2Tim.4.2" ∷ word (ἐ ∷ π ∷ ι ∷ τ ∷ ί ∷ μ ∷ η ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.2" ∷ word (π ∷ α ∷ ρ ∷ α ∷ κ ∷ ά ∷ ∙λ ∷ ε ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.2" ∷ word (ἐ ∷ ν ∷ []) "2Tim.4.2" ∷ word (π ∷ ά ∷ σ ∷ ῃ ∷ []) "2Tim.4.2" ∷ word (μ ∷ α ∷ κ ∷ ρ ∷ ο ∷ θ ∷ υ ∷ μ ∷ ί ∷ ᾳ ∷ []) "2Tim.4.2" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.2" ∷ word (δ ∷ ι ∷ δ ∷ α ∷ χ ∷ ῇ ∷ []) "2Tim.4.2" ∷ word (ἔ ∷ σ ∷ τ ∷ α ∷ ι ∷ []) "2Tim.4.3" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.4.3" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.4.3" ∷ word (ὅ ∷ τ ∷ ε ∷ []) "2Tim.4.3" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.4.3" ∷ word (ὑ ∷ γ ∷ ι ∷ α ∷ ι ∷ ν ∷ ο ∷ ύ ∷ σ ∷ η ∷ ς ∷ []) "2Tim.4.3" ∷ word (δ ∷ ι ∷ δ ∷ α ∷ σ ∷ κ ∷ α ∷ ∙λ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.4.3" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "2Tim.4.3" ∷ word (ἀ ∷ ν ∷ έ ∷ ξ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.4.3" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.4.3" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "2Tim.4.3" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "2Tim.4.3" ∷ word (ἰ ∷ δ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.4.3" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ ς ∷ []) "2Tim.4.3" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.4.3" ∷ word (ἐ ∷ π ∷ ι ∷ σ ∷ ω ∷ ρ ∷ ε ∷ ύ ∷ σ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.4.3" ∷ word (δ ∷ ι ∷ δ ∷ α ∷ σ ∷ κ ∷ ά ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.4.3" ∷ word (κ ∷ ν ∷ η ∷ θ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "2Tim.4.3" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.3" ∷ word (ἀ ∷ κ ∷ ο ∷ ή ∷ ν ∷ []) "2Tim.4.3" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.4" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.4.4" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "2Tim.4.4" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.4.4" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "2Tim.4.4" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.4" ∷ word (ἀ ∷ κ ∷ ο ∷ ὴ ∷ ν ∷ []) "2Tim.4.4" ∷ word (ἀ ∷ π ∷ ο ∷ σ ∷ τ ∷ ρ ∷ έ ∷ ψ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.4.4" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "2Tim.4.4" ∷ word (δ ∷ ὲ ∷ []) "2Tim.4.4" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "2Tim.4.4" ∷ word (μ ∷ ύ ∷ θ ∷ ο ∷ υ ∷ ς ∷ []) "2Tim.4.4" ∷ word (ἐ ∷ κ ∷ τ ∷ ρ ∷ α ∷ π ∷ ή ∷ σ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "2Tim.4.4" ∷ word (σ ∷ ὺ ∷ []) "2Tim.4.5" ∷ word (δ ∷ ὲ ∷ []) "2Tim.4.5" ∷ word (ν ∷ ῆ ∷ φ ∷ ε ∷ []) "2Tim.4.5" ∷ word (ἐ ∷ ν ∷ []) "2Tim.4.5" ∷ word (π ∷ ᾶ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.4.5" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ π ∷ ά ∷ θ ∷ η ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.5" ∷ word (ἔ ∷ ρ ∷ γ ∷ ο ∷ ν ∷ []) "2Tim.4.5" ∷ word (π ∷ ο ∷ ί ∷ η ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.5" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.5" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.5" ∷ word (δ ∷ ι ∷ α ∷ κ ∷ ο ∷ ν ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.5" ∷ word (σ ∷ ο ∷ υ ∷ []) "2Tim.4.5" ∷ word (π ∷ ∙λ ∷ η ∷ ρ ∷ ο ∷ φ ∷ ό ∷ ρ ∷ η ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.5" ∷ word (Ἐ ∷ γ ∷ ὼ ∷ []) "2Tim.4.6" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.4.6" ∷ word (ἤ ∷ δ ∷ η ∷ []) "2Tim.4.6" ∷ word (σ ∷ π ∷ έ ∷ ν ∷ δ ∷ ο ∷ μ ∷ α ∷ ι ∷ []) "2Tim.4.6" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.6" ∷ word (ὁ ∷ []) "2Tim.4.6" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ὸ ∷ ς ∷ []) "2Tim.4.6" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.4.6" ∷ word (ἀ ∷ ν ∷ α ∷ ∙λ ∷ ύ ∷ σ ∷ ε ∷ ώ ∷ ς ∷ []) "2Tim.4.6" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.4.6" ∷ word (ἐ ∷ φ ∷ έ ∷ σ ∷ τ ∷ η ∷ κ ∷ ε ∷ ν ∷ []) "2Tim.4.6" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.4.7" ∷ word (κ ∷ α ∷ ∙λ ∷ ὸ ∷ ν ∷ []) "2Tim.4.7" ∷ word (ἀ ∷ γ ∷ ῶ ∷ ν ∷ α ∷ []) "2Tim.4.7" ∷ word (ἠ ∷ γ ∷ ώ ∷ ν ∷ ι ∷ σ ∷ μ ∷ α ∷ ι ∷ []) "2Tim.4.7" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.4.7" ∷ word (δ ∷ ρ ∷ ό ∷ μ ∷ ο ∷ ν ∷ []) "2Tim.4.7" ∷ word (τ ∷ ε ∷ τ ∷ έ ∷ ∙λ ∷ ε ∷ κ ∷ α ∷ []) "2Tim.4.7" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.7" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.4.7" ∷ word (τ ∷ ε ∷ τ ∷ ή ∷ ρ ∷ η ∷ κ ∷ α ∷ []) "2Tim.4.7" ∷ word (∙λ ∷ ο ∷ ι ∷ π ∷ ὸ ∷ ν ∷ []) "2Tim.4.8" ∷ word (ἀ ∷ π ∷ ό ∷ κ ∷ ε ∷ ι ∷ τ ∷ α ∷ ί ∷ []) "2Tim.4.8" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.4.8" ∷ word (ὁ ∷ []) "2Tim.4.8" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "2Tim.4.8" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ς ∷ []) "2Tim.4.8" ∷ word (σ ∷ τ ∷ έ ∷ φ ∷ α ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.4.8" ∷ word (ὃ ∷ ν ∷ []) "2Tim.4.8" ∷ word (ἀ ∷ π ∷ ο ∷ δ ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.4.8" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.4.8" ∷ word (ὁ ∷ []) "2Tim.4.8" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.4.8" ∷ word (ἐ ∷ ν ∷ []) "2Tim.4.8" ∷ word (ἐ ∷ κ ∷ ε ∷ ί ∷ ν ∷ ῃ ∷ []) "2Tim.4.8" ∷ word (τ ∷ ῇ ∷ []) "2Tim.4.8" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ ᾳ ∷ []) "2Tim.4.8" ∷ word (ὁ ∷ []) "2Tim.4.8" ∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.4.8" ∷ word (κ ∷ ρ ∷ ι ∷ τ ∷ ή ∷ ς ∷ []) "2Tim.4.8" ∷ word (ο ∷ ὐ ∷ []) "2Tim.4.8" ∷ word (μ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "2Tim.4.8" ∷ word (δ ∷ ὲ ∷ []) "2Tim.4.8" ∷ word (ἐ ∷ μ ∷ ο ∷ ὶ ∷ []) "2Tim.4.8" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.4.8" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.8" ∷ word (π ∷ ᾶ ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.4.8" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.4.8" ∷ word (ἠ ∷ γ ∷ α ∷ π ∷ η ∷ κ ∷ ό ∷ σ ∷ ι ∷ []) "2Tim.4.8" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.8" ∷ word (ἐ ∷ π ∷ ι ∷ φ ∷ ά ∷ ν ∷ ε ∷ ι ∷ α ∷ ν ∷ []) "2Tim.4.8" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.8" ∷ word (Σ ∷ π ∷ ο ∷ ύ ∷ δ ∷ α ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.9" ∷ word (ἐ ∷ ∙λ ∷ θ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.4.9" ∷ word (π ∷ ρ ∷ ό ∷ ς ∷ []) "2Tim.4.9" ∷ word (μ ∷ ε ∷ []) "2Tim.4.9" ∷ word (τ ∷ α ∷ χ ∷ έ ∷ ω ∷ ς ∷ []) "2Tim.4.9" ∷ word (Δ ∷ η ∷ μ ∷ ᾶ ∷ ς ∷ []) "2Tim.4.10" ∷ word (γ ∷ ά ∷ ρ ∷ []) "2Tim.4.10" ∷ word (μ ∷ ε ∷ []) "2Tim.4.10" ∷ word (ἐ ∷ γ ∷ κ ∷ α ∷ τ ∷ έ ∷ ∙λ ∷ ι ∷ π ∷ ε ∷ ν ∷ []) "2Tim.4.10" ∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ή ∷ σ ∷ α ∷ ς ∷ []) "2Tim.4.10" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.4.10" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "2Tim.4.10" ∷ word (α ∷ ἰ ∷ ῶ ∷ ν ∷ α ∷ []) "2Tim.4.10" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.10" ∷ word (ἐ ∷ π ∷ ο ∷ ρ ∷ ε ∷ ύ ∷ θ ∷ η ∷ []) "2Tim.4.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.10" ∷ word (Θ ∷ ε ∷ σ ∷ σ ∷ α ∷ ∙λ ∷ ο ∷ ν ∷ ί ∷ κ ∷ η ∷ ν ∷ []) "2Tim.4.10" ∷ word (Κ ∷ ρ ∷ ή ∷ σ ∷ κ ∷ η ∷ ς ∷ []) "2Tim.4.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.10" ∷ word (Γ ∷ α ∷ ∙λ ∷ α ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.10" ∷ word (Τ ∷ ί ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.4.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.10" ∷ word (Δ ∷ α ∷ ∙λ ∷ μ ∷ α ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.10" ∷ word (Λ ∷ ο ∷ υ ∷ κ ∷ ᾶ ∷ ς ∷ []) "2Tim.4.11" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.4.11" ∷ word (μ ∷ ό ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.4.11" ∷ word (μ ∷ ε ∷ τ ∷ []) "2Tim.4.11" ∷ word (ἐ ∷ μ ∷ ο ∷ ῦ ∷ []) "2Tim.4.11" ∷ word (Μ ∷ ᾶ ∷ ρ ∷ κ ∷ ο ∷ ν ∷ []) "2Tim.4.11" ∷ word (ἀ ∷ ν ∷ α ∷ ∙λ ∷ α ∷ β ∷ ὼ ∷ ν ∷ []) "2Tim.4.11" ∷ word (ἄ ∷ γ ∷ ε ∷ []) "2Tim.4.11" ∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "2Tim.4.11" ∷ word (σ ∷ ε ∷ α ∷ υ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.11" ∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "2Tim.4.11" ∷ word (γ ∷ ά ∷ ρ ∷ []) "2Tim.4.11" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.4.11" ∷ word (ε ∷ ὔ ∷ χ ∷ ρ ∷ η ∷ σ ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.4.11" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.11" ∷ word (δ ∷ ι ∷ α ∷ κ ∷ ο ∷ ν ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.11" ∷ word (Τ ∷ υ ∷ χ ∷ ι ∷ κ ∷ ὸ ∷ ν ∷ []) "2Tim.4.12" ∷ word (δ ∷ ὲ ∷ []) "2Tim.4.12" ∷ word (ἀ ∷ π ∷ έ ∷ σ ∷ τ ∷ ε ∷ ι ∷ ∙λ ∷ α ∷ []) "2Tim.4.12" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.12" ∷ word (Ἔ ∷ φ ∷ ε ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.12" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.4.13" ∷ word (φ ∷ α ∷ ι ∷ ∙λ ∷ ό ∷ ν ∷ η ∷ ν ∷ []) "2Tim.4.13" ∷ word (ὃ ∷ ν ∷ []) "2Tim.4.13" ∷ word (ἀ ∷ π ∷ έ ∷ ∙λ ∷ ι ∷ π ∷ ο ∷ ν ∷ []) "2Tim.4.13" ∷ word (ἐ ∷ ν ∷ []) "2Tim.4.13" ∷ word (Τ ∷ ρ ∷ ῳ ∷ ά ∷ δ ∷ ι ∷ []) "2Tim.4.13" ∷ word (π ∷ α ∷ ρ ∷ ὰ ∷ []) "2Tim.4.13" ∷ word (Κ ∷ ά ∷ ρ ∷ π ∷ ῳ ∷ []) "2Tim.4.13" ∷ word (ἐ ∷ ρ ∷ χ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.4.13" ∷ word (φ ∷ έ ∷ ρ ∷ ε ∷ []) "2Tim.4.13" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.13" ∷ word (τ ∷ ὰ ∷ []) "2Tim.4.13" ∷ word (β ∷ ι ∷ β ∷ ∙λ ∷ ί ∷ α ∷ []) "2Tim.4.13" ∷ word (μ ∷ ά ∷ ∙λ ∷ ι ∷ σ ∷ τ ∷ α ∷ []) "2Tim.4.13" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "2Tim.4.13" ∷ word (μ ∷ ε ∷ μ ∷ β ∷ ρ ∷ ά ∷ ν ∷ α ∷ ς ∷ []) "2Tim.4.13" ∷ word (Ἀ ∷ ∙λ ∷ έ ∷ ξ ∷ α ∷ ν ∷ δ ∷ ρ ∷ ο ∷ ς ∷ []) "2Tim.4.14" ∷ word (ὁ ∷ []) "2Tim.4.14" ∷ word (χ ∷ α ∷ ∙λ ∷ κ ∷ ε ∷ ὺ ∷ ς ∷ []) "2Tim.4.14" ∷ word (π ∷ ο ∷ ∙λ ∷ ∙λ ∷ ά ∷ []) "2Tim.4.14" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.4.14" ∷ word (κ ∷ α ∷ κ ∷ ὰ ∷ []) "2Tim.4.14" ∷ word (ἐ ∷ ν ∷ ε ∷ δ ∷ ε ∷ ί ∷ ξ ∷ α ∷ τ ∷ ο ∷ []) "2Tim.4.14" ∷ word (ἀ ∷ π ∷ ο ∷ δ ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.4.14" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "2Tim.4.14" ∷ word (ὁ ∷ []) "2Tim.4.14" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.4.14" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "2Tim.4.14" ∷ word (τ ∷ ὰ ∷ []) "2Tim.4.14" ∷ word (ἔ ∷ ρ ∷ γ ∷ α ∷ []) "2Tim.4.14" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.14" ∷ word (ὃ ∷ ν ∷ []) "2Tim.4.15" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.15" ∷ word (σ ∷ ὺ ∷ []) "2Tim.4.15" ∷ word (φ ∷ υ ∷ ∙λ ∷ ά ∷ σ ∷ σ ∷ ο ∷ υ ∷ []) "2Tim.4.15" ∷ word (∙λ ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.15" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "2Tim.4.15" ∷ word (ἀ ∷ ν ∷ τ ∷ έ ∷ σ ∷ τ ∷ η ∷ []) "2Tim.4.15" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.4.15" ∷ word (ἡ ∷ μ ∷ ε ∷ τ ∷ έ ∷ ρ ∷ ο ∷ ι ∷ ς ∷ []) "2Tim.4.15" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ι ∷ ς ∷ []) "2Tim.4.15" ∷ word (Ἐ ∷ ν ∷ []) "2Tim.4.16" ∷ word (τ ∷ ῇ ∷ []) "2Tim.4.16" ∷ word (π ∷ ρ ∷ ώ ∷ τ ∷ ῃ ∷ []) "2Tim.4.16" ∷ word (μ ∷ ο ∷ υ ∷ []) "2Tim.4.16" ∷ word (ἀ ∷ π ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ί ∷ ᾳ ∷ []) "2Tim.4.16" ∷ word (ο ∷ ὐ ∷ δ ∷ ε ∷ ί ∷ ς ∷ []) "2Tim.4.16" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.4.16" ∷ word (π ∷ α ∷ ρ ∷ ε ∷ γ ∷ έ ∷ ν ∷ ε ∷ τ ∷ ο ∷ []) "2Tim.4.16" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "2Tim.4.16" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.4.16" ∷ word (μ ∷ ε ∷ []) "2Tim.4.16" ∷ word (ἐ ∷ γ ∷ κ ∷ α ∷ τ ∷ έ ∷ ∙λ ∷ ι ∷ π ∷ ο ∷ ν ∷ []) "2Tim.4.16" ∷ word (μ ∷ ὴ ∷ []) "2Tim.4.16" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "2Tim.4.16" ∷ word (∙λ ∷ ο ∷ γ ∷ ι ∷ σ ∷ θ ∷ ε ∷ ί ∷ η ∷ []) "2Tim.4.16" ∷ word (ὁ ∷ []) "2Tim.4.17" ∷ word (δ ∷ ὲ ∷ []) "2Tim.4.17" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ό ∷ ς ∷ []) "2Tim.4.17" ∷ word (μ ∷ ο ∷ ι ∷ []) "2Tim.4.17" ∷ word (π ∷ α ∷ ρ ∷ έ ∷ σ ∷ τ ∷ η ∷ []) "2Tim.4.17" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.17" ∷ word (ἐ ∷ ν ∷ ε ∷ δ ∷ υ ∷ ν ∷ ά ∷ μ ∷ ω ∷ σ ∷ έ ∷ ν ∷ []) "2Tim.4.17" ∷ word (μ ∷ ε ∷ []) "2Tim.4.17" ∷ word (ἵ ∷ ν ∷ α ∷ []) "2Tim.4.17" ∷ word (δ ∷ ι ∷ []) "2Tim.4.17" ∷ word (ἐ ∷ μ ∷ ο ∷ ῦ ∷ []) "2Tim.4.17" ∷ word (τ ∷ ὸ ∷ []) "2Tim.4.17" ∷ word (κ ∷ ή ∷ ρ ∷ υ ∷ γ ∷ μ ∷ α ∷ []) "2Tim.4.17" ∷ word (π ∷ ∙λ ∷ η ∷ ρ ∷ ο ∷ φ ∷ ο ∷ ρ ∷ η ∷ θ ∷ ῇ ∷ []) "2Tim.4.17" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.17" ∷ word (ἀ ∷ κ ∷ ο ∷ ύ ∷ σ ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "2Tim.4.17" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ α ∷ []) "2Tim.4.17" ∷ word (τ ∷ ὰ ∷ []) "2Tim.4.17" ∷ word (ἔ ∷ θ ∷ ν ∷ η ∷ []) "2Tim.4.17" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.17" ∷ word (ἐ ∷ ρ ∷ ρ ∷ ύ ∷ σ ∷ θ ∷ η ∷ ν ∷ []) "2Tim.4.17" ∷ word (ἐ ∷ κ ∷ []) "2Tim.4.17" ∷ word (σ ∷ τ ∷ ό ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.4.17" ∷ word (∙λ ∷ έ ∷ ο ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.4.17" ∷ word (ῥ ∷ ύ ∷ σ ∷ ε ∷ τ ∷ α ∷ ί ∷ []) "2Tim.4.18" ∷ word (μ ∷ ε ∷ []) "2Tim.4.18" ∷ word (ὁ ∷ []) "2Tim.4.18" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.4.18" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "2Tim.4.18" ∷ word (π ∷ α ∷ ν ∷ τ ∷ ὸ ∷ ς ∷ []) "2Tim.4.18" ∷ word (ἔ ∷ ρ ∷ γ ∷ ο ∷ υ ∷ []) "2Tim.4.18" ∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ο ∷ ῦ ∷ []) "2Tim.4.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.18" ∷ word (σ ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "2Tim.4.18" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.18" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.18" ∷ word (β ∷ α ∷ σ ∷ ι ∷ ∙λ ∷ ε ∷ ί ∷ α ∷ ν ∷ []) "2Tim.4.18" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.18" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "2Tim.4.18" ∷ word (ἐ ∷ π ∷ ο ∷ υ ∷ ρ ∷ ά ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "2Tim.4.18" ∷ word (ᾧ ∷ []) "2Tim.4.18" ∷ word (ἡ ∷ []) "2Tim.4.18" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ []) "2Tim.4.18" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "2Tim.4.18" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "2Tim.4.18" ∷ word (α ∷ ἰ ∷ ῶ ∷ ν ∷ α ∷ ς ∷ []) "2Tim.4.18" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "2Tim.4.18" ∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ω ∷ ν ∷ []) "2Tim.4.18" ∷ word (ἀ ∷ μ ∷ ή ∷ ν ∷ []) "2Tim.4.18" ∷ word (Ἄ ∷ σ ∷ π ∷ α ∷ σ ∷ α ∷ ι ∷ []) "2Tim.4.19" ∷ word (Π ∷ ρ ∷ ί ∷ σ ∷ κ ∷ α ∷ ν ∷ []) "2Tim.4.19" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.19" ∷ word (Ἀ ∷ κ ∷ ύ ∷ ∙λ ∷ α ∷ ν ∷ []) "2Tim.4.19" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.19" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "2Tim.4.19" ∷ word (Ὀ ∷ ν ∷ η ∷ σ ∷ ι ∷ φ ∷ ό ∷ ρ ∷ ο ∷ υ ∷ []) "2Tim.4.19" ∷ word (ο ∷ ἶ ∷ κ ∷ ο ∷ ν ∷ []) "2Tim.4.19" ∷ word (Ἔ ∷ ρ ∷ α ∷ σ ∷ τ ∷ ο ∷ ς ∷ []) "2Tim.4.20" ∷ word (ἔ ∷ μ ∷ ε ∷ ι ∷ ν ∷ ε ∷ ν ∷ []) "2Tim.4.20" ∷ word (ἐ ∷ ν ∷ []) "2Tim.4.20" ∷ word (Κ ∷ ο ∷ ρ ∷ ί ∷ ν ∷ θ ∷ ῳ ∷ []) "2Tim.4.20" ∷ word (Τ ∷ ρ ∷ ό ∷ φ ∷ ι ∷ μ ∷ ο ∷ ν ∷ []) "2Tim.4.20" ∷ word (δ ∷ ὲ ∷ []) "2Tim.4.20" ∷ word (ἀ ∷ π ∷ έ ∷ ∙λ ∷ ι ∷ π ∷ ο ∷ ν ∷ []) "2Tim.4.20" ∷ word (ἐ ∷ ν ∷ []) "2Tim.4.20" ∷ word (Μ ∷ ι ∷ ∙λ ∷ ή ∷ τ ∷ ῳ ∷ []) "2Tim.4.20" ∷ word (ἀ ∷ σ ∷ θ ∷ ε ∷ ν ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ α ∷ []) "2Tim.4.20" ∷ word (Σ ∷ π ∷ ο ∷ ύ ∷ δ ∷ α ∷ σ ∷ ο ∷ ν ∷ []) "2Tim.4.21" ∷ word (π ∷ ρ ∷ ὸ ∷ []) "2Tim.4.21" ∷ word (χ ∷ ε ∷ ι ∷ μ ∷ ῶ ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.4.21" ∷ word (ἐ ∷ ∙λ ∷ θ ∷ ε ∷ ῖ ∷ ν ∷ []) "2Tim.4.21" ∷ word (Ἀ ∷ σ ∷ π ∷ ά ∷ ζ ∷ ε ∷ τ ∷ α ∷ ί ∷ []) "2Tim.4.21" ∷ word (σ ∷ ε ∷ []) "2Tim.4.21" ∷ word (Ε ∷ ὔ ∷ β ∷ ο ∷ υ ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Tim.4.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.21" ∷ word (Π ∷ ο ∷ ύ ∷ δ ∷ η ∷ ς ∷ []) "2Tim.4.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.21" ∷ word (Λ ∷ ί ∷ ν ∷ ο ∷ ς ∷ []) "2Tim.4.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.21" ∷ word (Κ ∷ ∙λ ∷ α ∷ υ ∷ δ ∷ ί ∷ α ∷ []) "2Tim.4.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Tim.4.21" ∷ word (ο ∷ ἱ ∷ []) "2Tim.4.21" ∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ο ∷ ὶ ∷ []) "2Tim.4.21" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "2Tim.4.21" ∷ word (Ὁ ∷ []) "2Tim.4.22" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "2Tim.4.22" ∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "2Tim.4.22" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "2Tim.4.22" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ό ∷ ς ∷ []) "2Tim.4.22" ∷ word (σ ∷ ο ∷ υ ∷ []) "2Tim.4.22" ∷ word (ἡ ∷ []) "2Tim.4.22" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ς ∷ []) "2Tim.4.22" ∷ word (μ ∷ ε ∷ θ ∷ []) "2Tim.4.22" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "2Tim.4.22" ∷ []
46.570626
93
0.340221
a0be182aed94143b387cf0bb10e5be2f6659f0f6
413
agda
Agda
src/Data/Word/Primitive.agda
agda/agda-system-io
121d6c66cba34b4c15b437366b80c65dd2b02a8d
[ "MIT" ]
10
2015-01-04T13:45:16.000Z
2021-09-15T04:35:41.000Z
src/Data/Word/Primitive.agda
agda/agda-system-io
121d6c66cba34b4c15b437366b80c65dd2b02a8d
[ "MIT" ]
null
null
null
src/Data/Word/Primitive.agda
agda/agda-system-io
121d6c66cba34b4c15b437366b80c65dd2b02a8d
[ "MIT" ]
2
2017-08-10T06:12:54.000Z
2022-03-12T11:40:23.000Z
module Data.Word.Primitive where postulate Word : Set Word8 : Set Word16 : Set Word32 : Set Word64 : Set {-# FOREIGN GHC import qualified Data.Word #-} {-# COMPILE GHC Word = type Data.Word.Word #-} {-# COMPILE GHC Word8 = type Data.Word.Word8 #-} {-# COMPILE GHC Word16 = type Data.Word.Word16 #-} {-# COMPILE GHC Word32 = type Data.Word.Word32 #-} {-# COMPILE GHC Word64 = type Data.Word.Word64 #-}
25.8125
50
0.668281
1efa57d9a80ad80dd29b6f78f273afde0e677058
12,548
agda
Agda
Cubical/Homotopy/HopfInvariant/Base.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
1
2022-02-05T01:25:26.000Z
2022-02-05T01:25:26.000Z
Cubical/Homotopy/HopfInvariant/Base.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
null
null
null
Cubical/Homotopy/HopfInvariant/Base.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
null
null
null
{-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.Homotopy.HopfInvariant.Base where open import Cubical.Homotopy.Connected open import Cubical.Homotopy.Group.Base open import Cubical.Homotopy.Group.SuspensionMap open import Cubical.Relation.Nullary open import Cubical.ZCohomology.Base open import Cubical.ZCohomology.GroupStructure open import Cubical.ZCohomology.Properties open import Cubical.ZCohomology.MayerVietorisUnreduced open import Cubical.ZCohomology.Groups.Unit open import Cubical.ZCohomology.Groups.Wedge open import Cubical.ZCohomology.Groups.Sn open import Cubical.ZCohomology.RingStructure.CupProduct open import Cubical.ZCohomology.RingStructure.GradedCommutativity open import Cubical.ZCohomology.Gysin open import Cubical.Foundations.Path open import Cubical.Foundations.HLevels open import Cubical.Foundations.Transport open import Cubical.Foundations.Function open import Cubical.Foundations.Prelude open import Cubical.Foundations.Pointed open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Equiv open import Cubical.Data.Sigma open import Cubical.Data.Int hiding (_+'_) open import Cubical.Data.Nat renaming (_+_ to _+ℕ_ ; _·_ to _·ℕ_) open import Cubical.Data.Unit open import Cubical.Algebra.Group renaming (ℤ to ℤGroup ; Unit to UnitGroup) open import Cubical.Algebra.Group.ZAction open import Cubical.Algebra.Group.Exact open import Cubical.HITs.Pushout open import Cubical.HITs.Sn open import Cubical.HITs.Susp open import Cubical.HITs.Wedge open import Cubical.HITs.Truncation renaming (rec to trRec) open import Cubical.HITs.SetTruncation renaming (rec to sRec ; elim to sElim ; elim2 to sElim2 ; map to sMap) open import Cubical.HITs.PropositionalTruncation renaming (rec to pRec) -- The pushout of the hopf invariant HopfInvariantPush : (n : ℕ) → (f : S₊ (3 +ℕ n +ℕ n) → S₊ (2 +ℕ n)) → Type _ HopfInvariantPush n f = Pushout (λ _ → tt) f Hopfα : (n : ℕ) → (f : S₊∙ (3 +ℕ n +ℕ n) →∙ S₊∙ (2 +ℕ n)) → coHom (2 +ℕ n) (HopfInvariantPush n (fst f)) Hopfα n f = ∣ (λ { (inl x) → 0ₖ _ ; (inr x) → ∣ x ∣ ; (push a i) → help a (~ i)}) ∣₂ where help : (a : S₊ (3 +ℕ n +ℕ n)) → ∣ fst f a ∣ ≡ 0ₖ (2 +ℕ n) help = sphereElim _ (λ _ → isOfHLevelPlus' {n = n} (3 +ℕ n) (isOfHLevelPath' (3 +ℕ n) (isOfHLevelTrunc (4 +ℕ n)) _ _)) (cong ∣_∣ₕ (snd f)) Hopfβ : (n : ℕ) → (f : S₊∙ (3 +ℕ n +ℕ n) →∙ S₊∙ (2 +ℕ n)) → coHom (4 +ℕ (n +ℕ n)) (HopfInvariantPush n (fst f)) Hopfβ n f = fst (MV.d _ _ _ (λ _ → tt) (fst f) (3 +ℕ n +ℕ n)) ∣ ∣_∣ ∣₂ -- To define the Hopf invariant, we need to establish the -- non-trivial isos of Hⁿ(HopfInvariant). module _ (n : ℕ) (f : S₊∙ (3 +ℕ n +ℕ n) →∙ S₊∙ (2 +ℕ n)) where module M = MV _ _ _ (λ _ → tt) (fst f) ¬lemHopf : (n m : ℕ) → ¬ suc (suc (m +ℕ n)) ≡ suc n ¬lemHopf zero zero p = snotz (cong predℕ p) ¬lemHopf (suc n) zero p = ¬lemHopf n zero (cong predℕ p) ¬lemHopf zero (suc m) p = snotz (cong predℕ p) ¬lemHopf (suc n) (suc m) p = ¬lemHopf n (suc m) (cong (suc ∘ suc ) (sym (+-suc m n)) ∙ (cong predℕ p)) SphereHopfCohomIso : GroupEquiv (coHomGr (3 +ℕ n +ℕ n) (S₊ (3 +ℕ n +ℕ n))) ((coHomGr (suc (3 +ℕ n +ℕ n)) (HopfInvariantPush _ (fst f)))) fst (fst SphereHopfCohomIso) = fst (MV.d _ _ _ (λ _ → tt) (fst f) (3 +ℕ n +ℕ n)) snd (fst SphereHopfCohomIso) = help where abstract help : isEquiv (fst (MV.d _ _ _ (λ _ → tt) (fst f) (3 +ℕ n +ℕ n))) help = SES→isEquiv (isContr→≡UnitGroup (isContrΣ (GroupIsoUnitGroup→isContr (invGroupIso (Hⁿ-Unit≅0 _))) λ _ → GroupIsoUnitGroup→isContr (invGroupIso (Hⁿ-Sᵐ≅0 _ _ (¬lemHopf n n))))) (isContr→≡UnitGroup (isContrΣ (GroupIsoUnitGroup→isContr (invGroupIso (Hⁿ-Unit≅0 _))) λ _ → GroupIsoUnitGroup→isContr (invGroupIso (Hⁿ-Sᵐ≅0 _ _ (¬lemHopf n (suc n)))))) (M.Δ (3 +ℕ n +ℕ n)) (M.d (3 +ℕ n +ℕ n)) (M.i (4 +ℕ n +ℕ n)) (M.Ker-d⊂Im-Δ _) (M.Ker-i⊂Im-d _) snd SphereHopfCohomIso = d-inv where -- Currently, type checking is very slow without the abstract flag. -- TODO : Remove abstract abstract d-inv : IsGroupHom (snd (coHomGr (3 +ℕ n +ℕ n) (S₊ (3 +ℕ n +ℕ n)))) (fst (MV.d _ _ _ (λ _ → tt) (fst f) (3 +ℕ n +ℕ n))) (snd (coHomGr (suc (3 +ℕ n +ℕ n)) (Pushout (λ _ → tt) (fst f)))) d-inv = snd (MV.d _ _ _ (λ _ → tt) (fst f) (3 +ℕ n +ℕ n)) Hopfβ-Iso : GroupIso (coHomGr (suc (3 +ℕ n +ℕ n)) (HopfInvariantPush _ (fst f))) ℤGroup fst Hopfβ-Iso = compIso (invIso (equivToIso (fst SphereHopfCohomIso))) (fst (Hⁿ-Sⁿ≅ℤ (suc (suc (n +ℕ n))))) snd Hopfβ-Iso = grHom where abstract grHom : IsGroupHom (coHomGr (suc (3 +ℕ n +ℕ n)) (Pushout (λ _ → tt) (fst f)) .snd) (λ x → Iso.fun (fst ((Hⁿ-Sⁿ≅ℤ (suc (suc (n +ℕ n)))))) (invEq (fst SphereHopfCohomIso) x)) (ℤGroup .snd) grHom = snd (compGroupIso (GroupEquiv→GroupIso (invGroupEquiv (SphereHopfCohomIso))) (Hⁿ-Sⁿ≅ℤ (suc (suc (n +ℕ n))))) Hⁿ-Sⁿ≅ℤ-nice-generator : (n : ℕ) → Iso.inv (fst (Hⁿ-Sⁿ≅ℤ (suc n))) 1 ≡ ∣ ∣_∣ ∣₂ Hⁿ-Sⁿ≅ℤ-nice-generator zero = Iso.leftInv (fst (Hⁿ-Sⁿ≅ℤ (suc zero))) _ Hⁿ-Sⁿ≅ℤ-nice-generator (suc n) = (λ i → Iso.inv (fst (suspensionAx-Sn (suc n) (suc n))) (Hⁿ-Sⁿ≅ℤ-nice-generator n i)) ∙ cong ∣_∣₂ (funExt λ { north → refl ; south → cong ∣_∣ₕ (merid north) ; (merid a i) j → ∣ compPath-filler (merid a) (sym (merid north)) (~ j) i ∣ₕ}) Hopfβ↦1 : (n : ℕ) (f : S₊∙ (3 +ℕ n +ℕ n) →∙ S₊∙ (2 +ℕ n)) → Iso.fun (fst (Hopfβ-Iso n f)) (Hopfβ n f) ≡ 1 Hopfβ↦1 n f = sym (cong (Iso.fun (fst (Hopfβ-Iso n f))) lem) ∙ Iso.rightInv (fst (Hopfβ-Iso n f)) (pos 1) where lem : Iso.inv (fst (Hopfβ-Iso n f)) (pos 1) ≡ Hopfβ n f lem = (λ i → fst (MV.d _ _ _ (λ _ → tt) (fst f) (3 +ℕ n +ℕ n)) (Hⁿ-Sⁿ≅ℤ-nice-generator _ i)) ∙ cong ∣_∣₂ (funExt (λ { (inl x) → refl ; (inr x) → refl ; (push a i) → refl})) module _ (n : ℕ) (f : S₊∙ (3 +ℕ n +ℕ n) →∙ S₊∙ (2 +ℕ n)) where private 2+n = 2 +ℕ n H = HopfInvariantPush n (fst f) H→Sphere : coHom 2+n H → coHom 2+n (S₊ (suc (suc n))) H→Sphere = sMap (_∘ inr) grHom : IsGroupHom (snd (coHomGr 2+n H)) H→Sphere (snd (coHomGr 2+n (S₊ (suc (suc n))))) grHom = makeIsGroupHom (sElim2 (λ _ _ → isOfHLevelPath 2 squash₂ _ _) λ f g → refl) preSphere→H : (g : (S₊ (suc (suc n)) → coHomK 2+n)) → H → coHomK (2 +ℕ n) preSphere→H g (inl x) = 0ₖ _ preSphere→H g (inr x) = g x -ₖ g north preSphere→H g (push a i) = lem a i where lem : (a : S₊ (suc (suc (suc (n +ℕ n))))) → 0ₖ (suc (suc n)) ≡ g (fst f a) -ₖ g north lem = sphereElim _ (λ x → isOfHLevelPlus' {n = n} (3 +ℕ n) (isOfHLevelTrunc (4 +ℕ n) _ _)) (sym (rCancelₖ _ (g north)) ∙ cong (λ x → g x -ₖ g north) (sym (snd f))) Sphere→H : coHom 2+n (S₊ (suc (suc n))) → coHom 2+n H Sphere→H = sMap preSphere→H conCohom2+n : (x : _) → ∥ x ≡ 0ₖ (suc (suc n)) ∥ conCohom2+n = coHomK-elim _ (λ _ → isProp→isOfHLevelSuc (suc n) squash) ∣ refl ∣ HIPSphereCohomIso : Iso (coHom (2 +ℕ n) (HopfInvariantPush n (fst f))) (coHom (2 +ℕ n) (S₊ (2 +ℕ n))) Iso.fun HIPSphereCohomIso = H→Sphere Iso.inv HIPSphereCohomIso = Sphere→H Iso.rightInv HIPSphereCohomIso = sElim (λ _ → isOfHLevelPath 2 squash₂ _ _) λ g → pRec (squash₂ _ _) (λ p → cong ∣_∣₂ (funExt λ x → cong (g x +ₖ_) (cong (-ₖ_) p) ∙ rUnitₖ _ (g x))) (conCohom2+n (g north)) Iso.leftInv HIPSphereCohomIso = sElim (λ _ → isOfHLevelPath 2 squash₂ _ _) λ g → pRec (squash₂ _ _) (pRec (isPropΠ (λ _ → squash₂ _ _)) (λ gn gtt → trRec (isProp→isOfHLevelSuc n (squash₂ _ _)) (λ r → cong ∣_∣₂ (funExt λ { (inl x) → sym gtt ; (inr x) → (λ i → g (inr x) -ₖ gn i) ∙ rUnitₖ _ (g (inr x)) ; (push a i) → sphereElim _ {A = λ a → PathP (λ i → preSphere→H (λ x → g (inr x)) (push a i) ≡ g (push a i)) (sym gtt) ((λ i → g (inr (fst f a)) -ₖ gn i) ∙ rUnitₖ _ (g (inr (fst f a))))} (λ _ → isOfHLevelPathP' (suc (suc (suc (n +ℕ n)))) (isOfHLevelPath (suc (suc (suc (suc (n +ℕ n))))) (isOfHLevelPlus' {n = n} (suc (suc (suc (suc n)))) (isOfHLevelTrunc (suc (suc (suc (suc n)))))) _ _) _ _) r a i})) (push-helper g gtt gn)) (conCohom2+n (g (inr north)))) (conCohom2+n (g (inl tt))) where push-helper : (g : HopfInvariantPush n (fst f) → coHomK (suc (suc n))) → (gtt : g (inl tt) ≡ 0ₖ (suc (suc n))) → (gn : g (inr north) ≡ 0ₖ (suc (suc n))) → hLevelTrunc (suc n) (PathP (λ i → preSphere→H (λ x → g (inr x)) (push north i) ≡ g (push north i)) (sym gtt) ((λ i → g (inr (fst f north)) -ₖ gn i) ∙ rUnitₖ _ (g (inr (fst f north))))) push-helper g gtt gn = isConnectedPathP _ (isConnectedPath _ (isConnectedKn _) _ _) _ _ .fst Hopfα-Iso : GroupIso (coHomGr (2 +ℕ n) (HopfInvariantPush n (fst f))) ℤGroup Hopfα-Iso = compGroupIso (HIPSphereCohomIso , grHom) (Hⁿ-Sⁿ≅ℤ (suc n)) Hopfα-Iso-α : (n : ℕ) (f : _) → Iso.fun (fst (Hopfα-Iso n f)) (Hopfα n f) ≡ 1 Hopfα-Iso-α n f = sym (cong (Iso.fun (fst (Hⁿ-Sⁿ≅ℤ (suc n)))) (Hⁿ-Sⁿ≅ℤ-nice-generator n)) ∙ Iso.rightInv (fst (Hⁿ-Sⁿ≅ℤ (suc n))) (pos 1) where hz : Iso.fun (HIPSphereCohomIso n f) (Hopfα n f) ≡ ∣ ∣_∣ ∣₂ hz = refl ⌣-α : (n : ℕ) → (f : S₊∙ (3 +ℕ (n +ℕ n)) →∙ S₊∙ (2 +ℕ n)) → _ ⌣-α n f = Hopfα n f ⌣ Hopfα n f HopfInvariant : (n : ℕ) → (f : S₊∙ (3 +ℕ (n +ℕ n)) →∙ S₊∙ (2 +ℕ n)) → ℤ HopfInvariant n f = Iso.fun (fst (Hopfβ-Iso n f)) (subst (λ x → coHom x (HopfInvariantPush n (fst f))) (λ i → suc (suc (suc (+-suc n n i)))) (⌣-α n f)) HopfInvariant-π' : (n : ℕ) → π' (3 +ℕ (n +ℕ n)) (S₊∙ (2 +ℕ n)) → ℤ HopfInvariant-π' n = sRec isSetℤ (HopfInvariant n) HopfInvariant-π : (n : ℕ) → π (3 +ℕ (n +ℕ n)) (S₊∙ (2 +ℕ n)) → ℤ HopfInvariant-π n = sRec isSetℤ λ x → HopfInvariant-π' n ∣ Ω→SphereMap _ x ∣₂ -- Elimination principle for the pushout defining the Hopf Invariant HopfInvariantPushElim : ∀ {ℓ} n → (f : _) → {P : HopfInvariantPush n f → Type ℓ} → (isOfHLevel (suc (suc (suc (suc (n +ℕ n))))) (P (inl tt))) → (e : P (inl tt)) (g : (x : _) → P (inr x)) (r : PathP (λ i → P (push north i)) e (g (f north))) → (x : _) → P x HopfInvariantPushElim n f {P = P} hlev e g r (inl x) = e HopfInvariantPushElim n f {P = P} hlev e g r (inr x) = g x HopfInvariantPushElim n f {P = P} hlev e g r (push a i₁) = help a i₁ where help : (a : Susp (Susp (S₊ (suc (n +ℕ n))))) → PathP (λ i → P (push a i)) e (g (f a)) help = sphereElim _ (sphereElim _ (λ _ → isProp→isOfHLevelSuc (suc (suc (n +ℕ n))) (isPropIsOfHLevel _)) (isOfHLevelPathP' (suc (suc (suc (n +ℕ n)))) (subst (isOfHLevel (suc (suc (suc (suc (n +ℕ n)))))) (cong P (push north)) hlev) _ _)) r
39.961783
80
0.508049
571132d01aa46c6a5e1dfcdad78d137d8bc25613
3,746
agda
Agda
src/Categories/Object/Kernel/Properties.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
279
2019-06-01T14:36:40.000Z
2022-03-22T00:40:14.000Z
src/Categories/Object/Kernel/Properties.agda
seanpm2001/agda-categories
d9e4f578b126313058d105c61707d8c8ae987fa8
[ "MIT" ]
236
2019-06-01T14:53:54.000Z
2022-03-28T14:31:43.000Z
src/Categories/Object/Kernel/Properties.agda
seanpm2001/agda-categories
d9e4f578b126313058d105c61707d8c8ae987fa8
[ "MIT" ]
64
2019-06-02T16:58:15.000Z
2022-03-14T02:00:59.000Z
{-# OPTIONS --without-K --safe #-} open import Categories.Category open import Categories.Object.Zero module Categories.Object.Kernel.Properties {o ℓ e} {𝒞 : Category o ℓ e} (𝒞-Zero : Zero 𝒞) where open import Function using (_$_) open import Categories.Diagram.Equalizer 𝒞 open import Categories.Diagram.Pullback 𝒞 renaming (glue to glue-pullback; up-to-iso to pullback-up-to-iso) open import Categories.Diagram.Pullback.Properties 𝒞 open import Categories.Object.Kernel 𝒞-Zero open import Categories.Object.Terminal 𝒞 open import Categories.Morphism 𝒞 open import Categories.Morphism.Reasoning 𝒞 open Category 𝒞 open HomReasoning open Equiv open Zero 𝒞-Zero private variable A B : Obj f : A ⇒ B -- We can express kernels as pullbacks along the morphism '¡ : ⊥ ⇒ A'. Kernel⇒Pullback : Kernel f → Pullback f ¡ Kernel⇒Pullback {f = f} kernel = record { p₁ = kernel⇒ ; p₂ = ! ; isPullback = record { commute = commute ; universal = λ {C} {h₁} {h₂} eq → universal {h = h₁} $ begin f ∘ h₁ ≈⟨ eq ⟩ ¡ ∘ h₂ ≈˘⟨ refl⟩∘⟨ !-unique h₂ ⟩ zero⇒ ∎ ; unique = λ {C} {h₁} {h₂} {i} k-eq h-eq → unique $ begin h₁ ≈˘⟨ k-eq ⟩ kernel⇒ ∘ i ∎ ; p₁∘universal≈h₁ = ⟺ factors ; p₂∘universal≈h₂ = !-unique₂ } } where open Kernel kernel -- All pullbacks along the morphism '¡ : ⊥ ⇒ A' are also kernels. Pullback⇒Kernel : Pullback f ¡ → Kernel f Pullback⇒Kernel {f = f} pullback = record { kernel⇒ = p₁ ; isKernel = record { commute = begin f ∘ p₁ ≈⟨ commute ⟩ ¡ ∘ p₂ ≈˘⟨ refl⟩∘⟨ !-unique p₂ ⟩ zero⇒ ∎ ; universal = λ eq → universal eq ; factors = ⟺ p₁∘universal≈h₁ ; unique = λ eq → unique (⟺ eq) (⟺ (!-unique _)) } } where open Pullback pullback -- We can also express kernels as the equalizer of 'f' and the zero morphism. Kernel⇒Equalizer : Kernel f → Equalizer f zero⇒ Kernel⇒Equalizer {f = f} kernel = record { arr = kernel⇒ ; isEqualizer = record { equality = begin f ∘ kernel⇒ ≈⟨ commute ⟩ zero⇒ ≈˘⟨ zero-∘ʳ kernel⇒ ⟩ zero⇒ ∘ kernel⇒ ∎ ; equalize = λ {_} {h} eq → universal (eq ○ zero-∘ʳ h) ; universal = factors ; unique = unique } } where open Kernel kernel -- Furthermore, all equalizers of 'f' and the zero morphism are equalizers Equalizer⇒Kernel : Equalizer f zero⇒ → Kernel f Equalizer⇒Kernel {f = f} equalizer = record { kernel⇒ = arr ; isKernel = record { commute = begin f ∘ arr ≈⟨ equality ⟩ zero⇒ ∘ arr ≈⟨ zero-∘ʳ arr ⟩ zero⇒ ∎ ; universal = λ {_} {h} eq → equalize (eq ○ ⟺ (zero-∘ʳ h)) ; factors = universal ; unique = unique } } where open Equalizer equalizer module _ (K : Kernel f) where open Kernel K Kernel-Mono : Mono kernel⇒ Kernel-Mono g₁ g₂ eq = begin g₁ ≈⟨ unique refl ⟩ universal universal-∘ ≈˘⟨ unique eq ⟩ g₂ ∎ module _ (has-kernels : ∀ {A B} → (f : A ⇒ B) → Kernel f) where -- The kernel of a kernel is isomorphic to the zero object. kernel²-zero : ∀ {A B} {f : A ⇒ B} → Kernel.kernel (has-kernels (Kernel.kernel⇒ (has-kernels f))) ≅ 𝟘 kernel²-zero {B = B} {f = f} = pullback-up-to-iso kernel-pullback (pullback-mono-mono (¡-Mono 𝒞 {z = 𝒞-Zero})) where K : Kernel f K = has-kernels f module K = Kernel K K′ : Kernel K.kernel⇒ K′ = has-kernels K.kernel⇒ kernel-pullback : Pullback ¡ ¡ kernel-pullback = Pullback-resp-≈ (glue-pullback (Kernel⇒Pullback K) (swap (Kernel⇒Pullback K′))) (¡-unique (f ∘ ¡)) refl pullback-mono-mono : ∀ {A B} {f : A ⇒ B} → Mono f → Pullback f f pullback-mono-mono mono = record { p₁ = id ; p₂ = id ; isPullback = pullback-self-mono mono }
27.955224
127
0.606247
5e799f58d0519454009394fa94aedb9823cea24b
2,324
agda
Agda
continuity.agda
hazelgrove/hazelnut-dynamics-agda
229dfb06ea51ebe91cb3b1c973c2f2792e66797c
[ "MIT" ]
16
2018-03-12T14:32:03.000Z
2021-12-19T02:50:23.000Z
continuity.agda
hazelgrove/hazelnut-dynamics-agda
229dfb06ea51ebe91cb3b1c973c2f2792e66797c
[ "MIT" ]
54
2017-06-29T20:53:34.000Z
2018-11-29T16:32:40.000Z
continuity.agda
hazelgrove/hazelnut-dynamics-agda
229dfb06ea51ebe91cb3b1c973c2f2792e66797c
[ "MIT" ]
1
2019-09-13T18:20:02.000Z
2019-09-13T18:20:02.000Z
open import Nat open import Prelude open import core open import contexts open import progress open import preservation open import elaborability open import typed-elaboration module continuity where -- we take the sensibilty theorem as a postulate; for a proof, refer to -- the POPL17 mechanization. we also postulate some glue that allows us -- to use our theorems here on the shape of results from that work. postulate action : Set zexp : Set _◆ : zexp → hexp _⊢_=>_~_~>_=>_ : (Γ : tctx) → (e1 : zexp) → (t1 : htyp) → (α : action) → (e2 : zexp) → (t2 : htyp) → Set sensibility : {Γ : tctx} {e e' : zexp} {τ τ' : htyp} {α : action} → Γ ⊢ (e ◆) => τ → Γ ⊢ e => τ ~ α ~> e' => τ' → Γ ⊢ (e' ◆) => τ' binders-unique-h : hexp → Set binders-unique-z : zexp → Set binders-unique-cursor1 : ∀{e} → binders-unique-z e → binders-unique-h (e ◆) binders-unique-cursor2 : ∀{e} → binders-unique-h (e ◆) → binders-unique-z e binders-unique-sensibility : {Γ : tctx} {e e' : zexp} {τ τ' : htyp} {α : action} → binders-unique-z e → Γ ⊢ e => τ ~ α ~> e' => τ' → binders-unique-z e' expansion-unique : ∀{Γ e τ d Δ} → binders-unique-h e → Γ ⊢ e ⇒ τ ~> d ⊣ Δ → binders-unique d continuity : ∀{ e τ α e' τ' } → binders-unique-z e → ∅ ⊢ (e ◆) => τ → ∅ ⊢ e => τ ~ α ~> e' => τ' → Σ[ Δ ∈ hctx ] Σ[ d ∈ ihexp ] ( ∅ ⊢ (e' ◆) ⇒ τ' ~> d ⊣ Δ × Δ , ∅ ⊢ d :: τ' × ( (Σ[ d' ∈ ihexp ]( d ↦ d' × Δ , ∅ ⊢ d' :: τ' )) + d boxedval + d indet ) ) continuity bu wt action with sensibility wt action ... | sense with elaborability-synth sense ... | d , Δ , exp with typed-elaboration-synth exp ... | d::τ' with progress d::τ' ... | (S (d' , stp)) = Δ , d , exp , d::τ' , Inl (d' , stp , preservation (expansion-unique (binders-unique-cursor1 (binders-unique-sensibility bu action)) exp) d::τ' stp) ... | (I ind) = Δ , d , exp , d::τ' , Inr (Inr ind) ... | (BV boxed) = Δ , d , exp , d::τ' , Inr (Inl boxed)
40.068966
174
0.473752
a1a4cece2f5967f7d07f720de2a5c5c5f186bbb1
266
agda
Agda
test/Succeed/Issue892.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Succeed/Issue892.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Succeed/Issue892.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
module Issue892 where data D : Set where d : D module I where i : D i = d module M0 (X : Set) where module M1 where h : D h = d module M2 where open M1 public open I public module M = M0 D good : D good = M.M1.h bad : D bad = M.M2.h
10.230769
25
0.578947
3012ad0d61582fbf334a339f2372e490e617ad70
1,516
agda
Agda
LibraBFT/Impl/Types/OnChainConfig/ValidatorSet.agda
oracle/bft-consensus-agda
49f8b1b70823be805d84ffc3157c3b880edb1e92
[ "UPL-1.0" ]
4
2020-12-16T19:43:41.000Z
2021-12-18T19:24:05.000Z
LibraBFT/Impl/Types/OnChainConfig/ValidatorSet.agda
oracle/bft-consensus-agda
49f8b1b70823be805d84ffc3157c3b880edb1e92
[ "UPL-1.0" ]
72
2021-02-04T05:04:33.000Z
2022-03-25T05:36:11.000Z
LibraBFT/Impl/Types/OnChainConfig/ValidatorSet.agda
oracle/bft-consensus-agda
49f8b1b70823be805d84ffc3157c3b880edb1e92
[ "UPL-1.0" ]
6
2020-12-16T19:43:52.000Z
2022-02-18T01:04:32.000Z
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import LibraBFT.Base.KVMap as Map hiding (empty) open import LibraBFT.ImplShared.Consensus.Types open import LibraBFT.Prelude open import Optics.All module LibraBFT.Impl.Types.OnChainConfig.ValidatorSet where new : List ValidatorInfo → ValidatorSet new = ValidatorSet∙new ConsensusScheme∙new empty : ValidatorSet empty = new [] obmFromVV : ValidatorVerifier → ValidatorSet obmFromVV vv0 = record -- ValidatorSet { _vsScheme = ConsensusScheme∙new -- TODO ; _vsPayload = fmap go (Map.toList (vv0 ^∙ vvAddressToValidatorInfo)) } where go : (Author × ValidatorConsensusInfo) → ValidatorInfo go (address , ValidatorConsensusInfo∙new pk vp) = record -- ValidatorInfo { _viAccountAddress = address ; _viConsensusVotingPower = vp ; _viConfig = record -- ValidatorConfig { _vcConsensusPublicKey = pk ; _vcValidatorNetworkAddress = address ^∙ aAuthorName } } obmGetValidatorInfo : AuthorName → ValidatorSet → Either ErrLog ValidatorInfo obmGetValidatorInfo name vs = case List-filter (λ vi → vi ^∙ viAccountAddress ∙ aAuthorName ≟ name) (vs ^∙ vsPayload) of λ where (vi ∷ []) → pure vi _ → Left fakeErr -- ["ValidatorSet", "obmGetValidatorInfo", "TODO better err msg"]
37.9
111
0.718338
9ae13e2e3d07487c4b708d13afb74c954e3dce2f
3,453
agda
Agda
elaboration-unicity.agda
hazelgrove/hazel-palette-agda
c3225acc3c94c56376c6842b82b8b5d76912df2a
[ "MIT" ]
4
2020-10-04T06:45:06.000Z
2021-12-19T15:38:31.000Z
elaboration-unicity.agda
hazelgrove/hazel-palette-agda
c3225acc3c94c56376c6842b82b8b5d76912df2a
[ "MIT" ]
9
2020-09-30T20:27:56.000Z
2020-10-20T20:44:13.000Z
elaboration-unicity.agda
hazelgrove/hazelnut-livelits-agda
c3225acc3c94c56376c6842b82b8b5d76912df2a
[ "MIT" ]
null
null
null
open import Nat open import Prelude open import core open import contexts open import synth-unicity open import lemmas-matching module elaboration-unicity where mutual elaboration-unicity-synth : {Γ : tctx} {e : eexp} {τ1 τ2 : typ} {d1 d2 : iexp} {Δ1 Δ2 : hctx} → Γ ⊢ e ⇒ τ1 ~> d1 ⊣ Δ1 → Γ ⊢ e ⇒ τ2 ~> d2 ⊣ Δ2 → τ1 == τ2 × d1 == d2 × Δ1 == Δ2 elaboration-unicity-synth ESConst ESConst = refl , refl , refl elaboration-unicity-synth (ESVar {Γ = Γ} x₁) (ESVar x₂) = ctxunicity {Γ = Γ} x₁ x₂ , refl , refl elaboration-unicity-synth (ESLam apt1 d1) (ESLam apt2 d2) with elaboration-unicity-synth d1 d2 ... | ih1 , ih2 , ih3 = ap1 _ ih1 , ap1 _ ih2 , ih3 elaboration-unicity-synth (ESAp _ _ x x₁ x₂ x₃) (ESAp _ _ x₄ x₅ x₆ x₇) with synthunicity x x₄ ... | refl with match-unicity x₁ x₅ ... | refl with elaboration-unicity-ana x₂ x₆ ... | refl , refl , refl with elaboration-unicity-ana x₃ x₇ ... | refl , refl , refl = refl , refl , refl elaboration-unicity-synth ESEHole ESEHole = refl , refl , refl elaboration-unicity-synth (ESNEHole _ d1) (ESNEHole _ d2) with elaboration-unicity-synth d1 d2 ... | ih1 , ih2 , ih3 = refl , ap1 _ ih2 , ap1 _ ih3 elaboration-unicity-synth (ESAsc x) (ESAsc x₁) with elaboration-unicity-ana x x₁ ... | refl , refl , refl = refl , refl , refl elaboration-unicity-synth (ESFst s1 m1 e1) (ESFst s2 m2 e2) with synthunicity s1 s2 ... | refl with match-unicity-prod m1 m2 ... | refl with elaboration-unicity-ana e1 e2 ... | refl , refl , refl = refl , refl , refl elaboration-unicity-synth (ESSnd s1 m1 e1) (ESSnd s2 m2 e2) with synthunicity s1 s2 ... | refl with match-unicity-prod m1 m2 ... | refl with elaboration-unicity-ana e1 e2 ... | refl , refl , refl = refl , refl , refl elaboration-unicity-synth (ESPair x x₁ e1 e2) (ESPair x₂ x₃ e3 e4) with elaboration-unicity-synth e1 e3 | elaboration-unicity-synth e2 e4 ... | refl , refl , refl | refl , refl , refl = refl , refl , refl elaboration-unicity-ana : {Γ : tctx} {e : eexp} {τ τ1 τ2 : typ} {d1 d2 : iexp} {Δ1 Δ2 : hctx} → Γ ⊢ e ⇐ τ ~> d1 :: τ1 ⊣ Δ1 → Γ ⊢ e ⇐ τ ~> d2 :: τ2 ⊣ Δ2 → d1 == d2 × τ1 == τ2 × Δ1 == Δ2 elaboration-unicity-ana (EALam x₁ m D1) (EALam x₂ m2 D2) with match-unicity m m2 ... | refl with elaboration-unicity-ana D1 D2 ... | refl , refl , refl = refl , refl , refl elaboration-unicity-ana (EALam x₁ m D1) (EASubsume x₂ x₃ () x₅) elaboration-unicity-ana (EASubsume x₁ x₂ () x₄) (EALam x₅ m D2) elaboration-unicity-ana (EASubsume x x₁ x₂ x₃) (EASubsume x₄ x₅ x₆ x₇) with elaboration-unicity-synth x₂ x₆ ... | refl , refl , refl = refl , refl , refl elaboration-unicity-ana (EASubsume x x₁ x₂ x₃) EAEHole = abort (x _ refl) elaboration-unicity-ana (EASubsume x x₁ x₂ x₃) (EANEHole _ x₄) = abort (x₁ _ _ refl) elaboration-unicity-ana EAEHole (EASubsume x x₁ x₂ x₃) = abort (x _ refl) elaboration-unicity-ana EAEHole EAEHole = refl , refl , refl elaboration-unicity-ana (EANEHole _ x) (EASubsume x₁ x₂ x₃ x₄) = abort (x₂ _ _ refl) elaboration-unicity-ana (EANEHole _ x) (EANEHole _ x₁) with elaboration-unicity-synth x x₁ ... | refl , refl , refl = refl , refl , refl
51.537313
100
0.606719
a01b4c72566969d806fd1d458eafa3bf570e0eab
488
agda
Agda
Structure/Sets/Quantifiers.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
6
2020-04-07T17:58:13.000Z
2022-02-05T06:53:22.000Z
Structure/Sets/Quantifiers.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
null
null
null
Structure/Sets/Quantifiers.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
null
null
null
open import Logic open import Type module Structure.Sets.Quantifiers {ℓₑ ℓₛ ℓₗ}{E : Type{ℓₑ}}{S : Type{ℓₛ}} (_∈_ : E → S → Stmt{ℓₗ}) where import Lvl open import Logic.Propositional open import Logic.Predicate open import Syntax.Function private variable ℓ : Lvl.Level -- Set restricted existential quantifier. ∃ₛ : S → (E → Stmt{ℓ}) → Stmt ∃ₛ(A) P = ∃(x ↦ (x ∈ A) ∧ P(x)) -- Set restricted universal quantifier. ∀ₛ : S → (E → Stmt{ℓ}) → Stmt ∀ₛ(A) P = ∀ₗ(x ↦ ((x ∈ A) → P(x)))
24.4
103
0.635246
5e45d11140d4945d5f2959b7969cf203525d077a
82
agda
Agda
test/interaction/Issue2522-case.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/interaction/Issue2522-case.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/interaction/Issue2522-case.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
open import Agda.Builtin.Bool test : (true : Bool) → Set test = {!!} -- C-c C-c
16.4
29
0.585366
03a19a4ba2ad136ff55d56bc0c1b9e9518b6a4af
674
agda
Agda
src/fot/LTC-PCF/Data/Nat/UnaryNumbers.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
11
2015-09-03T20:53:42.000Z
2021-09-12T16:09:54.000Z
src/fot/LTC-PCF/Data/Nat/UnaryNumbers.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
2
2016-10-12T17:28:16.000Z
2017-01-01T14:34:26.000Z
src/fot/LTC-PCF/Data/Nat/UnaryNumbers.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
3
2016-09-19T14:18:30.000Z
2018-03-14T08:50:00.000Z
------------------------------------------------------------------------------ -- Unary naturales numbers ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module LTC-PCF.Data.Nat.UnaryNumbers where open import LTC-PCF.Base ------------------------------------------------------------------------------ [0] = zero [1] = succ₁ [0] [2] = succ₁ [1] [3] = succ₁ [2] [4] = succ₁ [3] [5] = succ₁ [4] [6] = succ₁ [5] [7] = succ₁ [6] [8] = succ₁ [7] [9] = succ₁ [8]
25.923077
78
0.333828
5e40f7f6d4e6031abd3795ed3ffc5e6fa2095d7c
934
agda
Agda
Agda/Ag01.agda
Brethland/LEARNING-STUFF
eb2cef0556efb9a4ce11783f8516789ea48cc344
[ "MIT" ]
2
2020-02-03T05:05:52.000Z
2020-03-11T10:35:42.000Z
Agda/Ag01.agda
Brethland/LEARNING-STUFF
eb2cef0556efb9a4ce11783f8516789ea48cc344
[ "MIT" ]
null
null
null
Agda/Ag01.agda
Brethland/LEARNING-STUFF
eb2cef0556efb9a4ce11783f8516789ea48cc344
[ "MIT" ]
1
2019-12-13T04:50:46.000Z
2019-12-13T04:50:46.000Z
module Ag01 where import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl) open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) data ℕ : Set where zero : ℕ suc : ℕ → ℕ {-# BUILTIN NATURAL ℕ #-} _+_ : ℕ → ℕ → ℕ zero + n = n suc m + n = suc (m + n) _*_ : ℕ → ℕ → ℕ zero * n = zero suc m * n = n + (m * n) _ : 3 * 4 ≡ 12 _ = refl _^_ : ℕ → ℕ → ℕ m ^ 0 = 1 m ^ (suc n) = m * (m ^ n) _ : 3 ^ 4 ≡ 81 _ = refl _∸_ : ℕ → ℕ → ℕ m ∸ zero = m zero ∸ suc n = zero suc m ∸ suc n = m ∸ n infixl 6 _+_ _∸_ infixl 7 _*_ data Bin : Set where nil : Bin x0_ : Bin → Bin x1_ : Bin → Bin inc : Bin → Bin inc nil = nil inc (x1 b) = x0 (inc b) inc (x0 b) = x1 b _ : inc (x0 nil) ≡ (x1 nil) _ = refl _ : inc (x1 x1 x0 x1 nil) ≡ x0 x0 x1 x1 nil _ = refl to : ℕ → Bin to zero = x0 nil to (suc m) = inc (to m) from : Bin → ℕ from nil = zero from (x1 b) = suc (2 * (from b)) from (x0 b) = 2 * (from b)
14.59375
50
0.514989
2fe62da41b7498c1a0bfe8103f21285b1e206693
6,607
agda
Agda
benchmark/monad/MonadPostulates.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
benchmark/monad/MonadPostulates.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
benchmark/monad/MonadPostulates.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
------------------------------------------------------------------------ -- Parser monad ------------------------------------------------------------------------ open import Relation.Binary open import Relation.Binary.OrderMorphism open import Relation.Binary.PropositionalEquality import Relation.Binary.Properties.StrictTotalOrder as STOProps open import Data.Product open import Level module MonadPostulates where postulate -- Input string positions. Position : Set _<P_ : Rel Position zero posOrdered : IsStrictTotalOrder _≡_ _<P_ -- Input strings. Input : Position -> Set -- In order to be able to store results in a memo table (and avoid -- having to lift the table code to Set1) the result types have to -- come from the following universe: Result : Set ⟦_⟧ : Result -> Set -- Memoisation keys. These keys must uniquely identify the -- computation that they are associated with, when paired up with -- the current input string position. Key : let PosPoset = STOProps.poset (record { Carrier = _ ; _≈_ = _; _<_ = _ ; isStrictTotalOrder = posOrdered }) MonoFun = PosPoset ⇒-Poset PosPoset in MonoFun -> Result -> Set _≈'_ _<_ : Rel (∃₂ Key) zero keyOrdered : IsStrictTotalOrder _≈'_ _<_ -- Furthermore the underlying equality needs to be strong enough. funsEqual : _≈'_ =[ proj₁ ]⇒ _≡_ resultsEqual : _≈'_ =[ (\rfk -> proj₁ (proj₂ rfk)) ]⇒ _≡_ -- where open _⇒-Poset_ open STOProps (record { Carrier = _ ; _≈_ = _; _<_ = _ ; isStrictTotalOrder = posOrdered }) import IndexedMap as Map -- renaming (Map to MemoTable) open import Category.Monad open import Category.Monad.State import Data.List as List; open List using (List) open import Data.Unit hiding (poset; _≤_) open import Function open import Data.Maybe hiding (Eq) open import Data.Product.Relation.Lex.Strict open import Data.Product.Relation.Pointwise.NonDependent import Relation.Binary.Construct.On as On ------------------------------------------------------------------------ -- Monotone functions MonoFun : Set MonoFun = poset ⇒-Poset poset ------------------------------------------------------------------------ -- Memo tables -- Indices and keys used by the memo table. Index : Set Index = Position × MonoFun × Result data MemoTableKey : Index -> Set where key : forall {f r} (key : Key f r) pos -> MemoTableKey (pos , f , r) -- Input strings of a certain maximum length. Input≤ : Position -> Set Input≤ pos = ∃ \pos′ -> pos′ ≤ pos × Input pos′ -- Memo table values. Value : Index -> Set Value (pos , f , r) = List (⟦ r ⟧ × Input≤ (fun f pos)) -- Shuffles the elements to simplify defining equality and order -- relations for the keys. shuffle : ∃ MemoTableKey -> Position × ∃₂ Key shuffle ((pos , f , r) , key k .pos) = (pos , f , r , k) -- Equality and order. Eq : Rel (∃ MemoTableKey) _ Eq = Pointwise _≡_ _≈'_ on shuffle Lt : Rel (∃ MemoTableKey) _ Lt = ×-Lex _≡_ _<P_ _<_ on shuffle isOrdered : IsStrictTotalOrder Eq Lt isOrdered = On.isStrictTotalOrder shuffle (×-isStrictTotalOrder posOrdered keyOrdered) indicesEqual′ : Eq =[ proj₁ ]⇒ _≡_ indicesEqual′ {((_ , _ , _) , key _ ._)} {((_ , _ , _) , key _ ._)} (eq₁ , eq₂) = cong₂ _,_ eq₁ (cong₂ _,_ (funsEqual eq₂) (resultsEqual eq₂)) open Map isOrdered (\{k₁} {k₂} -> indicesEqual′ {k₁} {k₂}) Value {- ------------------------------------------------------------------------ -- Parser monad -- The parser monad is built upon a list monad, for backtracking, and -- two state monads. One of the state monads stores a memo table, and -- is unaffected by backtracking. The other state monad, which /is/ -- affected by backtracking, stores the remaining input string. -- The memo table state monad. module MemoState = RawMonadState (StateMonadState MemoTable) -- The list monad. module List = RawMonadPlus List.ListMonadPlus -- The inner monad (memo table plus list). module IM where Inner : Set -> Set Inner R = State MemoTable (List R) InnerMonadPlus : RawMonadPlus Inner InnerMonadPlus = record { monadZero = record { monad = record { return = \x -> return (List.return x) ; _>>=_ = \m f -> List.concat <$> (List.mapM monad f =<< m) } ; ∅ = return List.∅ } ; _∣_ = \m₁ m₂ -> List._∣_ <$> m₁ ⊛ m₂ } where open MemoState InnerMonadState : RawMonadState MemoTable Inner InnerMonadState = record { monad = RawMonadPlus.monad InnerMonadPlus ; get = List.return <$> get ; put = \s -> List.return <$> put s } where open MemoState open RawMonadPlus InnerMonadPlus public open RawMonadState InnerMonadState public using (get; put; modify) -- The complete parser monad. module PM where P : MonoFun -> Set -> Set P f A = forall {n} -> Input n -> IM.Inner (A × Input≤ (fun f n)) -- Memoises the computation, assuming that the key is sufficiently -- unique. memoise : forall {f r} -> Key f r -> P f ⟦ r ⟧ -> P f ⟦ r ⟧ memoise k p {pos} xs = let open IM in helper =<< lookup k′ <$> get where i = (pos , _) k′ : MemoTableKey i k′ = key k pos helper : Maybe (Value i) -> State MemoTable (Value i) helper (just ris) = return ris where open MemoState helper nothing = p xs >>= \ris -> modify (insert k′ ris) >> return ris where open MemoState -- Other monadic operations. return : forall {A} -> A -> P idM A return a = \xs -> IM.return (a , _ , refl , xs) _>>=_ : forall {A B f g} -> P f A -> (A -> P g B) -> P (g ∘M f) B _>>=_ {g = g} m₁ m₂ xs = m₁ xs ⟨ IM._>>=_ ⟩ \ays -> let a = proj₁ ays le = proj₁ $ proj₂ $ proj₂ ays ys = proj₂ $ proj₂ $ proj₂ ays in fix le ⟨ IM._<$>_ ⟩ m₂ a ys where lemma : forall {i j k} -> j ≤ k -> i ≤ fun g j -> i ≤ fun g k lemma j≤k i≤gj = trans i≤gj (monotone g j≤k) fix : forall {A i j} -> i ≤ j -> A × Input≤ (fun g i) -> A × Input≤ (fun g j) fix le = map-× id (map-Σ id (map-× (lemma le) id)) ∅ : forall {A} -> P idM A ∅ = const IM.∅ _∣_ : forall {A f} -> P f A -> P f A -> P f A m₁ ∣ m₂ = \xs -> IM._∣_ (m₁ xs) (m₂ xs) put : forall {n} -> Input n -> P (constM n) ⊤ put xs = \_ -> IM.return (_ , _ , refl , xs) modify : forall {A f} -> (forall {n} -> Input n -> A × Input (fun f n)) -> P f A modify g xs = IM.return (proj₁ gxs , _ , refl , proj₂ gxs) where gxs = g xs -}
28.726087
72
0.577418
504ed316163ce253fc1e91e88265308a97e7d8b0
1,037
agda
Agda
src/Dodo/Binary.agda
sourcedennis/agda-dodo
376f0ccee1e1aa31470890e494bcb534324f598a
[ "BSD-3-Clause" ]
null
null
null
src/Dodo/Binary.agda
sourcedennis/agda-dodo
376f0ccee1e1aa31470890e494bcb534324f598a
[ "BSD-3-Clause" ]
null
null
null
src/Dodo/Binary.agda
sourcedennis/agda-dodo
376f0ccee1e1aa31470890e494bcb534324f598a
[ "BSD-3-Clause" ]
null
null
null
{-# OPTIONS --without-K --safe #-} module Dodo.Binary where open import Dodo.Binary.Acyclic public open import Dodo.Binary.Composition public open import Dodo.Binary.Cycle public open import Dodo.Binary.Dec public open import Dodo.Binary.Disjoint public open import Dodo.Binary.Domain public open import Dodo.Binary.Empty public open import Dodo.Binary.Equality public open import Dodo.Binary.Filter public open import Dodo.Binary.Flip public open import Dodo.Binary.Functional public open import Dodo.Binary.Identity public open import Dodo.Binary.Immediate public open import Dodo.Binary.Intersection public open import Dodo.Binary.Irreflexive public open import Dodo.Binary.Maximal public open import Dodo.Binary.Precedes public open import Dodo.Binary.Product public open import Dodo.Binary.SplittableOrder public open import Dodo.Binary.Subtraction public open import Dodo.Binary.Transitive public open import Dodo.Binary.Trichotomous public open import Dodo.Binary.Union public open ⊆₂-Reasoning public open ⇔₂-Reasoning public
33.451613
46
0.835101
0404a27b3edf7d694e49eeeb76cea9e58a57b037
9,710
agda
Agda
Cubical/Data/Nat/Order.agda
hyleIndex/cubical
ce5c2820ecb2e0fd8dce74fb0247856cdbf034c4
[ "MIT" ]
301
2018-10-17T18:00:24.000Z
2022-03-24T02:10:47.000Z
Cubical/Data/Nat/Order.agda
hyleIndex/cubical
ce5c2820ecb2e0fd8dce74fb0247856cdbf034c4
[ "MIT" ]
584
2018-10-15T09:49:02.000Z
2022-03-30T12:09:17.000Z
Cubical/Data/Nat/Order.agda
hyleIndex/cubical
ce5c2820ecb2e0fd8dce74fb0247856cdbf034c4
[ "MIT" ]
134
2018-11-16T06:11:03.000Z
2022-03-23T16:22:13.000Z
{-# OPTIONS --no-exact-split --safe #-} module Cubical.Data.Nat.Order where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.HLevels open import Cubical.Data.Empty as ⊥ open import Cubical.Data.Sigma open import Cubical.Data.Sum as ⊎ open import Cubical.Data.Nat.Base open import Cubical.Data.Nat.Properties open import Cubical.Induction.WellFounded open import Cubical.Relation.Nullary infix 4 _≤_ _<_ _≤_ : ℕ → ℕ → Type₀ m ≤ n = Σ[ k ∈ ℕ ] k + m ≡ n _<_ : ℕ → ℕ → Type₀ m < n = suc m ≤ n data Trichotomy (m n : ℕ) : Type₀ where lt : m < n → Trichotomy m n eq : m ≡ n → Trichotomy m n gt : n < m → Trichotomy m n private variable k l m n : ℕ private witness-prop : ∀ j → isProp (j + m ≡ n) witness-prop {m} {n} j = isSetℕ (j + m) n m≤n-isProp : isProp (m ≤ n) m≤n-isProp {m} {n} (k , p) (l , q) = Σ≡Prop witness-prop lemma where lemma : k ≡ l lemma = inj-+m (p ∙ (sym q)) zero-≤ : 0 ≤ n zero-≤ {n} = n , +-zero n suc-≤-suc : m ≤ n → suc m ≤ suc n suc-≤-suc (k , p) = k , (+-suc k _) ∙ (cong suc p) ≤-+k : m ≤ n → m + k ≤ n + k ≤-+k {m} {k = k} (i , p) = i , +-assoc i m k ∙ cong (_+ k) p ≤-k+ : m ≤ n → k + m ≤ k + n ≤-k+ {m} {n} {k} = subst (_≤ k + n) (+-comm m k) ∘ subst (m + k ≤_) (+-comm n k) ∘ ≤-+k pred-≤-pred : suc m ≤ suc n → m ≤ n pred-≤-pred (k , p) = k , injSuc ((sym (+-suc k _)) ∙ p) ≤-refl : m ≤ m ≤-refl = 0 , refl ≤-suc : m ≤ n → m ≤ suc n ≤-suc (k , p) = suc k , cong suc p ≤-predℕ : predℕ n ≤ n ≤-predℕ {zero} = ≤-refl ≤-predℕ {suc n} = ≤-suc ≤-refl ≤-trans : k ≤ m → m ≤ n → k ≤ n ≤-trans {k} {m} {n} (i , p) (j , q) = i + j , l2 ∙ (l1 ∙ q) where l1 : j + i + k ≡ j + m l1 = (sym (+-assoc j i k)) ∙ (cong (j +_) p) l2 : i + j + k ≡ j + i + k l2 = cong (_+ k) (+-comm i j) ≤-antisym : m ≤ n → n ≤ m → m ≡ n ≤-antisym {m} (i , p) (j , q) = (cong (_+ m) l3) ∙ p where l1 : j + i + m ≡ m l1 = (sym (+-assoc j i m)) ∙ ((cong (j +_) p) ∙ q) l2 : j + i ≡ 0 l2 = m+n≡n→m≡0 l1 l3 : 0 ≡ i l3 = sym (snd (m+n≡0→m≡0×n≡0 l2)) ≤-k+-cancel : k + m ≤ k + n → m ≤ n ≤-k+-cancel {k} {m} (l , p) = l , inj-m+ (sub k m ∙ p) where sub : ∀ k m → k + (l + m) ≡ l + (k + m) sub k m = +-assoc k l m ∙ cong (_+ m) (+-comm k l) ∙ sym (+-assoc l k m) ≤-+k-cancel : m + k ≤ n + k → m ≤ n ≤-+k-cancel {m} {k} {n} (l , p) = l , cancelled where cancelled : l + m ≡ n cancelled = inj-+m (sym (+-assoc l m k) ∙ p) ≤-·k : m ≤ n → m · k ≤ n · k ≤-·k {m} {n} {k} (d , r) = d · k , reason where reason : d · k + m · k ≡ n · k reason = d · k + m · k ≡⟨ ·-distribʳ d m k ⟩ (d + m) · k ≡⟨ cong (_· k) r ⟩ n · k ∎ <-k+-cancel : k + m < k + n → m < n <-k+-cancel {k} {m} {n} = ≤-k+-cancel ∘ subst (_≤ k + n) (sym (+-suc k m)) ¬-<-zero : ¬ m < 0 ¬-<-zero (k , p) = snotz ((sym (+-suc k _)) ∙ p) ¬m<m : ¬ m < m ¬m<m {m} = ¬-<-zero ∘ ≤-+k-cancel {k = m} ≤0→≡0 : n ≤ 0 → n ≡ 0 ≤0→≡0 {zero} ineq = refl ≤0→≡0 {suc n} ineq = ⊥.rec (¬-<-zero ineq) predℕ-≤-predℕ : m ≤ n → (predℕ m) ≤ (predℕ n) predℕ-≤-predℕ {zero} {zero} ineq = ≤-refl predℕ-≤-predℕ {zero} {suc n} ineq = zero-≤ predℕ-≤-predℕ {suc m} {zero} ineq = ⊥.rec (¬-<-zero ineq) predℕ-≤-predℕ {suc m} {suc n} ineq = pred-≤-pred ineq ¬m+n<m : ¬ m + n < m ¬m+n<m {m} {n} = ¬-<-zero ∘ <-k+-cancel ∘ subst (m + n <_) (sym (+-zero m)) <-weaken : m < n → m ≤ n <-weaken (k , p) = suc k , sym (+-suc k _) ∙ p ≤<-trans : l ≤ m → m < n → l < n ≤<-trans p = ≤-trans (suc-≤-suc p) <≤-trans : l < m → m ≤ n → l < n <≤-trans = ≤-trans <-trans : l < m → m < n → l < n <-trans p = ≤<-trans (<-weaken p) <-asym : m < n → ¬ n ≤ m <-asym m<n = ¬m<m ∘ <≤-trans m<n <-+k : m < n → m + k < n + k <-+k p = ≤-+k p <-k+ : m < n → k + m < k + n <-k+ {m} {n} {k} p = subst (λ km → km ≤ k + n) (+-suc k m) (≤-k+ p) +-<-+ : m < n → k < l → m + k < n + l +-<-+ m<n k<l = <-trans (<-+k m<n) (<-k+ k<l) <-·sk : m < n → m · suc k < n · suc k <-·sk {m} {n} {k} (d , r) = (d · suc k + k) , reason where reason : (d · suc k + k) + suc (m · suc k) ≡ n · suc k reason = (d · suc k + k) + suc (m · suc k) ≡⟨ sym (+-assoc (d · suc k) k _) ⟩ d · suc k + (k + suc (m · suc k)) ≡[ i ]⟨ d · suc k + +-suc k (m · suc k) i ⟩ d · suc k + suc m · suc k ≡⟨ ·-distribʳ d (suc m) (suc k) ⟩ (d + suc m) · suc k ≡⟨ cong (_· suc k) r ⟩ n · suc k ∎ ≤-∸-+-cancel : m ≤ n → (n ∸ m) + m ≡ n ≤-∸-+-cancel {zero} {n} _ = +-zero _ ≤-∸-+-cancel {suc m} {zero} m≤n = ⊥.rec (¬-<-zero m≤n) ≤-∸-+-cancel {suc m} {suc n} m+1≤n+1 = +-suc _ _ ∙ cong suc (≤-∸-+-cancel (pred-≤-pred m+1≤n+1)) ≤-∸-suc : m ≤ n → suc (n ∸ m) ≡ suc n ∸ m ≤-∸-suc {zero} {n} m≤n = refl ≤-∸-suc {suc m} {zero} m≤n = ⊥.rec (¬-<-zero m≤n) ≤-∸-suc {suc m} {suc n} m+1≤n+1 = ≤-∸-suc (pred-≤-pred m+1≤n+1) left-≤-max : m ≤ max m n left-≤-max {zero} {n} = zero-≤ left-≤-max {suc m} {zero} = ≤-refl left-≤-max {suc m} {suc n} = suc-≤-suc left-≤-max right-≤-max : n ≤ max m n right-≤-max {zero} {m} = zero-≤ right-≤-max {suc n} {zero} = ≤-refl right-≤-max {suc n} {suc m} = suc-≤-suc right-≤-max min-≤-left : min m n ≤ m min-≤-left {zero} {n} = ≤-refl min-≤-left {suc m} {zero} = zero-≤ min-≤-left {suc m} {suc n} = suc-≤-suc min-≤-left min-≤-right : min m n ≤ n min-≤-right {zero} {n} = zero-≤ min-≤-right {suc m} {zero} = ≤-refl min-≤-right {suc m} {suc n} = suc-≤-suc min-≤-right Trichotomy-suc : Trichotomy m n → Trichotomy (suc m) (suc n) Trichotomy-suc (lt m<n) = lt (suc-≤-suc m<n) Trichotomy-suc (eq m=n) = eq (cong suc m=n) Trichotomy-suc (gt n<m) = gt (suc-≤-suc n<m) _≟_ : ∀ m n → Trichotomy m n zero ≟ zero = eq refl zero ≟ suc n = lt (n , +-comm n 1) suc m ≟ zero = gt (m , +-comm m 1) suc m ≟ suc n = Trichotomy-suc (m ≟ n) <-split : m < suc n → (m < n) ⊎ (m ≡ n) <-split {n = zero} = inr ∘ snd ∘ m+n≡0→m≡0×n≡0 ∘ snd ∘ pred-≤-pred <-split {zero} {suc n} = λ _ → inl (suc-≤-suc zero-≤) <-split {suc m} {suc n} = ⊎.map suc-≤-suc (cong suc) ∘ <-split ∘ pred-≤-pred ≤-+-split : ∀ n m k → k ≤ n + m → (n ≤ k) ⊎ (m ≤ (n + m) ∸ k) ≤-+-split n m k k≤n+m with n ≟ k ... | eq p = inl (0 , p) ... | lt n<k = inl (<-weaken n<k) ... | gt k<n with m ≟ ((n + m) ∸ k) ... | eq p = inr (0 , p) ... | lt m<n+m∸k = inr (<-weaken m<n+m∸k) ... | gt n+m∸k<m = ⊥.rec (¬m<m (transport (λ i → ≤-∸-+-cancel k≤n+m i < +-comm m n i) (+-<-+ n+m∸k<m k<n))) private acc-suc : Acc _<_ n → Acc _<_ (suc n) acc-suc a = acc λ y y<sn → case <-split y<sn of λ { (inl y<n) → access a y y<n ; (inr y≡n) → subst _ (sym y≡n) a } <-wellfounded : WellFounded _<_ <-wellfounded zero = acc λ _ → ⊥.rec ∘ ¬-<-zero <-wellfounded (suc n) = acc-suc (<-wellfounded n) <→≢ : n < m → ¬ n ≡ m <→≢ {n} {m} p q = ¬m<m (subst (_< m) q p) module _ (b₀ : ℕ) (P : ℕ → Type₀) (base : ∀ n → n < suc b₀ → P n) (step : ∀ n → P n → P (suc b₀ + n)) where open WFI (<-wellfounded) private dichotomy : ∀ b n → (n < b) ⊎ (Σ[ m ∈ ℕ ] n ≡ b + m) dichotomy b n = case n ≟ b return (λ _ → (n < b) ⊎ (Σ[ m ∈ ℕ ] n ≡ b + m)) of λ { (lt o) → inl o ; (eq p) → inr (0 , p ∙ sym (+-zero b)) ; (gt (m , p)) → inr (suc m , sym p ∙ +-suc m b ∙ +-comm (suc m) b) } dichotomy<≡ : ∀ b n → (n<b : n < b) → dichotomy b n ≡ inl n<b dichotomy<≡ b n n<b = case dichotomy b n return (λ d → d ≡ inl n<b) of λ { (inl x) → cong inl (m≤n-isProp x n<b) ; (inr (m , p)) → ⊥.rec (<-asym n<b (m , sym (p ∙ +-comm b m))) } dichotomy+≡ : ∀ b m n → (p : n ≡ b + m) → dichotomy b n ≡ inr (m , p) dichotomy+≡ b m n p = case dichotomy b n return (λ d → d ≡ inr (m , p)) of λ { (inl n<b) → ⊥.rec (<-asym n<b (m , +-comm m b ∙ sym p)) ; (inr (m' , q)) → cong inr (Σ≡Prop (λ x → isSetℕ n (b + x)) (inj-m+ {m = b} (sym q ∙ p))) } b = suc b₀ lemma₁ : ∀{x y z} → x ≡ suc z + y → y < x lemma₁ {y = y} {z} p = z , +-suc z y ∙ sym p subStep : (n : ℕ) → (∀ m → m < n → P m) → (n < b) ⊎ (Σ[ m ∈ ℕ ] n ≡ b + m) → P n subStep n _ (inl l) = base n l subStep n rec (inr (m , p)) = transport (cong P (sym p)) (step m (rec m (lemma₁ p))) wfStep : (n : ℕ) → (∀ m → m < n → P m) → P n wfStep n rec = subStep n rec (dichotomy b n) wfStepLemma₀ : ∀ n (n<b : n < b) rec → wfStep n rec ≡ base n n<b wfStepLemma₀ n n<b rec = cong (subStep n rec) (dichotomy<≡ b n n<b) wfStepLemma₁ : ∀ n rec → wfStep (b + n) rec ≡ step n (rec n (lemma₁ refl)) wfStepLemma₁ n rec = cong (subStep (b + n) rec) (dichotomy+≡ b n (b + n) refl) ∙ transportRefl _ +induction : ∀ n → P n +induction = induction wfStep +inductionBase : ∀ n → (l : n < b) → +induction n ≡ base n l +inductionBase n l = induction-compute wfStep n ∙ wfStepLemma₀ n l _ +inductionStep : ∀ n → +induction (b + n) ≡ step n (+induction n) +inductionStep n = induction-compute wfStep (b + n) ∙ wfStepLemma₁ n _ module <-Reasoning where -- TODO: would it be better to mirror the way it is done in the agda-stdlib? infixr 2 _<⟨_⟩_ _≤<⟨_⟩_ _≤⟨_⟩_ _<≤⟨_⟩_ _≡<⟨_⟩_ _≡≤⟨_⟩_ _<≡⟨_⟩_ _≤≡⟨_⟩_ _<⟨_⟩_ : ∀ k → k < n → n < m → k < m _ <⟨ p ⟩ q = <-trans p q _≤<⟨_⟩_ : ∀ k → k ≤ n → n < m → k < m _ ≤<⟨ p ⟩ q = ≤<-trans p q _≤⟨_⟩_ : ∀ k → k ≤ n → n ≤ m → k ≤ m _ ≤⟨ p ⟩ q = ≤-trans p q _<≤⟨_⟩_ : ∀ k → k < n → n ≤ m → k < m _ <≤⟨ p ⟩ q = <≤-trans p q _≡≤⟨_⟩_ : ∀ k → k ≡ l → l ≤ m → k ≤ m _ ≡≤⟨ p ⟩ q = subst (λ k → k ≤ _) (sym p) q _≡<⟨_⟩_ : ∀ k → k ≡ l → l < m → k < m _ ≡<⟨ p ⟩ q = _ ≡≤⟨ cong suc p ⟩ q _≤≡⟨_⟩_ : ∀ k → k ≤ l → l ≡ m → k ≤ m _ ≤≡⟨ p ⟩ q = subst (λ l → _ ≤ l) q p _<≡⟨_⟩_ : ∀ k → k < l → l ≡ m → k < m _ <≡⟨ p ⟩ q = _ ≤≡⟨ p ⟩ q
29.424242
96
0.460659
8b24510c196792399eb5d2357d0839390ef95e92
1,682
agda
Agda
agda-stdlib/src/Data/Nat/DivMod/WithK.agda
DreamLinuxer/popl21-artifact
fb380f2e67dcb4a94f353dbaec91624fcb5b8933
[ "MIT" ]
5
2020-10-07T12:07:53.000Z
2020-10-10T21:41:32.000Z
agda-stdlib/src/Data/Nat/DivMod/WithK.agda
DreamLinuxer/popl21-artifact
fb380f2e67dcb4a94f353dbaec91624fcb5b8933
[ "MIT" ]
null
null
null
agda-stdlib/src/Data/Nat/DivMod/WithK.agda
DreamLinuxer/popl21-artifact
fb380f2e67dcb4a94f353dbaec91624fcb5b8933
[ "MIT" ]
1
2021-11-04T06:54:45.000Z
2021-11-04T06:54:45.000Z
------------------------------------------------------------------------ -- The Agda standard library -- -- More efficient mod and divMod operations (require the K axiom) ------------------------------------------------------------------------ {-# OPTIONS --with-K --safe #-} module Data.Nat.DivMod.WithK where open import Data.Nat using (ℕ; _+_; _*_; _≟_; zero; suc) open import Data.Nat.DivMod hiding (_mod_; _divMod_) open import Data.Nat.Properties using (≤⇒≤″) open import Data.Nat.WithK open import Data.Fin.Base using (Fin; toℕ; fromℕ<″) open import Data.Fin.Properties using (toℕ-fromℕ<″) open import Function using (_$_) open import Relation.Nullary.Decidable using (False) open import Relation.Binary.PropositionalEquality using (refl; sym; cong; module ≡-Reasoning) open import Relation.Binary.PropositionalEquality.WithK open ≡-Reasoning infixl 7 _mod_ _divMod_ ------------------------------------------------------------------------ -- Certified modulus _mod_ : (dividend divisor : ℕ) .{≢0 : False (divisor ≟ 0)} → Fin divisor a mod (suc n) = fromℕ<″ (a % suc n) (≤″-erase (≤⇒≤″ (m%n<n a n))) ------------------------------------------------------------------------ -- Returns modulus and division result with correctness proof _divMod_ : (dividend divisor : ℕ) .{≢0 : False (divisor ≟ 0)} → DivMod dividend divisor a divMod (suc n) = result (a / suc n) (a mod suc n) $ ≡-erase $ begin a ≡⟨ m≡m%n+[m/n]*n a n ⟩ a % suc n + [a/n]*n ≡⟨ cong (_+ [a/n]*n) (sym (toℕ-fromℕ<″ lemma′)) ⟩ toℕ (fromℕ<″ _ lemma′) + [a/n]*n ∎ where lemma′ = ≤″-erase (≤⇒≤″ (m%n<n a n)) [a/n]*n = a / suc n * suc n
37.377778
85
0.525565
5e308edefbf35f5bdbba869cef999860b2576509
2,086
agda
Agda
Categories/Bicategory.agda
copumpkin/categories
36f4181d751e2ecb54db219911d8c69afe8ba892
[ "BSD-3-Clause" ]
98
2015-04-15T14:57:33.000Z
2022-03-08T05:20:36.000Z
Categories/Bicategory.agda
copumpkin/categories
36f4181d751e2ecb54db219911d8c69afe8ba892
[ "BSD-3-Clause" ]
19
2015-05-23T06:47:10.000Z
2019-08-09T16:31:40.000Z
Categories/Bicategory.agda
copumpkin/categories
36f4181d751e2ecb54db219911d8c69afe8ba892
[ "BSD-3-Clause" ]
23
2015-02-05T13:03:09.000Z
2021-11-11T13:50:56.000Z
{-# OPTIONS --universe-polymorphism #-} module Categories.Bicategory where open import Level -- open import Data.Product using (curry; _,_) -- open import Function using () renaming (_∘_ to _·_) open import Categories.Support.PropositionalEquality open import Categories.Category open import Categories.Categories open import Categories.Object.Terminal open import Categories.Terminal open import Categories.Functor using (Functor) renaming (_∘_ to _∘F_; _≡_ to _≡F_; id to idF) open import Categories.Functor.Constant using (Constant) open import Categories.Bifunctor using (Bifunctor; reduce-×) open import Categories.Product using (assocʳ; πˡ; πʳ) open import Categories.NaturalIsomorphism open import Categories.Bicategory.Helpers using (module BicategoryHelperFunctors) record Bicategory (o ℓ t e : Level) : Set (suc (o ⊔ ℓ ⊔ t ⊔ e)) where open Terminal (One {ℓ} {t} {e}) field Obj : Set o _⇒_ : (A B : Obj) → Category ℓ t e id : {A : Obj} → Functor ⊤ (A ⇒ A) —∘— : {A B C : Obj} → Bifunctor (B ⇒ C) (A ⇒ B) (A ⇒ C) _∘_ : {A B C : Obj} {L R : Category ℓ t e} → Functor L (B ⇒ C) → Functor R (A ⇒ B) → Bifunctor L R (A ⇒ C) _∘_ {A} {B} {C} F G = reduce-× {D₁ = B ⇒ C} {D₂ = A ⇒ B} —∘— F G field λᵤ : {A B : Obj} → NaturalIsomorphism (id ∘ idF {C = A ⇒ B}) (πʳ {C = ⊤} {A ⇒ B}) ρᵤ : {A B : Obj} → NaturalIsomorphism (idF {C = A ⇒ B} ∘ id) (πˡ {C = A ⇒ B} {⊤}) α : {A B C D : Obj} → NaturalIsomorphism (idF ∘ —∘—) (((—∘— ∘ idF) ∘F assocʳ (C ⇒ D) (B ⇒ C) (A ⇒ B))) private module BHF = BicategoryHelperFunctors(Obj)(_⇒_)(—∘—)(id) private module EQ = BHF.Coherence(λᵤ)(ρᵤ)(α) private module _⇒_ (A B : Obj) = Category (A ⇒ B) open _⇒_ public using () renaming (Obj to _⇒₁_) field .triangle : {A B C : Obj} (f : A ⇒₁ B) (g : B ⇒₁ C) → EQ.Triangle f g .pentagon : {A B C D E : Obj} (f : A ⇒₁ B) (g : B ⇒₁ C) (h : C ⇒₁ D) (i : D ⇒₁ E) → EQ.Pentagon f g h i -- do note that most of the "convenience" definitions in the Helpers module should really -- be here (but usable in both places). Clean that up later.
41.72
108
0.621285
308d193c8e388e6ad4344b7c435e89173a983188
922
agda
Agda
Data/List/Functions/Positional.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
6
2020-04-07T17:58:13.000Z
2022-02-05T06:53:22.000Z
Data/List/Functions/Positional.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
null
null
null
Data/List/Functions/Positional.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
null
null
null
module Data.List.Functions.Positional where import Lvl open import Data.List open import Data.Option open import Type private variable ℓ : Lvl.Level private variable T : Type{ℓ} -- A singleton list. A list with only a single element. -- Example: -- singleton(a) = [a] singleton : T → List(T) singleton elem = elem ⊰ ∅ -- The list without its first element (if there is one). -- Example: -- tail [] = [] -- tail [a] = [] -- tail [a,b] = [b] -- tail [a,b,c] = [b,c] tail : List(T) → List(T) tail ∅ = ∅ tail (_ ⊰ l) = l -- The first element of the list (head) first : List(T) → Option(T) first ∅ = Option.None first (x ⊰ _) = Option.Some(x) -- The last element of the list last : List(T) → Option(T) last ∅ = Option.None last (x ⊰ ∅) = Option.Some(x) last (_ ⊰ y ⊰ l) = last (y ⊰ l) -- TODO: Function equivalent to (foldₗ (const Option.Some) Option.None)? Prove if correct
24.263158
89
0.60846
197c754063a86adb68bec8a7f6bdc75bc9f97fb0
694
agda
Agda
test/Succeed/Issue552.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Succeed/Issue552.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Succeed/Issue552.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
module Issue552 where data Id3 {A : Set} : A -> A -> A -> Set where refl3 : {x : A} -> Id3 x x x -- These work: ok1 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c ok1 ._ ._ ._ (refl3 {_}) = refl3 ok2 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c ok2 _ ._ ._ (refl3) = refl3 ok3 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c ok3 _ ._ ._ (refl3 {._}) = refl3 -- These work after the fix: bad4 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c bad4 ._ ._ _ (refl3 {._}) = refl3 bad3 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c bad3 ._ _ ._ (refl3 {._}) = refl3 -- Now this works as well: bad1 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c bad1 ._ ._ ._ (refl3) = refl3
23.133333
53
0.497118
4bee6da64b19efe77d676fd1f5ce97be24c6bbd3
266
agda
Agda
test/Succeed/Issue2194.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
3
2015-03-28T14:51:03.000Z
2015-12-07T20:14:00.000Z
test/Succeed/Issue2194.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
3
2018-11-14T15:31:44.000Z
2019-04-01T19:39:26.000Z
test/Succeed/Issue2194.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1
2015-09-15T14:36:15.000Z
2015-09-15T14:36:15.000Z
open import Common.Equality open import Common.Prelude NaN : Float NaN = primFloatDiv 0.0 0.0 NaN≢-NaN : primFloatEquality NaN (primFloatNegate NaN) ≡ true NaN≢-NaN = refl NaN≢N-NaN : primFloatNumericalEquality NaN (primFloatNegate NaN) ≡ false NaN≢N-NaN = refl
20.461538
72
0.759398
a14350b39fb0d85fd1001e788c8a4a717ba761cc
588
agda
Agda
test/Compiler/simple/Issue2921.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Compiler/simple/Issue2921.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Compiler/simple/Issue2921.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
open import Agda.Builtin.IO open import Agda.Builtin.Unit open import Agda.Builtin.Nat data Unit : Set where c : ⊤ → Nat → ⊤ → Unit -- Note that the ⊤ arguments do not get erased and should be present in -- the Haskell version of Unit. {-# FOREIGN GHC data Unit = Unit () Integer () #-} {-# COMPILE GHC Unit = data Unit (Unit) #-} postulate print : Nat → IO ⊤ {-# COMPILE GHC print = print #-} {-# COMPILE JS print = function (x) { return function(cb) { process.stdout.write(x + "\n"); cb(0) } } #-} foo : Unit → IO ⊤ foo (c _ n _) = print n main : IO ⊤ main = foo (c _ 12345 _)
25.565217
106
0.632653
384153d0994d6905e18597d967092ab4b65bbab6
14,285
agda
Agda
Univalence/PointedPi.agda
JacquesCarette/pi-dual
003835484facfde0b770bc2b3d781b42b76184c1
[ "BSD-2-Clause" ]
14
2015-08-18T21:40:15.000Z
2021-05-05T01:07:57.000Z
Univalence/PointedPi.agda
JacquesCarette/pi-dual
003835484facfde0b770bc2b3d781b42b76184c1
[ "BSD-2-Clause" ]
4
2018-06-07T16:27:41.000Z
2021-10-29T20:41:23.000Z
Univalence/PointedPi.agda
JacquesCarette/pi-dual
003835484facfde0b770bc2b3d781b42b76184c1
[ "BSD-2-Clause" ]
3
2016-05-29T01:56:33.000Z
2019-09-10T09:47:13.000Z
{-# OPTIONS --without-K #-} module PointedPi where open import Level using (_⊔_) renaming (zero to l0; suc to lsuc) open import Universe using (Universe) open import Categories.Category using (Category) open import Categories.Groupoid using (Groupoid) open import Categories.Functor using (Functor) open import Data.Empty using (⊥) open import Data.Unit using (⊤; tt) open import Data.Sum hiding ([_,_]) open import Data.Product open import Relation.Binary.PropositionalEquality as P open import Function using (flip) open import Data.Nat using (ℕ; zero; suc) open import Data.Nat.Properties.Simple using (+-right-identity) open import Data.Integer using (ℤ;+_;-[1+_]) renaming (suc to ℤsuc; -_ to ℤ-; _+_ to _ℤ+_) open import Data.List using (List; foldr; replicate; _++_) renaming (map to Lmap; [] to nil; _∷_ to _∷:_) open import Data.List.Any using (module Membership-≡; here; there) open Membership-≡ open import Data.List.Properties using () open import Categories.Groupoid.Sum using () renaming (Sum to GSum) open import Categories.Groupoid.Product using () renaming (Product to GProduct) open import PiU using (U; ZERO; ONE; PLUS; TIMES; toℕ) open import PiLevel0 open import PiLevel1 open import PiEquiv renaming (eval to ap; evalB to apB) open import Equiv open import PiIter data Pointed (t : U) : Set where ∙ : ⟦ t ⟧ → Pointed t -- yes, re-use name eval on purpose here eval : {t₁ t₂ : U} → (t₁ ⟷ t₂) → Pointed t₁ → Pointed t₂ eval c (∙ x) = ∙ (ap c x) -- all our values will be 'subtypes' of this: record V (t : U) : Set where constructor v field pt : ⟦ t ⟧ auto : t ⟷ t evalV : {t₁ t₂ : U} → (t₁ ⟷ t₂) → V t₁ → V t₂ evalV c (v pt auto) = v (ap c pt) (! c ◎ auto ◎ c) -- V equivalence record _≈_ {t : U} (a : V t) (b : V t) : Set where constructor veq field pt-eq : V.pt a P.≡ V.pt b auto-eq : V.auto a ⇔ V.auto b -- and in general, all our morphisms will be 'subtypes' of record H {s t : U} (a : V s) (b : V t) : Set where constructor mor field transp : s ⟷ t t-eq : evalV transp a ≈ b --- Generating sets: lists of combinators over a type GenSet : U → Set GenSet t = List (t ⟷ t) -- We will need to use a choice between 3 things. Don't want -- to abuse ⊎. The 3 things can be understood as -- Forward, Backward and Neutral. So we name it ⇕. infix 30 _⇕_ data _⇕_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where Fwd : (x : A) → A ⇕ B Bwd : (y : B) → A ⇕ B Neu : A ⇕ B -- note that this uses ≡ (inside ∈), not ⇔. On purpose. inGS : {t : U} → GenSet t → Set inGS {t} S = Σ (t ⟷ t) (λ p → (p ∈ S) ⇕ (p ∈ S)) -- flip a ⇕ flip⇕ : ∀ {a b} {A : Set a} {B : Set b} → A ⇕ B → B ⇕ A flip⇕ (Fwd x) = Bwd x flip⇕ (Bwd y) = Fwd y flip⇕ Neu = Neu -- type of sequences of applications from GenSet CombS : {t : U} → GenSet t → Set CombS {t} S = List ( inGS S ) extract : {t : U} {S : GenSet t} → inGS S → (t ⟷ t) extract (p , Fwd x) = p extract (p , Bwd y) = ! p extract (p , Neu ) = id⟷ interp : {t : U} {S : GenSet t} → CombS S → (t ⟷ t) interp l = foldr _◎_ id⟷ (Lmap extract l) -- the combinator (CombS S) acts as a sort of reference point data U↑ : Set where ↑ : U → U↑ # : {τ : U} → (S : GenSet τ) → CombS S → U↑ 1/ : {τ : U} → (S : GenSet τ) → CombS S → U↑ _⊞_ : U↑ → U↑ → U↑ _⊠_ : U↑ → U↑ → U↑ infix 40 _⇿_ data _⇿_ : U↑ → U↑ → Set where ↑ : {t₁ t₂ : U} → t₁ ⟷ t₂ → ↑ t₁ ⇿ ↑ t₂ ev : {t₁ : U} {S : GenSet t₁} → (q : CombS S) → ((# S q) ⊠ (1/ S q)) ⇿ ↑ ONE coev : {t₁ : U} {S : GenSet t₁} → (q : CombS S) → ↑ ONE ⇿ ((# S q) ⊠ (1/ S q)) id⇿ : {t₁ : U↑} → t₁ ⇿ t₁ -- needed for coev of ⊠ UG : Universe l0 (lsuc l0) UG = record { U = U↑ ; El = λ T → Σ[ ℂ ∈ Category l0 l0 l0 ] (Groupoid ℂ) } -- for convenience, create some types which are embedable into V D : U → Set D t = ⟦ t ⟧ embedD : {t : U} → D t → V t embedD w = v w id⟷ -- and D equality lifts to ≈ embedDeq : {τ : U} → (s t : D τ) → s ≡ t → embedD s ≈ embedD t embedDeq s .s P.refl = veq P.refl id⇔ -- even more to the point, it lifts to describing Hom sets -- note how we can't use embedDeq directly! embedDHom : {τ : U} → (s t : D τ) → s ≡ t → H (embedD s) (embedD t) embedDHom s .s P.refl = mor id⟷ (veq P.refl (trans⇔ idl◎l idl◎l)) -- this is the same as in 2DTypes/groupoid discreteC : U → Category _ _ _ discreteC t = record { Obj = D t ; _⇒_ = λ s₁ s₂ → s₁ P.≡ s₂ -- see embedDHom ; _≡_ = λ _ _ → ⊤ -- hard-code proof-irrelevance ; id = P.refl ; _∘_ = flip P.trans ; assoc = tt ; identityˡ = tt ; identityʳ = tt ; equiv = record { refl = tt ; sym = λ _ → tt ; trans = λ _ _ → tt } ; ∘-resp-≡ = λ _ _ → tt } -- ditto discreteG : (t : U) → Groupoid (discreteC t) discreteG S = record { _⁻¹ = λ { {A} {.A} refl → P.refl } ; iso = record { isoˡ = tt; isoʳ = tt } } ----------- --- Structure theorems for ⇕ extract-GS[]≡id⟷ : ∀ {t : U} → (gs : GenSet t) → gs ≡ nil → (∀ (y : inGS gs) → extract y ≡ id⟷) extract-GS[]≡id⟷ .nil refl (p , Fwd ()) extract-GS[]≡id⟷ .nil refl (p , Bwd ()) extract-GS[]≡id⟷ .nil refl (p , Neu) = refl private Iter→CombS : ∀ {τ : U} (c : τ ⟷ τ) → Iter c → CombS (c ∷: nil) Iter→CombS p (iter (+_ n) _ _) = replicate n (p , Fwd (here refl)) Iter→CombS p (iter (-[1+_] n) _ _) = replicate (suc n) (p , Bwd (here refl)) CombS→Iter : ∀ {τ : U} (c : τ ⟷ τ) → CombS (c ∷: nil) → Iter c CombS→Iter p nil = iter (+ 0) id⟷ id⇔ CombS→Iter p (x ∷: xs) with CombS→Iter p xs CombS→Iter p ((.p , Fwd (here refl)) ∷: xs) | iter i q pf = iter (ℤsuc i) (p ◎ q) (trans⇔ (id⇔ ⊡ pf) (trans⇔ (idr◎r ⊡ id⇔) (2! (lower (+ 1) i)))) CombS→Iter p ((p' , Fwd (there ())) ∷: xs) | iter i q pf CombS→Iter p ((.p , Bwd (here refl)) ∷: xs) | iter i q pf = iter (i ℤ+ -[1+ 0 ]) (q ◎ (! p)) (trans⇔ (pf ⊡ id⇔) (2! (lower i -[1+ 0 ]))) CombS→Iter p ((p' , Bwd (there ())) ∷: xs) | iter i q pf CombS→Iter p ((p' , Neu) ∷: xs) | iter i q pf = iter i q pf -- split Fwd case from Bwd preserve-iter : ∀ {τ : U} (c : τ ⟷ τ) → (n : ℕ) → let p = CombS→Iter c (replicate n (c , Fwd (here refl))) in Iter.i p ≡ + n preserve-iter c zero = refl preserve-iter c (suc n) = cong ℤsuc (preserve-iter c n) preserve-iterB : ∀ {τ : U} (c : τ ⟷ τ) → (n : ℕ) → let p = CombS→Iter c (replicate (suc n) (c , Bwd (here refl))) in Iter.i p ≡ -[1+ n ] preserve-iterB c zero = refl preserve-iterB c (suc i) = P.trans (cong (λ z → z ℤ+ -[1+ 0 ]) (preserve-iterB c i)) (cong (λ z → -[1+ (suc z) ]) (+-right-identity i)) P2C2P : ∀ {τ : U} (c : τ ⟷ τ) → (p : Iter c) → (CombS→Iter c (Iter→CombS c p)) ≡c p P2C2P c (iter (+_ zero) p' p'⇔p^i) = eqc refl (2! p'⇔p^i) P2C2P c (iter (+_ (suc n)) p' p'⇔p^i) with CombS→Iter c (replicate n (c , Fwd (here refl))) | P.inspect (λ nn → CombS→Iter c (replicate nn (c , Fwd (here refl)))) n ... | iter i q pf | [ eq ] = let i=n = (P.trans (cong Iter.i (P.sym eq)) (preserve-iter c n)) in eqc (cong ℤsuc i=n) (trans⇔ (id⇔ {c = c} ⊡ pf) (trans⇔ (id⇔ ⊡ P.subst (λ j → c ^ i ⇔ c ^ j) i=n (id⇔ {c = c ^ i})) (2! p'⇔p^i))) P2C2P c (iter (-[1+_] n) p' p'⇔p^i) with CombS→Iter c (replicate (suc n) (c , Bwd (here refl))) | P.inspect (λ nn → CombS→Iter c (replicate (suc nn) (c , Bwd (here refl)))) n ... | iter i q pf | [ eq ] = let i=n = P.trans (cong Iter.i (P.sym eq)) (preserve-iterB c n) in eqc i=n (trans⇔ (P.subst (λ j → q ⇔ c ^ j) i=n pf) (2! p'⇔p^i)) C2P2C : ∀ {τ : U} (c : τ ⟷ τ) → (q : CombS (c ∷: nil)) → interp (Iter→CombS c (CombS→Iter c q)) ⇔ interp q C2P2C c nil = id⇔ C2P2C c (x ∷: q) with CombS→Iter c q | (C2P2C c) q C2P2C c ((.c , Fwd (here refl)) ∷: q) | iter (+_ n) p' pf | pf2 = id⇔ ⊡ pf2 C2P2C c ((.c , Fwd (here refl)) ∷: q) | iter (-[1+_] zero) p' pf | pf2 = trans⇔ (linv◎r {c = c}) (id⇔ ⊡ trans⇔ idr◎r pf2) C2P2C c ((.c , Fwd (here refl)) ∷: q) | iter (-[1+_] (suc n)) p' pf | pf2 = trans⇔ (trans⇔ idl◎r (linv◎r ⊡ id⇔)) (trans⇔ assoc◎r (id⇔ ⊡ pf2)) C2P2C c ((comb , Fwd (there ())) ∷: q) | iter i p' pf | pf2 C2P2C c ((.c , Bwd (here refl)) ∷: q) | iter (+_ zero) p' pf | pf2 = id⇔ ⊡ pf2 C2P2C c ((.c , Bwd (here refl)) ∷: q) | iter (+_ (suc n)) p' pf | pf2 = trans⇔ (trans⇔ idl◎r (rinv◎r ⊡ id⇔)) (trans⇔ assoc◎r (id⇔ ⊡ pf2)) C2P2C c ((.c , Bwd (here refl)) ∷: q) | iter (-[1+_] n) p' pf | pf2 = id⇔ {c = ! c} ⊡ (P.subst (λ j → ! c ◎ foldr _◎_ id⟷ (Lmap extract (replicate j (c , Bwd (here refl)))) ⇔ foldr _◎_ id⟷ (Lmap extract q)) (P.sym (+-right-identity n)) pf2) C2P2C c ((comb , Bwd (there ())) ∷: q) | iter i p' pf | pf2 C2P2C c ((comb , Neu) ∷: q) | iter i p' pf | pf2 = trans⇔ pf2 idl◎r -- we would like to say: -- Iter[p]≃CombS[p] : ∀ {τ : U} (p : τ ⟷ τ) → Iter p ≃ CombS (p ∷: nil) -- but the homotopies have the wrong type (≡ rather than ≡c and ⇔). ----------- -- Generalization of # p to # S. orderC : {τ : U} → (S : GenSet τ) → Category _ _ _ orderC {τ} S = record { Obj = CombS S ; _⇒_ = λ q₁ q₂ → interp q₁ ⇔ interp q₂ ; _≡_ = λ _ _ → ⊤ ; id = id⇔ ; _∘_ = flip trans⇔ ; assoc = tt ; identityˡ = tt ; identityʳ = tt ; equiv = record { refl = tt; sym = λ _ → tt; trans = λ _ _ → tt } ; ∘-resp-≡ = λ _ _ → tt } orderG : {τ : U} → (S : GenSet τ) → Groupoid (orderC S) orderG {τ} S = record { _⁻¹ = 2! ; iso = record { isoˡ = tt ; isoʳ = tt } } commute-interp-++ : ∀ {τ : U} {S : GenSet τ} (f g : CombS S) → interp (f ++ g) ⇔ interp f ◎ interp g commute-interp-++ nil g = idl◎r commute-interp-++ (x ∷: f) g = trans⇔ (id⇔ ⊡ commute-interp-++ f g) assoc◎l 1/orderC : {τ : U} → (S : GenSet τ) → Category _ _ _ 1/orderC S = record { Obj = ⊤ ; _⇒_ = λ _ _ → CombS S ; _≡_ = λ p q → interp p ⇔ interp q ; id = nil ; _∘_ = _++_ ; assoc = λ { {f = f} {g} {h} → trans⇔ (commute-interp-++ (h ++ g) f) ( trans⇔ (commute-interp-++ h g ⊡ id⇔) ( trans⇔ assoc◎r ( trans⇔ (id⇔ ⊡ (2! (commute-interp-++ g f))) ( 2! (commute-interp-++ h (g ++ f)))))) } ; identityˡ = id⇔ -- could also use idl◎l like below ; identityʳ = λ { {f = f} → trans⇔ (commute-interp-++ f nil) idr◎l } ; equiv = record { refl = id⇔ ; sym = 2! ; trans = trans⇔ } ; ∘-resp-≡ = λ { {f = f} {h} {g} {i} f⇔h g⇔i → trans⇔ (commute-interp-++ f g) (trans⇔ (f⇔h ⊡ g⇔i) (2! (commute-interp-++ h i))) } } flipGS : {τ : U} {S : GenSet τ} → inGS S → inGS S flipGS (c , pf) = c , flip⇕ pf invert-CombS : {τ : U} {S : GenSet τ} → CombS S → CombS S invert-CombS pl = Data.List.map flipGS (Data.List.reverse pl) -- sometimes we need to do some list manipulations under interp lift-≡ : {t₁ t₂ : U} {p q : t₁ ⟷ t₂} → p ≡ q → p ⇔ q lift-≡ refl = id⇔ interp-invert : {τ : U} {S : GenSet τ} → (x : inGS S) → (f : CombS S) → interp (invert-CombS (x ∷: f)) ⇔ interp (invert-CombS f) ◎ extract (flipGS x) interp-invert (c , Fwd x) f = {!!} interp-invert (c , Bwd y) f = {!!} interp-invert (c , Neu) f = {!!} extract-flipGS : {τ : U} {S : GenSet τ} → (x : inGS S) → extract (flipGS x) ⇔ ! (extract x) extract-flipGS (proj₁ , Fwd x) = id⇔ extract-flipGS (proj₁ , Bwd y) = 2! !!⇔id extract-flipGS (proj₁ , Neu) = id⇔ private left-invCS : {τ : U} {S : GenSet τ} (f : CombS S) → interp (invert-CombS f ++ f) ⇔ id⟷ left-invCS nil = id⇔ left-invCS (x ∷: f) = trans⇔ (commute-interp-++ (invert-CombS (x ∷: f)) (x ∷: f)) (trans⇔ (interp-invert x f ⊡ id⇔) (trans⇔ assoc◎r (trans⇔ (id⇔ ⊡ assoc◎l) (trans⇔ (id⇔ ⊡ trans⇔ (trans⇔ (extract-flipGS x ⊡ id⇔) rinv◎l ⊡ id⇔) idl◎l) (trans⇔ (2! (commute-interp-++ (invert-CombS f) f)) (left-invCS f)))))) right-invCS : {τ : U} {S : GenSet τ} (f : CombS S) → interp (f ++ invert-CombS f) ⇔ id⟷ right-invCS l = {!!} 1/orderG : {τ : U} → (S : GenSet τ) → Groupoid (1/orderC S) 1/orderG s = record { _⁻¹ = invert-CombS ; iso = λ {_} {_} {f} → record { isoˡ = left-invCS f ; isoʳ = right-invCS f } } ----------- --- Our semantics into groupoids ⟦_⟧↑ : (T : U↑) → Universe.El UG T ⟦ ↑ S ⟧↑ = , discreteG S ⟦ # S q ⟧↑ = , orderG S -- the base point doesn't matter here? ⟦ 1/ S q ⟧↑ = , 1/orderG S -- ditto? ⟦ x ⊞ y ⟧↑ with ⟦ x ⟧↑ | ⟦ y ⟧↑ ... | (_ , G₁) | (_ , G₂) = , GSum G₁ G₂ ⟦ x ⊠ y ⟧↑ with ⟦ x ⟧↑ | ⟦ y ⟧↑ ... | (_ , G₁) | (_ , G₂) = , GProduct G₁ G₂ record W (t : U↑) : Set where constructor w field pt : Category.Obj (proj₁ ⟦ t ⟧↑) auto : Category._⇒_ (proj₁ ⟦ t ⟧↑) pt pt evalW : {s t : U↑} → s ⇿ t → W s → W t evalW (↑ x) (w pt auto) = w (ap x pt) refl evalW (ev q) (w (cc , tt) (cc⇔cc-pf , cc')) = w tt refl -- this is cheating, cc <=> cc' ?? evalW (coev q) (w tt refl) = w (q , tt) (id⇔ , q) -- but this isn't. evalW id⇿ (w pt auto) = w pt auto -- This should actually be Hom-set inhabitation, aka categorical equivalence -- (as we are in a groupoid setting). ObjEq : (t : U↑) → Category.Obj (proj₁ ⟦ t ⟧↑) → Category.Obj (proj₁ ⟦ t ⟧↑) → Set ObjEq (↑ x) a b = a P.≡ b ObjEq (# S x) a b = interp a ⇔ interp b ObjEq (1/ S x) a b = ⊤ ObjEq (s ⊞ t) (inj₁ x) (inj₁ y) = ObjEq s x y ObjEq (s ⊞ t) (inj₁ x) (inj₂ y) = ⊥ ObjEq (s ⊞ t) (inj₂ y) (inj₁ x) = ⊥ ObjEq (s ⊞ t) (inj₂ x) (inj₂ y) = ObjEq t x y ObjEq (s ⊠ t) (a , b) (c , d) = ObjEq s a c × ObjEq t b d HomEq : (t : U↑) → (a b : Category.Obj (proj₁ ⟦ t ⟧↑)) → Category._⇒_ (proj₁ ⟦ t ⟧↑) a b → Category._⇒_ (proj₁ ⟦ t ⟧↑) a b → Set HomEq (↑ x) a b h1 h2 = ⊤ -- this is basically proof-irrelevance h1 h2 HomEq (# S x) a b h1 h2 = ⊤ -- because h1 and h2 are the exact same ⇔ HomEq (1/ S x) tt tt h1 h2 = interp h1 ⇔ interp h2 -- here! HomEq (s ⊞ t) (inj₁ x) (inj₁ x₁) h1 h2 = HomEq s x x₁ h1 h2 HomEq (s ⊞ t) (inj₁ x) (inj₂ y) (Level.lift ()) h2 HomEq (s ⊞ t) (inj₂ y) (inj₁ x) (Level.lift ()) h2 HomEq (s ⊞ t) (inj₂ y) (inj₂ y₁) h1 h2 = HomEq t y y₁ h1 h2 HomEq (s ⊠ t) (a , b) (c , d) (a⇒c , b⇒d) (a⇒c' , b⇒d') = HomEq s a c a⇒c a⇒c' × HomEq t b d b⇒d b⇒d' -- W equivalence; note that transp is restricted to be the Homs of cat -- we might want to restrict that more. record _≈W_ {t : U↑} (a : W t) (b : W t) : Set where constructor weq cat = proj₁ ⟦ t ⟧↑ gpd = proj₂ ⟦ t ⟧↑ _∘_ = Category._∘_ cat field pt-eq : ObjEq t (W.pt a) (W.pt b) transp : Category._⇒_ cat (W.pt a) (W.pt b) auto-eq : HomEq t (W.pt a) (W.pt b) (W.auto b ∘ (transp ∘ (W.auto a))) transp
36.441327
176
0.539167
04848c2723325f143154cca056c75368f166e63e
7,363
agda
Agda
src/FOmegaInt/Kinding/Canonical/Validity.agda
sstucki/f-omega-int-agda
ae648c9520895a8428a7ad80f47bb55ecf4d50ea
[ "MIT" ]
12
2017-06-13T16:05:35.000Z
2021-09-27T05:53:06.000Z
src/FOmegaInt/Kinding/Canonical/Validity.agda
sstucki/f-omega-int-agda
ae648c9520895a8428a7ad80f47bb55ecf4d50ea
[ "MIT" ]
1
2021-05-14T08:09:40.000Z
2021-05-14T08:54:39.000Z
src/FOmegaInt/Kinding/Canonical/Validity.agda
sstucki/f-omega-int-agda
ae648c9520895a8428a7ad80f47bb55ecf4d50ea
[ "MIT" ]
2
2021-05-13T22:29:48.000Z
2021-05-14T10:25:05.000Z
------------------------------------------------------------------------ -- Validity of canonical kinding in Fω with interval kinds ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module FOmegaInt.Kinding.Canonical.Validity where open import Data.Product using (∃; _,_; _×_; proj₁; proj₂) open import Relation.Binary.PropositionalEquality open import FOmegaInt.Syntax open import FOmegaInt.Syntax.HereditarySubstitution open import FOmegaInt.Syntax.Normalization open import FOmegaInt.Kinding.Canonical open import FOmegaInt.Kinding.Canonical.HereditarySubstitution as HS hiding (Nf⇇-Π-e) open Syntax open ElimCtx open Substitution hiding (subst) open Kinding open WfCtxOps open ContextNarrowing ------------------------------------------------------------------------ -- Validity of canonical kinding, subkinding and subtyping. -- Validity of spine kinding: the kind of an elimination is -- well-formed, provided that the spine is well-kinded and the kind of -- the head is well-formed. Sp⇉-valid : ∀ {n} {Γ : Ctx n} {as j k} → Γ ⊢ j kd → Γ ⊢ j ⇉∙ as ⇉ k → Γ ⊢ k kd Sp⇉-valid j-kd ⇉-[] = j-kd Sp⇉-valid (kd-Π j-kd k-kd) (⇉-∷ a⇇j _ k[a]⇉as⇉l) = Sp⇉-valid (kd-/⟨⟩ k-kd (⇇-hsub a⇇j j-kd (⌊⌋-⌊⌋≡ _))) k[a]⇉as⇉l -- Validity of kinding for neutral types: the kinds of neutral types -- are well-formed. Ne∈-valid : ∀ {n} {Γ : Ctx n} {a k} → Γ ⊢Ne a ∈ k → Γ ⊢ k kd Ne∈-valid (∈-∙ x∈j j⇉as⇉k) = Sp⇉-valid (Var∈-valid x∈j) j⇉as⇉k -- Validity of spine equality. Sp≃-valid : ∀ {n} {Γ : Ctx n} {as bs j₁ j₂ k₂} → Γ ⊢ j₁ <∷ j₂ → Γ ⊢ j₂ ⇉∙ as ≃ bs ⇉ k₂ → ∃ λ k₁ → Γ ⊢ j₂ ⇉∙ as ⇉ k₂ × Γ ⊢ j₁ ⇉∙ bs ⇉ k₁ × Γ ⊢ k₁ <∷ k₂ Sp≃-valid k₁<∷k₂ ≃-[] = _ , ⇉-[] , ⇉-[] , k₁<∷k₂ Sp≃-valid (<∷-Π j₂<∷j₁ k₁<∷k₂ (kd-Π j₁-kd k₁-kd)) (≃-∷ a≃b⇇j₂ k₂[a]⇉as≃bs⇉l₂) = let j₂-kd = ≃-valid-kd a≃b⇇j₂ a⇇j₂ , b⇇j₂ = ≃-valid a≃b⇇j₂ b⇇j₁ = Nf⇇-⇑ b⇇j₂ j₂<∷j₁ k₁[b]<∷k₂[a] = <∷-/⟨⟩≃ k₁<∷k₂ (≃-hsub (≃-sym a≃b⇇j₂) (⌊⌋-⌊⌋≡ _)) l₁ , k₂[a]⇉as⇉l₂ , k₁[b]⇉bs⇉l₁ , l₁<∷l₂ = Sp≃-valid k₁[b]<∷k₂[a] k₂[a]⇉as≃bs⇉l₂ in l₁ , ⇉-∷ a⇇j₂ j₂-kd k₂[a]⇉as⇉l₂ , ⇉-∷ b⇇j₁ j₁-kd (subst (λ k → _ ⊢ _ Kind[ _ ∈ k ] ⇉∙ _ ⇉ l₁) (<∷-⌊⌋ j₂<∷j₁) k₁[b]⇉bs⇉l₁) , l₁<∷l₂ -- Validity of subkinding and subtyping: well-formed subkinds -- resp. well-kinded subtypes are also well-formed resp. well-kinded. mutual <∷-valid : ∀ {n} {Γ : Ctx n} {j k} → Γ ⊢ j <∷ k → Γ ⊢ j kd × Γ ⊢ k kd <∷-valid (<∷-⋯ a₂<:a₁ b₁<:b₂) = let a₂⇉a₂⋯a₂ , a₁⇉a₁⋯a₁ = <:-valid a₂<:a₁ b₁⇉b₁⋯b₁ , b₂⇉b₂⋯b₂ = <:-valid b₁<:b₂ in kd-⋯ a₁⇉a₁⋯a₁ b₁⇉b₁⋯b₁ , kd-⋯ a₂⇉a₂⋯a₂ b₂⇉b₂⋯b₂ <∷-valid (<∷-Π j₂<∷j₁ k₁<∷k₂ Πj₁k₁-kd) = let j₂-kd , j₁-kd = <∷-valid j₂<∷j₁ k₁-kd , k₂-kd = <∷-valid k₁<∷k₂ in Πj₁k₁-kd , kd-Π j₂-kd k₂-kd <:-valid : ∀ {n} {Γ : Ctx n} {a b} → Γ ⊢ a <: b → Γ ⊢Nf a ⇉ a ⋯ a × Γ ⊢Nf b ⇉ b ⋯ b <:-valid (<:-trans a<:b b<:c) = proj₁ (<:-valid a<:b) , proj₂ (<:-valid b<:c) <:-valid (<:-⊥ a⇉a⋯a) = ⇉-⊥-f (Nf⇉-ctx a⇉a⋯a) , a⇉a⋯a <:-valid (<:-⊤ a⇉a⋯a) = a⇉a⋯a , ⇉-⊤-f (Nf⇉-ctx a⇉a⋯a) <:-valid (<:-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁) = let k₂-kd , k₁-kd = <∷-valid k₂<∷k₁ a₁⇉a₁⋯a₁ , a₂⇉a₂⋯a₂ = <:-valid a₁<:a₂ in Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁ , ⇉-∀-f k₂-kd a₂⇉a₂⋯a₂ <:-valid (<:-→ a₂<:a₁ b₁<:b₂) = let a₂⇉a₂⋯a₂ , a₁⇉a₁⋯a₁ = <:-valid a₂<:a₁ b₁⇉b₁⋯b₁ , b₂⇉b₂⋯b₂ = <:-valid b₁<:b₂ in ⇉-→-f a₁⇉a₁⋯a₁ b₁⇉b₁⋯b₁ , ⇉-→-f a₂⇉a₂⋯a₂ b₂⇉b₂⋯b₂ <:-valid (<:-∙ x∈j j⇉as≃bs⇉c⋯d) with Sp≃-valid (<∷-refl (Var∈-valid x∈j)) j⇉as≃bs⇉c⋯d <:-valid (<:-∙ x∈j j⇉as≃bs⇉c₂⋯d₂) | _ , j⇉as⇉c₂⋯d₂ , j⇉bs⇉c₁⋯d₁ , <∷-⋯ c₂<:c₁ d₁<:d₂ = ⇉-s-i (∈-∙ x∈j j⇉as⇉c₂⋯d₂) , ⇉-s-i (∈-∙ x∈j j⇉bs⇉c₁⋯d₁) <:-valid (<:-⟨| a∈b⋯c) with Ne∈-valid a∈b⋯c <:-valid (<:-⟨| a∈b⋯c) | kd-⋯ b⇉b⋯b _ = b⇉b⋯b , ⇉-s-i a∈b⋯c <:-valid (<:-|⟩ a∈b⋯c) with Ne∈-valid a∈b⋯c <:-valid (<:-|⟩ a∈b⋯c) | kd-⋯ _ c⇉c⋯c = ⇉-s-i a∈b⋯c , c⇉c⋯c -- Validity of kind checking: if a normal type checks against a kind, -- then that kind is well-formed. Nf⇇-valid : ∀ {n} {Γ : Ctx n} {a k} → Γ ⊢Nf a ⇇ k → Γ ⊢ k kd Nf⇇-valid (⇇-⇑ a⇉j j<∷k) = proj₂ (<∷-valid j<∷k) ------------------------------------------------------------------------ -- Some corollaries of validity -- The checked kinds of subtypes are well-formed. <:⇇-valid-kd : ∀ {n} {Γ : Ctx n} {a b k} → Γ ⊢ a <: b ⇇ k → Γ ⊢ k kd <:⇇-valid-kd a<:b⇇k = Nf⇇-valid (proj₁ (<:⇇-valid a<:b⇇k)) -- Canonical kinding of applications is admissible (strong version). Nf⇇-Π-e : ∀ {n} {Γ : Ctx n} {a b j k} → Γ ⊢Nf a ⇇ Π j k → Γ ⊢Nf b ⇇ j → Γ ⊢Nf a ⌜·⌝⟨ ⌊ Π j k ⌋ ⟩ b ⇇ k Kind[ b ∈ ⌊ j ⌋ ] Nf⇇-Π-e a⇇Πjk b⇇j = HS.Nf⇇-Π-e a⇇Πjk b⇇j (Nf⇇-valid b⇇j) (⌊⌋-⌊⌋≡ _) -- Canonical subtyping of applications is admissible. <:-⌜·⌝ : ∀ {n} {Γ : Ctx n} {a₁ a₂ b₁ b₂ j k} → Γ ⊢ a₁ <: a₂ ⇇ Π j k → Γ ⊢ b₁ ≃ b₂ ⇇ j → Γ ⊢ a₁ ⌜·⌝⟨ ⌊ Π j k ⌋ ⟩ b₁ <: a₂ ⌜·⌝⟨ ⌊ Π j k ⌋ ⟩ b₂ ⇇ k Kind[ b₁ ∈ ⌊ j ⌋ ] <:-⌜·⌝ a₁<:a₂⇇Πjk b₁≃b₂⇇j with <:⇇-valid-kd a₁<:a₂⇇Πjk <:-⌜·⌝ (<:-λ a₁<:a₂⇇k Λj₁a₁⇇Πjk Λj₂a₂⇇Πjk) b₁≃b₂⇇j | (kd-Π _ k-kd) = <:⇇-/⟨⟩≃ a₁<:a₂⇇k k-kd (≃-hsub b₁≃b₂⇇j (⌊⌋-⌊⌋≡ _)) -- Subtyping of proper types checks against the kind of proper types. <:-⋯-* : ∀ {n} {Γ : Ctx n} {a b} → Γ ⊢ a <: b → Γ ⊢ a <: b ⇇ ⌜*⌝ <:-⋯-* a<:b with <:-valid a<:b <:-⋯-* a<:b | a⇉a⋯a , b⇉b⋯b = <:-⇇ (Nf⇉-⋯-* a⇉a⋯a) (Nf⇉-⋯-* b⇉b⋯b) a<:b -- Some commonly used (hereditary) substitution lemmas. kd-[] : ∀ {n} {Γ : Ctx n} {a j k} → kd k ∷ Γ ⊢ j kd → Γ ⊢Nf a ⇇ k → Γ ⊢ j Kind[ a ∈ ⌊ k ⌋ ] kd kd-[] j-kd a⇇k = kd-/⟨⟩ j-kd (⇇-hsub a⇇k (Nf⇇-valid a⇇k) (⌊⌋-⌊⌋≡ _)) Nf⇇-[] : ∀ {n} {Γ : Ctx n} {a b j k} → kd j ∷ Γ ⊢Nf a ⇇ k → Γ ⊢Nf b ⇇ j → Γ ⊢Nf a [ b ∈ ⌊ j ⌋ ] ⇇ k Kind[ b ∈ ⌊ j ⌋ ] Nf⇇-[] a⇇k b⇇j = Nf⇇-/⟨⟩ a⇇k (⇇-hsub b⇇j (Nf⇇-valid b⇇j) (⌊⌋-⌊⌋≡ _)) <∷-[≃] : ∀ {n} {Γ : Ctx n} {j k₁ k₂ a₁ a₂} → kd j ∷ Γ ⊢ k₁ <∷ k₂ → Γ ⊢ a₁ ≃ a₂ ⇇ j → Γ ⊢ k₁ Kind[ a₁ ∈ ⌊ j ⌋ ] <∷ k₂ Kind[ a₂ ∈ ⌊ j ⌋ ] <∷-[≃] k₁<∷k₂ a₁≃a₂⇇j = <∷-/⟨⟩≃ k₁<∷k₂ (≃-hsub a₁≃a₂⇇j (⌊⌋-⌊⌋≡ _)) <:-[≃] : ∀ {n} {Γ : Ctx n} {a₁ a₂ b₁ b₂ j k} → kd j ∷ Γ ⊢ a₁ <: a₂ ⇇ k → Γ ⊢ b₁ ≃ b₂ ⇇ j → Γ ⊢ a₁ [ b₁ ∈ ⌊ j ⌋ ] <: a₂ [ b₂ ∈ ⌊ j ⌋ ] ⇇ k Kind[ b₁ ∈ ⌊ j ⌋ ] <:-[≃] a₁<:a₂⇇k b₁≃b₂⇇j = <:⇇-/⟨⟩≃ a₁<:a₂⇇k (<:⇇-valid-kd a₁<:a₂⇇k) (≃-hsub b₁≃b₂⇇j (⌊⌋-⌊⌋≡ _)) -- Another admissible kinding rule for applications. Nf⇇-Π-e′ : ∀ {n} {Γ : Ctx n} {a b j k} → Γ ⊢Nf a ⇇ Π j k → Γ ⊢Nf b ⇇ j → Γ ⊢Nf a ↓⌜·⌝ b ⇇ k Kind[ b ∈ ⌊ j ⌋ ] Nf⇇-Π-e′ {b = b} (⇇-⇑ (⇉-Π-i {_} {a₁} j₁-kd a⇉k₁) (<∷-Π j₂<∷j₁ k₁<∷k₂ Πj₁k₁-kd)) b⇇j₂ = subst (_ ⊢Nf_⇇ _) (cong (a₁ [ b ∈_]) (<∷-⌊⌋ j₂<∷j₁)) (Nf⇇-[] (⇇-⇑ (⇓-Nf⇉ (Nf⇇-valid b⇇j₂) j₂<∷j₁ a⇉k₁) k₁<∷k₂) b⇇j₂) -- Another admissible subtyping rule for applications. <:-↓⌜·⌝ : ∀ {n} {Γ : Ctx n} {a₁ a₂ b₁ b₂ j k} → Γ ⊢ a₁ <: a₂ ⇇ Π j k → Γ ⊢ b₁ ≃ b₂ ⇇ j → Γ ⊢ a₁ ↓⌜·⌝ b₁ <: a₂ ↓⌜·⌝ b₂ ⇇ k Kind[ b₁ ∈ ⌊ j ⌋ ] <:-↓⌜·⌝ {b₁ = b₁} {b₂} (<:-λ a₁<:a₂⇇k (⇇-⇑ (⇉-Π-i {_} {a₁} _ _) (<∷-Π j₁<∷j _ _)) (⇇-⇑ (⇉-Π-i {_} {a₂} _ _) (<∷-Π j₂<∷j _ _))) b₁≃b₂⇇j = subst₂ (_ ⊢_<:_⇇ _) (cong (a₁ [ b₁ ∈_]) (<∷-⌊⌋ j₁<∷j)) (cong (a₂ [ b₂ ∈_]) (<∷-⌊⌋ j₂<∷j)) (<:-[≃] a₁<:a₂⇇k b₁≃b₂⇇j)
39.374332
80
0.448187
043d9ec7d5f7c24bf6dc6294e8315bcc95a6da23
242
agda
Agda
test/Fail/Issue3314.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Fail/Issue3314.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Fail/Issue3314.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
{-# OPTIONS --cubical #-} open import Agda.Primitive.Cubical open import Agda.Builtin.Cubical.Path data S1 : Set where base : S1 loop : base ≡ base postulate weird : S1 → I bad : (x : S1) → I bad base = {!!} bad (loop x) = {!!}
15.125
37
0.607438
1ec6629994098539eaf7ba3dc8109cfba7366fa3
631
agda
Agda
test/asset/agda-stdlib-1.0/Codata/Covec/Categorical.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
5
2020-10-07T12:07:53.000Z
2020-10-10T21:41:32.000Z
test/asset/agda-stdlib-1.0/Codata/Covec/Categorical.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Codata/Covec/Categorical.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
1
2021-11-04T06:54:45.000Z
2021-11-04T06:54:45.000Z
------------------------------------------------------------------------ -- The Agda standard library -- -- A categorical view of Covec ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe --sized-types #-} module Codata.Covec.Categorical where open import Codata.Conat open import Codata.Covec open import Category.Functor open import Category.Applicative functor : ∀ {ℓ i n} → RawFunctor {ℓ} (λ A → Covec A n i) functor = record { _<$>_ = map } applicative : ∀ {ℓ i n} → RawApplicative {ℓ} (λ A → Covec A n i) applicative = record { pure = replicate _ ; _⊛_ = ap }
25.24
72
0.51664
416d37ce5076d1c196186a6352222e34b9220f82
865
agda
Agda
src/fot/FOTC/Program/SortList/Properties/Totality/OrdList/FlattenI.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
11
2015-09-03T20:53:42.000Z
2021-09-12T16:09:54.000Z
src/fot/FOTC/Program/SortList/Properties/Totality/OrdList/FlattenI.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
2
2016-10-12T17:28:16.000Z
2017-01-01T14:34:26.000Z
src/fot/FOTC/Program/SortList/Properties/Totality/OrdList/FlattenI.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
3
2016-09-19T14:18:30.000Z
2018-03-14T08:50:00.000Z
------------------------------------------------------------------------------ -- Totality properties respect to OrdList (flatten-OrdList-helper) ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOTC.Program.SortList.Properties.Totality.OrdList.FlattenI where open import FOTC.Base open import FOTC.Data.Nat.Type open import FOTC.Program.SortList.SortList ------------------------------------------------------------------------------ -- See the combined proof. postulate flatten-OrdList-helper : ∀ {t₁ i t₂} → Tree t₁ → N i → Tree t₂ → OrdTree (node t₁ i t₂) → ≤-Lists (flatten t₁) (flatten t₂)
39.318182
78
0.442775
c76f8bcad5918943f2ec2652ad95e02f72c75275
25,254
agda
Agda
Definition/LogicalRelation/Properties/Conversion.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
2
2018-06-21T08:39:01.000Z
2022-01-17T16:13:53.000Z
Definition/LogicalRelation/Properties/Conversion.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
null
null
null
Definition/LogicalRelation/Properties/Conversion.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
2
2022-01-26T14:55:51.000Z
2022-02-15T19:42:19.000Z
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Properties.Conversion {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Typed open import Definition.Typed.RedSteps open import Definition.Typed.Reduction import Definition.Typed.Weakening as W open import Definition.Typed.Properties open import Definition.LogicalRelation open import Definition.LogicalRelation.ShapeView open import Definition.LogicalRelation.Irrelevance open import Tools.Product import Tools.PropositionalEquality as PE import Data.Fin as Fin import Data.Nat as Nat -- Conversion of syntactic reduction closures. convRed:*: : ∀ {t u A B Γ l} → Γ ⊢ t :⇒*: u ∷ A ^ l → Γ ⊢ A ≡ B ^ [ ! , l ] → Γ ⊢ t :⇒*: u ∷ B ^ l convRed:*: [[ ⊢t , ⊢u , d ]] A≡B = [[ conv ⊢t A≡B , conv ⊢u A≡B , conv* d A≡B ]] -- helper functions for the universe convTermTUniv : ∀ {Γ A B t l l' r ll l< d r' ll' l<' el' d'} (er : r PE.≡ r') (ellll' : ll PE.≡ ll') → Γ ⊩⟨ l ⟩ t ∷ A ^ [ ! , next ll ] / Uᵣ (Uᵣ r ll l< PE.refl d) → Γ ⊩⟨ l' ⟩ t ∷ B ^ [ ! , next ll ] / Uᵣ (Uᵣ r' ll' l<' el' d') convTermTUniv {l< = l<} {l<' = l<'} {d' = d'} er ellll' (Uₜ K d typeK K≡K [t]) = let dd = PE.subst (λ x → _ ⊢ _ :⇒*: Univ x _ ^ _) (PE.sym er) (PE.subst (λ x → _ ⊢ _ :⇒*: Univ _ x ^ [ ! , next x ]) (PE.sym ellll') d') in reduction-irrelevant-Univ {l< = l<} {l<' = l<'} {el = PE.refl} {D = dd} {D' = d'} er (Uₜ K d typeK K≡K [t]) convEqTermTUniv : ∀ {Γ A B t u l r ll l< d dd} → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ [ ! , next ll ] / Uᵣ (Uᵣ r ll l< PE.refl d) → Γ ⊩⟨ l ⟩ t ≡ u ∷ B ^ [ ! , next ll ] / Uᵣ (Uᵣ r ll l< PE.refl dd) convEqTermTUniv {l = ι ¹} {r = r} {⁰} (Uₜ₌ [t] [u] A≡B [t≡u]) = Uₜ₌ (convTermTUniv PE.refl PE.refl [t]) (convTermTUniv PE.refl PE.refl [u]) A≡B [t≡u] convEqTermTUniv {l = ∞} {r = r} {¹} (Uₜ₌ [t] [u] A≡B [t≡u]) = Uₜ₌ (convTermTUniv PE.refl PE.refl [t]) (convTermTUniv PE.refl PE.refl [u]) A≡B [t≡u] mutual -- Helper function for conversion of terms converting from left to right. convTermT₁ : ∀ {Γ A B r t l l′} {[A] : Γ ⊩⟨ l ⟩ A ^ r} {[B] : Γ ⊩⟨ l′ ⟩ B ^ r} → ShapeView Γ l l′ A B r r [A] [B] → Γ ⊩⟨ l ⟩ A ≡ B ^ r / [A] → Γ ⊩⟨ l ⟩ t ∷ A ^ r / [A] → Γ ⊩⟨ l′ ⟩ t ∷ B ^ r / [B] convTermT₁ (ℕᵥ D D′) A≡B t = t convTermT₁ (Emptyᵥ D D′) A≡B t = t convTermT₁ {r = [ ! , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ k d (neNfₜ neK₂ ⊢k k≡k)) = let K≡K₁ = PE.subst (λ x → _ ⊢ _ ≡ x ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (≅-eq (~-to-≅ K≡M)) in neₜ k (convRed:*: d K≡K₁) (neNfₜ neK₂ (conv ⊢k K≡K₁) (~-conv k≡k K≡K₁)) convTermT₁ {r = [ % , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ d) = let K≡K₁ = PE.subst (λ x → _ ⊢ _ ≡ x ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (≅-eq (~-to-≅ K≡M)) in neₜ (conv d (reduction (red D) (red D₁) (ne neK) (ne neK₁) K≡K₁)) convTermT₁ {Γ = Γ} {r = [ ! , ι ll ]} (Πᵥ (Πᵣ rF lF lG _ _ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ _ _ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (Πₜ f d funcF f≡f [f] [f]₁) = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) F₁≡F′ , rF₁≡rF′ , lF₁≡lF′ , G₁≡G′ , lG₁≡lG′ , lΠ≡lΠ₁ = Π-PE-injectivity ΠF₁G₁≡ΠF′G′ ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ ! , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in Πₜ f (convRed:*: d ΠFG≡ΠF₁G₁) funcF (≅-conv f≡f ΠFG≡ΠF₁G₁) (λ {ρ} [ρ] ⊢Δ [a] [b] [a≡b] → let [F≡F₁] = irrelevanceEqR′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ) [a]₁ = convTerm₂′ PE.refl (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a] [b]₁ = convTerm₂′ PE.refl (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [b] [a≡b]₁ = convEqTerm₂′ (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a≡b] [G≡G₁] = irrelevanceEqR′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′)) ([G] [ρ] ⊢Δ [a]₁) ([G≡G′] [ρ] ⊢Δ [a]₁) in convEqTerm₁′ PE.refl (PE.cong ι (PE.sym lG₁≡lG′)) ([G] [ρ] ⊢Δ [a]₁) ([G]₁ [ρ] ⊢Δ [a]) [G≡G₁] ([f] [ρ] ⊢Δ [a]₁ [b]₁ [a≡b]₁)) (λ {ρ} [ρ] ⊢Δ [a] → let [F≡F₁] = irrelevanceEqR′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ) [a]₁ = convTerm₂′ PE.refl (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a] [G≡G₁] = irrelevanceEqR′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′)) ([G] [ρ] ⊢Δ [a]₁) ([G≡G′] [ρ] ⊢Δ [a]₁) in convTerm₁′ PE.refl (PE.cong ι (PE.sym lG₁≡lG′)) ([G] [ρ] ⊢Δ [a]₁) ([G]₁ [ρ] ⊢Δ [a]) [G≡G₁] ([f]₁ [ρ] ⊢Δ [a]₁)) convTermT₁ {Γ = Γ} {r = [ % , ι ll ]} (Πᵥ (Πᵣ rF lF lG _ _ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ _ _ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) d = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) F₁≡F′ , rF₁≡rF′ , lF₁≡lF′ , G₁≡G′ , lG₁≡lG′ = Π-PE-injectivity ΠF₁G₁≡ΠF′G′ ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ % , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in conv d ΠFG≡ΠF₁G₁ convTermT₁ {Γ = Γ} {r = [ % , ll ]} (∃ᵥ (∃ᵣ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (∃ᵣ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (∃₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) d = let ∃F₁G₁≡∃F′G′ = whrDet* (red D₁ , ∃ₙ) (D′ , ∃ₙ) F₁≡F′ , G₁≡G′ = ∃-PE-injectivity ∃F₁G₁≡∃F′G′ ∃FG≡∃F₁G₁ = PE.subst (λ x → Γ ⊢ ∃ F ▹ G ≡ x ^ [ % , ll ]) (PE.sym ∃F₁G₁≡∃F′G′) (≅-eq A≡B) in conv d ∃FG≡∃F₁G₁ convTermT₁ (Uᵥ (Uᵣ r l l< PE.refl d) (Uᵣ r' l' l<' el' d')) A≡B X = let U≡U = whrDet* (A≡B , Uₙ) (red d' , Uₙ) r≡r , l≡l = Univ-PE-injectivity U≡U in convTermTUniv r≡r l≡l X convTermT₁ (emb⁰¹ X) A≡B t = convTermT₁ X A≡B t convTermT₁ (emb¹⁰ X) A≡B t = convTermT₁ X A≡B t convTermT₁ (emb¹∞ X) A≡B t = convTermT₁ X A≡B t convTermT₁ (emb∞¹ X) A≡B t = convTermT₁ X A≡B t -- Helper function for conversion of terms converting from right to left. convTermT₂ : ∀ {l l′ Γ A B r t} {[A] : Γ ⊩⟨ l ⟩ A ^ r} {[B] : Γ ⊩⟨ l′ ⟩ B ^ r} → ShapeView Γ l l′ A B r r [A] [B] → Γ ⊩⟨ l ⟩ A ≡ B ^ r / [A] → Γ ⊩⟨ l′ ⟩ t ∷ B ^ r / [B] → Γ ⊩⟨ l ⟩ t ∷ A ^ r / [A] convTermT₂ (ℕᵥ D D′) A≡B t = t convTermT₂ (Emptyᵥ D D′) A≡B t = t convTermT₂ {r = [ ! , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ k d (neNfₜ neK₂ ⊢k k≡k)) = let K₁≡K = PE.subst (λ x → _ ⊢ x ≡ _ ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (sym (≅-eq (~-to-≅ K≡M))) in neₜ k (convRed:*: d K₁≡K) (neNfₜ neK₂ (conv ⊢k K₁≡K) (~-conv k≡k K₁≡K)) convTermT₂ {r = [ % , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ d) = let K₁≡K = PE.subst (λ x → _ ⊢ x ≡ _ ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (sym (≅-eq (~-to-≅ K≡M))) in neₜ (conv d (reduction (red D₁) (red D) (ne neK₁) (ne neK) K₁≡K)) convTermT₂ {Γ = Γ} {r = [ ! , ι ll ]} (Πᵥ (Πᵣ rF lF lG _ _ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ _ _ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (Πₜ f d funcF f≡f [f] [f]₁) = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) F₁≡F′ , rF₁≡rF′ , lF₁≡lF′ , G₁≡G′ , lG₁≡lG′ , lΠ≡lΠ₁ = Π-PE-injectivity ΠF₁G₁≡ΠF′G′ ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ ! , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in Πₜ f (convRed:*: d (sym ΠFG≡ΠF₁G₁)) funcF (≅-conv f≡f (sym ΠFG≡ΠF₁G₁)) (λ {ρ} [ρ] ⊢Δ [a] [b] [a≡b] → let [F≡F₁] = irrelevanceEqR′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ) [a]₁ = convTerm₁′ (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a] [b]₁ = convTerm₁′ (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [b] [a≡b]₁ = convEqTerm₁′ (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a≡b] [G≡G₁] = irrelevanceEqR′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′)) ([G] [ρ] ⊢Δ [a]) ([G≡G′] [ρ] ⊢Δ [a]) in convEqTerm₂′ PE.refl (PE.cong ι (PE.sym lG₁≡lG′)) ([G] [ρ] ⊢Δ [a]) ([G]₁ [ρ] ⊢Δ [a]₁) [G≡G₁] ([f] [ρ] ⊢Δ [a]₁ [b]₁ [a≡b]₁)) (λ {ρ} [ρ] ⊢Δ [a] → let [F≡F₁] = irrelevanceEqR′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ) [a]₁ = convTerm₁′ (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a] [G≡G₁] = irrelevanceEqR′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′)) ([G] [ρ] ⊢Δ [a]) ([G≡G′] [ρ] ⊢Δ [a]) in convTerm₂′ PE.refl PE.refl (PE.cong ι (PE.sym lG₁≡lG′)) ([G] [ρ] ⊢Δ [a]) ([G]₁ [ρ] ⊢Δ [a]₁) [G≡G₁] ([f]₁ [ρ] ⊢Δ [a]₁)) convTermT₂ {Γ = Γ} {r = [ % , ι ll ]} (Πᵥ (Πᵣ rF lF lG _ _ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ _ _ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) d = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) F₁≡F′ , rF₁≡rF′ , lF₁≡lF′ , G₁≡G′ , lG₁≡lG′ = Π-PE-injectivity ΠF₁G₁≡ΠF′G′ ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ % , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in conv d (sym ΠFG≡ΠF₁G₁) convTermT₂ {Γ = Γ} {r = [ % , ll ]} (∃ᵥ (∃ᵣ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (∃ᵣ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (∃₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) d = let ∃F₁G₁≡∃F′G′ = whrDet* (red D₁ , ∃ₙ) (D′ , ∃ₙ) F₁≡F′ , G₁≡G′ = ∃-PE-injectivity ∃F₁G₁≡∃F′G′ ∃FG≡∃F₁G₁ = PE.subst (λ x → Γ ⊢ ∃ F ▹ G ≡ x ^ [ % , ll ]) (PE.sym ∃F₁G₁≡∃F′G′) (≅-eq A≡B) in conv d (sym ∃FG≡∃F₁G₁) convTermT₂ (Uᵥ (Uᵣ r l l< el d) (Uᵣ r' l' l<' PE.refl d')) A≡B X = let U≡U = whrDet* (A≡B , Uₙ) (red d' , Uₙ) r≡r , l≡l = Univ-PE-injectivity U≡U in convTermTUniv (PE.sym r≡r) (PE.sym l≡l) X convTermT₂ (emb⁰¹ X) A≡B t = convTermT₂ X A≡B t convTermT₂ (emb¹⁰ X) A≡B t = convTermT₂ X A≡B t convTermT₂ (emb¹∞ X) A≡B t = convTermT₂ X A≡B t convTermT₂ (emb∞¹ X) A≡B t = convTermT₂ X A≡B t -- Conversion of terms converting from left to right. convTerm₁ : ∀ {Γ A B r ll t l l′} ([A] : Γ ⊩⟨ l ⟩ A ^ [ r , ll ]) ([B] : Γ ⊩⟨ l′ ⟩ B ^ [ r , ll ]) → Γ ⊩⟨ l ⟩ A ≡ B ^ [ r , ll ] / [A] → Γ ⊩⟨ l ⟩ t ∷ A ^ [ r , ll ] / [A] → Γ ⊩⟨ l′ ⟩ t ∷ B ^ [ r , ll ] / [B] convTerm₁ [A] [B] A≡B t = convTermT₁ (goodCases [A] [B] A≡B) A≡B t -- Conversion of terms converting from left to right. with PE convTerm₁′ : ∀ {Γ A B r r' ll ll' t l l′} (eq : r PE.≡ r') (eql : ll PE.≡ ll') ([A] : Γ ⊩⟨ l ⟩ A ^ [ r , ll ]) ([B] : Γ ⊩⟨ l′ ⟩ B ^ [ r' , ll' ]) → Γ ⊩⟨ l ⟩ A ≡ B ^ [ r , ll ] / [A] → Γ ⊩⟨ l ⟩ t ∷ A ^ [ r , ll ] / [A] → Γ ⊩⟨ l′ ⟩ t ∷ B ^ [ r' , ll' ] / [B] convTerm₁′ PE.refl PE.refl [A] [B] A≡B t = convTerm₁ [A] [B] A≡B t -- Conversion of terms converting from right to left. convTerm₂ : ∀ {Γ A B r t l l′} ([A] : Γ ⊩⟨ l ⟩ A ^ r) ([B] : Γ ⊩⟨ l′ ⟩ B ^ r) → Γ ⊩⟨ l ⟩ A ≡ B ^ r / [A] → Γ ⊩⟨ l′ ⟩ t ∷ B ^ r / [B] → Γ ⊩⟨ l ⟩ t ∷ A ^ r / [A] convTerm₂ [A] [B] A≡B t = convTermT₂ (goodCases [A] [B] A≡B) A≡B t -- Conversion of terms converting from right to left -- with some propsitionally equal types. convTerm₂′ : ∀ {Γ A r r' ll ll' B B′ t l l′} → B PE.≡ B′ → r PE.≡ r' → ll PE.≡ ll' → ([A] : Γ ⊩⟨ l ⟩ A ^ [ r , ll ] ) ([B] : Γ ⊩⟨ l′ ⟩ B ^ [ r' , ll' ]) → Γ ⊩⟨ l ⟩ A ≡ B′ ^ [ r , ll ] / [A] → Γ ⊩⟨ l′ ⟩ t ∷ B ^ [ r' , ll' ] / [B] → Γ ⊩⟨ l ⟩ t ∷ A ^ [ r , ll ] / [A] convTerm₂′ PE.refl PE.refl PE.refl [A] [B] A≡B t = convTerm₂ [A] [B] A≡B t -- Helper function for conversion of term equality converting from left to right. convEqTermT₁ : ∀ {l l′ Γ A B r t u} {[A] : Γ ⊩⟨ l ⟩ A ^ r} {[B] : Γ ⊩⟨ l′ ⟩ B ^ r} → ShapeView Γ l l′ A B r r [A] [B] → Γ ⊩⟨ l ⟩ A ≡ B ^ r / [A] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ r / [A] → Γ ⊩⟨ l′ ⟩ t ≡ u ∷ B ^ r / [B] convEqTermT₁ (ℕᵥ D D′) A≡B t≡u = t≡u convEqTermT₁ (Emptyᵥ D D′) A≡B t≡u = t≡u convEqTermT₁ {r = [ ! , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ₌ k m d d′ (neNfₜ₌ neK₂ neM₁ k≡m)) = let K≡K₁ = PE.subst (λ x → _ ⊢ _ ≡ x ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (≅-eq (~-to-≅ K≡M)) in neₜ₌ k m (convRed:*: d K≡K₁) (convRed:*: d′ K≡K₁) (neNfₜ₌ neK₂ neM₁ (~-conv k≡m K≡K₁)) convEqTermT₁ {r = [ % , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ₌ d d′) = let K≡K₁ = PE.subst (λ x → _ ⊢ _ ≡ x ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (≅-eq (~-to-≅ K≡M)) in neₜ₌ (conv d (reduction (red D) (red D₁) (ne neK) (ne neK₁) K≡K₁)) (conv d′ (reduction (red D) (red D₁) (ne neK) (ne neK₁) K≡K₁)) convEqTermT₁ {Γ = Γ} {r = [ ! , ι ll ]} (Πᵥ (Πᵣ rF lF lG lF≤ lG≤ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ lF₁≤ lG₁≤ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (Πₜ₌ f g d d′ funcF funcG t≡u [t] [u] [t≡u]) = let [A] = Πᵣ′ rF lF lG lF≤ lG≤ F G D ⊢F ⊢G A≡A [F] [G] G-ext [B] = Πᵣ′ rF₁ lF₁ lG₁ lF₁≤ lG₁≤ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁ [A≡B] = Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′] ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ ! , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in Πₜ₌ f g (convRed:*: d ΠFG≡ΠF₁G₁) (convRed:*: d′ ΠFG≡ΠF₁G₁) funcF funcG (≅-conv t≡u ΠFG≡ΠF₁G₁) (convTerm₁ [A] [B] [A≡B] [t]) (convTerm₁ [A] [B] [A≡B] [u]) (λ {ρ} [ρ] ⊢Δ [a] → let F₁≡F′ , rF₁≡rF′ , lF₁≡lF′ , G₁≡G′ , lG₁≡lG′ , lΠ≡lΠ₁ = Π-PE-injectivity (whrDet* (red D₁ , Πₙ) (D′ , Πₙ)) [F≡F₁] = irrelevanceEqR′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ) [a]₁ = convTerm₂′ PE.refl (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a] [G≡G₁] = irrelevanceEqR′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′)) ([G] [ρ] ⊢Δ [a]₁) ([G≡G′] [ρ] ⊢Δ [a]₁) in convEqTerm₁′ PE.refl (PE.cong ι (PE.sym lG₁≡lG′)) ([G] [ρ] ⊢Δ [a]₁) ([G]₁ [ρ] ⊢Δ [a]) [G≡G₁] ([t≡u] [ρ] ⊢Δ [a]₁)) convEqTermT₁ {Γ = Γ} {r = [ % , ι ll ]} (Πᵥ (Πᵣ rF lF lG _ _ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ _ _ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (d , d′) = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ % , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in conv d ΠFG≡ΠF₁G₁ , conv d′ ΠFG≡ΠF₁G₁ convEqTermT₁ {Γ = Γ} {r = [ % , ll ]} (∃ᵥ (∃ᵣ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (∃ᵣ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (∃₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (d , d′) = let ∃F₁G₁≡∃F′G′ = whrDet* (red D₁ , ∃ₙ) (D′ , ∃ₙ) ∃FG≡∃F₁G₁ = PE.subst (λ x → Γ ⊢ ∃ F ▹ G ≡ x ^ [ % , ll ]) (PE.sym ∃F₁G₁≡∃F′G′) (≅-eq A≡B) in (conv d ∃FG≡∃F₁G₁) , conv d′ ∃FG≡∃F₁G₁ convEqTermT₁ (Uᵥ (Uᵣ r ll l< PE.refl d) (Uᵣ r' ll' l<' el' d')) A≡B X = let U≡U = whrDet* (A≡B , Uₙ) (red d' , Uₙ) r≡r , l≡l = Univ-PE-injectivity U≡U dd = PE.subst (λ x → _ ⊢ _ :⇒*: Univ x _ ^ _) (PE.sym r≡r) (PE.subst (λ x → _ ⊢ _ :⇒*: Univ _ x ^ [ ! , next x ]) (PE.sym l≡l) d') in reduction-irrelevant-Univ= {l< = l<} {l<' = l<'} {el = PE.refl} {el' = el'} {D = dd} {D' = d'} r≡r (convEqTermTUniv X) convEqTermT₁ (emb⁰¹ X) A≡B t≡u = convEqTermT₁ X A≡B t≡u convEqTermT₁ (emb¹⁰ X) A≡B t≡u = convEqTermT₁ X A≡B t≡u convEqTermT₁ (emb¹∞ X) A≡B t≡u = convEqTermT₁ X A≡B t≡u convEqTermT₁ (emb∞¹ X) A≡B t≡u = convEqTermT₁ X A≡B t≡u -- Helper function for conversion of term equality converting from right to left. convEqTermT₂ : ∀ {l l′ Γ A B t u r} {[A] : Γ ⊩⟨ l ⟩ A ^ r} {[B] : Γ ⊩⟨ l′ ⟩ B ^ r} → ShapeView Γ l l′ A B r r [A] [B] → Γ ⊩⟨ l ⟩ A ≡ B ^ r / [A] → Γ ⊩⟨ l′ ⟩ t ≡ u ∷ B ^ r / [B] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ r / [A] convEqTermT₂ (ℕᵥ D D′) A≡B t≡u = t≡u convEqTermT₂ (Emptyᵥ D D′) A≡B t≡u = t≡u convEqTermT₂ {r = [ ! , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ₌ k m d d′ (neNfₜ₌ neK₂ neM₁ k≡m)) = let K₁≡K = PE.subst (λ x → _ ⊢ x ≡ _ ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (sym (≅-eq (~-to-≅ K≡M))) in neₜ₌ k m (convRed:*: d K₁≡K) (convRed:*: d′ K₁≡K) (neNfₜ₌ neK₂ neM₁ (~-conv k≡m K₁≡K)) convEqTermT₂ {r = [ % , ll ]} (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ne₌ M D′ neM K≡M) (neₜ₌ d d′) = let K₁≡K = PE.subst (λ x → _ ⊢ x ≡ _ ^ _) (whrDet* (red D′ , ne neM) (red D₁ , ne neK₁)) (sym (≅-eq (~-to-≅ K≡M))) in neₜ₌ (conv d (reduction (red D₁) (red D) (ne neK₁) (ne neK) K₁≡K)) (conv d′ (reduction (red D₁) (red D) (ne neK₁) (ne neK) K₁≡K)) convEqTermT₂ {Γ = Γ} {r = [ ! , ι ll ]} (Πᵥ (Πᵣ rF lF lG lF≤ lG≤ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ lF₁≤ lG₁≤ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (Πₜ₌ f g d d′ funcF funcG t≡u [t] [u] [t≡u]) = let [A] = Πᵣ′ rF lF lG lF≤ lG≤ F G D ⊢F ⊢G A≡A [F] [G] G-ext [B] = Πᵣ′ rF₁ lF₁ lG₁ lF₁≤ lG₁≤ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁ [A≡B] = Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′] ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ ! , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in Πₜ₌ f g (convRed:*: d (sym ΠFG≡ΠF₁G₁)) (convRed:*: d′ (sym ΠFG≡ΠF₁G₁)) funcF funcG (≅-conv t≡u (sym ΠFG≡ΠF₁G₁)) (convTerm₂ [A] [B] [A≡B] [t]) (convTerm₂ [A] [B] [A≡B] [u]) (λ {ρ} [ρ] ⊢Δ [a] → let F₁≡F′ , rF₁≡rF′ , lF₁≡lF′ , G₁≡G′ , lG₁≡lG′ , lΠ≡lΠ₁ = Π-PE-injectivity (whrDet* (red D₁ , Πₙ) (D′ , Πₙ)) [F≡F₁] = irrelevanceEqR′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ) [a]₁ = convTerm₁′ (PE.sym rF₁≡rF′) (PE.cong ι (PE.sym lF₁≡lF′)) ([F] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [F≡F₁] [a] [G≡G₁] = irrelevanceEqR′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′)) ([G] [ρ] ⊢Δ [a]) ([G≡G′] [ρ] ⊢Δ [a]) in convEqTerm₂′ PE.refl (PE.cong ι (PE.sym lG₁≡lG′)) ([G] [ρ] ⊢Δ [a]) ([G]₁ [ρ] ⊢Δ [a]₁) [G≡G₁] ([t≡u] [ρ] ⊢Δ [a]₁)) convEqTermT₂ {Γ = Γ} {r = [ % , ι ll ]} (Πᵥ (Πᵣ rF lF lG _ _ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ rF₁ lF₁ lG₁ _ _ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (d , d′) = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) ΠFG≡ΠF₁G₁ = PE.subst (λ x → Γ ⊢ Π F ^ rF ° lF ▹ G ° lG ° ll ≡ x ^ [ % , ι ll ]) (PE.sym ΠF₁G₁≡ΠF′G′) (≅-eq A≡B) in (conv d (sym ΠFG≡ΠF₁G₁)) , (conv d′ (sym ΠFG≡ΠF₁G₁)) convEqTermT₂ {Γ = Γ} {r = [ % , ll ]} (∃ᵥ (∃ᵣ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (∃ᵣ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (∃₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (d , d′) = let ∃F₁G₁≡∃F′G′ = whrDet* (red D₁ , ∃ₙ) (D′ , ∃ₙ) ∃FG≡∃F₁G₁ = PE.subst (λ x → Γ ⊢ ∃ F ▹ G ≡ x ^ [ % , ll ]) (PE.sym ∃F₁G₁≡∃F′G′) (≅-eq A≡B) in (conv d (sym ∃FG≡∃F₁G₁)) , (conv d′ (sym ∃FG≡∃F₁G₁)) convEqTermT₂ (Uᵥ (Uᵣ r l l< el d) (Uᵣ r' l' l<' PE.refl d')) A≡B X = let U≡U = whrDet* (A≡B , Uₙ) (red d' , Uₙ) r≡r , l≡l = Univ-PE-injectivity (PE.sym U≡U) dd = PE.subst (λ x → _ ⊢ _ :⇒*: Univ x _ ^ _) (PE.sym r≡r) (PE.subst (λ x → _ ⊢ _ :⇒*: Univ _ x ^ [ ! , next x ]) (PE.sym l≡l) d) in reduction-irrelevant-Univ= {l< = l<'} {el = PE.refl} {D = dd} {D' = d} r≡r (convEqTermTUniv X) convEqTermT₂ (emb⁰¹ X) A≡B t≡u = convEqTermT₂ X A≡B t≡u convEqTermT₂ (emb¹⁰ X) A≡B t≡u = convEqTermT₂ X A≡B t≡u convEqTermT₂ (emb¹∞ X) A≡B t≡u = convEqTermT₂ X A≡B t≡u convEqTermT₂ (emb∞¹ X) A≡B t≡u = convEqTermT₂ X A≡B t≡u -- Conversion of term equality converting from left to right. convEqTerm₁ : ∀ {l l′ Γ A B t u r} ([A] : Γ ⊩⟨ l ⟩ A ^ r) ([B] : Γ ⊩⟨ l′ ⟩ B ^ r) → Γ ⊩⟨ l ⟩ A ≡ B ^ r / [A] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ r / [A] → Γ ⊩⟨ l′ ⟩ t ≡ u ∷ B ^ r / [B] convEqTerm₁ [A] [B] A≡B t≡u = convEqTermT₁ (goodCases [A] [B] A≡B) A≡B t≡u -- Conversion of term equality converting from left to right. with PE convEqTerm₁′ : ∀ {l l′ Γ A B t u r r' ll ll'} (eq : r PE.≡ r') (eql : ll PE.≡ ll') ([A] : Γ ⊩⟨ l ⟩ A ^ [ r , ll ]) ([B] : Γ ⊩⟨ l′ ⟩ B ^ [ r' , ll' ]) → Γ ⊩⟨ l ⟩ A ≡ B ^ [ r , ll ] / [A] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ [ r , ll ] / [A] → Γ ⊩⟨ l′ ⟩ t ≡ u ∷ B ^ [ r' , ll' ] / [B] convEqTerm₁′ PE.refl PE.refl [A] [B] A≡B t≡u = convEqTerm₁ [A] [B] A≡B t≡u -- Conversion of term equality converting from right to left. convEqTerm₂ : ∀ {l l′ Γ A B t u r ll} ([A] : Γ ⊩⟨ l ⟩ A ^ [ r , ll ]) ([B] : Γ ⊩⟨ l′ ⟩ B ^ [ r , ll ]) → Γ ⊩⟨ l ⟩ A ≡ B ^ [ r , ll ] / [A] → Γ ⊩⟨ l′ ⟩ t ≡ u ∷ B ^ [ r , ll ] / [B] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ [ r , ll ] / [A] convEqTerm₂ [A] [B] A≡B t≡u = convEqTermT₂ (goodCases [A] [B] A≡B) A≡B t≡u -- Conversion of term equality converting from right to left with PE convEqTerm₂′ : ∀ {l l′ Γ A B t u r r' ll ll'} (eq : r PE.≡ r') (eql : ll PE.≡ ll') ([A] : Γ ⊩⟨ l ⟩ A ^ [ r , ll ]) ([B] : Γ ⊩⟨ l′ ⟩ B ^ [ r' , ll' ]) → Γ ⊩⟨ l ⟩ A ≡ B ^ [ r , ll ] / [A] → Γ ⊩⟨ l′ ⟩ t ≡ u ∷ B ^ [ r' , ll' ] / [B] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A ^ [ r , ll ] / [A] convEqTerm₂′ PE.refl PE.refl [A] [B] A≡B t≡u = convEqTerm₂ [A] [B] A≡B t≡u
62.04914
143
0.394789
30c97d3bd2d3f91b9a9f7d6b2232025c1e2e414d
443
agda
Agda
metatheory/test/IntegerLiteral.agda
greggdourgarian/plutus
07a2fbef515b988ca3401d38e1464a36ca80b641
[ "Apache-2.0" ]
1
2019-02-22T12:34:17.000Z
2019-02-22T12:34:17.000Z
metatheory/test/IntegerLiteral.agda
greggdourgarian/plutus
07a2fbef515b988ca3401d38e1464a36ca80b641
[ "Apache-2.0" ]
1
2019-02-06T12:42:31.000Z
2019-02-06T12:42:31.000Z
metatheory/test/IntegerLiteral.agda
greggdourgarian/plutus
07a2fbef515b988ca3401d38e1464a36ca80b641
[ "Apache-2.0" ]
null
null
null
module test.IntegerLiteral where open import Type open import Declarative open import Builtin open import Builtin.Constant.Type open import Builtin.Constant.Term Ctx⋆ Kind * # _⊢⋆_ con size⋆ open import Agda.Builtin.Sigma open import Data.Integer open import Data.Nat -- plutus/language-plutus-core/test/data/integerLiteral.plc intLit : ∀{Γ} → Γ ⊢ con integer (size⋆ 100) intLit = con (integer 100 (ℤ.pos 102341) (-≤+ Σ., +≤+ (gen _ _ _)))
27.6875
67
0.742664
2e1de514bd6366dbdf632352472476debefae43c
1,445
agda
Agda
test/Fail/Issue1523.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
3
2015-03-28T14:51:03.000Z
2015-12-07T20:14:00.000Z
test/Fail/Issue1523.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
3
2018-11-14T15:31:44.000Z
2019-04-01T19:39:26.000Z
test/Fail/Issue1523.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1
2015-09-15T14:36:15.000Z
2015-09-15T14:36:15.000Z
-- Andreas, 2015-05-28 example by Andrea Vezzosi open import Common.Size data Nat (i : Size) : Set where zero : ∀ (j : Size< i) → Nat i suc : ∀ (j : Size< i) → Nat j → Nat i {-# TERMINATING #-} -- This definition is fine, the termination checker is too strict at the moment. fix : ∀ {C : Size → Set} → (∀ i → (∀ (j : Size< i) → Nat j -> C j) → Nat i → C i) → ∀ i → Nat i → C i fix t i (zero j) = t i (λ (j : Size< i) → fix t j) (zero j) fix t i (suc j n) = t i (λ (j : Size< i) → fix t j) (suc j n) case : ∀ i {C : Set} (n : Nat i) (z : C) (s : ∀ (j : Size< i) → Nat j → C) → C case i (zero j) z s = z case i (suc j n) z s = s j n applyfix : ∀ {C : Size → Set} i (n : Nat i) → (∀ i → (∀ (j : Size< i) → Nat j -> C j) → Nat i → C i) → C i applyfix i n f = fix f i n module M (i0 : Size) (bot : ∀{i} → Nat i) (A : Set) (default : A) where loops : A loops = applyfix (↑ i0) (zero i0) λ i r (_ : Nat i) → case i bot default λ (j : Size< i) (n : Nat j) → -- Size< i is possibly empty, should be rejected case j n default λ (h : Size< j) (_ : Nat h) → r (↑ h) (zero h) -- loops -- --> fix t (↑ i0) (zero i0) -- --> t (↑ i0) (fix t) (zero i0) -- --> case i0 bot default λ j n → case j n default λ h _ → fix t (↑ h) (zero h) -- and we have reproduced (modulo [h/i0]) what we started with -- The above needs this inference to typecheck -- h < j, j < i -- --------------------- -- ↑ h < i
34.404762
105
0.50173
c70ad26fc5e4368cdcbfb336b06d92ecb6f3ce77
995
agda
Agda
Data/Sum.agda
oisdk/agda-playground
97a3aab1282b2337c5f43e2cfa3fa969a94c11b7
[ "MIT" ]
6
2020-09-11T17:45:41.000Z
2021-11-16T08:11:34.000Z
Data/Sum.agda
oisdk/agda-playground
97a3aab1282b2337c5f43e2cfa3fa969a94c11b7
[ "MIT" ]
null
null
null
Data/Sum.agda
oisdk/agda-playground
97a3aab1282b2337c5f43e2cfa3fa969a94c11b7
[ "MIT" ]
1
2021-11-11T12:30:21.000Z
2021-11-11T12:30:21.000Z
{-# OPTIONS --without-K --safe #-} module Data.Sum where open import Level open import Data.Bool.Base using (Bool; true; false) open import Function using (const) data _⊎_ (A : Type a) (B : Type b) : Type (a ℓ⊔ b) where inl : A → A ⊎ B inr : B → A ⊎ B either : ∀ {ℓ} {C : A ⊎ B → Type ℓ} → ((a : A) → C (inl a)) → ((b : B) → C (inr b)) → (x : A ⊎ B) → C x either f _ (inl x) = f x either _ g (inr y) = g y ⟦l_,r_⟧ = either either′ : (A → C) → (B → C) → (A ⊎ B) → C either′ = either _▿_ : (A → C) → (B → C) → A ⊎ B → C _▿_ = either is-l : A ⊎ B → Bool is-l = either′ (const true) (const false) map-⊎ : ∀ {a₁ a₂ b₁ b₂} {A₁ : Type a₁} {A₂ : Type a₂} {B₁ : Type b₁} {B₂ : Type b₂} → (A₁ → A₂) → (B₁ → B₂) → (A₁ ⊎ B₁) → (A₂ ⊎ B₂) map-⊎ f g (inl x) = inl (f x) map-⊎ f g (inr x) = inr (g x) mapˡ : (A → B) → A ⊎ C → B ⊎ C mapˡ f (inl x) = inl (f x) mapˡ f (inr x) = inr x mapʳ : (A → B) → C ⊎ A → C ⊎ B mapʳ f (inl x) = inl x mapʳ f (inr x) = inr (f x)
22.613636
85
0.476382
2e1dd470b1c8ceebe8a9fdaf3e9f7053e6465504
1,667
agda
Agda
notes/FOT/Common/FOL/Relation/Binary/PropositionalEquality/Postulated.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
11
2015-09-03T20:53:42.000Z
2021-09-12T16:09:54.000Z
notes/FOT/Common/FOL/Relation/Binary/PropositionalEquality/Postulated.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
2
2016-10-12T17:28:16.000Z
2017-01-01T14:34:26.000Z
notes/FOT/Common/FOL/Relation/Binary/PropositionalEquality/Postulated.agda
asr/fotc
2fc9f2b81052a2e0822669f02036c5750371b72d
[ "MIT" ]
3
2016-09-19T14:18:30.000Z
2018-03-14T08:50:00.000Z
------------------------------------------------------------------------------ -- Postulated propositional equality ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOT.Common.FOL.Relation.Binary.PropositionalEquality.Postulated where -- We add 3 to the fixities of the Agda standard library 0.8.1 (see -- Relation/Binary/Core.agda). infix 7 _≡_ ------------------------------------------------------------------------------ -- The identity type on the universe of discourse. postulate D : Set _≡_ : D → D → Set refl : ∀ {x} → x ≡ x J : (A : D → Set) → ∀ {x y} → x ≡ y → A x → A y -- Identity properties sym : ∀ {x y} → x ≡ y → y ≡ x sym {x} h = J (λ y' → y' ≡ x) h refl trans : ∀ {x y z} → x ≡ y → y ≡ z → x ≡ z trans {x} h₁ h₂ = J (_≡_ x) h₂ h₁ trans₂ : ∀ {w x y z} → w ≡ x → x ≡ y → y ≡ z → w ≡ z trans₂ h₁ h₂ h₃ = trans (trans h₁ h₂) h₃ subst : (A : D → Set) → ∀ {x y} → x ≡ y → A x → A y subst = J subst₂ : (A : D → D → Set) → ∀ {x₁ x₂ y₁ y₂} → x₁ ≡ y₁ → x₂ ≡ y₂ → A x₁ x₂ → A y₁ y₂ subst₂ A {x₁} {x₂} {y₁} {y₂} h₁ h₂ h₃ = subst (λ y₁' → A y₁' y₂) h₁ (subst (A x₁) h₂ h₃) cong : (f : D → D) → ∀ {x y} → x ≡ y → f x ≡ f y cong f {x} h = subst (λ x' → f x ≡ f x') h refl cong₂ : (f : D → D → D) → ∀ {x₁ x₂ y₁ y₂} → x₁ ≡ y₁ → x₂ ≡ y₂ → f x₁ x₂ ≡ f y₁ y₂ cong₂ f {x₁} {x₂} {y₁} {y₂} h₁ h₂ = subst (λ x₁' → f x₁ x₂ ≡ f x₁' y₂) h₁ (subst (λ x₂' → f x₁ x₂ ≡ f x₁ x₂') h₂ refl)
30.309091
78
0.421716
1e22ec3ba13d9ab61128ef9704f6bf6e0171d5f3
656
agda
Agda
old/index.agda
danbornside/HoTT-Agda
1695a7f3dc60177457855ae846bbd86fcd96983e
[ "MIT" ]
294
2015-01-09T16:23:23.000Z
2022-03-20T13:54:45.000Z
old/index.agda
danbornside/HoTT-Agda
1695a7f3dc60177457855ae846bbd86fcd96983e
[ "MIT" ]
31
2015-03-05T20:09:00.000Z
2021-10-03T19:15:25.000Z
old/index.agda
danbornside/HoTT-Agda
1695a7f3dc60177457855ae846bbd86fcd96983e
[ "MIT" ]
50
2015-01-10T01:48:08.000Z
2022-02-14T03:03:25.000Z
{-# OPTIONS --without-K #-} {- Imports everything that is not imported by something else. This is not supposed to be used anywhere, this is just a simple way to do `make all' This file is intentionally named index.agda so that Agda will generate index.html. -} module index where import Base import Spaces.IntervalProps import Algebra.F2NotCommutative import Spaces.LoopSpaceCircle import Spaces.LoopSpaceDecidableWedgeCircles import Homotopy.PullbackIsPullback import Homotopy.PushoutIsPushout import Homotopy.Truncation import Sets.QuotientUP import Spaces.PikSn import Homotopy.VanKampen import Homotopy.Cover import Homotopy.Cover.ExamplePi1Circle
24.296296
70
0.830793
57fbc059fb8dd56fc39c273f8dd89d264fed30e5
29,090
agda
Agda
Definition/Typed/Weakening.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
2
2018-06-21T08:39:01.000Z
2022-01-17T16:13:53.000Z
Definition/Typed/Weakening.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
null
null
null
Definition/Typed/Weakening.agda
CoqHott/logrel-mltt
e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04
[ "MIT" ]
2
2022-01-26T14:55:51.000Z
2022-02-15T19:42:19.000Z
{-# OPTIONS --safe #-} module Definition.Typed.Weakening where open import Definition.Untyped as U hiding (wk) open import Definition.Untyped.Properties open import Definition.Typed import Tools.PropositionalEquality as PE -- Weakening type data _∷_⊆_ : Wk → Con Term → Con Term → Set where id : ∀ {Γ} → id ∷ Γ ⊆ Γ step : ∀ {Γ Δ A r ρ} → ρ ∷ Δ ⊆ Γ → step ρ ∷ Δ ∙ A ^ r ⊆ Γ lift : ∀ {Γ Δ A r ρ} → ρ ∷ Δ ⊆ Γ → lift ρ ∷ Δ ∙ U.wk ρ A ^ r ⊆ Γ ∙ A ^ r -- -- Weakening composition _•ₜ_ : ∀ {ρ ρ′ Γ Δ Δ′} → ρ ∷ Γ ⊆ Δ → ρ′ ∷ Δ ⊆ Δ′ → ρ • ρ′ ∷ Γ ⊆ Δ′ id •ₜ η′ = η′ step η •ₜ η′ = step (η •ₜ η′) lift η •ₜ id = lift η lift η •ₜ step η′ = step (η •ₜ η′) _•ₜ_ {lift ρ} {lift ρ′} {Δ′ = Δ′ ∙ A ^ rA} (lift η) (lift η′) = PE.subst (λ x → lift (ρ • ρ′) ∷ x ⊆ Δ′ ∙ A ^ rA) (PE.cong₂ (λ x y → x ∙ y ^ rA) PE.refl (PE.sym (wk-comp ρ ρ′ A))) (lift (η •ₜ η′)) -- Weakening of judgements wkIndex : ∀ {Γ Δ n A r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρn = wkVar ρ n in ⊢ Δ → n ∷ A ^ r ∈ Γ → ρn ∷ ρA ^ r ∈ Δ wkIndex id ⊢Δ i = PE.subst (λ x → _ ∷ x ^ _ ∈ _) (PE.sym (wk-id _)) i wkIndex (step ρ) (⊢Δ ∙ A) i = PE.subst (λ x → _ ∷ x ^ _ ∈ _) (wk1-wk _ _) (there (wkIndex ρ ⊢Δ i)) wkIndex (lift ρ) (⊢Δ ∙ A) (there i) = PE.subst (λ x → _ ∷ x ^ _ ∈ _) (wk1-wk≡lift-wk1 _ _) (there (wkIndex ρ ⊢Δ i)) wkIndex (lift ρ) ⊢Δ here = let G = _ n = _ in PE.subst (λ x → n ∷ x ^ _ ∈ G) (wk1-wk≡lift-wk1 _ _) here mutual wk : ∀ {Γ Δ A r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A in ⊢ Δ → Γ ⊢ A ^ r → Δ ⊢ ρA ^ r wk ρ ⊢Δ (Uⱼ ⊢Γ) = Uⱼ ⊢Δ wk ρ ⊢Δ (univ A) = univ (wkTerm ρ ⊢Δ A) wkTerm : ∀ {Γ Δ A t r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρt = U.wk ρ t in ⊢ Δ → Γ ⊢ t ∷ A ^ r → Δ ⊢ ρt ∷ ρA ^ r wkTerm ρ ⊢Δ (univ <l ⊢Γ) = univ <l ⊢Δ wkTerm ρ ⊢Δ (ℕⱼ ⊢Γ) = ℕⱼ ⊢Δ wkTerm ρ ⊢Δ (Emptyⱼ ⊢Γ) = Emptyⱼ ⊢Δ wkTerm ρ ⊢Δ (Πⱼ <l ▹ <l' ▹ F ▹ G) = let ρF = wkTerm ρ ⊢Δ F in Πⱼ <l ▹ <l' ▹ ρF ▹ (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) G) wkTerm ρ ⊢Δ (∃ⱼ F ▹ G) = let ρF = wkTerm ρ ⊢Δ F in ∃ⱼ ρF ▹ (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) G) wkTerm ρ ⊢Δ (var ⊢Γ x) = var ⊢Δ (wkIndex ρ ⊢Δ x) wkTerm ρ ⊢Δ (lamⱼ <l <l' F t) = let ρF = wk ρ ⊢Δ F in lamⱼ <l <l' ρF (wkTerm (lift ρ) (⊢Δ ∙ ρF) t) wkTerm ρ ⊢Δ (_∘ⱼ_ {G = G} g a) = PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (PE.sym (wk-β G)) (wkTerm ρ ⊢Δ g ∘ⱼ wkTerm ρ ⊢Δ a) wkTerm ρ ⊢Δ (⦅_,_,_,_⦆ⱼ {G = GG} F G t u ) = let ρF = wk ρ ⊢Δ F in ⦅ wk ρ ⊢Δ F , wk (lift ρ) (⊢Δ ∙ ρF) G , wkTerm ρ ⊢Δ t , PE.subst (λ X → _ ⊢ _ ∷ X ^ [ % , _ ]) (wk-β GG) (wkTerm ρ ⊢Δ u) ⦆ⱼ wkTerm ρ ⊢Δ (fstⱼ F G t) = let ρF = wkTerm ρ ⊢Δ F in let ρG = (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) G) in fstⱼ ρF ρG (wkTerm ρ ⊢Δ t) wkTerm ρ ⊢Δ (sndⱼ {G = G} F Gⱼ t) = let ρF = wkTerm ρ ⊢Δ F in let ρG = (wkTerm (lift ρ) (⊢Δ ∙ univ ρF) Gⱼ) in PE.subst (λ X → _ ⊢ _ ∷ X ^ [ % , _ ]) (PE.sym (wk-β G)) (sndⱼ ρF ρG (wkTerm ρ ⊢Δ t)) wkTerm ρ ⊢Δ (zeroⱼ ⊢Γ) = zeroⱼ ⊢Δ wkTerm ρ ⊢Δ (sucⱼ n) = sucⱼ (wkTerm ρ ⊢Δ n) wkTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrecⱼ {G = G} {rG = rG} {lG = lG} {s = s} ⊢G ⊢z ⊢s ⊢n) = PE.subst (λ x → _ ⊢ natrec _ _ _ _ _ ∷ x ^ _) (PE.sym (wk-β G)) (natrecⱼ (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢G) (PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β G) (wkTerm [ρ] ⊢Δ ⊢z)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ rG , ι lG ]) (wk-β-natrec ρ G rG lG) (wkTerm [ρ] ⊢Δ ⊢s)) (wkTerm [ρ] ⊢Δ ⊢n)) wkTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Emptyrecⱼ {A = A} {e = e} ⊢A ⊢e) = (Emptyrecⱼ (wk [ρ] ⊢Δ ⊢A) (wkTerm [ρ] ⊢Δ ⊢e)) wkTerm ρ ⊢Δ (Idⱼ A t u) = Idⱼ (wkTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ t) (wkTerm ρ ⊢Δ u) wkTerm ρ ⊢Δ (Idreflⱼ t) = Idreflⱼ (wkTerm ρ ⊢Δ t) wkTerm ρ ⊢Δ (transpⱼ {P = P} A Pⱼ t s u e) = let ρA = wk ρ ⊢Δ A in let ρP = wk (lift ρ) (⊢Δ ∙ ρA) Pⱼ in let ρt = wkTerm ρ ⊢Δ t in let ρs = PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β P) (wkTerm ρ ⊢Δ s) in let ρu = wkTerm ρ ⊢Δ u in let ρe = wkTerm ρ ⊢Δ e in PE.subst (λ x → _ ⊢ transp _ _ _ _ _ _ ∷ x ^ _) (PE.sym (wk-β P)) (transpⱼ ρA ρP ρt ρs ρu ρe) wkTerm ρ ⊢Δ (castⱼ A B e t) = castⱼ (wkTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t) wkTerm ρ ⊢Δ (castreflⱼ A t) = castreflⱼ (wkTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ t) wkTerm ρ ⊢Δ (conv t A≡B) = conv (wkTerm ρ ⊢Δ t) (wkEq ρ ⊢Δ A≡B) wkEq : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρB = U.wk ρ B in ⊢ Δ → Γ ⊢ A ≡ B ^ r → Δ ⊢ ρA ≡ ρB ^ r wkEq ρ ⊢Δ (univ A≡B) = univ (wkEqTerm ρ ⊢Δ A≡B) wkEq ρ ⊢Δ (refl A) = refl (wk ρ ⊢Δ A) wkEq ρ ⊢Δ (sym A≡B) = sym (wkEq ρ ⊢Δ A≡B) wkEq ρ ⊢Δ (trans A≡B B≡C) = trans (wkEq ρ ⊢Δ A≡B) (wkEq ρ ⊢Δ B≡C) wkEqTerm : ∀ {Γ Δ A t u r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρt = U.wk ρ t ρu = U.wk ρ u in ⊢ Δ → Γ ⊢ t ≡ u ∷ A ^ r → Δ ⊢ ρt ≡ ρu ∷ ρA ^ r wkEqTerm ρ ⊢Δ (refl t) = refl (wkTerm ρ ⊢Δ t) wkEqTerm ρ ⊢Δ (sym t≡u) = sym (wkEqTerm ρ ⊢Δ t≡u) wkEqTerm ρ ⊢Δ (trans t≡u u≡r) = trans (wkEqTerm ρ ⊢Δ t≡u) (wkEqTerm ρ ⊢Δ u≡r) wkEqTerm ρ ⊢Δ (conv t≡u A≡B) = conv (wkEqTerm ρ ⊢Δ t≡u) (wkEq ρ ⊢Δ A≡B) wkEqTerm ρ ⊢Δ (Π-cong <l <l' F F≡H G≡E) = let ρF = wk ρ ⊢Δ F in Π-cong <l <l' ρF (wkEqTerm ρ ⊢Δ F≡H) (wkEqTerm (lift ρ) (⊢Δ ∙ ρF) G≡E) wkEqTerm ρ ⊢Δ (∃-cong F F≡H G≡E) = let ρF = wk ρ ⊢Δ F in ∃-cong ρF (wkEqTerm ρ ⊢Δ F≡H) (wkEqTerm (lift ρ) (⊢Δ ∙ ρF) G≡E) wkEqTerm ρ ⊢Δ (app-cong {G = G} f≡g a≡b) = PE.subst (λ x → _ ⊢ _ ≡ _ ∷ x ^ _) (PE.sym (wk-β G)) (app-cong (wkEqTerm ρ ⊢Δ f≡g) (wkEqTerm ρ ⊢Δ a≡b)) wkEqTerm ρ ⊢Δ (β-red {a = a} {t = t} {G = G} l< l<' F ⊢t ⊢a) = let ρF = wk ρ ⊢Δ F in PE.subst (λ x → _ ⊢ _ ≡ _ ∷ x ^ _) (PE.sym (wk-β G)) (PE.subst (λ x → _ ⊢ U.wk _ ((lam _ ▹ t ^ _) ∘ a ^ _) ≡ x ∷ _ ^ _) (PE.sym (wk-β t)) (β-red l< l<' ρF (wkTerm (lift ρ) (⊢Δ ∙ ρF) ⊢t) (wkTerm ρ ⊢Δ ⊢a))) wkEqTerm ρ ⊢Δ (η-eq lF lG F f g f0≡g0) = let ρF = wk ρ ⊢Δ F in η-eq lF lG ρF (wkTerm ρ ⊢Δ f) (wkTerm ρ ⊢Δ g) (PE.subst (λ t → _ ⊢ t ∘ _ ^ _ ≡ _ ∷ _ ^ _) (PE.sym (wk1-wk≡lift-wk1 _ _)) (PE.subst (λ t → _ ⊢ _ ≡ t ∘ _ ^ _ ∷ _ ^ _) (PE.sym (wk1-wk≡lift-wk1 _ _)) (wkEqTerm (lift ρ) (⊢Δ ∙ ρF) f0≡g0))) wkEqTerm ρ ⊢Δ (suc-cong m≡n) = suc-cong (wkEqTerm ρ ⊢Δ m≡n) wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-cong {s = s} {s′ = s′} {F = F} {l = l} F≡F′ z≡z′ s≡s′ n≡n′) = PE.subst (λ x → Δ ⊢ natrec _ _ _ _ _ ≡ _ ∷ x ^ _) (PE.sym (wk-β F)) (natrec-cong (wkEq (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) F≡F′) (PE.subst (λ x → Δ ⊢ _ ≡ _ ∷ x ^ _) (wk-β F) (wkEqTerm [ρ] ⊢Δ z≡z′)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ≡ U.wk ρ s′ ∷ x ^ [ ! , ι l ]) (wk-β-natrec _ F ! l) (wkEqTerm [ρ] ⊢Δ s≡s′)) (wkEqTerm [ρ] ⊢Δ n≡n′)) wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-zero {z} {s} {F} {l = l} ⊢F ⊢z ⊢s) = PE.subst (λ x → Δ ⊢ natrec _ (U.wk (lift _) F) _ _ _ ≡ _ ∷ x ^ _) (PE.sym (wk-β F)) (natrec-zero (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F) (PE.subst (λ x → Δ ⊢ U.wk ρ z ∷ x ^ _) (wk-β F) (wkTerm [ρ] ⊢Δ ⊢z)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ]) (wk-β-natrec _ F ! l) (wkTerm [ρ] ⊢Δ ⊢s))) wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-suc {n} {z} {s} {F} {l = l} ⊢n ⊢F ⊢z ⊢s) = PE.subst (λ x → Δ ⊢ natrec _ (U.wk (lift _) F) _ _ _ ≡ _ ∘ (natrec _ _ _ _ _) ^ _ ∷ x ^ _) (PE.sym (wk-β F)) (natrec-suc (wkTerm [ρ] ⊢Δ ⊢n) (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F) (PE.subst (λ x → Δ ⊢ U.wk ρ z ∷ x ^ _) (wk-β F) (wkTerm [ρ] ⊢Δ ⊢z)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ]) (wk-β-natrec _ F ! l) (wkTerm [ρ] ⊢Δ ⊢s))) wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Emptyrec-cong {A = A} {A' = A'} {e = e} {e' = e'} A≡A' ⊢e ⊢e') = Emptyrec-cong (wkEq [ρ] ⊢Δ A≡A') (wkTerm [ρ] ⊢Δ ⊢e) (wkTerm [ρ] ⊢Δ ⊢e') wkEqTerm [ρ] ⊢Δ (proof-irrelevance t u) = proof-irrelevance (wkTerm [ρ] ⊢Δ t) (wkTerm [ρ] ⊢Δ u) wkEqTerm ρ ⊢Δ (Id-cong A t u) = Id-cong (wkEqTerm ρ ⊢Δ A) (wkEqTerm ρ ⊢Δ t) (wkEqTerm ρ ⊢Δ u) wkEqTerm {ρ = ρ} [ρ] ⊢Δ (Id-Π {rA = rA} {t = t} {u = u} <l <l' Aⱼ Bⱼ tⱼ uⱼ) = let ρA = wkTerm [ρ] ⊢Δ Aⱼ in let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ univ ρA) Bⱼ in let ρt = wkTerm [ρ] ⊢Δ tⱼ in let ρu = wkTerm [ρ] ⊢Δ uⱼ in PE.subst (λ x → _ ⊢ Id _ (U.wk ρ t) _ ≡ Π _ ^ _ ° _ ▹ Id _ (x ∘ _ ^ _) _ ° _ ° _ ∷ _ ^ [ ! , _ ]) (wk1-wk≡lift-wk1 ρ t) (PE.subst (λ x → _ ⊢ Id _ _ (U.wk ρ u) ≡ Π _ ^ _ ° _ ▹ Id _ _ (x ∘ _ ^ _) ° _ ° _ ∷ _ ^ [ ! , _ ]) (wk1-wk≡lift-wk1 ρ u) (Id-Π <l <l' ρA ρB ρt ρu)) wkEqTerm ρ ⊢Δ (Id-ℕ-00 ⊢Γ) = Id-ℕ-00 ⊢Δ wkEqTerm ρ ⊢Δ (Id-ℕ-SS m n) = Id-ℕ-SS (wkTerm ρ ⊢Δ m) (wkTerm ρ ⊢Δ n) wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Id-U-ΠΠ {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} Aⱼ Bⱼ A'ⱼ B'ⱼ) = let ρA = wkTerm [ρ] ⊢Δ Aⱼ in let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in let l = ⁰ in let l' = ¹ in let pred = λ A1 A1' A2' B1 B1' → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ≡ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π A1' ^ rA ° ⁰ ▹ Id (U l) (B1 [ cast l A2' A1 (Idsym (Univ rA l) A1 A2' (var 1)) (var 0) ]↑) B1' ° l' ° l') ∷ SProp l' ^ [ ! , next l' ] in let j1 : pred (wk1 (wk1 (U.wk ρ A))) (wk1 (U.wk ρ A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B')) j1 = Id-U-ΠΠ ρA ρB ρA' ρB' in let j2 = PE.subst (λ x → pred (wk1 (wk1 (U.wk ρ A))) x (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1-wk≡lift-wk1 ρ A') j1 in let j3 = PE.subst (λ x → pred x (U.wk (lift ρ) (wk1 A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A) j2 in let j4 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) x (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A') j3 in let j5 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) x (wk1d (U.wk (lift ρ) B'))) (wk1d-wk≡lift-wk1d ρ B) j4 in let j6 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1d B)) x) (wk1d-wk≡lift-wk1d ρ B') j5 in let j7 = PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ≡ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) (U.wk (lift (lift ρ)) (wk1d B) [ (cast l (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1 (wk1 A))) x (var 0)) ]↑) (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ [ ! , next l' ]) (PE.sym (wk-Idsym (lift (lift ρ)) (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1))) j6 in PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ≡ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) x (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ [ ! , _ ]) (PE.sym (wk-β↑ {ρ = lift ρ} {a = cast l (wk1 (wk1 A')) (wk1 (wk1 A)) (Idsym (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1)) (var 0)} (wk1d B))) j7 wkEqTerm ρ ⊢Δ (Id-U-ℕℕ ⊢Γ) = Id-U-ℕℕ ⊢Δ wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Id-SProp {A = A} {B = B} Aⱼ Bⱼ) = let ρA = wkTerm [ρ] ⊢Δ Aⱼ ρB = wkTerm [ρ] ⊢Δ Bⱼ l = ⁰ l' = ¹ in PE.subst (λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ≡ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° l') ▹ (Π _ ^ % ° ⁰ ▹ x ° _ ° l') ∷ _ ^ [ ! , _ ]) (wk1d-wk≡lift-wk1d ρ (wk1 A)) (PE.subst (λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ≡ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° l') ▹ (Π _ ^ % ° ⁰ ▹ U.wk (lift (step id)) x ° _ ° l') ∷ _ ^ [ ! , _ ]) (wk1-wk≡lift-wk1 ρ A) (PE.subst (λ x → _ ⊢ Id (SProp l) (U.wk ρ A) (U.wk ρ B) ≡ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ x ° ⁰ ° l') ▹ (Π x ^ % ° ⁰ ▹ _ ° ⁰ ° l') ∷ SProp ¹ ^ [ ! , _ ]) (wk1-wk≡lift-wk1 ρ B) (Id-SProp {A = U.wk ρ A} {B = U.wk ρ B} ρA ρB))) wkEqTerm ρ ⊢Δ (Id-ℕ-0S n) = Id-ℕ-0S (wkTerm ρ ⊢Δ n) wkEqTerm ρ ⊢Δ (Id-ℕ-S0 n) = Id-ℕ-S0 (wkTerm ρ ⊢Δ n) wkEqTerm ρ ⊢Δ (Id-U-ℕΠ A B) = let ρA = wkTerm ρ ⊢Δ A in let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in Id-U-ℕΠ ρA ρB wkEqTerm ρ ⊢Δ (Id-U-Πℕ A B) = let ρA = wkTerm ρ ⊢Δ A in let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in Id-U-Πℕ ρA ρB wkEqTerm ρ ⊢Δ (Id-U-ΠΠ!% eq A B A' B') = let ρA = wkTerm ρ ⊢Δ A ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B ρA' = wkTerm ρ ⊢Δ A' ρB' = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA')) B' in Id-U-ΠΠ!% eq ρA ρB ρA' ρB' wkEqTerm ρ ⊢Δ (cast-cong A B t e e') = cast-cong (wkEqTerm ρ ⊢Δ A) (wkEqTerm ρ ⊢Δ B) (wkEqTerm ρ ⊢Δ t) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ e') wkEqTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (cast-Π {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} {e = e} {f = f} Aⱼ Bⱼ A'ⱼ B'ⱼ eⱼ fⱼ) = let l = ⁰ in let lA = ⁰ in let lB = ⁰ in let ρA = wkTerm [ρ] ⊢Δ Aⱼ in let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in let ρe = wkTerm [ρ] ⊢Δ eⱼ in let ρf = wkTerm [ρ] ⊢Δ fⱼ in let pred = λ A1 A1' e1 f1 → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ≡ (lam (U.wk ρ A') ▹ (let a = cast l A1' A1 (Idsym (Univ rA l) A1 A1' (fst e1)) (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd e1) ∘ (var 0) ^ ¹) (f1 ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ [ ! , _ ] in let j0 : pred (wk1 (U.wk ρ A)) (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f)) j0 = cast-Π ρA ρB ρA' ρB' ρe ρf in let j1 = PE.subst (λ x → pred x (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A) j0 in let j2 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) x (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A') j1 in let j3 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) x (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ e) j2 in let j4 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 e)) x) (wk1-wk≡lift-wk1 ρ f) j3 in let j5 = PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ≡ (lam (U.wk ρ A') ▹ (let a = cast l (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 A)) x (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ [ ! , ι l ]) (PE.sym (wk-Idsym (lift ρ) (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e)))) j4 in PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ≡ (lam (U.wk ρ A') ▹ (let a = U.wk (lift ρ) (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0)) in cast l x (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ [ ! , ι l ]) (PE.sym (wk-β↑ {ρ = ρ} {a = (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0))} B)) j5 wkEqTerm ρ ⊢Δ (cast-ℕ-0 e) = cast-ℕ-0 (wkTerm ρ ⊢Δ e) wkEqTerm ρ ⊢Δ (cast-ℕ-S e n) = cast-ℕ-S (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ n) mutual wkRed : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρB = U.wk ρ B in ⊢ Δ → Γ ⊢ A ⇒ B ^ r → Δ ⊢ ρA ⇒ ρB ^ r wkRed ρ ⊢Δ (univ A⇒B) = univ (wkRedTerm ρ ⊢Δ A⇒B) wkRedTerm : ∀ {Γ Δ A l t u ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρt = U.wk ρ t ρu = U.wk ρ u in ⊢ Δ → Γ ⊢ t ⇒ u ∷ A ^ l → Δ ⊢ ρt ⇒ ρu ∷ ρA ^ l wkRedTerm ρ ⊢Δ (conv t⇒u A≡B) = conv (wkRedTerm ρ ⊢Δ t⇒u) (wkEq ρ ⊢Δ A≡B) wkRedTerm ρ ⊢Δ (app-subst {B = B} t⇒u a) = PE.subst (λ x → _ ⊢ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β B)) (app-subst (wkRedTerm ρ ⊢Δ t⇒u) (wkTerm ρ ⊢Δ a)) wkRedTerm ρ ⊢Δ (β-red {A} {B} {lF} {lG} {a} {t} l< l<' ⊢A ⊢t ⊢a) = let ⊢ρA = wk ρ ⊢Δ ⊢A in PE.subst (λ x → _ ⊢ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β B)) (PE.subst (λ x → _ ⊢ U.wk _ ((lam _ ▹ t ^ _) ∘ a ^ _) ⇒ x ∷ _ ^ _) (PE.sym (wk-β t)) (β-red l< l<' ⊢ρA (wkTerm (lift ρ) (⊢Δ ∙ ⊢ρA) ⊢t) (wkTerm ρ ⊢Δ ⊢a))) wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-subst {s = s} {F = F} {l = l} ⊢F ⊢z ⊢s n⇒n′) = PE.subst (λ x → _ ⊢ natrec _ _ _ _ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β F)) (natrec-subst (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F) (PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β F) (wkTerm [ρ] ⊢Δ ⊢z)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ]) (wk-β-natrec _ F ! l) (wkTerm [ρ] ⊢Δ ⊢s)) (wkRedTerm [ρ] ⊢Δ n⇒n′)) wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-zero {s = s} {F = F} {l = l} ⊢F ⊢z ⊢s) = PE.subst (λ x → _ ⊢ natrec _ (U.wk (lift ρ) F) _ _ _ ⇒ _ ∷ x ^ _) (PE.sym (wk-β F)) (natrec-zero (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F) (PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β F) (wkTerm [ρ] ⊢Δ ⊢z)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ]) (wk-β-natrec ρ F ! l) (wkTerm [ρ] ⊢Δ ⊢s))) wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (natrec-suc {s = s} {F = F} {l = l} ⊢n ⊢F ⊢z ⊢s) = PE.subst (λ x → _ ⊢ natrec _ _ _ _ _ ⇒ _ ∘ natrec _ _ _ _ _ ^ _ ∷ x ^ _) (PE.sym (wk-β F)) (natrec-suc (wkTerm [ρ] ⊢Δ ⊢n) (wk (lift [ρ]) (⊢Δ ∙ univ (ℕⱼ ⊢Δ)) ⊢F) (PE.subst (λ x → _ ⊢ _ ∷ x ^ _) (wk-β F) (wkTerm [ρ] ⊢Δ ⊢z)) (PE.subst (λ x → Δ ⊢ U.wk ρ s ∷ x ^ [ ! , ι l ]) (wk-β-natrec ρ F ! l) (wkTerm [ρ] ⊢Δ ⊢s))) wkRedTerm ρ ⊢Δ (Id-subst A t u) = Id-subst (wkRedTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ t) (wkTerm ρ ⊢Δ u) wkRedTerm ρ ⊢Δ (Id-ℕ-subst m n) = Id-ℕ-subst (wkRedTerm ρ ⊢Δ m) (wkTerm ρ ⊢Δ n) wkRedTerm ρ ⊢Δ (Id-ℕ-0-subst n) = Id-ℕ-0-subst (wkRedTerm ρ ⊢Δ n) wkRedTerm ρ ⊢Δ (Id-ℕ-S-subst m n) = Id-ℕ-S-subst (wkTerm ρ ⊢Δ m) (wkRedTerm ρ ⊢Δ n) wkRedTerm ρ ⊢Δ (Id-U-subst A B) = Id-U-subst (wkRedTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ B) wkRedTerm ρ ⊢Δ (Id-U-ℕ-subst B) = Id-U-ℕ-subst (wkRedTerm ρ ⊢Δ B) wkRedTerm ρ ⊢Δ (Id-U-Π-subst A P B) = let ρA = wkTerm ρ ⊢Δ A in Id-U-Π-subst ρA (wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) P) (wkRedTerm ρ ⊢Δ B) wkRedTerm {ρ = ρ} [ρ] ⊢Δ (Id-Π {t = t} {u = u} <l <l' Aⱼ Bⱼ tⱼ uⱼ) = let ρA = wkTerm [ρ] ⊢Δ Aⱼ in let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in let ρt = wkTerm [ρ] ⊢Δ tⱼ in let ρu = wkTerm [ρ] ⊢Δ uⱼ in PE.subst (λ x → _ ⊢ Id _ (U.wk ρ t) _ ⇒ Π _ ^ _ ° _ ▹ Id _ (x ∘ _ ^ _) _ ° _ ° _ ∷ _ ^ _) (wk1-wk≡lift-wk1 ρ t) (PE.subst (λ x → _ ⊢ Id _ _ (U.wk ρ u) ⇒ Π _ ^ _ ° _ ▹ Id _ _ (x ∘ _ ^ _) ° _ ° _ ∷ _ ^ _) (wk1-wk≡lift-wk1 ρ u) (Id-Π <l <l' ρA ρB ρt ρu)) wkRedTerm ρ ⊢Δ (Id-ℕ-00 ⊢Γ) = Id-ℕ-00 ⊢Δ wkRedTerm ρ ⊢Δ (Id-ℕ-SS m n) = Id-ℕ-SS (wkTerm ρ ⊢Δ m) (wkTerm ρ ⊢Δ n) wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (Id-U-ΠΠ {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} Aⱼ Bⱼ A'ⱼ B'ⱼ) = let l = ⁰ in let l' = ¹ in let ρA = wkTerm [ρ] ⊢Δ Aⱼ in let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in let pred = λ A1 A1' A2' B1 B1' → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ⇒ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π A1' ^ rA ° ⁰ ▹ Id (U l) (B1 [ cast l A2' A1 (Idsym (Univ rA l) A1 A2' (var 1)) (var 0) ]↑) B1' ° l' ° l') ∷ SProp l' ^ next l' in let j1 : pred (wk1 (wk1 (U.wk ρ A))) (wk1 (U.wk ρ A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B')) j1 = Id-U-ΠΠ ρA ρB ρA' ρB' in let j2 = PE.subst (λ x → pred (wk1 (wk1 (U.wk ρ A))) x (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1-wk≡lift-wk1 ρ A') j1 in let j3 = PE.subst (λ x → pred x (U.wk (lift ρ) (wk1 A')) (wk1 (wk1 (U.wk ρ A'))) (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A) j2 in let j4 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) x (wk1d (U.wk (lift ρ) B)) (wk1d (U.wk (lift ρ) B'))) (wk1wk1-wk≡liftlift-wk1 ρ A') j3 in let j5 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) x (wk1d (U.wk (lift ρ) B'))) (wk1d-wk≡lift-wk1d ρ B) j4 in let j6 = PE.subst (λ x → pred (U.wk (lift (lift ρ)) (wk1 (wk1 A))) (U.wk (lift ρ) (wk1 A')) (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1d B)) x) (wk1d-wk≡lift-wk1d ρ B') j5 in let j7 = PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ⇒ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) (U.wk (lift (lift ρ)) (wk1d B) [ (cast l (U.wk (lift (lift ρ)) (wk1 (wk1 A'))) (U.wk (lift (lift ρ)) (wk1 (wk1 A))) x (var 0)) ]↑) (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ next l') (PE.sym (wk-Idsym (lift (lift ρ)) (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1))) j6 in PE.subst (λ x → Δ ⊢ U.wk ρ (Id (U l) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° l) (Π A' ^ rA ° ⁰ ▹ B' ° ⁰ ° l)) ⇒ ∃ U.wk ρ (Id (Univ rA l) A A') ▹ (Π U.wk (lift ρ) (wk1 A') ^ rA ° ⁰ ▹ Id (U l) x (U.wk (lift (lift ρ)) (wk1d B')) ° l' ° l') ∷ SProp l' ^ next l') (PE.sym (wk-β↑ {ρ = lift ρ} {a = cast l (wk1 (wk1 A')) (wk1 (wk1 A)) (Idsym (Univ rA l) (wk1 (wk1 A)) (wk1 (wk1 A')) (var 1)) (var 0)} (wk1d B))) j7 wkRedTerm ρ ⊢Δ (Id-U-ℕℕ ⊢Γ) = Id-U-ℕℕ ⊢Δ wkRedTerm {ρ = ρ} [ρ] ⊢Δ (Id-SProp {A = A} {B = B} Aⱼ Bⱼ) = let ρA = wkTerm [ρ] ⊢Δ Aⱼ ρB = wkTerm [ρ] ⊢Δ Bⱼ l = ⁰ l' = ¹ in PE.subst (λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ⇒ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° _) ▹ (Π _ ^ % ° ⁰ ▹ x ° _ ° _) ∷ _ ^ _) (wk1d-wk≡lift-wk1d ρ (wk1 A)) (PE.subst (λ x → _ ⊢ Id (SProp l) (U.wk ρ A) _ ⇒ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ _ ° ⁰ ° _) ▹ (Π _ ^ % ° ⁰ ▹ U.wk (lift (step id)) x ° _ ° _) ∷ _ ^ _ ) (wk1-wk≡lift-wk1 ρ A) (PE.subst (λ x → _ ⊢ Id (SProp l) (U.wk ρ A) (U.wk ρ B) ⇒ ∃ (Π U.wk ρ A ^ % ° ⁰ ▹ x ° ⁰ ° _) ▹ (Π x ^ % ° ⁰ ▹ _ ° ⁰ ° _) ∷ SProp ¹ ^ _ ) (wk1-wk≡lift-wk1 ρ B) (Id-SProp {A = U.wk ρ A} {B = U.wk ρ B} ρA ρB))) wkRedTerm ρ ⊢Δ (Id-ℕ-0S n) = Id-ℕ-0S (wkTerm ρ ⊢Δ n) wkRedTerm ρ ⊢Δ (Id-ℕ-S0 n) = Id-ℕ-S0 (wkTerm ρ ⊢Δ n) wkRedTerm ρ ⊢Δ (Id-U-ℕΠ A B) = let ρA = wkTerm ρ ⊢Δ A in let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in Id-U-ℕΠ ρA ρB wkRedTerm ρ ⊢Δ (Id-U-Πℕ A B) = let ρA = wkTerm ρ ⊢Δ A in let ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B in Id-U-Πℕ ρA ρB wkRedTerm ρ ⊢Δ (Id-U-ΠΠ!% eq A B A' B') = let ρA = wkTerm ρ ⊢Δ A ρB = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) B ρA' = wkTerm ρ ⊢Δ A' ρB' = wkTerm (lift ρ) (⊢Δ ∙ (univ ρA')) B' in Id-U-ΠΠ!% eq ρA ρB ρA' ρB' wkRedTerm ρ ⊢Δ (cast-subst A B e t) = cast-subst (wkRedTerm ρ ⊢Δ A) (wkTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t) wkRedTerm ρ ⊢Δ (cast-ℕ-subst B e t) = cast-ℕ-subst (wkRedTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t) wkRedTerm ρ ⊢Δ (cast-Π-subst A P B e t) = let ρA = wkTerm ρ ⊢Δ A in cast-Π-subst ρA (wkTerm (lift ρ) (⊢Δ ∙ (univ ρA)) P) (wkRedTerm ρ ⊢Δ B) (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ t) wkRedTerm {Δ = Δ} {ρ = ρ} [ρ] ⊢Δ (cast-Π {A = A} {A' = A'} {rA = rA} {B = B} {B' = B'} {e = e} {f = f} Aⱼ Bⱼ A'ⱼ B'ⱼ eⱼ fⱼ) = let l = ⁰ in let lA = ⁰ in let lB = ⁰ in let ρA = wkTerm [ρ] ⊢Δ Aⱼ in let ρA' = wkTerm [ρ] ⊢Δ A'ⱼ in let ρB = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA)) Bⱼ in let ρB' = wkTerm (lift [ρ]) (⊢Δ ∙ (univ ρA')) B'ⱼ in let ρe = wkTerm [ρ] ⊢Δ eⱼ in let ρf = wkTerm [ρ] ⊢Δ fⱼ in let pred = λ A1 A1' e1 f1 → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ⇒ (lam (U.wk ρ A') ▹ (let a = cast l A1' A1 (Idsym (Univ rA l) A1 A1' (fst e1)) (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd e1) ∘ (var 0) ^ ¹) (f1 ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ _ in let j0 : pred (wk1 (U.wk ρ A)) (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f)) j0 = cast-Π ρA ρB ρA' ρB' ρe ρf in let j1 = PE.subst (λ x → pred x (wk1 (U.wk ρ A')) (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A) j0 in let j2 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) x (wk1 (U.wk ρ e)) (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ A') j1 in let j3 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) x (wk1 (U.wk ρ f))) (wk1-wk≡lift-wk1 ρ e) j2 in let j4 = PE.subst (λ x → pred (U.wk (lift ρ) (wk1 A)) (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 e)) x) (wk1-wk≡lift-wk1 ρ f) j3 in let j5 = PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ⇒ (lam (U.wk ρ A') ▹ (let a = cast l (U.wk (lift ρ) (wk1 A')) (U.wk (lift ρ) (wk1 A)) x (var 0) in cast l ((U.wk (lift ρ) B) [ a ]↑) (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ ι l) (PE.sym (wk-Idsym (lift ρ) (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e)))) j4 in PE.subst (λ x → Δ ⊢ U.wk ρ (cast l (Π A ^ rA ° lA ▹ B ° lB ° l) (Π A' ^ rA ° lA ▹ B' ° lB ° l) e f) ⇒ (lam (U.wk ρ A') ▹ (let a = U.wk (lift ρ) (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0)) in cast l x (U.wk (lift ρ) B') ((snd (U.wk (lift ρ) (wk1 e))) ∘ (var 0) ^ ¹) ((U.wk (lift ρ) (wk1 f)) ∘ a ^ l)) ^ l) ∷ U.wk ρ (Π A' ^ rA ° lA ▹ B' ° lB ° l) ^ ι l) (PE.sym (wk-β↑ {ρ = ρ} {a = (cast l (wk1 A') (wk1 A) (Idsym (Univ rA l) (wk1 A) (wk1 A') (fst (wk1 e))) (var 0))} B)) j5 wkRedTerm ρ ⊢Δ (cast-ℕ-0 e) = cast-ℕ-0 (wkTerm ρ ⊢Δ e) wkRedTerm ρ ⊢Δ (cast-ℕ-S e n) = cast-ℕ-S (wkTerm ρ ⊢Δ e) (wkTerm ρ ⊢Δ n) wkRedTerm ρ ⊢Δ (cast-ℕ-cong e n) = cast-ℕ-cong (wkTerm ρ ⊢Δ e) (wkRedTerm ρ ⊢Δ n) wkRed* : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρB = U.wk ρ B in ⊢ Δ → Γ ⊢ A ⇒* B ^ r → Δ ⊢ ρA ⇒* ρB ^ r wkRed* ρ ⊢Δ (id A) = id (wk ρ ⊢Δ A) wkRed* ρ ⊢Δ (A⇒A′ ⇨ A′⇒*B) = wkRed ρ ⊢Δ A⇒A′ ⇨ wkRed* ρ ⊢Δ A′⇒*B wkRed*Term : ∀ {Γ Δ A l t u ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρt = U.wk ρ t ρu = U.wk ρ u in ⊢ Δ → Γ ⊢ t ⇒* u ∷ A ^ l → Δ ⊢ ρt ⇒* ρu ∷ ρA ^ l wkRed*Term ρ ⊢Δ (id t) = id (wkTerm ρ ⊢Δ t) wkRed*Term ρ ⊢Δ (t⇒t′ ⇨ t′⇒*u) = wkRedTerm ρ ⊢Δ t⇒t′ ⇨ wkRed*Term ρ ⊢Δ t′⇒*u wkRed:*: : ∀ {Γ Δ A B r ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρB = U.wk ρ B in ⊢ Δ → Γ ⊢ A :⇒*: B ^ r → Δ ⊢ ρA :⇒*: ρB ^ r wkRed:*: ρ ⊢Δ [[ ⊢A , ⊢B , D ]] = [[ wk ρ ⊢Δ ⊢A , wk ρ ⊢Δ ⊢B , wkRed* ρ ⊢Δ D ]] wkRed:*:Term : ∀ {Γ Δ A l t u ρ} → ρ ∷ Δ ⊆ Γ → let ρA = U.wk ρ A ρt = U.wk ρ t ρu = U.wk ρ u in ⊢ Δ → Γ ⊢ t :⇒*: u ∷ A ^ l → Δ ⊢ ρt :⇒*: ρu ∷ ρA ^ l wkRed:*:Term ρ ⊢Δ [[ ⊢t , ⊢u , d ]] = [[ wkTerm ρ ⊢Δ ⊢t , wkTerm ρ ⊢Δ ⊢u , wkRed*Term ρ ⊢Δ d ]]
63.515284
525
0.424545
19534027526ee6c0d06cace1adfb2dc71022b2e9
8,604
agda
Agda
agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/Lec6.agda
haroldcarr/learn-haskell-coq-ml-etc
3dc7abca7ad868316bb08f31c77fbba0d3910225
[ "Unlicense" ]
36
2015-01-29T14:37:15.000Z
2021-07-30T06:55:03.000Z
agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/Lec6.agda
haroldcarr/learn-haskell-coq-ml-etc
3dc7abca7ad868316bb08f31c77fbba0d3910225
[ "Unlicense" ]
null
null
null
agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/Lec6.agda
haroldcarr/learn-haskell-coq-ml-etc
3dc7abca7ad868316bb08f31c77fbba0d3910225
[ "Unlicense" ]
8
2015-04-13T21:40:15.000Z
2021-09-21T15:58:10.000Z
{-# OPTIONS --type-in-type #-} module Lec6 where open import Lec1Done ListF : Set -> Set -> Set ListF X T = One + (X * T) data List (X : Set) : Set where <_> : (ListF X) (List X) -> (List X) infixr 4 _,-_ listF : {X T U : Set} -> (T -> U) -> (ListF X) T -> (ListF X) U listF g (inl <>) = inl <> listF g (inr (x , t)) = inr (x , g t) pattern [] = < inl <> > pattern _,-_ x xs = < inr (x , xs) > {-(-} mkList : {X : Set} -> (ListF X) (List X) -> List X mkList = <_> {- mkList (inl <>) = [] mkList (inr (x , xs)) = x ,- xs -} {-)-} {-(-} foldr : {X T : Set} -> ((ListF X) T -> T) -> List X -> T foldr alg [] = alg (inl <>) foldr alg (x ,- xs) = alg (inr (x , foldr alg xs)) ex1 = foldr mkList (1 ,- 2 ,- 3 ,- []) {-)-} {-(-} length : {X : Set} -> List X -> Nat length = foldr \ { (inl <>) -> zero ; (inr (x , n)) -> suc n } {-)-} record CoList (X : Set) : Set where coinductive field force : (ListF X) (CoList X) open CoList {-(-} []~ : {X : Set} -> CoList X force []~ = inl <> _,~_ : {X : Set} -> X -> CoList X -> CoList X force (x ,~ xs) = inr (x , xs) infixr 4 _,~_ {-)-} {-(-} unfoldr : {X S : Set} -> (S -> (ListF X) S) -> S -> CoList X force (unfoldr coalg s) with coalg s force (unfoldr coalg s) | inl <> = inl <> force (unfoldr coalg s) | inr (x , s') = inr (x , unfoldr coalg s') ex2 = unfoldr force (1 ,~ 2 ,~ 3 ,~ []~) {-)-} {-(-} repeat : {X : Set} -> X -> CoList X repeat = unfoldr \ x -> inr (x , x) {-)-} {-(-} prefix : {X : Set} -> Nat -> CoList X -> List X prefix zero xs = [] prefix (suc n) xs with force xs prefix (suc n) xs | inl <> = [] prefix (suc n) xs | inr (x , xs') = x ,- prefix n xs' ex2' = prefix 3 ex2 {-)-} StreamF : Set -> Set -> Set StreamF X S = X * S data Funny (X : Set) : Set where <_> : (StreamF X) (Funny X) -> Funny X funny : {X : Set} -> Funny X -> Zero funny < x , xf > = funny xf record Stream (X : Set) : Set where coinductive field hdTl : (StreamF X) (Stream X) open Stream {-(-} forever : {X : Set} -> X -> Stream X fst (hdTl (forever x)) = x snd (hdTl (forever x)) = forever x {-)-} natsFrom : Nat -> Stream Nat fst (hdTl (natsFrom n)) = n snd (hdTl (natsFrom n)) = natsFrom (suc n) sprefix : {X : Set} -> Nat -> Stream X -> List X -- could be Vec X n sprefix zero xs = [] sprefix (suc n) xs with hdTl xs sprefix (suc n) xs | x , xs' = x ,- sprefix n xs' {-(-} unfold : {X S : Set} -> (S -> X * S) -> S -> Stream X hdTl (unfold coalg s) with coalg s hdTl (unfold coalg s) | x , s' = x , unfold coalg s' {-)-} natsFrom' : Nat -> Stream Nat natsFrom' = unfold \ n -> n , suc n data Two : Set where tt ff : Two So : Two -> Set So tt = One So ff = Zero isSuc : Nat -> Two isSuc zero = ff isSuc (suc n) = tt {- div : (x y : Nat) -> So (isSuc y) -> Nat div x zero () div x (suc y) p = {!!} -} data Poly (X : Set) : Set where var' : X -> Poly X konst' : Two -> Poly X _+'_ _*'_ : Poly X -> Poly X -> Poly X Eval : {X : Set} -> (X -> Set) -> Poly X -> Set Eval var (var' x) = var x Eval var (konst' b) = So b Eval var (p +' q) = Eval var p + Eval var q Eval var (p *' q) = Eval var p * Eval var q eval : {X : Set}(u v : X -> Set)(p : Poly X) -> ((x : X) -> u x -> v x) -> Eval u p -> Eval v p eval u v (var' i) f x = f i x eval u v (konst' b) f x = x eval u v (p +' q) f (inl x) = inl (eval u v p f x) eval u v (p +' q) f (inr x) = inr (eval u v q f x) eval u v (p *' q) f (x , y) = eval u v p f x , eval u v q f y data Mu (p : Poly One) : Set where <_> : Eval (\ _ -> Mu p) p -> Mu p NatP : Poly One NatP = konst' tt +' var' <> NAT = Mu NatP ze : NAT ze = < (inl <>) > su : NAT -> NAT su n = < (inr n) > TreeP : Poly One TreeP = konst' tt +' (var' <> *' var' <>) -- What's a one-hole context in a Mu P? Diff : Poly One -> Poly One Diff (var' x) = konst' tt Diff (konst' x) = konst' ff Diff (p +' q) = Diff p +' Diff q Diff (p *' q) = (Diff p *' q) +' (p *' Diff q) plug : {X : Set}(p : Poly One) -> X -> Eval (\ _ -> X) (Diff p) -> Eval (\ _ -> X) p plug (var' <>) x <> = x plug (konst' b) x () plug (p +' q) x (inl xp') = inl (plug p x xp') plug (p +' q) x (inr xq') = inr (plug q x xq') plug (p *' q) x (inl (xp' , xq)) = plug p x xp' , xq plug (p *' q) x (inr (xp , xq')) = xp , plug q x xq' Context : Poly One -> Set Context p = List (Eval (\ _ -> Mu p) (Diff p)) plugs : (p : Poly One) -> Mu p -> Context p -> Mu p plugs p t [] = t plugs p t (t' ,- t's) = plugs p < plug p t t' > t's TernaryP : Poly One TernaryP = konst' tt +' (var' <> *' (var' <> *' var' <>)) fold : (p : Poly One){T : Set} -> (Eval (\ _ -> T) p -> T) -> Mu p -> T fold p {T} alg < x > = alg (evalFold p x) where evalFold : (q : Poly One) -> Eval (\ _ -> Mu p) q -> Eval (\ _ -> T) q evalFold (var' <>) x = fold p alg x evalFold (konst' b) x = x evalFold (q +' r) (inl y) = inl (evalFold q y) evalFold (q +' r) (inr y) = inr (evalFold r y) evalFold (q *' r) (y , z) = evalFold q y , evalFold r z record Nu (p : Poly One) : Set where coinductive field out : Eval (\ _ -> Nu p) p -- What's the connection between polynomials and containers? _-:>_ : {I : Set} -> (I -> Set) -> (I -> Set) -> (I -> Set) (S -:> T) i = S i -> T i [_] : {I : Set} -> (I -> Set) -> Set [ P ] = forall i -> P i -- [_] {I} P = (i : I) -> P i All : {X : Set} -> (X -> Set) -> (List X -> Set) All P [] = One All P (x ,- xs) = P x * All P xs record _|>_ (I O : Set) : Set where field Cuts : O -> Set -- given o : O, how may we cut it? inners : {o : O} -> Cuts o -> List I -- given how we cut it, what are -- the shapes of its pieces? record Cutting {I O}(C : I |> O)(P : I -> Set)(o : O) : Set where constructor _8><_ -- "scissors" open _|>_ C field cut : Cuts o -- we decide how to cut o pieces : All P (inners cut) -- then we give all the pieces. infixr 3 _8><_ data Interior {I}(C : I |> I)(T : I -> Set)(i : I) : Set where -- either... tile : T i -> Interior C T i -- we have a tile that fits, or... <_> : Cutting C (Interior C T) i -> -- ...we cut, then tile the pieces. Interior C T i _+L_ : {X : Set} -> List X -> List X -> List X [] +L ys = ys (x ,- xs) +L ys = x ,- (xs +L ys) polyCon : {I : Set} -> Poly I -> I |> One _|>_.Cuts (polyCon p) <> = Eval (\ _ -> One) p _|>_.inners (polyCon (var' i)) <> = i ,- [] _|>_.inners (polyCon (konst' x)) s = [] _|>_.inners (polyCon (p +' q)) (inl xp) = _|>_.inners (polyCon p) xp _|>_.inners (polyCon (p +' q)) (inr xq) = _|>_.inners (polyCon q) xq _|>_.inners (polyCon (p *' q)) (sp , sq) = _|>_.inners (polyCon p) sp +L _|>_.inners (polyCon q) sq Choose : {I J : Set} -> (I -> Set) -> (J -> Set) -> (I + J) -> Set Choose X Y (inl i) = X i Choose X Y (inr j) = Y j data MU {I -- what sorts of "elements" do we store? J -- what sorts of "nodes" do we have? : Set} (F : J -> Poly (I + J)) -- what is the structure of each sort of node? (X : I -> Set) -- what are the elements? (j : J) -- what sort is the outermost node? : Set where <_> : Eval (Choose X (MU F X)) -- subnodes in recursive positions (F j) -> MU F X j VecF : Nat -> Poly (One + Nat) VecF zero = konst' tt VecF (suc n) = (var' (inl <>)) *' (var' (inr n)) VEC : Nat -> Set -> Set VEC n X = MU VecF (\ _ -> X) n vnil : {X : Set} -> VEC zero X vnil = < <> > vcons : {X : Set}{n : Nat} -> X -> VEC n X -> VEC (suc n) X vcons x xs = < (x , xs) > gmap : {I -- what sorts of "elements" do we store? J -- what sorts of "nodes" do we have? : Set} {F : J -> Poly (I + J)} -- what is the structure of each sort of node? {X Y : I -> Set} -> -- what are the elements? ((i : I) -> X i -> Y i) -> (j : J) -> MU F X j -> MU F Y j gmapHelp : ∀ {I J} (F : J → Poly (I + J)) {X Y : I → Set} (w : Poly (I + J)) → ((i : I) → X i → Y i) → Eval (Choose X (MU F X)) w → Eval (Choose Y (MU F Y)) w gmap {F = F} f j < xt > = < gmapHelp F (F j) f xt > gmapHelp F (var' (inl i)) f x = f i x gmapHelp F (var' (inr j)) f t = gmap f j t gmapHelp F (konst' x) f v = v gmapHelp F (p +' q) f (inl xp) = inl (gmapHelp F p f xp) gmapHelp F (p +' q) f (inr xq) = inr (gmapHelp F q f xq) gmapHelp F (p *' q) f (xp , xq) = (gmapHelp F p f xp) , (gmapHelp F q f xq)
26.803738
81
0.48152
5e0adefe4654d4b1999d59ae434c143dfe918ac9
570
agda
Agda
test/Succeed/Issue1944-UnappliedOverloadedProjection.agda
pthariensflame/agda
222c4c64b2ccf8e0fc2498492731c15e8fef32d4
[ "BSD-3-Clause" ]
3
2015-03-28T14:51:03.000Z
2015-12-07T20:14:00.000Z
test/Succeed/Issue1944-UnappliedOverloadedProjection.agda
Blaisorblade/Agda
802a28aa8374f15fe9d011ceb80317fdb1ec0949
[ "BSD-3-Clause" ]
null
null
null
test/Succeed/Issue1944-UnappliedOverloadedProjection.agda
Blaisorblade/Agda
802a28aa8374f15fe9d011ceb80317fdb1ec0949
[ "BSD-3-Clause" ]
1
2019-03-05T20:02:38.000Z
2019-03-05T20:02:38.000Z
-- Andreas, Bentfest 2016-04-28 Marsstrand -- Issue 1944: also resolve overloaded projections in checking position module _ (A : Set) (a : A) where record R B : Set where field f : B open R record S B : Set where field f : B open S test : R A → A test = f test1 : ∀{A} → R A → A test1 = f test2 : ∀ A → R A → A test2 A = f {A} postulate F : Set → Set mapF : ∀{A B} (f : A → B) → F A → F B fr : F (R A) test3 : F (R A) → F A test3 = mapF f test4 : F (R _) → F A test4 = mapF f test5 : ∀{A} → F (F (R A)) → F _ test5 = mapF (mapF f) test6 = mapF f fr
15
71
0.564912
19403b9be7fceac2e966dfd91dac2bbb08d70d3f
1,407
agda
Agda
extra/extra/Reasoning.agda
krzygorz/plfa.github.io
10a3203624f2ea937b3892176db5de825d0c46b4
[ "CC-BY-4.0" ]
1,003
2018-07-05T18:15:14.000Z
2022-03-27T07:03:28.000Z
extra/extra/Reasoning.agda
krzygorz/plfa.github.io
10a3203624f2ea937b3892176db5de825d0c46b4
[ "CC-BY-4.0" ]
323
2018-07-05T22:34:34.000Z
2022-03-30T07:42:57.000Z
extra/extra/Reasoning.agda
krzygorz/plfa.github.io
10a3203624f2ea937b3892176db5de825d0c46b4
[ "CC-BY-4.0" ]
304
2018-07-16T18:24:59.000Z
2022-03-28T11:35:02.000Z
open import Data.Nat using (ℕ; zero; suc; _+_) import Relation.Binary.PropositionalEquality as Eq import Relation.Binary.PreorderReasoning as Re module ReEq = Re (Eq.preorder ℕ) open ReEq using (begin_; _∎; _IsRelatedTo_) renaming (_≈⟨⟩_ to _≡⟨⟩_; _∼⟨_⟩_ to _≡⟨_⟩_) open Eq using (_≡_; refl; sym; trans) lift : ∀ {m n : ℕ} → m ≡ n → suc m ≡ suc n lift refl = refl +-assoc : ∀ (m n p : ℕ) → (m + n) + p ≡ m + (n + p) +-assoc zero n p = begin (zero + n) + p ≡⟨⟩ zero + (n + p) ∎ +-assoc (suc m) n p = begin (suc m + n) + p ≡⟨⟩ suc ((m + n) + p) ≡⟨ lift (+-assoc m n p) ⟩ suc (m + (n + p)) ≡⟨⟩ suc m + (n + p) ∎ +-identity : ∀ (m : ℕ) → m + zero ≡ m +-identity zero = begin zero + zero ≡⟨⟩ zero ∎ +-identity (suc m) = begin suc m + zero ≡⟨⟩ suc (m + zero) ≡⟨ lift (+-identity m) ⟩ suc m ∎ +-suc : ∀ (m n : ℕ) → m + suc n ≡ suc (m + n) +-suc zero n = begin zero + suc n ≡⟨⟩ suc n ≡⟨⟩ suc (zero + n) ∎ +-suc (suc m) n = begin suc m + suc n ≡⟨⟩ suc (m + suc n) ≡⟨ lift (+-suc m n) ⟩ suc (suc (m + n)) ≡⟨⟩ suc (suc m + n) ∎ +-comm : ∀ (m n : ℕ) → m + n ≡ n + m +-comm m zero = begin m + zero ≡⟨ +-identity m ⟩ m ≡⟨⟩ zero + m ∎ +-comm m (suc n) = begin m + suc n ≡⟨ +-suc m n ⟩ suc (m + n) ≡⟨ lift (+-comm m n) ⟩ suc (n + m) ≡⟨⟩ suc n + m ∎
16.172414
87
0.452736
5e574ef391ab29ed216d5e6a07a26934398ae1c9
8,598
agda
Agda
src/Bisimilarity/Weak/Up-to.agda
nad/up-to
b936ff85411baf3401ad85ce85d5ff2e9aa0ca14
[ "MIT" ]
null
null
null
src/Bisimilarity/Weak/Up-to.agda
nad/up-to
b936ff85411baf3401ad85ce85d5ff2e9aa0ca14
[ "MIT" ]
null
null
null
src/Bisimilarity/Weak/Up-to.agda
nad/up-to
b936ff85411baf3401ad85ce85d5ff2e9aa0ca14
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- Up-to techniques for the standard coinductive definition of weak -- bisimilarity ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} open import Labelled-transition-system module Bisimilarity.Weak.Up-to {ℓ} (lts : LTS ℓ) where open import Logical-equivalence using (_⇔_) open import Prelude open import Prelude.Size open import Bisimilarity.Weak lts import Bisimilarity.Weak.Equational-reasoning-instances open import Equational-reasoning open import Expansion lts as E using (Expansion; _≲_; ≳:_) import Expansion.Equational-reasoning-instances open import Indexed-container open import Relation import Similarity.Weak lts as S import Up-to open LTS lts import Similarity.Step lts _[_]⇒̂_ as SS ------------------------------------------------------------------------ -- The general up-to machinery, instantiated with the StepC container open Up-to StepC public ------------------------------------------------------------------------ -- Up to expansion -- Up to expansion. -- -- I took this definition from "Enhancements of the bisimulation proof -- method" by Pous and Sangiorgi. Up-to-expansion : Trans₂ ℓ Proc Up-to-expansion R = Expansion ∞ ⊙ R ⊙ Expansion ∞ ⁻¹ -- Up to expansion is monotone. up-to-expansion-monotone : Monotone Up-to-expansion up-to-expansion-monotone R⊆S = Σ-map id (Σ-map id (Σ-map id (Σ-map R⊆S id))) -- Up to expansion is size-preserving. up-to-expansion-size-preserving : Size-preserving Up-to-expansion up-to-expansion-size-preserving = _⇔_.from (monotone→⇔ up-to-expansion-monotone) (λ where {x = p , q} (r , p≳r , s , r≈s , s≲q) → p ∼⟨ p≳r ⟩ r ∼′⟨ r≈s ⟩ ≳: s ∽⟨ s≲q ⟩■ q) ------------------------------------------------------------------------ -- A generalisation of up to expansion mutual -- A monolithic implementation of a non-symmetric variant of up to -- expansion, based on the technique presented in Section 6.5.2.4 of -- "Enhancements of the bisimulation proof method" by Pous and -- Sangiorgi. -- -- It is at the time of writing not clear to me if there is some -- size-preserving proof that matches this technique. 6-5-2-4 : {R : Rel₂ ℓ Proc} → (∀ {P P′ Q μ} → R (P , Q) → P [ μ ]⟶ P′ → ∃ λ Q′ → Q [ μ ]⇒̂ Q′ × (Expansion ∞ ⊙ R ⊙ Weak-bisimilarity ∞) (P′ , Q′)) → (∀ {P Q Q′ μ} → R (P , Q) → Q [ μ ]⟶ Q′ → ∃ λ P′ → P [ μ ]⇒̂ P′ × (Weak-bisimilarity ∞ ⊙ R ⊙ Expansion ∞ ⁻¹) (P′ , Q′)) → R ⊆ Weak-bisimilarity ∞ 6-5-2-4 {R} lr⟶ rl⟶ = 6-5-2-4′ (λ PRQ → S.⟨ lr⟶ PRQ ⟩) (λ PR⁻¹Q → S.⟨ Σ-map id (Σ-map id lemma) ∘ rl⟶ PR⁻¹Q ⟩) where lemma : Weak-bisimilarity ∞ ⊙ R ⊙ Expansion ∞ ⁻¹ ⊆ (Expansion ∞ ⊙ R ⁻¹ ⊙ Weak-bisimilarity ∞) ⁻¹ lemma (_ , P₁≈P₂ , _ , P₂RP₃ , P₃≲P₄) = (_ , P₃≲P₄ , _ , P₂RP₃ , symmetric P₁≈P₂) -- A variant of 6-5-2-4. 6-5-2-4′ : let Prog = λ (R : Rel₂ ℓ Proc) → R ⊆ ⟦ S.StepC ⟧ (Expansion ∞ ⊙ R ⊙ Weak-bisimilarity ∞) in ∀ {R} → Prog R → Prog (R ⁻¹) → R ⊆ Weak-bisimilarity ∞ 6-5-2-4′ {R} lr⟶ rl⟶ = R ⊆⟨ ⊆≈≈ ⟩ ≈ R ≈ ⊆⟨ unfold _ (λ P≈R≈Q → StepC.⟨ SS.Step.challenge (lemma lr⟶ P≈R≈Q) , Σ-map id (Σ-map id ≈≈-sym) ∘ SS.Step.challenge (lemma rl⟶ (≈≈-sym P≈R≈Q)) ⟩) ⟩∎ Weak-bisimilarity ∞ ∎ where ≈_≈ : Rel₂ ℓ Proc → Rel₂ ℓ Proc ≈ R ≈ = Weak-bisimilarity ∞ ⊙ R ⊙ Weak-bisimilarity ∞ ⊆≈≈ : ∀ {R} → R ⊆ ≈ R ≈ ⊆≈≈ r = _ , reflexive , _ , r , reflexive ≳_≈ : Rel₂ ℓ Proc → Rel₂ ℓ Proc ≳ R ≈ = Expansion ∞ ⊙ R ⊙ Weak-bisimilarity ∞ ⊆≳≈ : ∀ {R} → R ⊆ ≳ R ≈ ⊆≳≈ r = _ , reflexive , _ , r , reflexive ≈≈-sym : ∀ {R} → ≈ R ≈ ⊆ ≈ R ⁻¹ ≈ ⁻¹ ≈≈-sym (_ , P₁≈P₂ , _ , P₂RP₃ , P₃≈P₄) = (_ , symmetric P₃≈P₄ , _ , P₂RP₃ , symmetric P₁≈P₂) lemma : ∀ {R} → R ⊆ ⟦ S.StepC ⟧ ≳ R ≈ → ≈ R ≈ ⊆ SS.Step ≈ R ≈ lemma {R} lr⟶ = λ where (P₁ , P≈P₁ , Q₁ , P₁RQ₁ , Q₁≈Q) .SS.Step.challenge P⟶P₁ → let P₁′ , P₁⟶̂P₁′ , P′≈′P₁′ = left-to-right P≈P₁ P⟶P₁ Q₁′ , Q₁⇒̂Q₁′ , P₁″ , P₁′≳P₁″ , Q₁″ , P₁″RQ₁″ , Q₁″≈Q₁′ = lr≳≈⇒̂ (⊆≳≈ P₁RQ₁) P₁⟶̂P₁′ Q′ , Q⇒̂Q′ , Q₁′≈Q′ = weak-is-weak⇒̂ Q₁≈Q Q₁⇒̂Q₁′ in Q′ , Q⇒̂Q′ , P₁″ , transitive′ {a = ℓ} (force P′≈′P₁′) P₁′≳P₁″ , Q₁″ , P₁″RQ₁″ , transitive {a = ℓ} Q₁″≈Q₁′ Q₁′≈Q′ where lr⟶̂ : ∀ {P P′ Q μ} → R (P , Q) → P [ μ ]⟶̂ P′ → ∃ λ Q′ → Q [ μ ]⇒̂ Q′ × ≳ R ≈ (P′ , Q′) lr⟶̂ PRQ (done s) = _ , silent s done , ⊆≳≈ PRQ lr⟶̂ PRQ (step P⟶P′) = S.challenge (lr⟶ PRQ) P⟶P′ lr≳≈⟶ : ∀ {P P′ Q μ} → ≳ R ≈ (P , Q) → P [ μ ]⟶ P′ → ∃ λ Q′ → Q [ μ ]⇒̂ Q′ × ≳ R ≈ (P′ , Q′) lr≳≈⟶ (P₁ , P≳P₁ , Q₁ , P₁RQ₁ , Q₁≈Q) P⟶P′ = let P₁′ , P₁⟶̂P₁′ , P′≳P₁′ = E.left-to-right P≳P₁ P⟶P′ Q₁′ , Q₁⇒̂Q₁′ , P₁″ , P₁′≳P₁″ , Q₁″ , P₁″RQ₁″ , Q₁″≈Q₁′ = lr⟶̂ P₁RQ₁ P₁⟶̂P₁′ Q′ , Q⇒̂Q′ , Q₁′≈Q′ = weak-is-weak⇒̂ Q₁≈Q Q₁⇒̂Q₁′ in Q′ , Q⇒̂Q′ , P₁″ , transitive {a = ℓ} P′≳P₁′ P₁′≳P₁″ , Q₁″ , P₁″RQ₁″ , transitive {a = ℓ} Q₁″≈Q₁′ Q₁′≈Q′ lr≳≈⇒ : ∀ {P P′ Q} → ≳ R ≈ (P , Q) → P ⇒ P′ → ∃ λ Q′ → Q ⇒ Q′ × ≳ R ≈ (P′ , Q′) lr≳≈⇒ P≳R≈Q done = _ , done , P≳R≈Q lr≳≈⇒ P≳R≈Q (step s P⟶P′ P′⇒P″) = let Q′ , Q⇒̂Q′ , P′≳R≈Q′ = lr≳≈⟶ P≳R≈Q P⟶P′ Q″ , Q′⇒Q″ , P″≳R≈Q″ = lr≳≈⇒ P′≳R≈Q′ P′⇒P″ in Q″ , ⇒-transitive (⇒̂→⇒ s Q⇒̂Q′) Q′⇒Q″ , P″≳R≈Q″ lr≳≈[]⇒ : ∀ {P P′ Q μ} → ¬ Silent μ → ≳ R ≈ (P , Q) → P [ μ ]⇒ P′ → ∃ λ Q′ → Q [ μ ]⇒ Q′ × ≳ R ≈ (P′ , Q′) lr≳≈[]⇒ ¬s P≳R≈Q (steps P⇒P′ P′⟶P″ P″⇒P‴) = let Q′ , Q⇒Q′ , P′≳R≈Q′ = lr≳≈⇒ P≳R≈Q P⇒P′ Q″ , Q′⇒̂Q″ , P″≳R≈Q″ = lr≳≈⟶ P′≳R≈Q′ P′⟶P″ Q‴ , Q″⇒Q‴ , P‴≳R≈Q‴ = lr≳≈⇒ P″≳R≈Q″ P″⇒P‴ in Q‴ , []⇒⇒-transitive (⇒[]⇒-transitive Q⇒Q′ (⇒̂→[]⇒ ¬s Q′⇒̂Q″)) Q″⇒Q‴ , P‴≳R≈Q‴ lr≳≈⇒̂ : ∀ {P P′ Q μ} → ≳ R ≈ (P , Q) → P [ μ ]⇒̂ P′ → ∃ λ Q′ → Q [ μ ]⇒̂ Q′ × ≳ R ≈ (P′ , Q′) lr≳≈⇒̂ PRQ = λ where (silent s P⇒P′) → Σ-map id (Σ-map (silent s) id) (lr≳≈⇒ PRQ P⇒P′) (non-silent ¬s P⇒P′) → Σ-map id (Σ-map (non-silent ¬s) id) (lr≳≈[]⇒ ¬s PRQ P⇒P′) ------------------------------------------------------------------------ -- Up to weak bisimilarity -- Up to weak bisimilarity. -- -- I based this definition on Definition 4.2.13 in Milner's -- "Operational and Algebraic Semantics of Concurrent Processes". Up-to-weak-bisimilarity : Trans₂ ℓ Proc Up-to-weak-bisimilarity R = Weak-bisimilarity ∞ ⊙ R ⊙ Weak-bisimilarity ∞ -- Up to weak bisimilarity is monotone. up-to-weak-bisimilarity-monotone : Monotone Up-to-weak-bisimilarity up-to-weak-bisimilarity-monotone R⊆S = Σ-map id (Σ-map id (Σ-map id (Σ-map R⊆S id))) -- If transitivity of weak bisimilarity is size-preserving in the -- first argument, then "up to weak bisimilarity" is size-preserving. size-preserving-transitivity→up-to-weak-bisimilarity-size-preserving : (∀ {i x y z} → [ i ] x ≈ y → [ ∞ ] y ≈ z → [ i ] x ≈ z) → Size-preserving Up-to-weak-bisimilarity size-preserving-transitivity→up-to-weak-bisimilarity-size-preserving trans = _⇔_.from (monotone→⇔ up-to-weak-bisimilarity-monotone) λ where {x = p , q} (r , p≈r , s , r≈s , s≈q) → p ≈∞⟨ p≈r ⟩ r ≈⟨ r≈s ⟩∞ s ∼⟨ s≈q ⟩■ q where infixr -2 _≈⟨_⟩∞_ _≈∞⟨_⟩_ _≈⟨_⟩∞_ : ∀ {i} x {y z} → [ i ] x ≈ y → [ ∞ ] y ≈ z → [ i ] x ≈ z _ ≈⟨ p ⟩∞ q = trans p q _≈∞⟨_⟩_ : ∀ {i} x {y z} → [ ∞ ] x ≈ y → [ i ] y ≈ z → [ i ] x ≈ z _ ≈∞⟨ p ⟩ q = symmetric (trans (symmetric q) (symmetric p)) -- If transitivity of weak bisimilarity is size-preserving in both -- arguments, then weak bisimulations up to weak bisimilarity are -- contained in weak bisimilarity. size-preserving-transitivity→up-to-weak-bisimilarity-up-to : (∀ {i x y z} → [ i ] x ≈ y → [ i ] y ≈ z → [ i ] x ≈ z) → Up-to-technique Up-to-weak-bisimilarity size-preserving-transitivity→up-to-weak-bisimilarity-up-to = size-preserving→up-to ∘ size-preserving-transitivity→up-to-weak-bisimilarity-size-preserving
35.382716
94
0.467202
fbd4be5763e0b9a94611c3f764d5c78a7080145b
2,893
agda
Agda
proglangs-learning/Agda/sv20/assign2/First.agda
helq/old_code
a432faf1b340cb379190a2f2b11b997b02d1cd8d
[ "CC0-1.0" ]
null
null
null
proglangs-learning/Agda/sv20/assign2/First.agda
helq/old_code
a432faf1b340cb379190a2f2b11b997b02d1cd8d
[ "CC0-1.0" ]
4
2020-03-10T19:20:21.000Z
2021-06-07T15:39:48.000Z
proglangs-learning/Agda/sv20/assign2/First.agda
helq/old_code
a432faf1b340cb379190a2f2b11b997b02d1cd8d
[ "CC0-1.0" ]
null
null
null
-- For the first task, we are asked to prove that max is idempotent and -- associative. The proves presented in this file are as succint as they -- possibly can. The proves come with added comments to aid understanding as -- the proves are meant to be short and simple but not very legible. The -- solution to task 1 starts in lines 44 and 51. module sv20.assign2.First where open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong) open import Data.Nat using (ℕ; zero; suc; _+_) open import Data.Nat using (_≤_; z≤n; s≤s; _<_) open import Relation.Nullary using (¬_) open import Data.Empty using (⊥-elim) open import Function using (_∘_) -- First, we define the max function. Notice, how the function differs from the -- definition offered for the assignment max : ℕ → ℕ → ℕ max zero n = n max (suc m) zero = suc m max (suc m) (suc n) = suc (max m n) -- Nonetheless, we can prove that the definition of max presented in the -- assignment follows from ours. -- In athena, the first part of the definition corresponds to the sentence -- "y < x ==> x max y = x", which translated into Agda corresponds to: less : ∀ {x y} → y < x → max x y ≡ x -- and it is easily proven by: less {zero} () -- Nonesense case less {suc m} {zero} (s≤s z≤n) = refl -- Simplest case, y ≡ 0 less {suc m} {suc n} (s≤s n<m) = cong suc (less n<m) -- if "n < m → max m n ≡ m" then "suc n < suc m → max (suc m) (suc n) ≡ (suc m)" -- The second part of the definition asserts (in Athena) that -- "~ y < x ==> x max y = y" not-less : ∀ {x y} → ¬ (y < x) → max x y ≡ y -- which is easily proven by induction with: not-less {zero} {n} ¬y<x = refl -- Base case 1 not-less {suc m} {zero} ¬z<sm = ⊥-elim (¬z<sm (s≤s z≤n)) -- Base case 2 not-less {suc m} {suc n} ¬sn<sm = cong suc (not-less (¬sn<sm ∘ s≤s)) -- Inductive case --not-less {suc m} {suc n} ¬sn<sm = cong suc (not-less {m} {n} (λ n<m → ¬sn<sm (s≤s n<m))) -- The pattern ¬sn<sm ∘ s≤s means that you are creating a function ¬n<m from ¬sn<sm -- SOLUTIONS -- max is idempotent -- By induction: max-idem : ∀ x → max x x ≡ x max-idem zero = refl -- Base case: max 0 0 ≡ 0 max-idem (suc n) = cong suc (max-idem n) -- Inductive case: if "max n n ≡ n" then "max (suc n) (suc n) ≡ suc n" because "max (suc n) (suc n) ≡ suc (max n n)" -- max is associative -- By induction: max-assoc : ∀ x y z → max x (max y z) ≡ max (max x y) z max-assoc zero _ _ = refl -- Base cases: when one of the numbers is 0, then "max 0 n ≡ n" by definition of max max-assoc (suc m) zero _ = refl -- max-assoc (suc m) (suc n) zero = refl -- max-assoc (suc m) (suc n) (suc o) = cong suc (max-assoc m n o) -- Inductive case: if "max m (max n o) ≡ max (max m n) o" then "max (suc m) (max (suc n) (suc o)) ≡ suc (max m (max n o)) ≡ suc (max (max m n) o) ≡ max (max (suc m) (suc n)) (suc o)"
50.754386
245
0.620809
8bed8974553ecca5c96852754cd7affc17cdc2eb
8,159
agda
Agda
src/Container/Tree.agda
nad/equality
402b20615cfe9ca944662380d7b2d69b0f175200
[ "MIT" ]
3
2020-05-21T22:58:50.000Z
2021-09-02T17:18:15.000Z
src/Container/Tree.agda
nad/equality
402b20615cfe9ca944662380d7b2d69b0f175200
[ "MIT" ]
null
null
null
src/Container/Tree.agda
nad/equality
402b20615cfe9ca944662380d7b2d69b0f175200
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- A container for finite binary trees with information in internal -- nodes ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Equality module Container.Tree {c⁺} (eq : ∀ {a p} → Equality-with-J a p c⁺) where open Derived-definitions-and-properties eq open import Prelude hiding (id; _∘_; List; []; _∷_) open import Bijection eq using (_↔_; module _↔_) open import Container eq hiding (Shape; Position) open import Container.List eq hiding (fold; fold-lemma) open import Function-universe eq import Tree eq as Tree ------------------------------------------------------------------------ -- The type -- Shapes. data Shape : Type where lf : Shape nd : Shape → Shape → Shape -- Positions. data Position : Shape → Type where root : ∀ {l r} → Position (nd l r) left : ∀ {l r} → Position l → Position (nd l r) right : ∀ {l r} → Position r → Position (nd l r) -- Trees. Tree : Container lzero Tree = Shape ▷ Position ------------------------------------------------------------------------ -- An isomorphism -- The type of shapes is isomorphic to Tree.Tree ⊤. -- -- This lemma is included because it was mentioned in the paper "Bag -- Equivalence via a Proof-Relevant Membership Relation". Shape↔Tree-⊤ : Shape ↔ Tree.Tree ⊤ Shape↔Tree-⊤ = record { surjection = record { logical-equivalence = record { to = to ; from = from } ; right-inverse-of = to∘from } ; left-inverse-of = from∘to } where to : Shape → Tree.Tree ⊤ to lf = Tree.leaf to (nd l r) = Tree.node (to l) tt (to r) from : Tree.Tree ⊤ → Shape from Tree.leaf = lf from (Tree.node l tt r) = nd (from l) (from r) to∘from : ∀ t → to (from t) ≡ t to∘from Tree.leaf = refl _ to∘from (Tree.node l tt r) = cong₂ (λ l r → Tree.node l tt r) (to∘from l) (to∘from r) from∘to : ∀ s → from (to s) ≡ s from∘to lf = refl _ from∘to (nd l r) = cong₂ nd (from∘to l) (from∘to r) ------------------------------------------------------------------------ -- Constructors -- Leaves. leaf : {A : Type} → ⟦ Tree ⟧ A leaf = (lf , λ ()) -- Internal nodes. node : {A : Type} → ⟦ Tree ⟧ A → A → ⟦ Tree ⟧ A → ⟦ Tree ⟧ A node (l , lkup-l) x (r , lkup-r) = ( nd l r , λ { root → x ; (left p) → lkup-l p ; (right p) → lkup-r p } ) -- Even if we don't assume extensionality we can prove that -- intensionally distinct implementations of the constructors are bag -- equivalent. leaf≈ : {A : Type} {lkup : _ → A} → _≈-bag_ {C₂ = Tree} leaf (lf , lkup) leaf≈ _ = record { surjection = record { logical-equivalence = record { to = λ { (() , _) } ; from = λ { (() , _) } } ; right-inverse-of = λ { (() , _) } } ; left-inverse-of = λ { (() , _) } } node≈ : ∀ {A : Type} {l r} {lkup : _ → A} → _≈-bag_ {C₂ = Tree} (node (l , lkup ∘ left) (lkup root) (r , lkup ∘ right)) (nd l r , lkup) node≈ _ = record { surjection = record { logical-equivalence = record { to = λ { (root , eq) → (root , eq) ; (left p , eq) → (left p , eq) ; (right p , eq) → (right p , eq) } ; from = λ { (root , eq) → (root , eq) ; (left p , eq) → (left p , eq) ; (right p , eq) → (right p , eq) } } ; right-inverse-of = λ { (root , eq) → refl _ ; (left p , eq) → refl _ ; (right p , eq) → refl _ } } ; left-inverse-of = λ { (root , eq) → refl _ ; (left p , eq) → refl _ ; (right p , eq) → refl _ } } -- Any lemmas for the constructors. Any-leaf : ∀ {A : Type} (P : A → Type) → Any P leaf ↔ ⊥₀ Any-leaf _ = record { surjection = record { logical-equivalence = record { to = λ { (() , _) } ; from = λ () } ; right-inverse-of = λ () } ; left-inverse-of = λ { (() , _) } } Any-node : ∀ {A : Type} (P : A → Type) {l x r} → Any P (node l x r) ↔ Any P l ⊎ P x ⊎ Any P r Any-node _ {l = _ , _} {r = _ , _} = record { surjection = record { logical-equivalence = record { to = λ { (root , eq) → inj₂ (inj₁ eq) ; (left p , eq) → inj₁ (p , eq) ; (right p , eq) → inj₂ (inj₂ (p , eq)) } ; from = λ { (inj₁ (p , eq)) → (left p , eq) ; (inj₂ (inj₁ eq)) → (root , eq) ; (inj₂ (inj₂ (p , eq))) → (right p , eq) } } ; right-inverse-of = λ { (inj₁ (p , eq)) → refl _ ; (inj₂ (inj₁ eq)) → refl _ ; (inj₂ (inj₂ (p , eq))) → refl _ } } ; left-inverse-of = λ { (root , eq) → refl _ ; (left p , eq) → refl _ ; (right p , eq) → refl _ } } ------------------------------------------------------------------------ -- More functions -- Singleton trees. singleton : {A : Type} → A → ⟦ Tree ⟧ A singleton x = node leaf x leaf -- Any lemma for singleton. Any-singleton : ∀ {A : Type} (P : A → Type) {x} → Any P (singleton x) ↔ P x Any-singleton P {x} = Any P (singleton x) ↔⟨⟩ Any P (node leaf x leaf) ↔⟨ Any-node P ⟩ Any P leaf ⊎ P x ⊎ Any P leaf ↔⟨ Any-leaf P ⊎-cong id ⊎-cong Any-leaf P ⟩ ⊥ ⊎ P x ⊎ ⊥ ↔⟨ ⊎-left-identity ⟩ P x ⊎ ⊥ ↔⟨ ⊎-right-identity ⟩ P x □ -- For the design considerations underlying the inclusion of fold and -- fold-lemma, see Container.List.fold/fold-lemma. -- A fold for trees. (Well, this is not a catamorphism, it is a -- paramorphism.) fold : {A B : Type} → B → (⟦ Tree ⟧ A → A → ⟦ Tree ⟧ A → B → B → B) → ⟦ Tree ⟧ A → B fold {A} {B} fl fn = uncurry fold′ where fold′ : (s : Shape) → (Position s → A) → B fold′ lf lkup = fl fold′ (nd l r) lkup = fn (l , lkup ∘ left ) (lkup root) (r , lkup ∘ right) (fold′ l (lkup ∘ left )) (fold′ r (lkup ∘ right)) -- A lemma which can be used to prove properties about fold. -- -- The "respects bag equivalence" argument could be omitted if -- equality of functions were extensional. fold-lemma : ∀ {A B : Type} {fl : B} {fn : ⟦ Tree ⟧ A → A → ⟦ Tree ⟧ A → B → B → B} (P : ⟦ Tree ⟧ A → B → Type) → (∀ t₁ t₂ → t₁ ≈-bag t₂ → ∀ b → P t₁ b → P t₂ b) → P leaf fl → (∀ l x r b₁ b₂ → P l b₁ → P r b₂ → P (node l x r) (fn l x r b₁ b₂)) → ∀ t → P t (fold fl fn t) fold-lemma {A} {fl = fl} {fn} P resp P-le P-no = uncurry fold-lemma′ where fold-lemma′ : (s : Shape) (lkup : Position s → A) → P (s , lkup) (fold fl fn (s , lkup)) fold-lemma′ lf lkup = resp _ _ leaf≈ _ P-le fold-lemma′ (nd l r) lkup = resp _ _ node≈ _ $ P-no _ _ _ _ _ (fold-lemma′ l (lkup ∘ left )) (fold-lemma′ r (lkup ∘ right)) -- Inorder flattening of a tree. flatten : {A : Type} → ⟦ Tree ⟧ A → ⟦ List ⟧ A flatten = fold [] (λ _ x _ xs ys → xs ++ x ∷ ys) -- Flatten does not add or remove any elements. flatten≈ : {A : Type} (t : ⟦ Tree ⟧ A) → flatten t ≈-bag t flatten≈ = fold-lemma (λ t xs → xs ≈-bag t) (λ t₁ t₂ t₁≈t₂ xs xs≈t₁ z → z ∈ xs ↔⟨ xs≈t₁ z ⟩ z ∈ t₁ ↔⟨ t₁≈t₂ z ⟩ z ∈ t₂ □) (λ z → z ∈ [] ↔⟨ Any-[] (λ x → z ≡ x) ⟩ ⊥ ↔⟨ inverse $ Any-leaf (λ x → z ≡ x) ⟩ z ∈ leaf □) (λ l x r xs ys xs≈l ys≈r z → z ∈ xs ++ x ∷ ys ↔⟨ Any-++ (λ x → z ≡ x) _ _ ⟩ z ∈ xs ⊎ z ∈ x ∷ ys ↔⟨ id ⊎-cong Any-∷ (λ x → z ≡ x) ⟩ z ∈ xs ⊎ z ≡ x ⊎ z ∈ ys ↔⟨ xs≈l z ⊎-cong id ⊎-cong ys≈r z ⟩ z ∈ l ⊎ z ≡ x ⊎ z ∈ r ↔⟨ inverse $ Any-node (λ x → z ≡ x) ⟩ z ∈ node l x r □)
29.886447
76
0.442456
032317840273fb6fb6eb4007db76ed2f69caeddc
1,503
agda
Agda
test/Succeed/QuoteExtLam.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
null
null
null
test/Succeed/QuoteExtLam.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
null
null
null
test/Succeed/QuoteExtLam.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
null
null
null
open import Common.Prelude open import Common.Reflection open import Common.Equality open import Agda.Builtin.Sigma magic₁ : ⊥ → Nat magic₁ = λ () magic₂ : ⊥ → Nat magic₂ = λ { () } magic₃ : ⊥ → Nat magic₃ () data Wrap (A : Set) : Set where wrap : A → Wrap A magic₄ : Wrap ⊥ → Nat magic₄ (wrap ()) data OK : Set where ok : OK bad : String bad = "not good" macro checkDefinition : (Definition → Bool) → QName → Tactic checkDefinition isOk f hole = bindTC (getDefinition f) λ def → give (if isOk def then quoteTerm ok else quoteTerm bad) hole pattern `Nat = def (quote Nat) [] pattern _`→_ a b = pi (vArg a) (abs "_" b) pattern `Wrap a = def (quote Wrap) (vArg a ∷ []) pattern `⊥ = def (quote ⊥) [] pattern expected₄ = funDef (absurdClause (("()" , vArg `⊥) ∷ []) (vArg (con (quote wrap) (vArg absurd ∷ [])) ∷ []) ∷ []) check₄ : OK check₄ = checkDefinition (λ { expected₄ → true; _ → false }) magic₄ expected = extLam (absurdClause (("()" , vArg `⊥) ∷ []) (arg (argInfo visible relevant) absurd ∷ []) ∷ []) [] macro quoteTermNormalised : Term → Term → TC ⊤ quoteTermNormalised t hole = bindTC (normalise t) λ t → bindTC (quoteTC t) λ t → unify hole t check₁ : quoteTermNormalised magic₁ ≡ expected check₁ = refl check₂ : quoteTermNormalised magic₂ ≡ expected check₂ = refl pattern expectedDef = funDef (absurdClause (("()" , vArg `⊥) ∷ []) (vArg absurd ∷ []) ∷ []) check₃ : OK check₃ = checkDefinition (λ { expectedDef → true; _ → false }) magic₃
22.432836
109
0.6334
5e539b1179b9b3e1dc5433256496372c21f0f475
5,597
agda
Agda
src/Container/Indexed/Variant/M/Codata.agda
nad/equality
402b20615cfe9ca944662380d7b2d69b0f175200
[ "MIT" ]
3
2020-05-21T22:58:50.000Z
2021-09-02T17:18:15.000Z
src/Container/Indexed/Variant/M/Codata.agda
nad/equality
402b20615cfe9ca944662380d7b2d69b0f175200
[ "MIT" ]
null
null
null
src/Container/Indexed/Variant/M/Codata.agda
nad/equality
402b20615cfe9ca944662380d7b2d69b0f175200
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- M-types for indexed containers, defined coinductively (in Cubical -- Agda) ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe --guardedness #-} import Equality.Path as P module Container.Indexed.Variant.M.Codata {e⁺} (eq : ∀ {a p} → P.Equality-with-paths a p e⁺) where open P.Derived-definitions-and-properties eq open import Prelude open import Bijection equality-with-J using (_↔_) open import Container.Indexed equality-with-J using (_⇾_; _∘⇾_) open import Container.Indexed.Variant equality-with-J hiding (Final′≃Final′) import Container.Indexed.Variant P.equality-with-J as PC open import Equality.Path.Isomorphisms eq open import Equivalence equality-with-J as Eq using (_≃_) open import Function-universe equality-with-J open import H-level equality-with-J private variable a iℓ s : Level A I : Type a i p q x : A C : Container I s p n : ℕ -- An M-type for a given container. -- -- This definition is similar to one in "Indexed containers" by -- Altenkirch, Ghani, Hancock, McBride and Morris. record M {I : Type iℓ} (C : Container I s p) (i : I) : Type (iℓ ⊔ s ⊔ p) where coinductive constructor in-M field out-M : ⟦ C ⟧ (M C) i open M public -- An η-law. η : in-M (out-M x) ≡ x η = _↔_.from ≡↔≡ η′ where η′ : in-M (out-M x) P.≡ x η′ {x = x} _ .out-M = x .out-M -- M C is, in a certain sense, a fixpoint of ⟦ C ⟧. M-fixpoint : ⟦ C ⟧ (M C) i ≃ M C i M-fixpoint = Eq.↔→≃ in-M out-M (λ _ → η) refl -- A coalgebra defined using M and out-M. M-coalgebra : (C : Container I s p) → Coalgebra C M-coalgebra C = M C , λ _ → out-M private -- M-coalgebra C is a final coalgebra. -- -- This code is based on code written by Andrea Vezzosi for the -- cubical library. M-final′′ : PC.Final′ (M-coalgebra C) M-final′′ {C = C@(S ◁ P)} Y@(Q , f) = unfold , unique where g : Q ⇾ M C g i q .out-M .proj₁ = f i q .proj₁ g i q .out-M .proj₂ j p = g j (f i q .proj₂ j p) g-ok : (λ _ → out-M) ∘⇾ g P.≡ map C g ∘⇾ f g-ok i j q .proj₁ = f j q .proj₁ g-ok i j q .proj₂ k p .out-M = g-ok i k (f j q .proj₂ k p) unfold : Y PC.⇨ M-coalgebra C unfold = g , g-ok module _ (u : Y PC.⇨ M-coalgebra C) where lemma₁ : x P.≡ u .proj₁ i q → x .out-M .proj₁ P.≡ (map C (u .proj₁) ∘⇾ f) i q .proj₁ lemma₁ {i = i} {x = x} {q = q} eq = x .out-M .proj₁ P.≡⟨ P.cong (λ x → x .out-M .proj₁) eq ⟩ u .proj₁ i q .out-M .proj₁ P.≡⟨ P.cong (λ f → f i q .proj₁) (u .proj₂) ⟩∎ (map C (u .proj₁) ∘⇾ f) i q .proj₁ ∎ lemma₂ : (eq : x P.≡ u .proj₁ i q) → P.[ (λ l → P (lemma₁ eq l) ⇾ M C) ] x .out-M .proj₂ ≡ (map C (u .proj₁) ∘⇾ f) i q .proj₂ lemma₂ {i = i} {x = x} {q = q} eq = x .out-M .proj₂ P.≡⟨ P.hcong (λ x → x .out-M .proj₂) eq ⟩[ (λ p → P p ⇾ M C) ] u .proj₁ i q .out-M .proj₂ P.≡⟨ P.hcong (λ f → f i q .proj₂) (u .proj₂) ⟩∎h (map C (u .proj₁) ∘⇾ f) i q .proj₂ ∎ unique′ : ∀ i q x → x P.≡ u .proj₁ i q → x P.≡ g i q unique′ _ _ _ eq j .out-M .proj₁ = lemma₁ eq j unique′ i q x eq j .out-M .proj₂ k p = unique′ k (f i q .proj₂ k p₁) (x .out-M .proj₂ k p₀) lemma₂′ j where lem₁ = lemma₁ eq p₀ : P (lem₁ P.0̲) k p₁ : P (lem₁ P.1̲) k p₀ = P.transport (λ l → P (lem₁ (P.min j (P.- l))) k) (P.- j) p p₁ = P.transport (λ l → P (lem₁ (P.max j l )) k) j p p₀≡p₁ : P.[ (λ l → P (lem₁ l) k) ] p₀ ≡ p₁ p₀≡p₁ = P.elim¹ (λ eq → ∀ p → P.[ (λ l → eq l) ] P.transport (λ l → eq (P.min j (P.- l))) (P.- j) p ≡ P.transport (λ l → eq (P.max j l )) j p) (λ p → P.transport (λ _ → P (x .out-M .proj₁) k) (P.- j) p P.≡⟨ P.cong (_$ p) $ P.transport-refl (P.- j) ⟩ p P.≡⟨ P.cong (_$ p) $ P.sym $ P.transport-refl j ⟩∎ P.transport (λ _ → P (x .out-M .proj₁) k) j p ∎) (P.cong (λ s → P s k) lem₁) p lemma₂′ : x .out-M .proj₂ k p₀ P.≡ (map C (u .proj₁) ∘⇾ f) i q .proj₂ k p₁ lemma₂′ l = lemma₂ eq l k (p₀≡p₁ l) unique : unfold .proj₁ P.≡ u .proj₁ unique = P.⟨ext⟩ λ _ → P.⟨ext⟩ λ _ → P.sym $ unique′ _ _ _ P.refl -- Finality expressed using equality is equivalent to finality -- expressed using paths. Final′≃Final′ : (X : Coalgebra C) → Final′ X ≃ PC.Final′ X Final′≃Final′ X = (∀ Y → ∃ λ (m : Y ⇨ X) → (m′ : Y ⇨ X) → proj₁ m ≡ proj₁ m′) ↔⟨ (∀-cong ext λ _ → Σ-cong (lemma _) λ _ → Π-cong ext (lemma _) λ _ → ≡↔≡) ⟩□ (∀ Y → ∃ λ (m : Y PC.⇨ X) → (m′ : Y PC.⇨ X) → proj₁ m P.≡ proj₁ m′) □ where lemma : ∀ Y → (Y ⇨ X) ↔ (Y PC.⇨ X) lemma Y = ∃-cong λ _ → ≡↔≡ -- M-coalgebra C is a final coalgebra. -- -- The lemma M-final′′ is based on code written by Andrea Vezzosi for -- the cubical library. M-final′ : (C : Container I s p) → Final′ (M-coalgebra C) M-final′ C = _≃_.from (Final′≃Final′ (M-coalgebra C)) M-final′′
32.923529
116
0.469359
38d85a06e7810e34d23d09f50b273ab1038644ca
2,056
agda
Agda
Cubical/HITs/SetTruncation/Properties.agda
Rotsor/cubical
d55cd4834ca1f171f58b4a0c46b804ea6d18191f
[ "MIT" ]
null
null
null
Cubical/HITs/SetTruncation/Properties.agda
Rotsor/cubical
d55cd4834ca1f171f58b4a0c46b804ea6d18191f
[ "MIT" ]
null
null
null
Cubical/HITs/SetTruncation/Properties.agda
Rotsor/cubical
d55cd4834ca1f171f58b4a0c46b804ea6d18191f
[ "MIT" ]
null
null
null
{- This file contains: - Properties of set truncations -} {-# OPTIONS --cubical --safe #-} module Cubical.HITs.SetTruncation.Properties where open import Cubical.Core.Glue open import Cubical.HITs.SetTruncation.Base open import Cubical.Foundations.Prelude open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels private variable ℓ : Level A : Type ℓ -- lemma 6.9.1 in HoTT book elimSetTrunc : {B : ∥ A ∥₀ → Type ℓ} → (Bset : (x : ∥ A ∥₀) → isSet (B x)) → (g : (a : A) → B (∣ a ∣₀)) → (x : ∥ A ∥₀) → B x elimSetTrunc Bset g ∣ a ∣₀ = g a elimSetTrunc {A = A} {B = B} Bset g (squash₀ x y p q i j) = isOfHLevel→isOfHLevelDep {n = 2} Bset (elimSetTrunc Bset g x) (elimSetTrunc Bset g y) (cong (elimSetTrunc Bset g) p) (cong (elimSetTrunc Bset g) q) (squash₀ x y p q) i j setTruncUniversal : {B : Type ℓ} → (isSet B) → (∥ A ∥₀ → B) ≃ (A → B) setTruncUniversal Bset = isoToEquiv (iso intro elim leftInv rightInv) where intro = (λ h a → h ∣ a ∣₀) elim = elimSetTrunc (λ x → Bset) leftInv : ∀ g → intro (elim g) ≡ g leftInv g = refl rightInv : ∀ h → elim (intro h) ≡ h rightInv h i x = elimSetTrunc (λ x → isProp→isSet (Bset (elim (intro h) x) (h x))) (λ a → refl) x i elimSetTrunc2 : {B : ∥ A ∥₀ → ∥ A ∥₀ → Type ℓ} (Bset : ((x y : ∥ A ∥₀) → isSet (B x y))) (g : (a b : A) → B ∣ a ∣₀ ∣ b ∣₀) (x y : ∥ A ∥₀) → B x y elimSetTrunc2 Bset g = elimSetTrunc (λ _ → hLevelPi 2 (λ _ → Bset _ _)) (λ a → elimSetTrunc (λ _ → Bset _ _) (λ b → g a b)) elimSetTrunc3 : {B : (x y z : ∥ A ∥₀) → Type ℓ} (Bset : ((x y z : ∥ A ∥₀) → isSet (B x y z))) (g : (a b c : A) → B ∣ a ∣₀ ∣ b ∣₀ ∣ c ∣₀) (x y z : ∥ A ∥₀) → B x y z elimSetTrunc3 Bset g = elimSetTrunc2 (λ _ _ → hLevelPi 2 λ _ → Bset _ _ _) (λ a b → elimSetTrunc (λ _ → Bset _ _ _) (λ c → g a b c))
33.704918
88
0.532588
a02515c64ccec8289ef22ef6d0a606c9e8c03c32
928
agda
Agda
test/Compiler/simple/VecReverse.agda
cagix/agda
cc026a6a97a3e517bb94bafa9d49233b067c7559
[ "BSD-2-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Compiler/simple/VecReverse.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Compiler/simple/VecReverse.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
-- Andreas, 2020-12-16, also test #5103 -- Allow compilation with unsolved metas {-# OPTIONS --allow-unsolved-metas #-} module _ where open import Common.Prelude open import Lib.Vec _∘_ : ∀ {a b c} {A : Set a} {B : A → Set b} {C : ∀ x → B x → Set c} (f : ∀ {x} (y : B x) → C x y) (g : ∀ x → B x) → ∀ x → C x (g x) (f ∘ g) x = f (g x) sum : ∀ {n} → Vec Nat n → Nat sum (x ∷ xs) = x + sum xs sum [] = 0 foldl : ∀ {A} (B : Nat → Set) → (∀ {n} → B n → A → B (suc n)) → B 0 → ∀ {n} → Vec A n → B n foldl B f z (x ∷ xs) = foldl (λ n → B (suc n)) f (f z x) xs foldl B f z [] = z reverse : ∀ {A n} → Vec A n → Vec A n reverse = foldl (Vec {!!}) (λ xs x → x ∷ xs) [] -- inessential unsolved meta here downFrom : ∀ n → Vec Nat n downFrom zero = [] downFrom (suc n) = n ∷ downFrom n main : IO Unit main = printNat (sum (reverse (downFrom 600))) -- 10000 gives a stack overflow on JS
25.081081
85
0.508621
5e6a6634e0f79babf414ecb32355ddce24966b69
4,842
agda
Agda
Cubical/Data/List/Properties.agda
borsiemir/cubical
cefeb3669ffdaea7b88ae0e9dd258378418819ca
[ "MIT" ]
null
null
null
Cubical/Data/List/Properties.agda
borsiemir/cubical
cefeb3669ffdaea7b88ae0e9dd258378418819ca
[ "MIT" ]
null
null
null
Cubical/Data/List/Properties.agda
borsiemir/cubical
cefeb3669ffdaea7b88ae0e9dd258378418819ca
[ "MIT" ]
null
null
null
{-# OPTIONS --cubical --safe #-} module Cubical.Data.List.Properties where open import Agda.Builtin.List open import Cubical.Core.Everything open import Cubical.Foundations.HLevels open import Cubical.Foundations.Prelude open import Cubical.Data.Empty as ⊥ open import Cubical.Data.Nat open import Cubical.Data.Prod open import Cubical.Data.Unit open import Cubical.Relation.Nullary open import Cubical.Data.List.Base module _ {ℓ} {A : Type ℓ} where ++-unit-r : (xs : List A) → xs ++ [] ≡ xs ++-unit-r [] = refl ++-unit-r (x ∷ xs) = cong (_∷_ x) (++-unit-r xs) ++-assoc : (xs ys zs : List A) → (xs ++ ys) ++ zs ≡ xs ++ ys ++ zs ++-assoc [] ys zs = refl ++-assoc (x ∷ xs) ys zs = cong (_∷_ x) (++-assoc xs ys zs) rev-++ : (xs ys : List A) → rev (xs ++ ys) ≡ rev ys ++ rev xs rev-++ [] ys = sym (++-unit-r (rev ys)) rev-++ (x ∷ xs) ys = cong (λ zs → zs ++ [ x ]) (rev-++ xs ys) ∙ ++-assoc (rev ys) (rev xs) [ x ] rev-rev : (xs : List A) → rev (rev xs) ≡ xs rev-rev [] = refl rev-rev (x ∷ xs) = rev-++ (rev xs) [ x ] ∙ cong (_∷_ x) (rev-rev xs) -- Path space of list type module ListPath {ℓ} {A : Type ℓ} where Cover : List A → List A → Type ℓ Cover [] [] = Lift Unit Cover [] (_ ∷ _) = Lift ⊥ Cover (_ ∷ _) [] = Lift ⊥ Cover (x ∷ xs) (y ∷ ys) = (x ≡ y) × Cover xs ys reflCode : ∀ xs → Cover xs xs reflCode [] = lift tt reflCode (_ ∷ xs) = refl , reflCode xs encode : ∀ xs ys → (p : xs ≡ ys) → Cover xs ys encode xs _ = J (λ ys _ → Cover xs ys) (reflCode xs) encodeRefl : ∀ xs → encode xs xs refl ≡ reflCode xs encodeRefl xs = JRefl (λ ys _ → Cover xs ys) (reflCode xs) decode : ∀ xs ys → Cover xs ys → xs ≡ ys decode [] [] _ = refl decode [] (_ ∷ _) (lift ()) decode (x ∷ xs) [] (lift ()) decode (x ∷ xs) (y ∷ ys) (p , c) = cong₂ _∷_ p (decode xs ys c) decodeRefl : ∀ xs → decode xs xs (reflCode xs) ≡ refl decodeRefl [] = refl decodeRefl (x ∷ xs) = cong (cong₂ _∷_ refl) (decodeRefl xs) decodeEncode : ∀ xs ys → (p : xs ≡ ys) → decode xs ys (encode xs ys p) ≡ p decodeEncode xs _ = J (λ ys p → decode xs ys (encode xs ys p) ≡ p) (cong (decode xs xs) (encodeRefl xs) ∙ decodeRefl xs) isOfHLevelCover : (n : ℕ) (p : isOfHLevel (suc (suc n)) A) (xs ys : List A) → isOfHLevel (suc n) (Cover xs ys) isOfHLevelCover n p [] [] = isOfHLevelLift (suc n) (isProp→isOfHLevelSuc n isPropUnit) isOfHLevelCover n p [] (y ∷ ys) = isOfHLevelLift (suc n) (isProp→isOfHLevelSuc n isProp⊥) isOfHLevelCover n p (x ∷ xs) [] = isOfHLevelLift (suc n) (isProp→isOfHLevelSuc n isProp⊥) isOfHLevelCover n p (x ∷ xs) (y ∷ ys) = isOfHLevelProd (suc n) (p x y) (isOfHLevelCover n p xs ys) isOfHLevelList : ∀ {ℓ} (n : ℕ) {A : Type ℓ} → isOfHLevel (suc (suc n)) A → isOfHLevel (suc (suc n)) (List A) isOfHLevelList n ofLevel xs ys = isOfHLevelRetract (suc n) (ListPath.encode xs ys) (ListPath.decode xs ys) (ListPath.decodeEncode xs ys) (ListPath.isOfHLevelCover n ofLevel xs ys) private variable ℓ : Level A : Type ℓ caseList : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} → (n c : B) → List A → B caseList n _ [] = n caseList _ c (_ ∷ _) = c safe-head : A → List A → A safe-head x [] = x safe-head _ (x ∷ _) = x safe-tail : List A → List A safe-tail [] = [] safe-tail (_ ∷ xs) = xs cons-inj₁ : ∀ {x y : A} {xs ys} → x ∷ xs ≡ y ∷ ys → x ≡ y cons-inj₁ {x = x} p = cong (safe-head x) p cons-inj₂ : ∀ {x y : A} {xs ys} → x ∷ xs ≡ y ∷ ys → xs ≡ ys cons-inj₂ = cong safe-tail ¬cons≡nil : ∀ {x : A} {xs} → ¬ (x ∷ xs ≡ []) ¬cons≡nil {A = A} p = lower (subst (caseList (Lift ⊥) (List A)) p []) ¬nil≡cons : ∀ {x : A} {xs} → ¬ ([] ≡ x ∷ xs) ¬nil≡cons {A = A} p = lower (subst (caseList (List A) (Lift ⊥)) p []) ¬snoc≡nil : ∀ {x : A} {xs} → ¬ (xs ∷ʳ x ≡ []) ¬snoc≡nil {xs = []} contra = ¬cons≡nil contra ¬snoc≡nil {xs = x ∷ xs} contra = ¬cons≡nil contra ¬nil≡snoc : ∀ {x : A} {xs} → ¬ ([] ≡ xs ∷ʳ x) ¬nil≡snoc contra = ¬snoc≡nil (sym contra) cons≡rev-snoc : (x : A) → (xs : List A) → x ∷ rev xs ≡ rev (xs ∷ʳ x) cons≡rev-snoc _ [] = refl cons≡rev-snoc x (y ∷ ys) = λ i → cons≡rev-snoc x ys i ++ y ∷ [] nil≡nil-isContr : isContr (Path (List A) [] []) nil≡nil-isContr = refl , ListPath.decodeEncode [] [] list≡nil-isProp : {xs : List A} → isProp (xs ≡ []) list≡nil-isProp {xs = []} = isOfHLevelSuc 0 nil≡nil-isContr list≡nil-isProp {xs = x ∷ xs} = λ p _ → ⊥.rec (¬cons≡nil p) discreteList : Discrete A → Discrete (List A) discreteList eqA [] [] = yes refl discreteList eqA [] (y ∷ ys) = no ¬nil≡cons discreteList eqA (x ∷ xs) [] = no ¬cons≡nil discreteList eqA (x ∷ xs) (y ∷ ys) with eqA x y | discreteList eqA xs ys ... | yes p | yes q = yes (λ i → p i ∷ q i) ... | yes _ | no ¬q = no (λ p → ¬q (cons-inj₂ p)) ... | no ¬p | _ = no (λ q → ¬p (cons-inj₁ q))
33.393103
76
0.561958
9a113827d60576986f2e44e117cd9fb8bc33cbd7
1,190
agda
Agda
src/Categories/Kan/Duality.agda
glittershark/agda-categories
2128fab9e8d341364cbf784bb17c547bf73891de
[ "MIT" ]
null
null
null
src/Categories/Kan/Duality.agda
glittershark/agda-categories
2128fab9e8d341364cbf784bb17c547bf73891de
[ "MIT" ]
null
null
null
src/Categories/Kan/Duality.agda
glittershark/agda-categories
2128fab9e8d341364cbf784bb17c547bf73891de
[ "MIT" ]
null
null
null
{-# OPTIONS --without-K --safe #-} module Categories.Kan.Duality where open import Level open import Categories.Category open import Categories.Functor open import Categories.NaturalTransformation open import Categories.Kan private variable o ℓ e : Level C D E : Category o ℓ e F G : Functor C D module _ {F : Functor C D} {G : Functor C E} where private module F = Functor F module G = Functor G coLan⇒Ran : Lan F.op G.op → Ran F G coLan⇒Ran lan = record { R = L.op ; ε = η.op ; δ = λ M α → NaturalTransformation.op (σ (Functor.op M) (NaturalTransformation.op α)) ; δ-unique = λ δ′ eq → σ-unique (NaturalTransformation.op δ′) eq ; commutes = λ M α → commutes (Functor.op M) (NaturalTransformation.op α) } where open Lan lan coRan⇒Lan : Ran F.op G.op → Lan F G coRan⇒Lan ran = record { L = R.op ; η = ε.op ; σ = λ M α → NaturalTransformation.op (δ (Functor.op M) (NaturalTransformation.op α)) ; σ-unique = λ σ′ eq → δ-unique (NaturalTransformation.op σ′) eq ; commutes = λ M α → commutes (Functor.op M) (NaturalTransformation.op α) } where open Ran ran
28.333333
97
0.62437
301740464f4db25ee24851de48d48e80adebdb04
470
agda
Agda
test/Fail/Issue759b.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Fail/Issue759b.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Fail/Issue759b.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
module Issue759b where import Common.Level abstract record Wrap (A : Set) : Set where constructor wrp field wrapped : A open Wrap public wrap : {A : Set} → A → Wrap A wrap a = record { wrapped = a } -- WAS: Broken error message: -- Not in scope: -- Issue759b.Wrap.wrp at -- when checking the definition of wrap -- NOW: -- Expected non-abstract record type, found Wrap -- when checking that the expression record { wrapped = a } has type -- Wrap .A
18.076923
68
0.674468
4bca6e9f711b6b7980bf55d4e6a01c95f84f26fb
1,668
agda
Agda
currypp/.cpm/packages/verify/examples/PROOF-gamelength.agda
phlummox/curry-tools
7905bc4f625a94a725f9f6d8a2de1140bea5e471
[ "BSD-3-Clause" ]
null
null
null
currypp/.cpm/packages/verify/examples/PROOF-gamelength.agda
phlummox/curry-tools
7905bc4f625a94a725f9f6d8a2de1140bea5e471
[ "BSD-3-Clause" ]
null
null
null
currypp/.cpm/packages/verify/examples/PROOF-gamelength.agda
phlummox/curry-tools
7905bc4f625a94a725f9f6d8a2de1140bea5e471
[ "BSD-3-Clause" ]
null
null
null
-- Agda program using the Iowa Agda library {-# OPTIONS --termination-depth=2 #-} module PROOF-gamelength where open import eq open import bool open import nat open import nat-thms open import list open import nondet open import nondet-thms --------------------------------------------------------------------------- -- Translated Curry operations: data Move : Set where L : Move R : Move solve2 : ℕ → ℕ → ND (𝕃 Move) solve2 zero zero = Val [] solve2 (suc x) zero = mapND (_::_ L) (solve2 x zero) solve2 zero (suc y) = mapND (_::_ R) (solve2 zero y) solve2 (suc z) (suc u) = (mapND (_::_ L) (solve2 z (suc u))) ?? (mapND (_::_ R) (solve2 (suc z) u)) len : {a : Set} → 𝕃 a → ℕ len [] = zero len (x :: y) = suc (len y) --------------------------------------------------------------------------- -- Theorem: the length of every solution is the sum of the input arguments gamelength : (x : ℕ) → (y : ℕ) → (solve2 x y) satisfy (λ xs → length xs =ℕ x + y) ≡ tt gamelength zero zero = refl gamelength zero (suc y) rewrite satisfy-mapND (_::_ R) (solve2 zero y) (λ xs → length xs =ℕ zero + suc y) | gamelength zero y = refl gamelength (suc x) zero rewrite satisfy-mapND (_::_ L) (solve2 x zero) (λ xs → length xs =ℕ suc x + zero) | gamelength x zero = refl gamelength (suc x) (suc y) rewrite satisfy-mapND (_::_ L) (solve2 x (suc y)) (λ xs → length xs =ℕ suc x + suc y) | satisfy-mapND (_::_ R) (solve2 (suc x) y) (λ xs → length xs =ℕ suc x + suc y) | gamelength x (suc y) | +suc x y | gamelength (suc x) y = refl ---------------------------------------------------------------------------
29.263158
80
0.528177
1304b31a5f4e0b2b9b4d772dd5913a38990fffba
5,331
agda
Agda
core/lib/types/Circle.agda
cmknapp/HoTT-Agda
bc849346a17b33e2679a5b3f2b8efbe7835dc4b6
[ "MIT" ]
null
null
null
core/lib/types/Circle.agda
cmknapp/HoTT-Agda
bc849346a17b33e2679a5b3f2b8efbe7835dc4b6
[ "MIT" ]
null
null
null
core/lib/types/Circle.agda
cmknapp/HoTT-Agda
bc849346a17b33e2679a5b3f2b8efbe7835dc4b6
[ "MIT" ]
null
null
null
{-# OPTIONS --without-K #-} open import lib.Basics open import lib.NConnected open import lib.NType2 open import lib.types.Paths open import lib.types.Pi open import lib.types.Truncation open import lib.types.Unit open import lib.types.Bool open import lib.types.Suspension open import lib.types.IteratedSuspension module lib.types.Circle where {- Idea : data S¹ : Type₀ where base : S¹ loop : base == base I’m using Dan Licata’s trick to have a higher inductive type with definitional reduction rule for [base] -} {- favonia (2016/05): Now [Circle] is defined as [Sphere 1]. -} module _ where -- (already defined in IteratedSuspension.agda) -- S¹ : Type₀ -- S¹ = Sphere 1 base : S¹ base = north loop : base == base loop = merid true ∙' ! (merid false) module S¹Elim {i} {P : S¹ → Type i} (base* : P base) (loop* : base* == base* [ P ↓ loop ]) where private north* = base* south* = transport P (merid false) base* merid*-general : ∀ {x : S¹} (p q : base == x) (loop* : base* == base* [ P ↓ p ∙' ! q ]) (b : Bool) → base* == transport P q base* [ P ↓ if b then p else q ] merid*-general p idp loop* true = loop* merid*-general p idp loop* false = idp merid* : ∀ (b : Bool) → north* == south* [ P ↓ merid b ] merid* true = merid*-general (merid true) (merid false) loop* true merid* false = merid*-general (merid true) (merid false) loop* false module SE = SuspensionElim north* south* merid* f : Π S¹ P f = SE.f private merid*-general-lemma : ∀ {x : S¹} (p q : base == x) (loop* : base* == base* [ P ↓ p ∙' ! q ]) → merid*-general p q loop* true ▹ !ᵈ (merid*-general p q loop* false) == loop* merid*-general-lemma p idp loop* = ▹idp _ loop-β : apd f loop == loop* loop-β = apd f loop =⟨ apd-∙' f (merid true) (! (merid false)) ⟩ apd f (merid true) ▹ apd f (! (merid false)) =⟨ apd-! f (merid false) |in-ctx apd f (merid true) ▹_ ⟩ apd f (merid true) ▹ !ᵈ (apd f (merid false)) =⟨ SE.merid-β true |in-ctx _▹ !ᵈ (apd f (merid false)) ⟩ merid* true ▹ !ᵈ (apd f (merid false)) =⟨ SE.merid-β false |in-ctx (λ p → merid* true ▹ !ᵈ p) ⟩ merid* true ▹ !ᵈ (merid* false) =⟨ merid*-general-lemma (merid true) (merid false) loop* ⟩ loop* ∎ open S¹Elim public using () renaming (f to S¹-elim) module S¹Rec {i} {A : Type i} (base* : A) (loop* : base* == base*) where private module M = S¹Elim base* (↓-cst-in loop*) f : S¹ → A f = M.f loop-β : ap f loop == loop* loop-β = apd=cst-in {f = f} M.loop-β module S¹RecType {i} (A : Type i) (e : A ≃ A) where open S¹Rec A (ua e) public coe-loop-β : (a : A) → coe (ap f loop) a == –> e a coe-loop-β a = coe (ap f loop) a =⟨ loop-β |in-ctx (λ u → coe u a) ⟩ coe (ua e) a =⟨ coe-β e a ⟩ –> e a ∎ coe!-loop-β : (a : A) → coe! (ap f loop) a == <– e a coe!-loop-β a = coe! (ap f loop) a =⟨ loop-β |in-ctx (λ u → coe! u a) ⟩ coe! (ua e) a =⟨ coe!-β e a ⟩ <– e a ∎ ↓-loop-out : {a a' : A} → a == a' [ f ↓ loop ] → –> e a == a' ↓-loop-out {a} {a'} p = –> e a =⟨ ! (coe-loop-β a) ⟩ coe (ap f loop) a =⟨ to-transp p ⟩ a' ∎ import lib.types.Generic1HIT as Generic1HIT module S¹G = Generic1HIT Unit Unit (idf _) (idf _) module P = S¹G.RecType (cst A) (cst e) private generic-S¹ : Σ S¹ f == Σ S¹G.T P.f generic-S¹ = eqv-tot where module To = S¹Rec (S¹G.cc tt) (S¹G.pp tt) to = To.f module From = S¹G.Rec (cst base) (cst loop) from : S¹G.T → S¹ from = From.f abstract to-from : (x : S¹G.T) → to (from x) == x to-from = S¹G.elim (λ _ → idp) (λ _ → ↓-∘=idf-in to from (ap to (ap from (S¹G.pp tt)) =⟨ From.pp-β tt |in-ctx ap to ⟩ ap to loop =⟨ To.loop-β ⟩ S¹G.pp tt ∎)) from-to : (x : S¹) → from (to x) == x from-to = S¹-elim idp (↓-∘=idf-in from to (ap from (ap to loop) =⟨ To.loop-β |in-ctx ap from ⟩ ap from (S¹G.pp tt) =⟨ From.pp-β tt ⟩ loop ∎)) eqv : S¹ ≃ S¹G.T eqv = equiv to from to-from from-to eqv-fib : f == P.f [ (λ X → (X → Type _)) ↓ ua eqv ] eqv-fib = ↓-app→cst-in (λ {t} p → S¹-elim {P = λ t → f t == P.f (–> eqv t)} idp (↓-='-in (ap (P.f ∘ (–> eqv)) loop =⟨ ap-∘ P.f to loop ⟩ ap P.f (ap to loop) =⟨ To.loop-β |in-ctx ap P.f ⟩ ap P.f (S¹G.pp tt) =⟨ P.pp-β tt ⟩ ua e =⟨ ! loop-β ⟩ ap f loop ∎)) t ∙ ap P.f (↓-idf-ua-out eqv p)) eqv-tot : Σ S¹ f == Σ S¹G.T P.f eqv-tot = ap (uncurry Σ) (pair= (ua eqv) eqv-fib) import lib.types.Flattening as Flattening module FlatteningS¹ = Flattening Unit Unit (idf _) (idf _) (cst A) (cst e) open FlatteningS¹ public hiding (flattening-equiv; module P) flattening-S¹ : Σ S¹ f == Wt flattening-S¹ = generic-S¹ ∙ ua FlatteningS¹.flattening-equiv S¹-connected : is-connected 0 S¹ S¹-connected = ([ base ] , Trunc-elim (λ x → =-preserves-level 0 Trunc-level) (S¹-elim idp (prop-has-all-paths-↓ ((Trunc-level :> is-set (Trunc 0 S¹)) _ _))))
30.289773
94
0.527106
5801891ce8bd0d786c1b368c63b0cb1d7eb51b13
1,431
agda
Agda
src/sym2n.agda
shinji-kono/Galois
bf000643c139f40d5783e962bb3b63353ba3d6e4
[ "MIT" ]
1
2021-10-16T03:37:05.000Z
2021-10-16T03:37:05.000Z
src/sym2n.agda
shinji-kono/Galois
bf000643c139f40d5783e962bb3b63353ba3d6e4
[ "MIT" ]
null
null
null
src/sym2n.agda
shinji-kono/Galois
bf000643c139f40d5783e962bb3b63353ba3d6e4
[ "MIT" ]
null
null
null
open import Level hiding ( suc ; zero ) open import Algebra module sym2n where open import Symmetric open import Data.Unit open import Function.Inverse as Inverse using (_↔_; Inverse; _InverseOf_) open import Function open import Data.Nat hiding (_⊔_) -- using (ℕ; suc; zero) open import Relation.Nullary open import Data.Empty open import Data.Product open import Gutil open import Putil open import Solvable using (solvable) open import Relation.Binary.PropositionalEquality hiding ( [_] ) open import Data.Fin open import Data.Fin.Permutation hiding (_∘ₚ_) infixr 200 _∘ₚ_ _∘ₚ_ = Data.Fin.Permutation._∘ₚ_ sym2solvable : solvable (Symmetric 2) solvable.dervied-length sym2solvable = 1 solvable.end sym2solvable x d = solved1 x d where open import Data.List using ( List ; [] ; _∷_ ) open Solvable (Symmetric 2) open import FLutil open import Data.List.Fresh hiding ([_]) open import Relation.Nary using (⌊_⌋) p0id : FL→perm ((# 0) :: ((# 0) :: f0)) =p= pid p0id = pleq _ _ refl open import Data.List.Fresh.Relation.Unary.Any open import FLComm stage2FList : CommFListN 2 1 ≡ cons (zero :: zero :: f0) [] (Level.lift tt) stage2FList = refl solved1 : (x : Permutation 2 2) → deriving 1 x → x =p= pid solved1 x dr = CommSolved 2 x ( CommFListN 2 1 ) stage2FList p0id solved0 where solved0 : Any (perm→FL x ≡_) ( CommFListN 2 1 ) solved0 = CommStage→ 2 1 x dr
27.519231
82
0.703704
1369ab1c97d48e87c4bdfe30891ff1b68fbc8562
3,704
agda
Agda
examples/outdated-and-incorrect/clowns/Dissect.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
examples/outdated-and-incorrect/clowns/Dissect.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
examples/outdated-and-incorrect/clowns/Dissect.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
module Dissect where import Functor import Sets import Isomorphism open Sets open Functor open Functor.Semantics open Functor.Recursive infixr 40 _+₂_ infixr 60 _×₂_ ∇ : U -> U₂ ∇ (K A) = K₂ [0] ∇ Id = K₂ [1] ∇ (F + G) = ∇ F +₂ ∇ G ∇ (F × G) = ∇ F ×₂ ↗ G +₂ ↖ F ×₂ ∇ G diagonal : U₂ -> U diagonal (K₂ A) = K A diagonal (↖ F) = F diagonal (↗ F) = F diagonal (F +₂ G) = diagonal F + diagonal G diagonal (F ×₂ G) = diagonal F × diagonal G module Derivative where import Derivative as D ∂ : U -> U ∂ F = diagonal (∇ F) open Isomorphism same : (F : U)(X : Set) -> ⟦ ∂ F ⟧ X ≅ ⟦ D.∂ F ⟧ X same (K A) X = refl-≅ [0] same Id X = refl-≅ [1] same (F + G) X = iso[+] (same F X) (same G X) same (F × G) X = iso[+] (iso[×] (same F X) (refl-≅ _)) (iso[×] (refl-≅ _) (same G X)) Stack : (F : U) -> Set -> Set -> Set Stack F C J = List (⟦ ∇ F ⟧₂ C J) NextJoker : U -> Set -> Set -> Set NextJoker F C J = J [×] ⟦ ∇ F ⟧₂ C J [+] ⟦ F ⟧ C mutual into : (F : U){C J : Set} -> ⟦ F ⟧ J -> NextJoker F C J into (K A) a = inr a into Id x = inl < x , <> > into (F + G) (inl f) = (id <×> inl <+> inl) (into F f) into (F + G) (inr g) = (id <×> inr <+> inr) (into G g) into (F × G) < fj , gj > = tryL F G (into F fj) gj next : (F : U){C J : Set} -> ⟦ ∇ F ⟧₂ C J -> C -> NextJoker F C J next (K A) () _ next Id <> c = inr c next (F + G) (inl f') c = (id <×> inl <+> inl) (next F f' c) next (F + G) (inr g') c = (id <×> inr <+> inr) (next G g' c) next (F × G) (inl < f' , gj >) c = tryL F G (next F f' c) gj next (F × G) (inr < fc , g' >) c = tryR F G fc (next G g' c) tryL : (F G : U){C J : Set} -> NextJoker F C J -> ⟦ G ⟧ J -> NextJoker (F × G) C J tryL F G (inl < j , f' >) gj = inl < j , inl < f' , gj > > tryL F G (inr fc) gj = tryR F G fc (into G gj) tryR : (F G : U){C J : Set} -> ⟦ F ⟧ C -> NextJoker G C J -> NextJoker (F × G) C J tryR F G fc (inl < j , g' >) = inl < j , inr < fc , g' > > tryR F G fc (inr gc) = inr < fc , gc > map : (F : U){C J : Set} -> (J -> C) -> ⟦ F ⟧ J -> ⟦ F ⟧ C map F φ f = iter (into F f) where iter : NextJoker F _ _ -> ⟦ F ⟧ _ iter (inl < j , d >) = iter (next F d (φ j)) iter (inr f) = f fold : (F : U){T : Set} -> (⟦ F ⟧ T -> T) -> μ F -> T fold F {T} φ r = inward r [] where mutual inward : μ F -> Stack F T (μ F) -> T inward (inn f) γ = onward (into F f) γ outward : T -> Stack F T (μ F) -> T outward t [] = t outward t (f' :: γ) = onward (next F f' t) γ onward : NextJoker F T (μ F) -> Stack F T (μ F) -> T onward (inl < r , f' >) γ = inward r (f' :: γ) onward (inr t) γ = outward (φ t) γ -- can we make a non-tail recursive fold? -- of course, nothing could be simpler: (not structurally recursive though) fold' : (F : U){T : Set} -> (⟦ F ⟧ T -> T) -> μ F -> T fold' F φ = φ ∘ map F (fold' F φ) ∘ out -- Fold operators Φ : (F : U) -> Set -> Set Φ (K A) T = A -> T Φ Id T = T -> T Φ (F + G) T = Φ F T [×] Φ G T Φ (F × G) T = (T -> T -> T) [×] (Φ F T [×] Φ G T) mkφ : (F : U){T : Set} -> Φ F T -> ⟦ F ⟧ T -> T mkφ (K A) f a = f a mkφ Id f t = f t mkφ (F + G) < φf , φg > (inl f) = mkφ F φf f mkφ (F + G) < φf , φg > (inr g) = mkφ G φg g mkφ (F × G) < _○_ , < φf , φg > > < f , g > = mkφ F φf f ○ mkφ G φg g
31.931034
77
0.412797
1381f7b8dcc22b2247e7adfe82169e2dd7df4754
1,251
agda
Agda
Structure/Operator/Vector/Equiv.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
6
2020-04-07T17:58:13.000Z
2022-02-05T06:53:22.000Z
Structure/Operator/Vector/Equiv.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
null
null
null
Structure/Operator/Vector/Equiv.agda
Lolirofle/stuff-in-agda
70f4fba849f2fd779c5aaa5af122ccb6a5b271ba
[ "MIT" ]
null
null
null
module Structure.Operator.Vector.LinearMap.Equiv where open import Functional open import Function.Proofs open import Logic.Predicate import Lvl open import Structure.Category open import Structure.Function open import Structure.Function.Multi open import Structure.Operator.Properties open import Structure.Operator.Vector.LinearMap open import Structure.Operator.Vector.LinearMaps open import Structure.Operator.Vector.Proofs open import Structure.Operator.Vector open import Structure.Relator.Properties open import Structure.Setoid open import Syntax.Transitivity open import Type private variable ℓ ℓᵥ ℓᵥₗ ℓᵥᵣ ℓᵥ₁ ℓᵥ₂ ℓᵥ₃ ℓₛ ℓᵥₑ ℓᵥₑₗ ℓᵥₑᵣ ℓᵥₑ₁ ℓᵥₑ₂ ℓᵥₑ₃ ℓₛₑ : Lvl.Level private variable V Vₗ Vᵣ V₁ V₂ V₃ S : Type{ℓ} private variable _+ᵥ_ _+ᵥₗ_ _+ᵥᵣ_ _+ᵥ₁_ _+ᵥ₂_ _+ᵥ₃_ : V → V → V private variable _⋅ₛᵥ_ _⋅ₛᵥₗ_ _⋅ₛᵥᵣ_ _⋅ₛᵥ₁_ _⋅ₛᵥ₂_ _⋅ₛᵥ₃_ : S → V → V private variable _+ₛ_ _⋅ₛ_ : S → S → S private variable f g : Vₗ → Vᵣ open VectorSpace ⦃ … ⦄ module _ ⦃ equiv-S : Equiv{ℓₛₑ}(S) ⦄ where private variable A B : VectorSpaceVObject {ℓᵥ}{_}{ℓᵥₑ}{ℓₛₑ} ⦃ equiv-S ⦄ (_+ₛ_)(_⋅ₛ_) [_→ˡⁱⁿᵉᵃʳᵐᵃᵖ_]-equiv : Equiv(A →ˡⁱⁿᵉᵃʳᵐᵃᵖ B) Equiv._≡_ [_→ˡⁱⁿᵉᵃʳᵐᵃᵖ_]-equiv ([∃]-intro f) ([∃]-intro g) = {!!} Equiv.equivalence [_→ˡⁱⁿᵉᵃʳᵐᵃᵖ_]-equiv = {!!}
35.742857
89
0.7506
30269f6017297ae889df25be80c559eae0f64fb7
11,826
agda
Agda
Categories/Diagram/Limit/Ran.agda
rei1024/agda-categories
89d163f72caa7deeac9413f27bc1b4ed7f9e025b
[ "MIT" ]
null
null
null
Categories/Diagram/Limit/Ran.agda
rei1024/agda-categories
89d163f72caa7deeac9413f27bc1b4ed7f9e025b
[ "MIT" ]
null
null
null
Categories/Diagram/Limit/Ran.agda
rei1024/agda-categories
89d163f72caa7deeac9413f27bc1b4ed7f9e025b
[ "MIT" ]
null
null
null
{-# OPTIONS --without-K --safe #-} module Categories.Diagram.Limit.Ran where open import Level open import Data.Product using (Σ) open import Categories.Category open import Categories.Category.Complete open import Categories.Category.Construction.Cones open import Categories.Category.Construction.Comma open import Categories.Category.Construction.Properties.Comma open import Categories.Diagram.Cone.Properties open import Categories.Diagram.Limit.Properties open import Categories.Functor open import Categories.Functor.Properties open import Categories.Functor.Construction.Constant open import Categories.NaturalTransformation open import Categories.NaturalTransformation.Equivalence using () renaming (_≃_ to _≊_) open import Categories.NaturalTransformation.NaturalIsomorphism using (NaturalIsomorphism; _≃_; module ≃; _ⓘˡ_) open import Categories.Kan open import Categories.Diagram.Limit import Categories.Morphism as Mor import Categories.Morphism.Reasoning as MR private variable o ℓ e : Level C D E : Category o ℓ e -- construct a Ran from a limit module _ {o ℓ e o′ ℓ′ e′} {C : Category o′ ℓ′ e′} {D : Category o ℓ e} (F : Functor C D) (X : Functor C E) (Com : Complete (o′ ⊔ ℓ) (ℓ′ ⊔ e) e′ E) where private module C = Category C module D = Category D module E = Category E module F = Functor F module X = Functor X open Limit open Cone renaming (commute to K-commute) open Cone⇒ renaming (commute to ⇒-commute) open Mor E G : (d : D.Obj) → Functor (d ↙ F) E G d = X ∘F Cod (const! d) F ⊤Gd : ∀ d → Limit (G d) ⊤Gd d = Com (G d) module ⊤Gd d = Limit (⊤Gd d) f↙F : ∀ {Y Z} (f : Y D.⇒ Z) → Functor (Z ↙ F) (Y ↙ F) f↙F = along-natˡ′ F Gf≃ : ∀ {Y Z} (f : Y D.⇒ Z) → G Z ≃ G Y ∘F f↙F f Gf≃ f = record { F⇒G = ntHelper record { η = λ _ → X.F₁ C.id ; commute = λ _ → [ X ]-resp-square id-comm-sym } ; F⇐G = ntHelper record { η = λ _ → X.F₁ C.id ; commute = λ _ → [ X ]-resp-square id-comm-sym } ; iso = λ _ → record { isoˡ = [ X ]-resp-∘ C.identity² ○ X.identity ; isoʳ = [ X ]-resp-∘ C.identity² ○ X.identity } } where open MR C open E.HomReasoning limY⇒limZ∘ : ∀ {Y Z} (f : Y D.⇒ Z) → Cones (G Y ∘F f↙F f) [ F-map-Coneʳ (f↙F f) (limit (Com (G Y))) , limit (Com (G Y ∘F f↙F f)) ] limY⇒limZ∘ {Y} f = F⇒arr Com (f↙F f) (G Y) limZ∘≅limZ : ∀ {Y Z} (f : Y D.⇒ Z) → apex (⊤Gd Z) ≅ apex (Com (G Y ∘F f↙F f)) limZ∘≅limZ {Y} {Z} f = ≃⇒lim≅ (Gf≃ f) (⊤Gd Z) (Com _) limit-is-ran : Ran F X limit-is-ran = record { R = R ; ε = ε ; δ = δ ; δ-unique = λ {M γ} δ′ eq → δ-unique {M} {γ} δ′ eq ; commutes = commutes } where open MR E open E.HomReasoning open D.HomReasoning using () renaming (_○_ to _●_ ; ⟺ to ⟷) R₀ : D.Obj → E.Obj R₀ d = apex (⊤Gd d) R₁ : ∀ {A B} → D [ A , B ] → E [ R₀ A , R₀ B ] R₁ {A} f = _≅_.to (limZ∘≅limZ f) E.∘ arr (limY⇒limZ∘ f) proj-red : ∀ {Y Z} K (f : Y D.⇒ Z) → ⊤Gd.proj Z K E.∘ R₁ f E.≈ ⊤Gd.proj Y (record { f = D.id D.∘ CommaObj.f K D.∘ f }) proj-red {Y} {Z} K f = begin ⊤Gd.proj Z K E.∘ R₁ f ≈⟨ pullˡ (⇒-commute (≃⇒Cone⇒ (≃.sym (Gf≃ f)) (Com _) (⊤Gd Z))) ⟩ (X.F₁ C.id E.∘ proj (Com _) K) E.∘ arr (limY⇒limZ∘ f) ≈⟨ pullʳ (⇒-commute (limY⇒limZ∘ f)) ⟩ X.F₁ C.id E.∘ ⊤Gd.proj Y _ ≈⟨ elimˡ X.identity ⟩ ⊤Gd.proj Y _ ∎ proj≈ : ∀ {d b} {f g : d D.⇒ F.F₀ b} → f D.≈ g → ⊤Gd.proj d record { f = f } E.≈ ⊤Gd.proj d record { f = g } proj≈ {d} {b} {f} {g} eq = begin ⊤Gd.proj d _ ≈⟨ introˡ X.identity ⟩ X.F₁ C.id E.∘ ⊤Gd.proj d _ ≈⟨ K-commute _ (⊤Gd.limit d) (record { h = C.id ; commute = D.∘-resp-≈ F.identity eq ● MR.id-comm-sym D }) ⟩ ⊤Gd.proj d _ ∎ R : Functor D E R = record { F₀ = R₀ ; F₁ = R₁ ; identity = λ {d} → terminal.⊤-id (⊤Gd d) record { commute = λ {Z} → begin ⊤Gd.proj d Z ∘ R₁ D.id ≈⟨ proj-red Z D.id ⟩ ⊤Gd.proj d record { f = D.id D.∘ CommaObj.f Z D.∘ D.id } ≈⟨ proj≈ (D.identityˡ ● D.identityʳ) ⟩ ⊤Gd.proj d Z ∎ } ; homomorphism = λ {Y Z W} {f g} → terminal.!-unique₂ (⊤Gd W) {let module ⊤GY = Cone _ (⊤Gd.limit Y) module H = Functor (f↙F (g D.∘ f)) in record { apex = record { ψ = λ K → ⊤GY.ψ (H.F₀ K) ; commute = λ h → ⊤GY.commute (H.F₁ h) } }} {record { arr = R₁ (g D.∘ f) ; commute = λ {K} → proj-red K (g D.∘ f) }} {record { arr = R₁ g ∘ R₁ f ; commute = λ {K} → begin ⊤Gd.proj W K ∘ R₁ g ∘ R₁ f ≈⟨ sym-assoc ⟩ (⊤Gd.proj W K ∘ R₁ g) ∘ R₁ f ≈⟨ proj-red K g ⟩∘⟨refl ⟩ ⊤Gd.proj Z record { f = D.id D.∘ CommaObj.f K D.∘ g } ∘ R₁ f ≈⟨ proj-red _ f ⟩ ⊤Gd.proj Y record { f = D.id D.∘ (D.id D.∘ CommaObj.f K D.∘ g) D.∘ f } ≈⟨ proj≈ (D.identityˡ ● (MR.assoc²' D)) ⟩ ⊤Gd.proj Y record { f = D.id D.∘ CommaObj.f K D.∘ g D.∘ f } ∎ }} ; F-resp-≈ = λ {Y Z} {f g} eq → terminal.!-unique₂ (⊤Gd Z) {let module ⊤GY = Cone _ (⊤Gd.limit Y) module H = Functor (f↙F f) in record { apex = record { ψ = λ K → ⊤GY.ψ (H.F₀ K) ; commute = λ h → ⊤GY.commute (H.F₁ h) } }} {record { arr = R₁ f ; commute = F-resp-≈-commute D.Equiv.refl }} {record { arr = R₁ g ; commute = F-resp-≈-commute eq }} } where open E F-resp-≈-commute : ∀ {Y Z} {K : Category.Obj (Z ↙ F)} {f g : Y D.⇒ Z} → f D.≈ g → ⊤Gd.proj Z K ∘ R₁ g ≈ ⊤Gd.proj Y record { f = D.id D.∘ CommaObj.f K D.∘ f } F-resp-≈-commute {Y} {Z} {K} {f} {g} eq = begin ⊤Gd.proj Z K ∘ R₁ g ≈⟨ proj-red K g ⟩ ⊤Gd.proj Y _ ≈⟨ proj≈ (D.∘-resp-≈ʳ (D.∘-resp-≈ʳ (D.Equiv.sym eq))) ⟩ ⊤Gd.proj Y _ ∎ ε : NaturalTransformation (R ∘F F) X ε = ntHelper record { η = λ c → ⊤Gd.proj (F.F₀ c) record { f = D.id } ; commute = λ {Y Z} f → begin ⊤Gd.proj (F.F₀ Z) _ ∘ Functor.F₁ (R ∘F F) f ≈⟨ proj-red _ (F.F₁ f) ⟩ ⊤Gd.proj (F.F₀ Y) _ ≈˘⟨ K-commute _ (⊤Gd.limit (F.F₀ Y)) record { h = f ; commute = ⟷ (D.∘-resp-≈ˡ D.identityˡ ● D.∘-resp-≈ˡ D.identityˡ) } ⟩ X.F₁ f ∘ ⊤Gd.proj (F.F₀ Y) _ ∎ } where open E δ-Cone : ∀ d (M : Functor D E) → NaturalTransformation (M ∘F F) X → Cone (G d) δ-Cone d M γ = record { apex = record { ψ = λ K → γ.η (CommaObj.β K) E.∘ M.F₁ (CommaObj.f K) ; commute = λ {Y Z} f → begin X.F₁ (Comma⇒.h f) E.∘ γ.η (CommaObj.β Y) E.∘ M.F₁ (CommaObj.f Y) ≈˘⟨ pushˡ (γ.commute (Comma⇒.h f)) ⟩ (γ.η (CommaObj.β Z) E.∘ M.F₁ (F.F₁ (Comma⇒.h f))) E.∘ M.F₁ (CommaObj.f Y) ≈⟨ pullʳ ([ M ]-resp-∘ (Comma⇒.commute f ● D.identityʳ)) ⟩ γ.η (CommaObj.β Z) E.∘ M.F₁ (CommaObj.f Z) ∎ } } where module M = Functor M module γ = NaturalTransformation γ δ : (M : Functor D E) → NaturalTransformation (M ∘F F) X → NaturalTransformation M R δ M γ = ntHelper record { η = λ d → ⊤Gd.rep d (δ-Cone d M γ) ; commute = λ {Y Z} f → terminal.!-unique₂ (⊤Gd Z) {record { apex = record { ψ = λ W → δ-Cone.ψ Z W E.∘ M.F₁ f ; commute = λ {W V} g → begin X.F₁ (Comma⇒.h g) E.∘ (γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)) E.∘ M.F₁ f ≈⟨ E.sym-assoc ⟩ (X.F₁ (Comma⇒.h g) E.∘ γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)) E.∘ M.F₁ f ≈⟨ δ-Cone.commute Z g ⟩∘⟨refl ⟩ (γ.η (CommaObj.β V) E.∘ M.F₁ (CommaObj.f V)) E.∘ M.F₁ f ∎ } }} {record { arr = ⊤Gd.rep Z (δ-Cone Z M γ) E.∘ M.F₁ f ; commute = pullˡ (⇒-commute (⊤Gd.rep-cone Z (δ-Cone Z M γ))) }} {record { arr = R₁ f E.∘ ⊤Gd.rep Y (δ-Cone Y M γ) ; commute = λ {W} → begin ⊤Gd.proj Z W E.∘ R₁ f E.∘ ⊤Gd.rep Y (δ-Cone Y M γ) ≈⟨ pullˡ (proj-red W f) ⟩ ⊤Gd.proj Y (record { f = D.id D.∘ CommaObj.f W D.∘ f }) E.∘ ⊤Gd.rep Y (δ-Cone Y M γ) ≈⟨ ⇒-commute (⊤Gd.rep-cone Y (δ-Cone Y M γ)) ⟩ γ.η (CommaObj.β W) E.∘ M.F₁ (D.id D.∘ CommaObj.f W D.∘ f) ≈˘⟨ refl⟩∘⟨ [ M ]-resp-∘ (⟷ D.identityˡ) ⟩ γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W) E.∘ M.F₁ f ≈⟨ E.sym-assoc ⟩ (γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W)) E.∘ M.F₁ f ∎ }} } where module M = Functor M module γ = NaturalTransformation γ module δ-Cone d = Cone _ (δ-Cone d M γ) δ-unique : ∀ {M : Functor D E} {α : NaturalTransformation (M ∘F F) X} (δ′ : NaturalTransformation M R) → α ≊ ε ∘ᵥ δ′ ∘ʳ F → δ′ ≊ δ M α δ-unique {M} {γ} δ′ eq {d} = ⟺ (⊤Gd.terminal.!-unique d record { arr = δ′.η d ; commute = λ {W} → begin ⊤Gd.proj d W E.∘ δ′.η d ≈˘⟨ proj≈ (D.identityˡ ● D.identityˡ) ⟩∘⟨refl ⟩ ⊤Gd.proj d (record { f = D.id D.∘ D.id D.∘ CommaObj.f W }) E.∘ δ′.η d ≈˘⟨ pullˡ (proj-red _ (CommaObj.f W)) ⟩ ⊤Gd.proj (F.F₀ (CommaObj.β W)) _ E.∘ R₁ (CommaObj.f W) E.∘ δ′.η d ≈˘⟨ pullʳ (δ′.commute (CommaObj.f W)) ⟩ (⊤Gd.proj (F.F₀ (CommaObj.β W)) (record { f = D.id}) E.∘ δ′.η (F.F₀ (CommaObj.β W))) E.∘ M.F₁ (CommaObj.f W) ≈˘⟨ eq ⟩∘⟨refl ⟩ γ.η (CommaObj.β W) E.∘ M.F₁ (CommaObj.f W) ∎ }) where module M = Functor M module γ = NaturalTransformation γ module δ′ = NaturalTransformation δ′ commutes : (M : Functor D E) (α : NaturalTransformation (M ∘F F) X) → α ≊ ε ∘ᵥ δ M α ∘ʳ F commutes M γ {c} = ⟺ (⇒-commute (⊤Gd.rep-cone (F.F₀ c) (δ-Cone (F.F₀ c) M γ)) ○ elimʳ M.identity) where module M = Functor M module γ = NaturalTransformation γ
45.137405
179
0.419499
0607fbccabe946625153c973e40753384cf68c6b
13,244
agda
Agda
agda-stdlib-0.9/src/Algebra.agda
qwe2/try-agda
9d4c43b1609d3f085636376fdca73093481ab882
[ "Apache-2.0" ]
1
2016-10-20T15:52:05.000Z
2016-10-20T15:52:05.000Z
agda-stdlib-0.9/src/Algebra.agda
qwe2/try-agda
9d4c43b1609d3f085636376fdca73093481ab882
[ "Apache-2.0" ]
null
null
null
agda-stdlib-0.9/src/Algebra.agda
qwe2/try-agda
9d4c43b1609d3f085636376fdca73093481ab882
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------ -- The Agda standard library -- -- Definitions of algebraic structures like monoids and rings -- (packed in records together with sets, operations, etc.) ------------------------------------------------------------------------ module Algebra where open import Relation.Binary open import Algebra.FunctionProperties open import Algebra.Structures open import Function open import Level ------------------------------------------------------------------------ -- Semigroups, (commutative) monoids and (abelian) groups record Semigroup c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _∙_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∙_ : Op₂ Carrier isSemigroup : IsSemigroup _≈_ _∙_ open IsSemigroup isSemigroup public setoid : Setoid _ _ setoid = record { isEquivalence = isEquivalence } -- A raw monoid is a monoid without any laws. record RawMonoid c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _∙_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∙_ : Op₂ Carrier ε : Carrier record Monoid c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _∙_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∙_ : Op₂ Carrier ε : Carrier isMonoid : IsMonoid _≈_ _∙_ ε open IsMonoid isMonoid public semigroup : Semigroup _ _ semigroup = record { isSemigroup = isSemigroup } open Semigroup semigroup public using (setoid) rawMonoid : RawMonoid _ _ rawMonoid = record { _≈_ = _≈_ ; _∙_ = _∙_ ; ε = ε } record CommutativeMonoid c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _∙_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∙_ : Op₂ Carrier ε : Carrier isCommutativeMonoid : IsCommutativeMonoid _≈_ _∙_ ε open IsCommutativeMonoid isCommutativeMonoid public monoid : Monoid _ _ monoid = record { isMonoid = isMonoid } open Monoid monoid public using (setoid; semigroup; rawMonoid) record Group c ℓ : Set (suc (c ⊔ ℓ)) where infix 8 _⁻¹ infixl 7 _∙_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∙_ : Op₂ Carrier ε : Carrier _⁻¹ : Op₁ Carrier isGroup : IsGroup _≈_ _∙_ ε _⁻¹ open IsGroup isGroup public monoid : Monoid _ _ monoid = record { isMonoid = isMonoid } open Monoid monoid public using (setoid; semigroup; rawMonoid) record AbelianGroup c ℓ : Set (suc (c ⊔ ℓ)) where infix 8 _⁻¹ infixl 7 _∙_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∙_ : Op₂ Carrier ε : Carrier _⁻¹ : Op₁ Carrier isAbelianGroup : IsAbelianGroup _≈_ _∙_ ε _⁻¹ open IsAbelianGroup isAbelianGroup public group : Group _ _ group = record { isGroup = isGroup } open Group group public using (setoid; semigroup; monoid; rawMonoid) commutativeMonoid : CommutativeMonoid _ _ commutativeMonoid = record { isCommutativeMonoid = isCommutativeMonoid } ------------------------------------------------------------------------ -- Various kinds of semirings record NearSemiring c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier 0# : Carrier isNearSemiring : IsNearSemiring _≈_ _+_ _*_ 0# open IsNearSemiring isNearSemiring public +-monoid : Monoid _ _ +-monoid = record { isMonoid = +-isMonoid } open Monoid +-monoid public using (setoid) renaming ( semigroup to +-semigroup ; rawMonoid to +-rawMonoid) *-semigroup : Semigroup _ _ *-semigroup = record { isSemigroup = *-isSemigroup } record SemiringWithoutOne c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier 0# : Carrier isSemiringWithoutOne : IsSemiringWithoutOne _≈_ _+_ _*_ 0# open IsSemiringWithoutOne isSemiringWithoutOne public nearSemiring : NearSemiring _ _ nearSemiring = record { isNearSemiring = isNearSemiring } open NearSemiring nearSemiring public using ( setoid ; +-semigroup; +-rawMonoid; +-monoid ; *-semigroup ) +-commutativeMonoid : CommutativeMonoid _ _ +-commutativeMonoid = record { isCommutativeMonoid = +-isCommutativeMonoid } record SemiringWithoutAnnihilatingZero c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier 0# : Carrier 1# : Carrier isSemiringWithoutAnnihilatingZero : IsSemiringWithoutAnnihilatingZero _≈_ _+_ _*_ 0# 1# open IsSemiringWithoutAnnihilatingZero isSemiringWithoutAnnihilatingZero public +-commutativeMonoid : CommutativeMonoid _ _ +-commutativeMonoid = record { isCommutativeMonoid = +-isCommutativeMonoid } open CommutativeMonoid +-commutativeMonoid public using (setoid) renaming ( semigroup to +-semigroup ; rawMonoid to +-rawMonoid ; monoid to +-monoid ) *-monoid : Monoid _ _ *-monoid = record { isMonoid = *-isMonoid } open Monoid *-monoid public using () renaming ( semigroup to *-semigroup ; rawMonoid to *-rawMonoid ) record Semiring c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier 0# : Carrier 1# : Carrier isSemiring : IsSemiring _≈_ _+_ _*_ 0# 1# open IsSemiring isSemiring public semiringWithoutAnnihilatingZero : SemiringWithoutAnnihilatingZero _ _ semiringWithoutAnnihilatingZero = record { isSemiringWithoutAnnihilatingZero = isSemiringWithoutAnnihilatingZero } open SemiringWithoutAnnihilatingZero semiringWithoutAnnihilatingZero public using ( setoid ; +-semigroup; +-rawMonoid; +-monoid ; +-commutativeMonoid ; *-semigroup; *-rawMonoid; *-monoid ) semiringWithoutOne : SemiringWithoutOne _ _ semiringWithoutOne = record { isSemiringWithoutOne = isSemiringWithoutOne } open SemiringWithoutOne semiringWithoutOne public using (nearSemiring) record CommutativeSemiringWithoutOne c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier 0# : Carrier isCommutativeSemiringWithoutOne : IsCommutativeSemiringWithoutOne _≈_ _+_ _*_ 0# open IsCommutativeSemiringWithoutOne isCommutativeSemiringWithoutOne public semiringWithoutOne : SemiringWithoutOne _ _ semiringWithoutOne = record { isSemiringWithoutOne = isSemiringWithoutOne } open SemiringWithoutOne semiringWithoutOne public using ( setoid ; +-semigroup; +-rawMonoid; +-monoid ; +-commutativeMonoid ; *-semigroup ; nearSemiring ) record CommutativeSemiring c ℓ : Set (suc (c ⊔ ℓ)) where infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier 0# : Carrier 1# : Carrier isCommutativeSemiring : IsCommutativeSemiring _≈_ _+_ _*_ 0# 1# open IsCommutativeSemiring isCommutativeSemiring public semiring : Semiring _ _ semiring = record { isSemiring = isSemiring } open Semiring semiring public using ( setoid ; +-semigroup; +-rawMonoid; +-monoid ; +-commutativeMonoid ; *-semigroup; *-rawMonoid; *-monoid ; nearSemiring; semiringWithoutOne ; semiringWithoutAnnihilatingZero ) *-commutativeMonoid : CommutativeMonoid _ _ *-commutativeMonoid = record { isCommutativeMonoid = *-isCommutativeMonoid } commutativeSemiringWithoutOne : CommutativeSemiringWithoutOne _ _ commutativeSemiringWithoutOne = record { isCommutativeSemiringWithoutOne = isCommutativeSemiringWithoutOne } ------------------------------------------------------------------------ -- (Commutative) rings -- A raw ring is a ring without any laws. record RawRing c : Set (suc c) where infix 8 -_ infixl 7 _*_ infixl 6 _+_ field Carrier : Set c _+_ : Op₂ Carrier _*_ : Op₂ Carrier -_ : Op₁ Carrier 0# : Carrier 1# : Carrier record Ring c ℓ : Set (suc (c ⊔ ℓ)) where infix 8 -_ infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier -_ : Op₁ Carrier 0# : Carrier 1# : Carrier isRing : IsRing _≈_ _+_ _*_ -_ 0# 1# open IsRing isRing public +-abelianGroup : AbelianGroup _ _ +-abelianGroup = record { isAbelianGroup = +-isAbelianGroup } semiring : Semiring _ _ semiring = record { isSemiring = isSemiring } open Semiring semiring public using ( setoid ; +-semigroup; +-rawMonoid; +-monoid ; +-commutativeMonoid ; *-semigroup; *-rawMonoid; *-monoid ; nearSemiring; semiringWithoutOne ; semiringWithoutAnnihilatingZero ) open AbelianGroup +-abelianGroup public using () renaming (group to +-group) rawRing : RawRing _ rawRing = record { _+_ = _+_ ; _*_ = _*_ ; -_ = -_ ; 0# = 0# ; 1# = 1# } record CommutativeRing c ℓ : Set (suc (c ⊔ ℓ)) where infix 8 -_ infixl 7 _*_ infixl 6 _+_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _+_ : Op₂ Carrier _*_ : Op₂ Carrier -_ : Op₁ Carrier 0# : Carrier 1# : Carrier isCommutativeRing : IsCommutativeRing _≈_ _+_ _*_ -_ 0# 1# open IsCommutativeRing isCommutativeRing public ring : Ring _ _ ring = record { isRing = isRing } commutativeSemiring : CommutativeSemiring _ _ commutativeSemiring = record { isCommutativeSemiring = isCommutativeSemiring } open Ring ring public using (rawRing; +-group; +-abelianGroup) open CommutativeSemiring commutativeSemiring public using ( setoid ; +-semigroup; +-rawMonoid; +-monoid; +-commutativeMonoid ; *-semigroup; *-rawMonoid; *-monoid; *-commutativeMonoid ; nearSemiring; semiringWithoutOne ; semiringWithoutAnnihilatingZero; semiring ; commutativeSemiringWithoutOne ) ------------------------------------------------------------------------ -- (Distributive) lattices and boolean algebras record Lattice c ℓ : Set (suc (c ⊔ ℓ)) where infixr 7 _∧_ infixr 6 _∨_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∨_ : Op₂ Carrier _∧_ : Op₂ Carrier isLattice : IsLattice _≈_ _∨_ _∧_ open IsLattice isLattice public setoid : Setoid _ _ setoid = record { isEquivalence = isEquivalence } record DistributiveLattice c ℓ : Set (suc (c ⊔ ℓ)) where infixr 7 _∧_ infixr 6 _∨_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∨_ : Op₂ Carrier _∧_ : Op₂ Carrier isDistributiveLattice : IsDistributiveLattice _≈_ _∨_ _∧_ open IsDistributiveLattice isDistributiveLattice public lattice : Lattice _ _ lattice = record { isLattice = isLattice } open Lattice lattice public using (setoid) record BooleanAlgebra c ℓ : Set (suc (c ⊔ ℓ)) where infix 8 ¬_ infixr 7 _∧_ infixr 6 _∨_ infix 4 _≈_ field Carrier : Set c _≈_ : Rel Carrier ℓ _∨_ : Op₂ Carrier _∧_ : Op₂ Carrier ¬_ : Op₁ Carrier ⊤ : Carrier ⊥ : Carrier isBooleanAlgebra : IsBooleanAlgebra _≈_ _∨_ _∧_ ¬_ ⊤ ⊥ open IsBooleanAlgebra isBooleanAlgebra public distributiveLattice : DistributiveLattice _ _ distributiveLattice = record { isDistributiveLattice = isDistributiveLattice } open DistributiveLattice distributiveLattice public using (setoid; lattice)
27.940928
72
0.568484
2eb5b137c83e6af0052b45c659d16ac8a789c345
207
agda
Agda
functor.agda
heades/AUGL
b33c6a59d664aed46cac8ef77d34313e148fecc2
[ "MIT" ]
null
null
null
functor.agda
heades/AUGL
b33c6a59d664aed46cac8ef77d34313e148fecc2
[ "MIT" ]
null
null
null
functor.agda
heades/AUGL
b33c6a59d664aed46cac8ef77d34313e148fecc2
[ "MIT" ]
null
null
null
module functor where open import level record Functor {ℓ : Level} (F : Set ℓ → Set ℓ) : Set (lsuc ℓ) where constructor mkFunc field fmap : ∀{A B : Set ℓ} → (A → B) → F A → F B open Functor public
18.818182
67
0.623188
adf4071bbb700892d7c404a7b6a1f2e99c27a007
130
agda
Agda
test/Fail/IrrelevantModuleParameter.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Fail/IrrelevantModuleParameter.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Fail/IrrelevantModuleParameter.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
module IrrelevantModuleParameter .(A : Set) where postulate a : A -- cannot declare something of type A, since A is irrelevant
21.666667
60
0.753846
4b711e97163937746308d07f6cf7c256b7097469
5,198
agda
Agda
src/Semantics.agda
mietek/nbe-correctness
54e9a83a8db4e33a33bf5dae5b2d651ad38aa3d5
[ "X11" ]
3
2017-03-23T06:25:23.000Z
2017-03-23T18:51:34.000Z
src/Semantics.agda
mietek/nbe-correctness
54e9a83a8db4e33a33bf5dae5b2d651ad38aa3d5
[ "X11" ]
null
null
null
src/Semantics.agda
mietek/nbe-correctness
54e9a83a8db4e33a33bf5dae5b2d651ad38aa3d5
[ "X11" ]
null
null
null
module Semantics where open import Syntax public -- Kripke models. record Model : Set₁ where infix 3 _⊩ᵅ_ field World : Set _≤_ : World → World → Set refl≤ : ∀ {w} → w ≤ w trans≤ : ∀ {w w′ w″} → w ≤ w′ → w′ ≤ w″ → w ≤ w″ idtrans≤ : ∀ {w w′} → (p : w ≤ w′) → trans≤ refl≤ p ≡ p _⊩ᵅ_ : World → Atom → Set mono⊩ᵅ : ∀ {P w w′} → w ≤ w′ → w ⊩ᵅ P → w′ ⊩ᵅ P idmono⊩ᵅ : ∀ {P w} → (s : w ⊩ᵅ P) → mono⊩ᵅ {P} refl≤ s ≡ s open Model {{…}} public -- Forcing in a particular world. module _ {{_ : Model}} where infix 3 _⊩_ _⊩_ : World → Type → Set w ⊩ α P = w ⊩ᵅ P w ⊩ A ⇒ B = ∀ {w′} → w ≤ w′ → w′ ⊩ A → w′ ⊩ B w ⊩ A ⩕ B = w ⊩ A ∧ w ⊩ B w ⊩ ⫪ = ⊤ infix 3 _⊩⋆_ _⊩⋆_ : World → Stack Type → Set w ⊩⋆ ∅ = ⊤ w ⊩⋆ Ξ , A = w ⊩⋆ Ξ ∧ w ⊩ A -- Function extensionality. postulate funext : ∀ {X : Set} {Y : X → Set} {f g : ∀ x → Y x} → (∀ x → f x ≡ g x) → (λ x → f x) ≡ (λ x → g x) ⟨funext⟩ : ∀ {X : Set} {Y : X → Set} {f g : ∀ {x} → Y x} → (∀ {x} → f {x} ≡ g {x}) → (λ {x} → f {x}) ≡ (λ {x} → g {x}) extfun : ∀ {X : Set} {Y : X → Set} {f g : ∀ x → Y x} → (λ x → f x) ≡ (λ x → g x) → (∀ x → f x ≡ g x) extfun refl = λ x → refl ⟨extfun⟩ : ∀ {X : Set} {Y : X → Set} {f g : ∀ {x} → Y x} → (λ {x} → f {x}) ≡ (λ {x} → g {x}) → (∀ {x} → f {x} ≡ g {x}) ⟨extfun⟩ refl = refl -- Monotonicity of forcing with respect to constructive accessibility. module _ {{_ : Model}} where mono⊩ : ∀ {A w w′} → w ≤ w′ → w ⊩ A → w′ ⊩ A mono⊩ {α P} p s = mono⊩ᵅ p s mono⊩ {A ⇒ B} p s = λ p′ → s (trans≤ p p′) mono⊩ {A ⩕ B} p s = mono⊩ {A} p (π₁ s) , mono⊩ {B} p (π₂ s) mono⊩ {⫪} p s = ∙ mono⊩⋆ : ∀ {Ξ w w′} → w ≤ w′ → w ⊩⋆ Ξ → w′ ⊩⋆ Ξ mono⊩⋆ {∅} p ∙ = ∙ mono⊩⋆ {Ξ , A} p (σ , s) = mono⊩⋆ {Ξ} p σ , mono⊩ {A} p s -- TODO: Naming things. module _ {{_ : Model}} where idmono⊩ : ∀ {A w} → (s : w ⊩ A) → mono⊩ {A} refl≤ s ≡ s idmono⊩ {α P} s = idmono⊩ᵅ s idmono⊩ {A ⇒ B} s = ⟨funext⟩ λ {w′} → funext λ p → cong s (idtrans≤ p) idmono⊩ {A ⩕ B} s = cong² _,_ (idmono⊩ {A} (π₁ s)) (idmono⊩ {B} (π₂ s)) idmono⊩ {⫪} s = refl idmono⊩⋆ : ∀ {Ξ w} → (γ : w ⊩⋆ Ξ) → mono⊩⋆ refl≤ γ ≡ γ idmono⊩⋆ {∅} ∙ = refl idmono⊩⋆ {Ξ , A} (σ , s) = cong² _,_ (idmono⊩⋆ σ) (idmono⊩ {A} s) -- TODO: Naming things. module _ {{_ : Model}} where _⟪_⊫_⟫ : World → Context → Type → Set w ⟪ Γ ⊫ A ⟫ = w ⊩⋆ Γ → w ⊩ A -- Evaluation equipment. module _ {{_ : Model}} where ⟪var⟫ : ∀ {A Γ w} → A ∈ Γ → w ⟪ Γ ⊫ A ⟫ ⟪var⟫ top = λ { (γ , s) → s } ⟪var⟫ (pop i) = λ { (γ , s) → ⟪var⟫ i γ } ⟪lam⟫ : ∀ {A B Γ w} → (∀ {w′} → w′ ⟪ Γ , A ⊫ B ⟫) → w ⟪ Γ ⊫ A ⇒ B ⟫ ⟪lam⟫ ⟪d⟫ = λ γ p s → ⟪d⟫ (mono⊩⋆ p γ , s) ⟪app⟫ : ∀ {A B Γ w} → w ⟪ Γ ⊫ A ⇒ B ⟫ → w ⟪ Γ ⊫ A ⟫ → w ⟪ Γ ⊫ B ⟫ ⟪app⟫ ⟪d⟫ ⟪e⟫ = λ γ → ⟪d⟫ γ refl≤ (⟪e⟫ γ) ⟪pair⟫ : ∀ {A B Γ w} → w ⟪ Γ ⊫ A ⟫ → w ⟪ Γ ⊫ B ⟫ → w ⟪ Γ ⊫ A ⩕ B ⟫ ⟪pair⟫ ⟪d⟫ ⟪e⟫ = λ γ → ⟪d⟫ γ , ⟪e⟫ γ ⟪fst⟫ : ∀ {A B Γ w} → w ⟪ Γ ⊫ A ⩕ B ⟫ → w ⟪ Γ ⊫ A ⟫ ⟪fst⟫ ⟪d⟫ = λ γ → π₁ (⟪d⟫ γ) ⟪snd⟫ : ∀ {A B Γ w} → w ⟪ Γ ⊫ A ⩕ B ⟫ → w ⟪ Γ ⊫ B ⟫ ⟪snd⟫ ⟪d⟫ = λ γ → π₂ (⟪d⟫ γ) ⟪unit⟫ : ∀ {Γ w} → w ⟪ Γ ⊫ ⫪ ⟫ ⟪unit⟫ = λ γ → ∙ -- Shorthand for variables. module _ {{_ : Model}} where ⟪v₀⟫ : ∀ {A Γ w} → w ⟪ Γ , A ⊫ A ⟫ ⟪v₀⟫ {A} = ⟪var⟫ {A} i₀ -- Forcing in all worlds, or semantic entailment. module _ {{_ : Model}} where infix 3 _⊨_ _⊨_ : Context → Type → Set Γ ⊨ A = ∀ {w} → w ⟪ Γ ⊫ A ⟫ -- Evaluation, or soundness of the semantics with respect to the syntax. module _ {{_ : Model}} where eval : ∀ {A Γ} → Γ ⊢ A → Γ ⊨ A eval (var i) = ⟪var⟫ i eval (lam {A} {B} d) = ⟪lam⟫ {A} {B} (eval d) eval (app {A} {B} d e) = ⟪app⟫ {A} {B} (eval d) (eval e) eval (pair {A} {B} d e) = ⟪pair⟫ {A} {B} (eval d) (eval e) eval (fst {A} {B} d) = ⟪fst⟫ {A} {B} (eval d) eval (snd {A} {B} d) = ⟪snd⟫ {A} {B} (eval d) eval unit = ⟪unit⟫ -- The canonical model. private instance canon : Model canon = record { World = Context ; _≤_ = _⊆_ ; refl≤ = refl⊆ ; trans≤ = trans⊆ ; idtrans≤ = idtrans⊆ ; _⊩ᵅ_ = λ Γ P → Γ ⊢ⁿᵉ α P ; mono⊩ᵅ = mono⊢ⁿᵉ ; idmono⊩ᵅ = idmono⊢ⁿᵉ } -- Soundness and completeness of the canonical model with respect to the syntax. mutual evalᶜ : ∀ {A Γ} → Γ ⊢ⁿᵉ A → Γ ⊩ A evalᶜ {α P} d = d evalᶜ {A ⇒ B} d = λ p e → evalᶜ (appⁿᵉ (mono⊢ⁿᵉ p d) (quotᶜ e)) evalᶜ {A ⩕ B} d = evalᶜ (fstⁿᵉ d) , evalᶜ (sndⁿᵉ d) evalᶜ {⫪} d = ∙ quotᶜ : ∀ {A Γ} → Γ ⊩ A → Γ ⊢ⁿᶠ A quotᶜ {α P} s = neⁿᶠ s quotᶜ {A ⇒ B} s = lamⁿᶠ (quotᶜ (s weak⊆ (evalᶜ {A} v₀ⁿᵉ))) quotᶜ {A ⩕ B} s = pairⁿᶠ (quotᶜ (π₁ s)) (quotᶜ (π₂ s)) quotᶜ {⫪} s = unitⁿᶠ -- Reflexivity of simultaneous forcing. refl⊩⋆ : ∀ {Γ} → Γ ⊩⋆ Γ refl⊩⋆ {∅} = ∙ refl⊩⋆ {Γ , A} = mono⊩⋆ weak⊆ refl⊩⋆ , evalᶜ {A} v₀ⁿᵉ -- Quotation, or completeness of the semantics with respect to the syntax. quot : ∀ {A Γ} → Γ ⊨ A → Γ ⊢ⁿᶠ A quot s = quotᶜ (s refl⊩⋆) -- Normalisation by evaluation. nbe : ∀ {A Γ} → Γ ⊢ A → Γ ⊢ⁿᶠ A nbe = quot ∘ eval
25.99
80
0.428049
3893da3f99ab7696d4d8eb1ee61e2a6adf596f8e
1,474
agda
Agda
test/asset/agda-stdlib-1.0/Data/List/Relation/Binary/Equality/Setoid.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Data/List/Relation/Binary/Equality/Setoid.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Data/List/Relation/Binary/Equality/Setoid.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- The Agda standard library -- -- Equality over lists parameterised by some setoid ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary using (Setoid) module Data.List.Relation.Binary.Equality.Setoid {a ℓ} (S : Setoid a ℓ) where open import Data.List.Base using (List) open import Level open import Relation.Binary renaming (Rel to Rel₂) open import Relation.Binary.PropositionalEquality as P using (_≡_) open import Data.List.Relation.Binary.Pointwise as PW using (Pointwise) open Setoid S renaming (Carrier to A) ------------------------------------------------------------------------ -- Definition of equality infix 4 _≋_ _≋_ : Rel₂ (List A) (a ⊔ ℓ) _≋_ = Pointwise _≈_ open Pointwise public using ([]; _∷_) ------------------------------------------------------------------------ -- Relational properties ≋-refl : Reflexive _≋_ ≋-refl = PW.refl refl ≋-reflexive : _≡_ ⇒ _≋_ ≋-reflexive P.refl = ≋-refl ≋-sym : Symmetric _≋_ ≋-sym = PW.symmetric sym ≋-trans : Transitive _≋_ ≋-trans = PW.transitive trans ≋-isEquivalence : IsEquivalence _≋_ ≋-isEquivalence = PW.isEquivalence isEquivalence ≋-setoid : Setoid _ _ ≋-setoid = PW.setoid S ------------------------------------------------------------------------ -- Operations open PW public using ( tabulate⁺ ; tabulate⁻ ; ++⁺ ; concat⁺ )
24.163934
77
0.531208
57ca5bb0a5b81ec370fcf63c260a83c6fb5a7048
1,143
agda
Agda
test/succeed/Issue814.agda
larrytheliquid/agda
477c8c37f948e6038b773409358fd8f38395f827
[ "MIT" ]
1
2018-10-10T17:08:44.000Z
2018-10-10T17:08:44.000Z
test/succeed/Issue814.agda
np/agda-git-experiment
20596e9dd9867166a64470dd24ea68925ff380ce
[ "MIT" ]
null
null
null
test/succeed/Issue814.agda
np/agda-git-experiment
20596e9dd9867166a64470dd24ea68925ff380ce
[ "MIT" ]
1
2022-03-12T11:35:18.000Z
2022-03-12T11:35:18.000Z
{-# OPTIONS --allow-unsolved-metas #-} -- {-# OPTIONS -v tc.conv.elim:100 #-} module Issue814 where record IsMonoid (M : Set) : Set where field unit : M _*_ : M → M → M record Monoid : Set₁ where field carrier : Set is-mon : IsMonoid carrier record Structure (Struct : Set₁) (HasStruct : Set → Set) (carrier : Struct → Set) : Set₁ where field has-struct : (X : Struct) → HasStruct (carrier X) mon-mon-struct : Structure Monoid IsMonoid Monoid.carrier mon-mon-struct = record { has-struct = Monoid.is-mon } mon-mon-struct' : Structure Monoid IsMonoid Monoid.carrier mon-mon-struct' = record { has-struct = Monoid.is-mon } unit : {Struct : Set₁}{C : Struct → Set} → ⦃ X : Struct ⦄ → ⦃ struct : Structure Struct IsMonoid C ⦄ → C X unit {Struct}{C} ⦃ X ⦄ ⦃ struct ⦄ = IsMonoid.unit (Structure.has-struct struct X) f : (M : Monoid) → Monoid.carrier M f M = unit -- An internal error has occurred. Please report this as a bug. -- Location of the error: src/full/Agda/TypeChecking/Eliminators.hs:45 -- This used to crash, but should only produce unsolved metas.
27.214286
81
0.643045
1e691f3c08acf9c561e14ae222ef7c765d961f76
6,198
agda
Agda
cohomology/FunctionOver.agda
danbornside/HoTT-Agda
1695a7f3dc60177457855ae846bbd86fcd96983e
[ "MIT" ]
null
null
null
cohomology/FunctionOver.agda
danbornside/HoTT-Agda
1695a7f3dc60177457855ae846bbd86fcd96983e
[ "MIT" ]
null
null
null
cohomology/FunctionOver.agda
danbornside/HoTT-Agda
1695a7f3dc60177457855ae846bbd86fcd96983e
[ "MIT" ]
null
null
null
{-# OPTIONS --without-K #-} open import HoTT {- Useful lemmas for computing the effect of transporting a function - across an equivalence in the domain or codomain -} module cohomology.FunctionOver where {- transporting a function along an equivalcence or path in the domain -} module _ {i} {j} {B : Type i} {C : Type j} (g : B → C) where domain-over-path : {A : Type i} (p : A == B) → g ∘ coe p == g [ (λ D → (D → C)) ↓ p ] domain-over-path idp = idp domain-over-equiv : {A : Type i} (e : A ≃ B) → g ∘ –> e == g [ (λ D → (D → C)) ↓ ua e ] domain-over-equiv e = ↓-app→cst-in $ λ q → ap g (↓-idf-ua-out e q) module _ {i} {j} {A : Type i} {C : Type j} (f : A → C) where domain!-over-path : {B : Type i} (p : A == B) → f == f ∘ coe! p [ (λ D → (D → C)) ↓ p ] domain!-over-path idp = idp domain!-over-equiv : {B : Type i} (e : A ≃ B) → f == f ∘ <– e [ (λ D → (D → C)) ↓ ua e ] domain!-over-equiv e = ↓-app→cst-in $ λ q → ap f (! (<–-inv-l e _) ∙ ap (<– e) (↓-idf-ua-out e q)) {- transporting a ptd function along a equivalence or path in the domain -} module _ {i} {j} {Y : Ptd i} {Z : Ptd j} (g : fst (Y ⊙→ Z)) where domain-over-⊙path : {X : Ptd i} (p : fst X == fst Y) (q : coe p (snd X) == snd Y) → g ⊙∘ (coe p , q) == g [ (λ W → fst (W ⊙→ Z)) ↓ pair= p (↓-idf-in p q) ] domain-over-⊙path idp idp = idp domain-over-⊙equiv : {X : Ptd i} (e : fst X ≃ fst Y) (q : –> e (snd X) == snd Y) → g ⊙∘ ⊙–> e q == g [ (λ W → fst (W ⊙→ Z)) ↓ ⊙ua e q ] domain-over-⊙equiv {X = X} e q = ap (λ w → g ⊙∘ w) lemma ◃ domain-over-⊙path (ua e) (coe-β e (snd X) ∙ q) where lemma : Path {A = fst (X ⊙→ Y)}  (⊙–> e q) (coe (ua e) , coe-β e (snd X) ∙ q) lemma = ! $ ⊙λ= (coe-β e) idp module _ {i} {j} {X : Ptd i} {Z : Ptd j} (f : fst (X ⊙→ Z)) where domain!-over-⊙path : {Y : Ptd i} (p : fst X == fst Y) (q : coe p (snd X) == snd Y) → f == f ⊙∘ (coe! p , ap (coe! p) (! q) ∙ coe!-inv-l p (snd X)) [ (λ W → fst (W ⊙→ Z)) ↓ pair= p (↓-idf-in p q) ] domain!-over-⊙path idp idp = idp domain!-over-⊙equiv : {Y : Ptd i} (e : fst X ≃ fst Y) (q : –> e (snd X) == snd Y) → f == f ⊙∘ (⊙<– e q) [ (λ W → fst (W ⊙→ Z)) ↓ ⊙ua e q ] domain!-over-⊙equiv {Y = Y} e q = (ap (λ w → f ⊙∘ w) (lemma e q) ∙ ! (⊙∘-assoc f _ (–> e , q))) ◃ domain-over-⊙equiv (f ⊙∘ (<– e , ap (<– e) (! q) ∙ <–-inv-l e (snd X))) e q where lemma : {X Y : Ptd i} (e : fst X ≃ fst Y) (q : –> e (snd X) == snd Y) → ⊙idf X == ((<– e , ap (<– e) (! q) ∙ <–-inv-l e (snd X)) ⊙∘ (–> e , q)) lemma {X = X} e idp = ! $ ⊙λ= (<–-inv-l e) (! (∙-unit-r _)) {- transporting a function along an equivalence or path in the codomain -} module _ {i} {j} {A : Type i} {B : Type j} (f : A → B) where codomain-over-path : {C : Type j} (p : B == C) → f == coe p ∘ f [ (λ D → (A → D)) ↓ p ] codomain-over-path idp = idp codomain-over-equiv : {C : Type j} (e : B ≃ C) → f == –> e ∘ f [ (λ D → (A → D)) ↓ ua e ] codomain-over-equiv e = ↓-cst→app-in $ λ _ → ↓-idf-ua-in e idp module _ {i} {j} {A : Type i} {C : Type j} (g : A → C) where codomain!-over-path : {B : Type j} (p : B == C) → coe! p ∘ g == g [ (λ D → (A → D)) ↓ p ] codomain!-over-path idp = idp codomain!-over-equiv : {B : Type j} (e : B ≃ C) → <– e ∘ g == g [ (λ D → (A → D)) ↓ ua e ] codomain!-over-equiv e = ↓-cst→app-in $ λ _ → ↓-idf-ua-in e (<–-inv-r e _) {- transporting a ptd function along a equivalence or path in the codomain -} module _ {i} {j} {X : Ptd i} {Y : Ptd j} (f : fst (X ⊙→ Y)) where codomain-over-⊙path : {Z : Ptd j} (p : fst Y == fst Z) (q : coe p (snd Y) == snd Z) → f == (coe p , q) ⊙∘ f [ (λ W → fst (X ⊙→ W)) ↓ pair= p (↓-idf-in p q) ] codomain-over-⊙path idp idp = pair= idp (! (∙-unit-r _ ∙ ap-idf (snd f))) codomain-over-⊙equiv : {Z : Ptd j} (e : fst Y ≃ fst Z) (q : –> e (snd Y) == snd Z) → f == (–> e , q) ⊙∘ f [ (λ W → fst (X ⊙→ W)) ↓ ⊙ua e q ] codomain-over-⊙equiv {Z = Z} e q = codomain-over-⊙path (ua e) (coe-β e (snd Y) ∙ q) ▹ ap (λ w → w ⊙∘ f) lemma where lemma : Path {A = fst (Y ⊙→ Z)} (coe (ua e) , coe-β e (snd Y) ∙ q) (–> e , q) lemma = ⊙λ= (coe-β e) idp module _ {i} {j} {X : Ptd i} {Z : Ptd j} (g : fst (X ⊙→ Z)) where codomain!-over-⊙path : {Y : Ptd j} (p : fst Y == fst Z) (q : coe p (snd Y) == snd Z) → (coe! p , ap (coe! p) (! q) ∙ coe!-inv-l p (snd Y)) ⊙∘ g == g [ (λ W → fst (X ⊙→ W)) ↓ pair= p (↓-idf-in p q) ] codomain!-over-⊙path idp idp = pair= idp (∙-unit-r _ ∙ ap-idf (snd g)) codomain!-over-⊙equiv : {Y : Ptd j} (e : fst Y ≃ fst Z) (q : –> e (snd Y) == snd Z) → (⊙<– e q) ⊙∘ g == g [ (λ W → fst (X ⊙→ W)) ↓ ⊙ua e q ] codomain!-over-⊙equiv {Y = Y} e q = codomain-over-⊙equiv ((<– e , ap (<– e) (! q) ∙ <–-inv-l e (snd Y)) ⊙∘ g) e q ▹ (! (⊙∘-assoc (–> e , q) _ g) ∙ ap (λ w → w ⊙∘ g) (lemma e q) ∙ ⊙∘-unit-l g) where lemma : {Y Z : Ptd j} (e : fst Y ≃ fst Z) (q : –> e (snd Y) == snd Z) → ((–> e , q) ⊙∘ (<– e , ap (<– e) (! q) ∙ <–-inv-l e (snd Y))) == ⊙idf Z lemma {Y = Y} e idp = ⊙λ= (<–-inv-r e) (ap (λ w → w ∙ idp) (<–-inv-adj e (snd Y))) {- transporting a group homomorphism along an isomorphism -} domain-over-iso : ∀ {i j} {G H : Group i} {K : Group j} (φ : G →ᴳ H) (ie : is-equiv (GroupHom.f φ)) (ψ : G →ᴳ K) (χ : H →ᴳ K) → GroupHom.f ψ == GroupHom.f χ [ (λ A → A → Group.El K) ↓ ua (GroupHom.f φ , ie) ] → ψ == χ [ (λ J → J →ᴳ K) ↓ group-ua (φ , ie) ] domain-over-iso {K = K} φ ie ψ χ p = hom=-↓ _ _ $ ↓-ap-out _ Group.El _ $ transport (λ q → GroupHom.f ψ == GroupHom.f χ [ (λ A → A → Group.El K) ↓ q ]) (! (group-ua-el (φ , ie))) p codomain-over-iso : ∀ {i j} {G : Group i} {H K : Group j} (φ : H →ᴳ K) (ie : is-equiv (GroupHom.f φ)) (ψ : G →ᴳ H) (χ : G →ᴳ K) → GroupHom.f ψ == GroupHom.f χ [ (λ A → Group.El G → A) ↓ ua (GroupHom.f φ , ie) ] → ψ == χ [ (λ J → G →ᴳ J) ↓ group-ua (φ , ie) ] codomain-over-iso {G = G} φ ie ψ χ p = hom=-↓ _ _ $ ↓-ap-out _ Group.El _ $ transport (λ q → GroupHom.f ψ == GroupHom.f χ [ (λ A → Group.El G → A) ↓ q ]) (! (group-ua-el (φ , ie))) p
39.730769
79
0.461116
1388f0d4fa56af0a65572d9b07d05ca7d5192e1e
4,681
agda
Agda
src/cfg.agda
jaywunder/jarsec-verified
40cca331810f1d3f7dc099614ddca4fa96bd695c
[ "MIT" ]
null
null
null
src/cfg.agda
jaywunder/jarsec-verified
40cca331810f1d3f7dc099614ddca4fa96bd695c
[ "MIT" ]
null
null
null
src/cfg.agda
jaywunder/jarsec-verified
40cca331810f1d3f7dc099614ddca4fa96bd695c
[ "MIT" ]
null
null
null
module cfg where open import jarsec using (Parser ; run-parser ; partial-parse ; _>>=_ ; _>>_ ; _<*>_) open import Data.Bool open import Data.List hiding (lookup) open import Data.Vec renaming ([_] to V[_] ; _++_ to _vv_) hiding (_>>=_) open import Data.Fin hiding (_+_) open import Data.Char open import Agda.Builtin.Char renaming ( primCharEquality to charEq ) open import Data.Nat open import Relation.Binary.PropositionalEquality using (_≡_ ; refl) open import Data.Maybe open import Data.Sum hiding (map) open import Data.String hiding (length ; _++_) renaming (primStringToList to 𝕊→𝕃 ; primStringFromList to 𝕃→𝕊) open import Data.Product hiding (map) open import Agda.Builtin.Unit postulate 𝕃⇄𝕊 : ∀ (cs : List Char) → (𝕊→𝕃 (𝕃→𝕊 cs)) ≡ cs _at_ : ∀ {n} {A : Set} → Vec A n → Fin n → A (x ∷ xs) at zero = x (x ∷ xs) at suc i = xs at i A : Set A = Char data Cfg : ℕ → Set where emp : ∀ {n} → Cfg n eps : ∀ {n} → Cfg n lit : ∀ {n} → A → Cfg n var : ∀ {n} → Fin n → Cfg n seq : ∀ {n} → Cfg n → Cfg n → Cfg n alt : ∀ {n} → Cfg n → Cfg n → Cfg n many : ∀ {n} → Cfg n → Cfg n fix : ∀ {n} → Cfg (suc n) → Cfg n Env : ℕ → Set Env n = Vec (Cfg n) n _⊖_ : ∀ (n : ℕ) → Fin n → ℕ (suc n) ⊖ zero = n (suc n) ⊖ suc i = suc (n ⊖ i) _⊕_ : ℕ → ℕ → ℕ zero ⊕ n = n suc m ⊕ n = m ⊕ suc n introd-var : ∀ {n : ℕ} (i : Fin n) → Fin (n ⊖ i) → Fin n introd-var zero x = suc x introd-var (suc i) zero = zero introd-var (suc i) (suc x) = suc (introd-var i x) introd : ∀ {n : ℕ} (i : Fin n) → Cfg (n ⊖ i) → Cfg n introd i emp = emp introd i eps = eps introd i (lit l) = lit l introd i (var x) = var (introd-var i x) introd i (seq e₁ e₂) = seq (introd i e₁) (introd i e₂) introd i (alt e₁ e₂) = alt (introd i e₁) (introd i e₂) introd i (many e) = many (introd i e) introd i (fix e) = fix (introd (suc i) e) -- used in subst introd-var-N : ∀ {n : ℕ} (m : ℕ) → Fin n → Fin (m ⊕ n) introd-var-N zero x = x introd-var-N (suc m) x = introd-var-N m (introd-var zero x) -- used in subst intro : ∀ {n : ℕ} → Cfg n → Cfg (suc n) intro = introd zero subst-var : ∀ {n : ℕ} (m : ℕ) (x : Fin n) → Cfg (m ⊕ (n ⊖ x)) → Fin n → Cfg (m ⊕ (n ⊖ x)) subst-var m zero v zero = v subst-var m zero v (suc y) = var (introd-var-N m y) subst-var m (suc x) v zero = var (introd-var-N m zero) subst-var m (suc x) v (suc y) = subst-var (suc m) x v y subst : ∀ {n : ℕ} (x : Fin n) → Cfg (n ⊖ x) → Cfg n → Cfg (n ⊖ x) subst y v emp = emp subst y v eps = eps subst y v (lit l) = lit l subst y v (var x) = subst-var zero y v x subst y v (seq e₁ e₂) = seq (subst y v e₁) (subst y v e₂) subst y v (alt e₁ e₂) = alt (subst y v e₁) (subst y v e₂) subst y v (many e) = many (subst y v e) subst y v (fix e) = fix (subst (suc y) (intro v) e) sub : ∀ {n : ℕ} → Cfg n → Cfg (suc n) → Cfg n sub = subst zero data _∈[_] : List A → Cfg 0 → Set where eps : [] ∈[ eps ] lit : ∀ (c : A) → [ c ] ∈[ lit c ] seq : ∀ {s₁ s₂ : List A} {cfg₁ cfg₂ : Cfg 0} → s₁ ∈[ cfg₁ ] → s₂ ∈[ cfg₂ ] → (s₁ ++ s₂) ∈[ seq cfg₁ cfg₂ ] alt₁ : {s : List A} {cfg₁ cfg₂ : Cfg 0} → s ∈[ cfg₁ ] → s ∈[ alt cfg₁ cfg₂ ] alt₂ : {s : List A} {cfg₁ cfg₂ : Cfg 0} → s ∈[ cfg₂ ] → s ∈[ alt cfg₁ cfg₂ ] many0 : {cfg : Cfg 0} → [] ∈[ many cfg ] many+ : {s₁ s₂ : List A} {cfg : Cfg 0} → s₁ ∈[ cfg ] → s₂ ∈[ many cfg ] → (s₁ ++ s₂) ∈[ many cfg ] unroll : {s : List A} → {cfg : Cfg 1} → s ∈[ sub (fix cfg) cfg ] → s ∈[ fix cfg ] abstract instance block : ⊤ block = tt unblock : block ≡ tt unblock = refl delayed : ∀ {A : Set} → ⊤ → A → A delayed tt x = x delay : ∀ {A : Set} → A → A delay = delayed block {-# TERMINATING #-} interp : Cfg 0 → Parser (List A) interp emp = Parser.mk-parser (λ _ → []) interp eps = Parser.mk-parser (λ str → [ ([] , str) ]) interp (lit c) = do c′ ← jarsec.satisfy (charEq c) jarsec.unit [ c′ ] interp (var ()) interp (seq cfg₁ cfg₂) = do x ← (interp cfg₁) y ← (interp cfg₂) jarsec.unit (x ++ y) interp (alt cfg₁ cfg₂) = jarsec.combine (interp cfg₁) (interp cfg₂) interp (many cfg) = interp (alt eps (seq cfg (delay (many cfg)))) interp (fix cfg) = interp (sub (fix cfg) cfg) a : Fin 2 a = zero b : Fin 2 b = (suc zero) xX-or-ε : Cfg 0 xX-or-ε = fix (alt (seq (lit 'x') (var zero)) eps) -- _ : interp xX-or-ε ≡ {! !} -- _ = refl _ : (𝕊→𝕃 "xx") ∈[ fix {n = 0} (alt (seq (lit 'x') (var zero)) (eps)) ] _ = unroll (alt₁ (seq (lit 'x') (unroll (alt₁ (seq (lit 'x') (unroll (alt₂ eps))))))) _ : (𝕊→𝕃 "xx") ∈[ xX-or-ε ] _ = unroll (alt₁ (seq (lit 'x') ( unroll (alt₁ (seq (lit 'x') ( unroll (alt₂ eps))))))) _ : ( 'a' ∷ 'a' ∷ []) ∈[ many (lit 'a') ] _ = many+ (lit 'a') (many+ (lit 'a') many0)
26.005556
109
0.547105
1a47a279c5eb69faf254d93ce90e97df735b2f9b
2,038
agda
Agda
StructurallyRecursiveDescentParsing/PBM.agda
nad/parser-combinators
76774f54f466cfe943debf2da731074fe0c33644
[ "MIT" ]
1
2020-07-03T08:56:13.000Z
2020-07-03T08:56:13.000Z
StructurallyRecursiveDescentParsing/PBM.agda
nad/parser-combinators
76774f54f466cfe943debf2da731074fe0c33644
[ "MIT" ]
null
null
null
StructurallyRecursiveDescentParsing/PBM.agda
nad/parser-combinators
76774f54f466cfe943debf2da731074fe0c33644
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- A parser for PBM images; illustrates "essential" use of bind ------------------------------------------------------------------------ -- Note that I am using the simple "Plain PBM" format, and I try to -- adhere to the following statement from the pbm man page: -- -- "Programs that read this format should be as lenient as possible, -- accepting anything that looks remotely like a bitmap." -- I got the idea to write this particular parser from "The Power of -- Pi" by Oury and Swierstra. module StructurallyRecursiveDescentParsing.PBM where import Data.Vec as Vec import Data.List as List open import Codata.Musical.Notation open import Data.Bool open import Data.Char using (_==_) import Data.Char.Properties as Char import Data.String as String open import Data.Unit open import Function open import Relation.Binary.PropositionalEquality open import StructurallyRecursiveDescentParsing.Grammar open import StructurallyRecursiveDescentParsing.Lib open import StructurallyRecursiveDescentParsing.DepthFirst open Token Char.decSetoid open import TotalParserCombinators.Examples.PBM using (module PBM) open PBM mutual comment : Parser EmptyNT _ _ _ comment = tt <$ tok '#' <⊛ sat' (not ∘ _==_ '\n') ⋆ <⊛ tok '\n' colour = white <$ tok '0' ∣ black <$ tok '1' pbm = w∣c ⋆ ⊛> theString (String.toVec "P1") ⊛> w∣c ⋆ ⊛> number !>>= λ cols → ♯ -- _>>=_ works just as well. (w∣c + ⊛> number >>= λ rows → -- _!>>=_ works just as well. w∣c ⊛> (toPBM <$> exactly rows (exactly cols (w∣c ⋆ ⊛> colour))) <⊛ any ⋆) where w∣c = whitespace ∣ comment module Example where open Vec image = toPBM ((white ∷ black ∷ white ∷ []) ∷ (black ∷ white ∷ black ∷ []) ∷ (white ∷ black ∷ white ∷ []) ∷ []) ex : parseComplete (⟦ pbm ⟧ emptyGrammar) (String.toList (show image)) ≡ List.[_] image ex = refl
29.536232
72
0.601079
3d9a1dc882daf6666acd8d6ec21af235ded28e4a
404
agda
Agda
test/succeed/Issue152.agda
asr/agda-kanso
aa10ae6a29dc79964fe9dec2de07b9df28b61ed5
[ "MIT" ]
1
2019-11-27T07:26:06.000Z
2019-11-27T07:26:06.000Z
test/succeed/Issue152.agda
np/agda-git-experiment
20596e9dd9867166a64470dd24ea68925ff380ce
[ "MIT" ]
null
null
null
test/succeed/Issue152.agda
np/agda-git-experiment
20596e9dd9867166a64470dd24ea68925ff380ce
[ "MIT" ]
null
null
null
module Issue152 where data ℕ : Set where zero : ℕ suc : ℕ → ℕ {-# BUILTIN NATURAL ℕ #-} {-# BUILTIN ZERO zero #-} {-# BUILTIN SUC suc #-} f : ℕ → ℕ f 0 with zero f 0 | n = n f 1 with zero f 1 | n = n f n = n g : ℕ → ℕ g 0 with zero g zero | n = n g 1 with zero g (suc zero) | n = n g n = n h : ℕ → ℕ h zero with zero h 0 | n = n h (suc zero) with zero h 1 | n = n h n = n
12.242424
28
0.507426
03ef28b9b5f3d0ebdf2dc33498070ce4796c40be
28,530
agda
Agda
agda-stdlib/src/Data/Vec/Properties.agda
DreamLinuxer/popl21-artifact
fb380f2e67dcb4a94f353dbaec91624fcb5b8933
[ "MIT" ]
5
2020-10-07T12:07:53.000Z
2020-10-10T21:41:32.000Z
agda-stdlib/src/Data/Vec/Properties.agda
DreamLinuxer/popl21-artifact
fb380f2e67dcb4a94f353dbaec91624fcb5b8933
[ "MIT" ]
null
null
null
agda-stdlib/src/Data/Vec/Properties.agda
DreamLinuxer/popl21-artifact
fb380f2e67dcb4a94f353dbaec91624fcb5b8933
[ "MIT" ]
1
2021-11-04T06:54:45.000Z
2021-11-04T06:54:45.000Z
------------------------------------------------------------------------ -- The Agda standard library -- -- Some Vec-related properties ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Vec.Properties where open import Algebra.Definitions open import Data.Bool.Base using (true; false) open import Data.Empty using (⊥-elim) open import Data.Fin.Base as Fin using (Fin; zero; suc; toℕ; fromℕ) open import Data.List.Base as List using (List) open import Data.Nat.Base open import Data.Nat.Properties using (+-assoc; ≤-step) open import Data.Product as Prod using (_×_; _,_; proj₁; proj₂; <_,_>; uncurry) open import Data.Sum.Base using ([_,_]′) open import Data.Sum.Properties using ([,]-map-commute) open import Data.Vec.Base open import Function.Base open import Function.Inverse using (_↔_; inverse) open import Level using (Level) open import Relation.Binary as B hiding (Decidable) open import Relation.Binary.PropositionalEquality as P using (_≡_; _≢_; refl; _≗_; cong₂) open import Relation.Unary using (Pred; Decidable) open import Relation.Nullary using (Dec; does; yes; no) open import Relation.Nullary.Decidable using (map′) open import Relation.Nullary.Product using (_×-dec_) private variable a b c d p : Level A : Set a B : Set b C : Set c D : Set d ------------------------------------------------------------------------ -- Properties of propositional equality over vectors module _ {n} {x y : A} {xs ys : Vec A n} where ∷-injectiveˡ : x ∷ xs ≡ y ∷ ys → x ≡ y ∷-injectiveˡ refl = refl ∷-injectiveʳ : x ∷ xs ≡ y ∷ ys → xs ≡ ys ∷-injectiveʳ refl = refl ∷-injective : (x ∷ xs) ≡ (y ∷ ys) → x ≡ y × xs ≡ ys ∷-injective refl = refl , refl ≡-dec : B.Decidable _≡_ → ∀ {n} → B.Decidable {A = Vec A n} _≡_ ≡-dec _≟_ [] [] = yes refl ≡-dec _≟_ (x ∷ xs) (y ∷ ys) = map′ (uncurry (cong₂ _∷_)) ∷-injective (x ≟ y ×-dec ≡-dec _≟_ xs ys) ------------------------------------------------------------------------ -- _[_]=_ []=-injective : ∀ {n} {xs : Vec A n} {i x y} → xs [ i ]= x → xs [ i ]= y → x ≡ y []=-injective here here = refl []=-injective (there xsᵢ≡x) (there xsᵢ≡y) = []=-injective xsᵢ≡x xsᵢ≡y -- See also Data.Vec.Properties.WithK.[]=-irrelevant. ------------------------------------------------------------------------ -- lookup []=⇒lookup : ∀ {n} {x : A} {xs} {i : Fin n} → xs [ i ]= x → lookup xs i ≡ x []=⇒lookup here = refl []=⇒lookup (there xs[i]=x) = []=⇒lookup xs[i]=x lookup⇒[]= : ∀ {n} (i : Fin n) {x : A} xs → lookup xs i ≡ x → xs [ i ]= x lookup⇒[]= zero (_ ∷ _) refl = here lookup⇒[]= (suc i) (_ ∷ xs) p = there (lookup⇒[]= i xs p) []=↔lookup : ∀ {n i} {x} {xs : Vec A n} → xs [ i ]= x ↔ lookup xs i ≡ x []=↔lookup {i = i} = inverse []=⇒lookup (lookup⇒[]= _ _) lookup⇒[]=∘[]=⇒lookup ([]=⇒lookup∘lookup⇒[]= _ i) where lookup⇒[]=∘[]=⇒lookup : ∀ {n x xs} {i : Fin n} (p : xs [ i ]= x) → lookup⇒[]= i xs ([]=⇒lookup p) ≡ p lookup⇒[]=∘[]=⇒lookup here = refl lookup⇒[]=∘[]=⇒lookup (there p) = P.cong there (lookup⇒[]=∘[]=⇒lookup p) []=⇒lookup∘lookup⇒[]= : ∀ {n} xs (i : Fin n) {x} (p : lookup xs i ≡ x) → []=⇒lookup (lookup⇒[]= i xs p) ≡ p []=⇒lookup∘lookup⇒[]= (x ∷ xs) zero refl = refl []=⇒lookup∘lookup⇒[]= (x ∷ xs) (suc i) p = []=⇒lookup∘lookup⇒[]= xs i p ------------------------------------------------------------------------ -- updateAt (_[_]%=_) -- (+) updateAt i actually updates the element at index i. updateAt-updates : ∀ {n} (i : Fin n) {f : A → A} (xs : Vec A n) {x : A} → xs [ i ]= x → (updateAt i f xs) [ i ]= f x updateAt-updates zero (x ∷ xs) here = here updateAt-updates (suc i) (x ∷ xs) (there loc) = there (updateAt-updates i xs loc) -- (-) updateAt i does not touch the elements at other indices. updateAt-minimal : ∀ {n} (i j : Fin n) {f : A → A} {x : A} (xs : Vec A n) → i ≢ j → xs [ i ]= x → (updateAt j f xs) [ i ]= x updateAt-minimal zero zero (x ∷ xs) 0≢0 here = ⊥-elim (0≢0 refl) updateAt-minimal zero (suc j) (x ∷ xs) _ here = here updateAt-minimal (suc i) zero (x ∷ xs) _ (there loc) = there loc updateAt-minimal (suc i) (suc j) (x ∷ xs) i≢j (there loc) = there (updateAt-minimal i j xs (i≢j ∘ P.cong suc) loc) -- The other properties are consequences of (+) and (-). -- We spell the most natural properties out. -- Direct inductive proofs are in most cases easier than just using -- the defining properties. -- In the explanations, we make use of shorthand f = g ↾ x -- meaning that f and g agree at point x, i.e. f x ≡ g x. -- updateAt i is a morphism from the monoid of endofunctions A → A -- to the monoid of endofunctions Vec A n → Vec A n -- 1a. relative identity: f = id ↾ (lookup xs i) -- implies updateAt i f = id ↾ xs updateAt-id-relative : ∀ {n} (i : Fin n) {f : A → A} (xs : Vec A n) → f (lookup xs i) ≡ lookup xs i → updateAt i f xs ≡ xs updateAt-id-relative zero (x ∷ xs) eq = P.cong (_∷ xs) eq updateAt-id-relative (suc i) (x ∷ xs) eq = P.cong (x ∷_) (updateAt-id-relative i xs eq) -- 1b. identity: updateAt i id ≗ id updateAt-id : ∀ {n} (i : Fin n) (xs : Vec A n) → updateAt i id xs ≡ xs updateAt-id i xs = updateAt-id-relative i xs refl -- 2a. relative composition: f ∘ g = h ↾ (lookup xs i) -- implies updateAt i f ∘ updateAt i g = updateAt i h ↾ xs updateAt-compose-relative : ∀ {n} (i : Fin n) {f g h : A → A} (xs : Vec A n) → f (g (lookup xs i)) ≡ h (lookup xs i) → updateAt i f (updateAt i g xs) ≡ updateAt i h xs updateAt-compose-relative zero (x ∷ xs) fg=h = P.cong (_∷ xs) fg=h updateAt-compose-relative (suc i) (x ∷ xs) fg=h = P.cong (x ∷_) (updateAt-compose-relative i xs fg=h) -- 2b. composition: updateAt i f ∘ updateAt i g ≗ updateAt i (f ∘ g) updateAt-compose : ∀ {n} (i : Fin n) {f g : A → A} → updateAt i f ∘ updateAt i g ≗ updateAt i (f ∘ g) updateAt-compose i xs = updateAt-compose-relative i xs refl -- 3. congruence: updateAt i is a congruence wrt. extensional equality. -- 3a. If f = g ↾ (lookup xs i) -- then updateAt i f = updateAt i g ↾ xs updateAt-cong-relative : ∀ {n} (i : Fin n) {f g : A → A} (xs : Vec A n) → f (lookup xs i) ≡ g (lookup xs i) → updateAt i f xs ≡ updateAt i g xs updateAt-cong-relative zero (x ∷ xs) f=g = P.cong (_∷ xs) f=g updateAt-cong-relative (suc i) (x ∷ xs) f=g = P.cong (x ∷_) (updateAt-cong-relative i xs f=g) -- 3b. congruence: f ≗ g → updateAt i f ≗ updateAt i g updateAt-cong : ∀ {n} (i : Fin n) {f g : A → A} → f ≗ g → updateAt i f ≗ updateAt i g updateAt-cong i f≗g xs = updateAt-cong-relative i xs (f≗g (lookup xs i)) -- The order of updates at different indices i ≢ j does not matter. -- This a consequence of updateAt-updates and updateAt-minimal -- but easier to prove inductively. updateAt-commutes : ∀ {n} (i j : Fin n) {f g : A → A} → i ≢ j → updateAt i f ∘ updateAt j g ≗ updateAt j g ∘ updateAt i f updateAt-commutes zero zero 0≢0 (x ∷ xs) = ⊥-elim (0≢0 refl) updateAt-commutes zero (suc j) i≢j (x ∷ xs) = refl updateAt-commutes (suc i) zero i≢j (x ∷ xs) = refl updateAt-commutes (suc i) (suc j) i≢j (x ∷ xs) = P.cong (x ∷_) (updateAt-commutes i j (i≢j ∘ P.cong suc) xs) -- lookup after updateAt reduces. -- For same index this is an easy consequence of updateAt-updates -- using []=↔lookup. lookup∘updateAt : ∀ {n} (i : Fin n) {f : A → A} → ∀ xs → lookup (updateAt i f xs) i ≡ f (lookup xs i) lookup∘updateAt i xs = []=⇒lookup (updateAt-updates i xs (lookup⇒[]= i _ refl)) -- For different indices it easily follows from updateAt-minimal. lookup∘updateAt′ : ∀ {n} (i j : Fin n) {f : A → A} → i ≢ j → ∀ xs → lookup (updateAt j f xs) i ≡ lookup xs i lookup∘updateAt′ i j xs i≢j = []=⇒lookup (updateAt-minimal i j i≢j xs (lookup⇒[]= i _ refl)) -- Aliases for notation _[_]%=_ []%=-id : ∀ {n} (xs : Vec A n) (i : Fin n) → xs [ i ]%= id ≡ xs []%=-id xs i = updateAt-id i xs []%=-compose : ∀ {n} (xs : Vec A n) (i : Fin n) {f g : A → A} → xs [ i ]%= f [ i ]%= g ≡ xs [ i ]%= g ∘ f []%=-compose xs i = updateAt-compose i xs ------------------------------------------------------------------------ -- _[_]≔_ (update) -- -- _[_]≔_ is defined in terms of updateAt, and all of its properties -- are special cases of the ones for updateAt. []≔-idempotent : ∀ {n} (xs : Vec A n) (i : Fin n) {x₁ x₂ : A} → (xs [ i ]≔ x₁) [ i ]≔ x₂ ≡ xs [ i ]≔ x₂ []≔-idempotent xs i = updateAt-compose i xs []≔-commutes : ∀ {n} (xs : Vec A n) (i j : Fin n) {x y : A} → i ≢ j → (xs [ i ]≔ x) [ j ]≔ y ≡ (xs [ j ]≔ y) [ i ]≔ x []≔-commutes xs i j i≢j = updateAt-commutes j i (i≢j ∘ P.sym) xs []≔-updates : ∀ {n} (xs : Vec A n) (i : Fin n) {x : A} → (xs [ i ]≔ x) [ i ]= x []≔-updates xs i = updateAt-updates i xs (lookup⇒[]= i xs refl) []≔-minimal : ∀ {n} (xs : Vec A n) (i j : Fin n) {x y : A} → i ≢ j → xs [ i ]= x → (xs [ j ]≔ y) [ i ]= x []≔-minimal xs i j i≢j loc = updateAt-minimal i j xs i≢j loc []≔-lookup : ∀ {n} (xs : Vec A n) (i : Fin n) → xs [ i ]≔ lookup xs i ≡ xs []≔-lookup xs i = updateAt-id-relative i xs refl []≔-++-inject+ : ∀ {m n x} (xs : Vec A m) (ys : Vec A n) i → (xs ++ ys) [ Fin.inject+ n i ]≔ x ≡ (xs [ i ]≔ x) ++ ys []≔-++-inject+ (x ∷ xs) ys zero = refl []≔-++-inject+ (x ∷ xs) ys (suc i) = P.cong (x ∷_) $ []≔-++-inject+ xs ys i lookup∘update : ∀ {n} (i : Fin n) (xs : Vec A n) x → lookup (xs [ i ]≔ x) i ≡ x lookup∘update i xs x = lookup∘updateAt i xs lookup∘update′ : ∀ {n} {i j : Fin n} → i ≢ j → ∀ (xs : Vec A n) y → lookup (xs [ j ]≔ y) i ≡ lookup xs i lookup∘update′ {i = i} {j} i≢j xs y = lookup∘updateAt′ i j i≢j xs ------------------------------------------------------------------------ -- map map-id : ∀ {n} → map {A = A} {n = n} id ≗ id map-id [] = refl map-id (x ∷ xs) = P.cong (x ∷_) (map-id xs) map-cong : ∀ {n} {f g : A → B} → f ≗ g → map {n = n} f ≗ map g map-cong f≗g [] = refl map-cong f≗g (x ∷ xs) = P.cong₂ _∷_ (f≗g x) (map-cong f≗g xs) map-∘ : ∀ {n} (f : B → C) (g : A → B) → map {n = n} (f ∘ g) ≗ map f ∘ map g map-∘ f g [] = refl map-∘ f g (x ∷ xs) = P.cong (f (g x) ∷_) (map-∘ f g xs) lookup-map : ∀ {n} (i : Fin n) (f : A → B) (xs : Vec A n) → lookup (map f xs) i ≡ f (lookup xs i) lookup-map zero f (x ∷ xs) = refl lookup-map (suc i) f (x ∷ xs) = lookup-map i f xs map-updateAt : ∀ {n} {f : A → B} {g : A → A} {h : B → B} (xs : Vec A n) (i : Fin n) → f (g (lookup xs i)) ≡ h (f (lookup xs i)) → map f (updateAt i g xs) ≡ updateAt i h (map f xs) map-updateAt (x ∷ xs) zero eq = P.cong (_∷ _) eq map-updateAt (x ∷ xs) (suc i) eq = P.cong (_ ∷_) (map-updateAt xs i eq) map-[]≔ : ∀ {n} (f : A → B) (xs : Vec A n) (i : Fin n) {x : A} → map f (xs [ i ]≔ x) ≡ map f xs [ i ]≔ f x map-[]≔ f xs i = map-updateAt xs i refl ------------------------------------------------------------------------ -- _++_ module _ {m} {ys ys' : Vec A m} where -- See also Data.Vec.Properties.WithK.++-assoc. ++-injectiveˡ : ∀ {n} (xs xs' : Vec A n) → xs ++ ys ≡ xs' ++ ys' → xs ≡ xs' ++-injectiveˡ [] [] _ = refl ++-injectiveˡ (x ∷ xs) (x' ∷ xs') eq = P.cong₂ _∷_ (∷-injectiveˡ eq) (++-injectiveˡ _ _ (∷-injectiveʳ eq)) ++-injectiveʳ : ∀ {n} (xs xs' : Vec A n) → xs ++ ys ≡ xs' ++ ys' → ys ≡ ys' ++-injectiveʳ [] [] eq = eq ++-injectiveʳ (x ∷ xs) (x' ∷ xs') eq = ++-injectiveʳ xs xs' (∷-injectiveʳ eq) ++-injective : ∀ {n} (xs xs' : Vec A n) → xs ++ ys ≡ xs' ++ ys' → xs ≡ xs' × ys ≡ ys' ++-injective xs xs' eq = (++-injectiveˡ xs xs' eq , ++-injectiveʳ xs xs' eq) lookup-++-< : ∀ {m n} (xs : Vec A m) (ys : Vec A n) → ∀ i (i<m : toℕ i < m) → lookup (xs ++ ys) i ≡ lookup xs (Fin.fromℕ< i<m) lookup-++-< (x ∷ xs) ys zero (s≤s z≤n) = refl lookup-++-< (x ∷ xs) ys (suc i) (s≤s (s≤s i<m)) = lookup-++-< xs ys i (s≤s i<m) lookup-++-≥ : ∀ {m n} (xs : Vec A m) (ys : Vec A n) → ∀ i (i≥m : toℕ i ≥ m) → lookup (xs ++ ys) i ≡ lookup ys (Fin.reduce≥ i i≥m) lookup-++-≥ [] ys i i≥m = refl lookup-++-≥ (x ∷ xs) ys (suc i) (s≤s i≥m) = lookup-++-≥ xs ys i i≥m lookup-++ˡ : ∀ {m n} (xs : Vec A m) (ys : Vec A n) i → lookup (xs ++ ys) (Fin.inject+ n i) ≡ lookup xs i lookup-++ˡ (x ∷ xs) ys zero = refl lookup-++ˡ (x ∷ xs) ys (suc i) = lookup-++ˡ xs ys i lookup-++ʳ : ∀ {m n} (xs : Vec A m) (ys : Vec A n) i → lookup (xs ++ ys) (Fin.raise m i) ≡ lookup ys i lookup-++ʳ [] ys zero = refl lookup-++ʳ [] (y ∷ xs) (suc i) = lookup-++ʳ [] xs i lookup-++ʳ (x ∷ xs) ys i = lookup-++ʳ xs ys i lookup-splitAt : ∀ m {n} (xs : Vec A m) (ys : Vec A n) i → lookup (xs ++ ys) i ≡ [ lookup xs , lookup ys ]′ (Fin.splitAt m i) lookup-splitAt zero [] ys i = refl lookup-splitAt (suc m) (x ∷ xs) ys zero = refl lookup-splitAt (suc m) (x ∷ xs) ys (suc i) = P.trans (lookup-splitAt m xs ys i) (P.sym ([,]-map-commute (Fin.splitAt m i))) ------------------------------------------------------------------------ -- zipWith module _ {f : A → A → A} where zipWith-assoc : Associative _≡_ f → ∀ {n} → Associative _≡_ (zipWith {n = n} f) zipWith-assoc assoc [] [] [] = refl zipWith-assoc assoc (x ∷ xs) (y ∷ ys) (z ∷ zs) = P.cong₂ _∷_ (assoc x y z) (zipWith-assoc assoc xs ys zs) zipWith-idem : Idempotent _≡_ f → ∀ {n} → Idempotent _≡_ (zipWith {n = n} f) zipWith-idem idem [] = refl zipWith-idem idem (x ∷ xs) = P.cong₂ _∷_ (idem x) (zipWith-idem idem xs) module _ {f : A → A → A} {e : A} where zipWith-identityˡ : LeftIdentity _≡_ e f → ∀ {n} → LeftIdentity _≡_ (replicate e) (zipWith {n = n} f) zipWith-identityˡ idˡ [] = refl zipWith-identityˡ idˡ (x ∷ xs) = P.cong₂ _∷_ (idˡ x) (zipWith-identityˡ idˡ xs) zipWith-identityʳ : RightIdentity _≡_ e f → ∀ {n} → RightIdentity _≡_ (replicate e) (zipWith {n = n} f) zipWith-identityʳ idʳ [] = refl zipWith-identityʳ idʳ (x ∷ xs) = P.cong₂ _∷_ (idʳ x) (zipWith-identityʳ idʳ xs) zipWith-zeroˡ : LeftZero _≡_ e f → ∀ {n} → LeftZero _≡_ (replicate e) (zipWith {n = n} f) zipWith-zeroˡ zeˡ [] = refl zipWith-zeroˡ zeˡ (x ∷ xs) = P.cong₂ _∷_ (zeˡ x) (zipWith-zeroˡ zeˡ xs) zipWith-zeroʳ : RightZero _≡_ e f → ∀ {n} → RightZero _≡_ (replicate e) (zipWith {n = n} f) zipWith-zeroʳ zeʳ [] = refl zipWith-zeroʳ zeʳ (x ∷ xs) = P.cong₂ _∷_ (zeʳ x) (zipWith-zeroʳ zeʳ xs) zipWith-inverseˡ : ∀ {⁻¹} → LeftInverse _≡_ e ⁻¹ f → ∀ {n} → LeftInverse _≡_ (replicate {n = n} e) (map ⁻¹) (zipWith f) zipWith-inverseˡ invˡ [] = refl zipWith-inverseˡ invˡ (x ∷ xs) = P.cong₂ _∷_ (invˡ x) (zipWith-inverseˡ invˡ xs) zipWith-inverseʳ : ∀ {⁻¹} → RightInverse _≡_ e ⁻¹ f → ∀ {n} → RightInverse _≡_ (replicate {n = n} e) (map ⁻¹) (zipWith f) zipWith-inverseʳ invʳ [] = refl zipWith-inverseʳ invʳ (x ∷ xs) = P.cong₂ _∷_ (invʳ x) (zipWith-inverseʳ invʳ xs) module _ {f g : A → A → A} where zipWith-distribˡ : _DistributesOverˡ_ _≡_ f g → ∀ {n} → _DistributesOverˡ_ _≡_ (zipWith {n = n} f) (zipWith g) zipWith-distribˡ distribˡ [] [] [] = refl zipWith-distribˡ distribˡ (x ∷ xs) (y ∷ ys) (z ∷ zs) = P.cong₂ _∷_ (distribˡ x y z) (zipWith-distribˡ distribˡ xs ys zs) zipWith-distribʳ : _DistributesOverʳ_ _≡_ f g → ∀ {n} → _DistributesOverʳ_ _≡_ (zipWith {n = n} f) (zipWith g) zipWith-distribʳ distribʳ [] [] [] = refl zipWith-distribʳ distribʳ (x ∷ xs) (y ∷ ys) (z ∷ zs) = P.cong₂ _∷_ (distribʳ x y z) (zipWith-distribʳ distribʳ xs ys zs) zipWith-absorbs : _Absorbs_ _≡_ f g → ∀ {n} → _Absorbs_ _≡_ (zipWith {n = n} f) (zipWith g) zipWith-absorbs abs [] [] = refl zipWith-absorbs abs (x ∷ xs) (y ∷ ys) = P.cong₂ _∷_ (abs x y) (zipWith-absorbs abs xs ys) module _ {f : A → A → B} where zipWith-comm : (∀ x y → f x y ≡ f y x) → ∀ {n} (xs ys : Vec A n) → zipWith f xs ys ≡ zipWith f ys xs zipWith-comm comm [] [] = refl zipWith-comm comm (x ∷ xs) (y ∷ ys) = P.cong₂ _∷_ (comm x y) (zipWith-comm comm xs ys) zipWith-map₁ : ∀ {n} (_⊕_ : B → C → D) (f : A → B) (xs : Vec A n) (ys : Vec C n) → zipWith _⊕_ (map f xs) ys ≡ zipWith (λ x y → f x ⊕ y) xs ys zipWith-map₁ _⊕_ f [] [] = refl zipWith-map₁ _⊕_ f (x ∷ xs) (y ∷ ys) = P.cong (f x ⊕ y ∷_) (zipWith-map₁ _⊕_ f xs ys) zipWith-map₂ : ∀ {n} (_⊕_ : A → C → D) (f : B → C) (xs : Vec A n) (ys : Vec B n) → zipWith _⊕_ xs (map f ys) ≡ zipWith (λ x y → x ⊕ f y) xs ys zipWith-map₂ _⊕_ f [] [] = refl zipWith-map₂ _⊕_ f (x ∷ xs) (y ∷ ys) = P.cong (x ⊕ f y ∷_) (zipWith-map₂ _⊕_ f xs ys) lookup-zipWith : ∀ (f : A → B → C) {n} (i : Fin n) xs ys → lookup (zipWith f xs ys) i ≡ f (lookup xs i) (lookup ys i) lookup-zipWith _ zero (x ∷ _) (y ∷ _) = refl lookup-zipWith _ (suc i) (_ ∷ xs) (_ ∷ ys) = lookup-zipWith _ i xs ys ------------------------------------------------------------------------ -- zip lookup-zip : ∀ {n} (i : Fin n) (xs : Vec A n) (ys : Vec B n) → lookup (zip xs ys) i ≡ (lookup xs i , lookup ys i) lookup-zip = lookup-zipWith _,_ -- map lifts projections to vectors of products. map-proj₁-zip : ∀ {n} (xs : Vec A n) (ys : Vec B n) → map proj₁ (zip xs ys) ≡ xs map-proj₁-zip [] [] = refl map-proj₁-zip (x ∷ xs) (y ∷ ys) = P.cong (x ∷_) (map-proj₁-zip xs ys) map-proj₂-zip : ∀ {n} (xs : Vec A n) (ys : Vec B n) → map proj₂ (zip xs ys) ≡ ys map-proj₂-zip [] [] = refl map-proj₂-zip (x ∷ xs) (y ∷ ys) = P.cong (y ∷_) (map-proj₂-zip xs ys) -- map lifts pairing to vectors of products. map-<,>-zip : ∀ {n} (f : A → B) (g : A → C) (xs : Vec A n) → map < f , g > xs ≡ zip (map f xs) (map g xs) map-<,>-zip f g [] = P.refl map-<,>-zip f g (x ∷ xs) = P.cong (_ ∷_) (map-<,>-zip f g xs) map-zip : ∀ {n} (f : A → B) (g : C → D) (xs : Vec A n) (ys : Vec C n) → map (Prod.map f g) (zip xs ys) ≡ zip (map f xs) (map g ys) map-zip f g [] [] = refl map-zip f g (x ∷ xs) (y ∷ ys) = P.cong (_ ∷_) (map-zip f g xs ys) ------------------------------------------------------------------------ -- unzip lookup-unzip : ∀ {n} (i : Fin n) (xys : Vec (A × B) n) → let xs , ys = unzip xys in (lookup xs i , lookup ys i) ≡ lookup xys i lookup-unzip () [] lookup-unzip zero ((x , y) ∷ xys) = refl lookup-unzip (suc i) ((x , y) ∷ xys) = lookup-unzip i xys map-unzip : ∀ {n} (f : A → B) (g : C → D) (xys : Vec (A × C) n) → let xs , ys = unzip xys in (map f xs , map g ys) ≡ unzip (map (Prod.map f g) xys) map-unzip f g [] = refl map-unzip f g ((x , y) ∷ xys) = P.cong (Prod.map (f x ∷_) (g y ∷_)) (map-unzip f g xys) -- Products of vectors are isomorphic to vectors of products. unzip∘zip : ∀ {n} (xs : Vec A n) (ys : Vec B n) → unzip (zip xs ys) ≡ (xs , ys) unzip∘zip [] [] = refl unzip∘zip (x ∷ xs) (y ∷ ys) = P.cong (Prod.map (x ∷_) (y ∷_)) (unzip∘zip xs ys) zip∘unzip : ∀ {n} (xys : Vec (A × B) n) → uncurry zip (unzip xys) ≡ xys zip∘unzip [] = refl zip∘unzip ((x , y) ∷ xys) = P.cong ((x , y) ∷_) (zip∘unzip xys) ×v↔v× : ∀ {n} → (Vec A n × Vec B n) ↔ Vec (A × B) n ×v↔v× = inverse (uncurry zip) unzip (uncurry unzip∘zip) zip∘unzip ------------------------------------------------------------------------ -- _⊛_ lookup-⊛ : ∀ {n} i (fs : Vec (A → B) n) (xs : Vec A n) → lookup (fs ⊛ xs) i ≡ (lookup fs i $ lookup xs i) lookup-⊛ zero (f ∷ fs) (x ∷ xs) = refl lookup-⊛ (suc i) (f ∷ fs) (x ∷ xs) = lookup-⊛ i fs xs map-is-⊛ : ∀ {n} (f : A → B) (xs : Vec A n) → map f xs ≡ (replicate f ⊛ xs) map-is-⊛ f [] = refl map-is-⊛ f (x ∷ xs) = P.cong (_ ∷_) (map-is-⊛ f xs) ⊛-is-zipWith : ∀ {n} (fs : Vec (A → B) n) (xs : Vec A n) → (fs ⊛ xs) ≡ zipWith _$_ fs xs ⊛-is-zipWith [] [] = refl ⊛-is-zipWith (f ∷ fs) (x ∷ xs) = P.cong (f x ∷_) (⊛-is-zipWith fs xs) zipWith-is-⊛ : ∀ {n} (f : A → B → C) (xs : Vec A n) (ys : Vec B n) → zipWith f xs ys ≡ (replicate f ⊛ xs ⊛ ys) zipWith-is-⊛ f [] [] = refl zipWith-is-⊛ f (x ∷ xs) (y ∷ ys) = P.cong (_ ∷_) (zipWith-is-⊛ f xs ys) ------------------------------------------------------------------------ -- foldr -- See also Data.Vec.Properties.WithK.foldr-cong. -- The (uniqueness part of the) universality property for foldr. foldr-universal : ∀ {A : Set a} (B : ℕ → Set b) (f : ∀ {n} → A → B n → B (suc n)) {e} (h : ∀ {n} → Vec A n → B n) → h [] ≡ e → (∀ {n} x → h ∘ (x ∷_) ≗ f {n} x ∘ h) → ∀ {n} → h ≗ foldr B {n} f e foldr-universal B f {_} h base step [] = base foldr-universal B f {e} h base step (x ∷ xs) = begin h (x ∷ xs) ≡⟨ step x xs ⟩ f x (h xs) ≡⟨ P.cong (f x) (foldr-universal B f h base step xs) ⟩ f x (foldr B f e xs) ∎ where open P.≡-Reasoning foldr-fusion : ∀ {A : Set a} {B : ℕ → Set b} {f : ∀ {n} → A → B n → B (suc n)} e {C : ℕ → Set c} {g : ∀ {n} → A → C n → C (suc n)} (h : ∀ {n} → B n → C n) → (∀ {n} x → h ∘ f {n} x ≗ g x ∘ h) → ∀ {n} → h ∘ foldr B {n} f e ≗ foldr C g (h e) foldr-fusion {B = B} {f} e {C} h fuse = foldr-universal C _ _ refl (λ x xs → fuse x (foldr B f e xs)) idIsFold : ∀ {n} → id ≗ foldr (Vec A) {n} _∷_ [] idIsFold = foldr-universal _ _ id refl (λ _ _ → refl) ------------------------------------------------------------------------ -- sum sum-++-commute : ∀ {m n} (xs : Vec ℕ m) {ys : Vec ℕ n} → sum (xs ++ ys) ≡ sum xs + sum ys sum-++-commute [] {_} = refl sum-++-commute (x ∷ xs) {ys} = begin x + sum (xs ++ ys) ≡⟨ P.cong (x +_) (sum-++-commute xs) ⟩ x + (sum xs + sum ys) ≡⟨ P.sym (+-assoc x (sum xs) (sum ys)) ⟩ sum (x ∷ xs) + sum ys ∎ where open P.≡-Reasoning ------------------------------------------------------------------------ -- replicate lookup-replicate : ∀ {n} (i : Fin n) (x : A) → lookup (replicate x) i ≡ x lookup-replicate zero = λ _ → refl lookup-replicate (suc i) = lookup-replicate i map-replicate : ∀ (f : A → B) (x : A) n → map f (replicate x) ≡ replicate {n = n} (f x) map-replicate f x zero = refl map-replicate f x (suc n) = P.cong (f x ∷_) (map-replicate f x n) zipWith-replicate₁ : ∀ {n} (_⊕_ : A → B → C) (x : A) (ys : Vec B n) → zipWith _⊕_ (replicate x) ys ≡ map (x ⊕_) ys zipWith-replicate₁ _⊕_ x [] = refl zipWith-replicate₁ _⊕_ x (y ∷ ys) = P.cong (x ⊕ y ∷_) (zipWith-replicate₁ _⊕_ x ys) zipWith-replicate₂ : ∀ {n} (_⊕_ : A → B → C) (xs : Vec A n) (y : B) → zipWith _⊕_ xs (replicate y) ≡ map (_⊕ y) xs zipWith-replicate₂ _⊕_ [] y = refl zipWith-replicate₂ _⊕_ (x ∷ xs) y = P.cong (x ⊕ y ∷_) (zipWith-replicate₂ _⊕_ xs y) ------------------------------------------------------------------------ -- tabulate lookup∘tabulate : ∀ {n} (f : Fin n → A) (i : Fin n) → lookup (tabulate f) i ≡ f i lookup∘tabulate f zero = refl lookup∘tabulate f (suc i) = lookup∘tabulate (f ∘ suc) i tabulate∘lookup : ∀ {n} (xs : Vec A n) → tabulate (lookup xs) ≡ xs tabulate∘lookup [] = refl tabulate∘lookup (x ∷ xs) = P.cong (x ∷_) (tabulate∘lookup xs) tabulate-∘ : ∀ {n} (f : A → B) (g : Fin n → A) → tabulate (f ∘ g) ≡ map f (tabulate g) tabulate-∘ {n = zero} f g = refl tabulate-∘ {n = suc n} f g = P.cong (f (g zero) ∷_) (tabulate-∘ f (g ∘ suc)) tabulate-cong : ∀ {n} {f g : Fin n → A} → f ≗ g → tabulate f ≡ tabulate g tabulate-cong {n = zero} p = refl tabulate-cong {n = suc n} p = P.cong₂ _∷_ (p zero) (tabulate-cong (p ∘ suc)) ------------------------------------------------------------------------ -- allFin lookup-allFin : ∀ {n} (i : Fin n) → lookup (allFin n) i ≡ i lookup-allFin = lookup∘tabulate id allFin-map : ∀ n → allFin (suc n) ≡ zero ∷ map suc (allFin n) allFin-map n = P.cong (zero ∷_) $ tabulate-∘ suc id tabulate-allFin : ∀ {n} (f : Fin n → A) → tabulate f ≡ map f (allFin n) tabulate-allFin f = tabulate-∘ f id -- If you look up every possible index, in increasing order, then you -- get back the vector you started with. map-lookup-allFin : ∀ {n} (xs : Vec A n) → map (lookup xs) (allFin n) ≡ xs map-lookup-allFin {n = n} xs = begin map (lookup xs) (allFin n) ≡˘⟨ tabulate-∘ (lookup xs) id ⟩ tabulate (lookup xs) ≡⟨ tabulate∘lookup xs ⟩ xs ∎ where open P.≡-Reasoning ------------------------------------------------------------------------ -- count module _ {P : Pred A p} (P? : Decidable P) where count≤n : ∀ {n} (xs : Vec A n) → count P? xs ≤ n count≤n [] = z≤n count≤n (x ∷ xs) with does (P? x) ... | true = s≤s (count≤n xs) ... | false = ≤-step (count≤n xs) ------------------------------------------------------------------------ -- insert insert-lookup : ∀ {n} (xs : Vec A n) (i : Fin (suc n)) (v : A) → lookup (insert xs i v) i ≡ v insert-lookup xs zero v = refl insert-lookup (x ∷ xs) (suc i) v = insert-lookup xs i v insert-punchIn : ∀ {n} (xs : Vec A n) (i : Fin (suc n)) (v : A) (j : Fin n) → lookup (insert xs i v) (Fin.punchIn i j) ≡ lookup xs j insert-punchIn xs zero v j = refl insert-punchIn (x ∷ xs) (suc i) v zero = refl insert-punchIn (x ∷ xs) (suc i) v (suc j) = insert-punchIn xs i v j remove-punchOut : ∀ {n} (xs : Vec A (suc n)) {i : Fin (suc n)} {j : Fin (suc n)} (i≢j : i ≢ j) → lookup (remove xs i) (Fin.punchOut i≢j) ≡ lookup xs j remove-punchOut (x ∷ xs) {zero} {zero} i≢j = ⊥-elim (i≢j refl) remove-punchOut (x ∷ xs) {zero} {suc j} i≢j = refl remove-punchOut (x ∷ y ∷ xs) {suc i} {zero} i≢j = refl remove-punchOut (x ∷ y ∷ xs) {suc i} {suc j} i≢j = remove-punchOut (y ∷ xs) (i≢j ∘ P.cong suc) ------------------------------------------------------------------------ -- remove remove-insert : ∀ {n} (xs : Vec A n) (i : Fin (suc n)) (v : A) → remove (insert xs i v) i ≡ xs remove-insert xs zero v = refl remove-insert (x ∷ xs) (suc zero) v = refl remove-insert (x ∷ y ∷ xs) (suc (suc i)) v = P.cong (x ∷_) (remove-insert (y ∷ xs) (suc i) v) insert-remove : ∀ {n} (xs : Vec A (suc n)) (i : Fin (suc n)) → insert (remove xs i) i (lookup xs i) ≡ xs insert-remove (x ∷ xs) zero = refl insert-remove (x ∷ y ∷ xs) (suc i) = P.cong (x ∷_) (insert-remove (y ∷ xs) i) ------------------------------------------------------------------------ -- Conversion function toList∘fromList : (xs : List A) → toList (fromList xs) ≡ xs toList∘fromList List.[] = refl toList∘fromList (x List.∷ xs) = P.cong (x List.∷_) (toList∘fromList xs) ------------------------------------------------------------------------ -- DEPRECATED NAMES ------------------------------------------------------------------------ -- Please use the new names as continuing support for the old names is -- not guaranteed. -- Version 1.1 lookup-++-inject+ = lookup-++ˡ {-# WARNING_ON_USAGE lookup-++-inject+ "Warning: lookup-++-inject+ was deprecated in v1.1. Please use lookup-++ˡ instead." #-} lookup-++-+′ = lookup-++ʳ {-# WARNING_ON_USAGE lookup-++-+′ "Warning: lookup-++-+′ was deprecated in v1.1. Please use lookup-++ʳ instead." #-}
38.763587
93
0.483421
a0d3529fe5a68dc676c4789eb55f02aef67a0bae
183
agda
Agda
Cubical/HITs/Ints/BiInvInt.agda
limemloh/cubical
df4ef7edffd1c1deb3d4ff342c7178e9901c44f1
[ "MIT" ]
1
2020-03-23T23:52:11.000Z
2020-03-23T23:52:11.000Z
Cubical/HITs/Ints/BiInvInt.agda
limemloh/cubical
df4ef7edffd1c1deb3d4ff342c7178e9901c44f1
[ "MIT" ]
null
null
null
Cubical/HITs/Ints/BiInvInt.agda
limemloh/cubical
df4ef7edffd1c1deb3d4ff342c7178e9901c44f1
[ "MIT" ]
null
null
null
{-# OPTIONS --cubical --safe #-} module Cubical.HITs.Ints.BiInvInt where open import Cubical.HITs.Ints.BiInvInt.Base public open import Cubical.HITs.Ints.BiInvInt.Properties public
26.142857
56
0.786885
198fba3577418100b6325cc9da5fe3334e89241d
1,066
agda
Agda
Algebra/Category/Groupoid.agda
esoeylemez/agda-simple
d9245e5a8b2e902781736de09bd17e81022f6f13
[ "BSD-3-Clause" ]
1
2019-10-07T17:36:42.000Z
2019-10-07T17:36:42.000Z
Algebra/Category/Groupoid.agda
esoeylemez/agda-simple
d9245e5a8b2e902781736de09bd17e81022f6f13
[ "BSD-3-Clause" ]
null
null
null
Algebra/Category/Groupoid.agda
esoeylemez/agda-simple
d9245e5a8b2e902781736de09bd17e81022f6f13
[ "BSD-3-Clause" ]
null
null
null
-- Copyright: (c) 2016 Ertugrul Söylemez -- License: BSD3 -- Maintainer: Ertugrul Söylemez <esz@posteo.de> module Algebra.Category.Groupoid where open import Algebra.Category.Category open import Core -- A groupoid is a category where all morphisms are isomorphisms. record Groupoid {c h r} : Set (lsuc (c ⊔ h ⊔ r)) where field category : Category {c} {h} {r} open Category category public field iso : ∀ {A B} (f : Hom A B) → Iso f open module MyIso {A B} (f : Hom A B) = Iso (iso f) public using (inv; left-inv; right-inv; inv-unique) field inv-cong : ∀ {A B} {f g : Hom A B} → f ≈ g → inv f ≈ inv g -- The inverse function is an involution. inv-invol : ∀ {A B} {f : Hom A B} → inv (inv f) ≈ f inv-invol {f = f} = begin inv (inv f) ≈[ sym (right-id _) ] inv (inv f) ∘ id ≈[ ∘-cong refl (sym (left-inv _)) ] inv (inv f) ∘ (inv f ∘ f) ≈[ sym (assoc _ _ _) ] (inv (inv f) ∘ inv f) ∘ f ≈[ ∘-cong (left-inv _) refl ] id ∘ f ≈[ left-id _ ] f qed
30.457143
67
0.557223
5e8485a37a7f4696dd1bcdab0937c09e8795f440
4,011
agda
Agda
src/Categories/Object/Subobject/Properties.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
1
2021-04-18T18:21:47.000Z
2021-04-18T18:21:47.000Z
src/Categories/Object/Subobject/Properties.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
null
null
null
src/Categories/Object/Subobject/Properties.agda
jaykru/agda-categories
a4053cf700bcefdf73b857c3352f1eae29382a60
[ "MIT" ]
null
null
null
{-# OPTIONS --without-K --safe #-} module Categories.Object.Subobject.Properties where open import Level open import Data.Product open import Data.Unit open import Function using (_$_) open import Relation.Binary using (_=[_]⇒_) open import Relation.Binary.Bundles open import Categories.Category open import Categories.Functor open import Categories.Functor.Presheaf open import Categories.Category.Slice open import Categories.Object.Subobject open import Categories.Diagram.Pullback renaming (glue to glue-pullback) open import Categories.Diagram.Pullback.Properties open import Categories.Category.Instance.Posets open import Categories.Category.Instance.Setoids open import Categories.Adjoint.Instance.PosetCore import Categories.Morphism as Mor import Categories.Morphism.Reasoning as MR open import Categories.Morphism.Notation module _ {o ℓ e} {𝒞 : Category o ℓ e} (has-pullbacks : ∀ {A B X} → (f : 𝒞 [ A , X ]) → (g : 𝒞 [ B , X ]) → Pullback 𝒞 f g) where private module 𝒞 = Category 𝒞 open 𝒞.HomReasoning open 𝒞.Equiv open Mor 𝒞 open MR 𝒞 open _↣_ -- The Subobject functor, into the category of posets Subₚ : Presheaf 𝒞 (Posets (o ⊔ ℓ ⊔ e) (ℓ ⊔ e) (ℓ ⊔ e)) Subₚ = record { F₀ = Subobjects 𝒞 ; F₁ = λ f → ⇒-Poset-helper (morphism f) (λ {(α , m) (β , n)} h → monotone f {α , m} {β , n} h) ; identity = λ {A} {(α , m)} → let pid = has-pullbacks 𝒞.id (mor m) in record { from = record { h = Pullback.p₂ pid ; △ = ⟺ (Pullback.commute pid) ○ 𝒞.identityˡ } ; to = record { h = Pullback.universal pid id-comm-sym ; △ = Pullback.p₁∘universal≈h₁ pid } ; iso = record { isoˡ = pullback-identity 𝒞 pid ; isoʳ = Pullback.p₂∘universal≈h₂ pid } } ; homomorphism = λ {X} {Y} {Z} {f} {g} {(α , m)} → let pfg = has-pullbacks (𝒞 [ f ∘ g ]) (mor m) pf = has-pullbacks f (mor m) pg = has-pullbacks g (Pullback.p₁ pf) iso = up-to-iso 𝒞 pfg (glue-pullback 𝒞 pf pg) module iso = _≅_ iso in record { from = record { h = iso.from ; △ = Pullback.p₁∘universal≈h₁ pg } ; to = record { h = iso.to ; △ = Pullback.p₁∘universal≈h₁ pfg } ; iso = record { isoˡ = iso.isoˡ ; isoʳ = iso.isoʳ } } ; F-resp-≈ = λ {A B f g} eq {(α , m)} → let pf = has-pullbacks f (mor m) pg = has-pullbacks g (mor m) iso = up-to-iso 𝒞 pf (pullback-resp-≈ 𝒞 pg (sym eq) refl) module iso = _≅_ iso in record { from = record { h = iso.from ; △ = Pullback.p₁∘universal≈h₁ pg } ; to = record { h = iso.to ; △ = Pullback.p₁∘universal≈h₁ pf } ; iso = record { isoˡ = iso.isoˡ ; isoʳ = iso.isoʳ } } } where morphism : ∀ {A B} → (f : 𝒞 [ B , A ]) → Σ[ α ∈ 𝒞.Obj ] (α ↣ A) → Σ[ β ∈ 𝒞.Obj ] (β ↣ B) morphism f (α , m) = let pb = has-pullbacks f (mor m) in Pullback.P pb , record { mor = Pullback.p₁ pb ; mono = Pullback-resp-Mono 𝒞 pb (mono m) } monotone : ∀ {A B} (f : 𝒞 [ B , A ]) → Poset._≤_ (Subobjects 𝒞 A) =[ morphism f ]⇒ Poset._≤_ (Subobjects 𝒞 B) monotone f {(α , m)} {(β , n)} h = let pm = has-pullbacks f (mor m) pn = has-pullbacks f (mor n) in record { h = Pullback.universal pn $ begin 𝒞 [ f ∘ Pullback.p₁ pm ] ≈⟨ Pullback.commute pm ⟩ 𝒞 [ mor m ∘ Pullback.p₂ pm ] ≈⟨ pushˡ (⟺ (Slice⇒.△ h)) ⟩ 𝒞 [ mor n ∘ 𝒞 [ Slice⇒.h h ∘ Pullback.p₂ pm ] ] ∎ ; △ = Pullback.p₁∘universal≈h₁ pn } -- The subobject functor as a presheaf on Setoids. -- This is just Subₚ composed with the 'Core' Sub : Presheaf 𝒞 (Setoids (o ⊔ ℓ ⊔ e) (ℓ ⊔ e)) Sub = Core ∘F Subₚ
31.833333
128
0.538519
134da1111ee7ed224badfe210ecd18a0d9b9d7fb
3,571
agda
Agda
src/Categories/Category/Monoidal/Interchange/Symmetric.agda
yourboynico/agda-categories
6a087c592dbe58fc4bd9d02e1be9b94a9e138aca
[ "MIT" ]
279
2019-06-01T14:36:40.000Z
2022-03-22T00:40:14.000Z
src/Categories/Category/Monoidal/Interchange/Symmetric.agda
seanpm2001/agda-categories
d9e4f578b126313058d105c61707d8c8ae987fa8
[ "MIT" ]
236
2019-06-01T14:53:54.000Z
2022-03-28T14:31:43.000Z
src/Categories/Category/Monoidal/Interchange/Symmetric.agda
seanpm2001/agda-categories
d9e4f578b126313058d105c61707d8c8ae987fa8
[ "MIT" ]
64
2019-06-02T16:58:15.000Z
2022-03-14T02:00:59.000Z
{-# OPTIONS --without-K --safe #-} open import Categories.Category using (Category; module Commutation) open import Categories.Category.Monoidal.Core using (Monoidal) open import Categories.Category.Monoidal.Symmetric using (Symmetric) -- Extra identities that hold only for symmetric monoidal categories. module Categories.Category.Monoidal.Interchange.Symmetric {o ℓ e} {C : Category o ℓ e} {M : Monoidal C} (S : Symmetric M) where open import Data.Product using (_,_) import Categories.Category.Construction.Core C as Core import Categories.Category.Monoidal.Braided.Properties as BraidedProps open import Categories.Category.Monoidal.Interchange using (HasInterchange) import Categories.Category.Monoidal.Interchange.Braided as BraidedInterchange using (module swapInner; swapInner-braiding) import Categories.Category.Monoidal.Reasoning M as MonoidalReasoning import Categories.Category.Monoidal.Utilities M as MonoidalUtilities open import Categories.Category.Product using (_⁂_; assocˡ) open import Categories.Functor using (_∘F_) open import Categories.NaturalTransformation.NaturalIsomorphism using (_≃_; niHelper) open import Categories.Morphism.IsoEquiv C using (to-unique) open import Categories.Morphism.Reasoning C using (elim-center; pushˡ; pullʳ; cancelInner; switch-fromtoˡ) open Category C using (Obj; _⇒_; _∘_; id; sym-assoc; ∘-resp-≈ʳ; module Equiv) open Commutation C open MonoidalReasoning open MonoidalUtilities using (_⊗ᵢ_) open Symmetric S renaming (associator to α; braided to B) open BraidedInterchange B open Core.Shorthands -- for idᵢ, _∘ᵢ_, ... open MonoidalUtilities.Shorthands -- for λ⇒, ρ⇒, α⇒, ... open BraidedProps.Shorthands B -- for σ⇒, ... private variable W W₁ W₂ X X₁ X₂ Y Y₁ Y₂ Z Z₁ Z₂ : Obj f g h i : X ⇒ Y private i⇒ = swapInner.from i⇐ = swapInner.to swapInner-commutative : [ (X₁ ⊗₀ X₂) ⊗₀ (Y₁ ⊗₀ Y₂) ⇒ (X₁ ⊗₀ X₂) ⊗₀ (Y₁ ⊗₀ Y₂) ]⟨ i⇒ ⇒⟨ (X₁ ⊗₀ Y₁) ⊗₀ (X₂ ⊗₀ Y₂) ⟩ i⇒ ≈ id ⟩ swapInner-commutative = begin i⇒ ∘ i⇒ ≈⟨ pullʳ (cancelInner α.isoʳ) ⟩ α⇐ ∘ id ⊗₁ (α⇒ ∘ σ⇒ ⊗₁ id ∘ α⇐) ∘ id ⊗₁ (α⇒ ∘ σ⇒ ⊗₁ id ∘ α⇐) ∘ α⇒ ≈˘⟨ refl⟩∘⟨ pushˡ split₂ˡ ⟩ α⇐ ∘ id ⊗₁ ((α⇒ ∘ σ⇒ ⊗₁ id ∘ α⇐) ∘ α⇒ ∘ σ⇒ ⊗₁ id ∘ α⇐) ∘ α⇒ ≈⟨ refl⟩∘⟨ refl⟩⊗⟨ (∘-resp-≈ʳ sym-assoc ○ α[σ⊗1]α⁻¹.isoʳ) ⟩∘⟨refl ⟩ α⇐ ∘ id ⊗₁ id ∘ α⇒ ≈⟨ elim-center ⊗.identity ○ α.isoˡ ⟩ id ∎ where module α[σ⊗1]α⁻¹ = _≅_ (α ∘ᵢ braided-iso ⊗ᵢ idᵢ ∘ᵢ α ⁻¹) using (isoʳ) swapInner-iso : (W ⊗₀ X) ⊗₀ (Y ⊗₀ Z) ≅ (W ⊗₀ Y) ⊗₀ (X ⊗₀ Z) swapInner-iso = record { from = i⇒ ; to = i⇒ ; iso = record { isoˡ = swapInner-commutative ; isoʳ = swapInner-commutative } } swapInner-selfInverse : [ (X₁ ⊗₀ X₂) ⊗₀ (Y₁ ⊗₀ Y₂) ⇒ (X₁ ⊗₀ Y₁) ⊗₀ (X₂ ⊗₀ Y₂) ]⟨ i⇒ ≈ i⇐ ⟩ swapInner-selfInverse = to-unique (iso swapInner-iso) swapInner.iso Equiv.refl swapInner-braiding′ : [ (W ⊗₀ X) ⊗₀ (Y ⊗₀ Z) ⇒ (Y ⊗₀ W) ⊗₀ (Z ⊗₀ X) ]⟨ i⇒ ⇒⟨ (W ⊗₀ Y) ⊗₀ (X ⊗₀ Z) ⟩ σ⇒ ⊗₁ σ⇒ ≈ σ⇒ ⇒⟨ (Y ⊗₀ Z) ⊗₀ (W ⊗₀ X) ⟩ i⇒ ⟩ swapInner-braiding′ = switch-fromtoˡ swapInner-iso swapInner-braiding
41.045977
138
0.565668
22b6737fc3278913f181c2afc435a83ae336abc5
426
agda
Agda
test/interaction/Long.agda
zliu41/agda
73405f70bced057d24dd4bf122d53f9548544aba
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/interaction/Long.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/interaction/Long.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
module Long where data Nat : Set where z : Nat s : (n : Nat) → Nat data Exp : Set where val : (n : Nat) → Exp throw : Exp data Maybe (A : Set) : Set where Just : A → Maybe A Nothing : Maybe A abstract s′ : Nat → Nat s′ = s eval : Exp → Maybe Nat eval (val n) = ? eval throw = ? data D : Nat → Set where d : D z D′ = D foo : D {!!} foo = {!!} bar : D′ z bar = {!!} baz : Maybe {!!} baz = {!!}
11.513514
32
0.507042
2ee4892366cb4ced8acdf072e76c0dc57972c871
1,965
agda
Agda
vendor/stdlib/src/Data/BoundedVec.agda
isabella232/Lemmachine
8ef786b40e4a9ab274c6103dc697dcb658cf3db3
[ "MIT" ]
56
2015-01-20T02:11:42.000Z
2021-12-21T17:02:19.000Z
vendor/stdlib/src/Data/BoundedVec.agda
larrytheliquid/Lemmachine
8ef786b40e4a9ab274c6103dc697dcb658cf3db3
[ "MIT" ]
1
2022-03-12T12:17:51.000Z
2022-03-12T12:17:51.000Z
vendor/stdlib/src/Data/BoundedVec.agda
isabella232/Lemmachine
8ef786b40e4a9ab274c6103dc697dcb658cf3db3
[ "MIT" ]
3
2015-07-21T16:37:58.000Z
2022-03-12T11:54:10.000Z
------------------------------------------------------------------------ -- Bounded vectors ------------------------------------------------------------------------ -- Vectors of a specified maximum length. module Data.BoundedVec where open import Data.Nat open import Data.List as List using (List) open import Data.Vec as Vec using (Vec) open import Relation.Binary.PropositionalEquality open import Data.Nat.Properties open SemiringSolver ------------------------------------------------------------------------ -- The type abstract data BoundedVec (a : Set) : ℕ → Set where bVec : ∀ {m n} (xs : Vec a n) → BoundedVec a (n + m) [] : ∀ {a n} → BoundedVec a n [] = bVec Vec.[] infixr 5 _∷_ _∷_ : ∀ {a n} → a → BoundedVec a n → BoundedVec a (suc n) x ∷ bVec xs = bVec (Vec._∷_ x xs) ------------------------------------------------------------------------ -- Pattern matching infixr 5 _∷v_ data View (a : Set) : ℕ → Set where []v : ∀ {n} → View a n _∷v_ : ∀ {n} (x : a) (xs : BoundedVec a n) → View a (suc n) abstract view : ∀ {a n} → BoundedVec a n → View a n view (bVec Vec.[]) = []v view (bVec (Vec._∷_ x xs)) = x ∷v bVec xs ------------------------------------------------------------------------ -- Increasing the bound abstract ↑ : ∀ {a n} → BoundedVec a n → BoundedVec a (suc n) ↑ {a = a} (bVec {m = m} {n = n} xs) = subst (BoundedVec a) lemma (bVec {m = suc m} xs) where lemma = solve 2 (λ m n → n :+ (con 1 :+ m) := con 1 :+ (n :+ m)) refl m n ------------------------------------------------------------------------ -- Conversions abstract fromList : ∀ {a} → (xs : List a) → BoundedVec a (List.length xs) fromList {a = a} xs = subst (BoundedVec a) lemma (bVec {m = zero} (Vec.fromList xs)) where lemma = solve 1 (λ m → m :+ con 0 := m) refl _ toList : ∀ {a n} → BoundedVec a n → List a toList (bVec xs) = Vec.toList xs
26.917808
72
0.441221
9a96f2a7ca2e97998c413452d1d5a732b1833507
89
agda
Agda
test/Fail/Issue5434-1.agda
favonia/agda
8d433b967567c08afe15d04a5cb63b6f6d8884ee
[ "BSD-2-Clause" ]
null
null
null
test/Fail/Issue5434-1.agda
favonia/agda
8d433b967567c08afe15d04a5cb63b6f6d8884ee
[ "BSD-2-Clause" ]
6
2021-10-18T08:12:24.000Z
2021-11-24T08:31:10.000Z
test/Fail/Issue5434-1.agda
antoinevanmuylder/agda
bd59d5b07ffe02a43b28d186d95e1747aac5bc8c
[ "BSD-2-Clause" ]
null
null
null
{-# OPTIONS --cubical-compatible #-} data D : Set → Set₁ where c : (@0 A : Set) → D A
17.8
36
0.550562
9af709a0e290294633aaaaf0495a181a59ba7008
20,755
agda
Agda
Data/Num/Surjection.agda
banacorn/numeral
aae093cc9bf21f11064e7f7b12049448cd6449f1
[ "MIT" ]
1
2015-04-23T15:58:28.000Z
2015-04-23T15:58:28.000Z
Data/Num/Surjection.agda
banacorn/numeral
aae093cc9bf21f11064e7f7b12049448cd6449f1
[ "MIT" ]
null
null
null
Data/Num/Surjection.agda
banacorn/numeral
aae093cc9bf21f11064e7f7b12049448cd6449f1
[ "MIT" ]
1
2015-05-30T05:50:50.000Z
2015-05-30T05:50:50.000Z
module Data.Num.Surjection where open import Data.Num.Core open import Data.Num.Continuous open import Data.Nat open import Data.Nat.Properties open import Data.Nat.Properties.Simple open import Data.Nat.Properties.Extra open import Data.Fin as Fin using (Fin; fromℕ≤; inject≤) renaming (zero to z; suc to s) open import Data.Fin.Properties using (toℕ-fromℕ≤; bounded) open import Data.Product open import Data.Empty using (⊥) open import Data.Unit using (⊤; tt) open import Function open import Function.Surjection hiding (_∘_) open Surjective open import Function.Equality using (_⟶_; _⟨$⟩_) open import Relation.Nullary.Decidable open import Relation.Nullary open import Relation.Nullary.Negation open import Relation.Binary open import Relation.Binary.PropositionalEquality open ≡-Reasoning open ≤-Reasoning renaming (begin_ to start_; _∎ to _□; _≡⟨_⟩_ to _≈⟨_⟩_) open DecTotalOrder decTotalOrder using (reflexive) renaming (refl to ≤-refl) -- fromℕ that preserves equality -- ℕ⟶Num : ∀ {b d o} -- → (True (Continuous? b (suc d) o)) -- → (val : ℕ) -- → (True (o ≤? val)) -- → Num b (suc d) o -- ℕ⟶Num : ∀ b d o → True (Continuous? b (suc d) o) → setoid ℕ ⟶ setoid (Num b (suc d) o) -- ℕ⟶Num b d o cont = record -- { _⟨$⟩_ = fromℕ cont -- ; cong = cong (fromℕ cont) -- } -- -- -- Surjective? : ∀ b d o → (True (Continuous? b (suc d) o)) → Dec (Surjective (ℕ⟶Num b d o)) -- -- Surjective? b d o with Continuous? b (suc d) o -- -- Surjective? b d o | yes cont = {! !} -- -- Surjective? b d o | no ¬cont = {! !} -- -- Num⟶ℕ-Surjective : ∀ b d o → (cont : True (Continuous? b (suc d) o)) → Surjective (Num⟶ℕ b (suc d) o) -- Num⟶ℕ-Surjective b d o cont = record -- { from = ℕ⟶Num b d o cont -- ; right-inverse-of = {! toℕ-fromℕ cont !} -- } -- Surjective? : ∀ b d o → Dec (Surjective (Num⟶ℕ b d o)) -- Surjective? b d o with surjectionView b d o -- Surjective? b d o | Surj cond = yes (record -- { from = ℕ⟶Num b d o -- ; right-inverse-of = toℕ-fromℕ {b} {d} {o} {SurjCond⇒IsSurj cond} -- }) -- Surjective? b d o | NonSurj reason = no (NonSurjCond⇏Surjective reason) -- -- Conditions of surjectiveness -- data SurjCond : ℕ → ℕ → ℕ → Set where -- WithZerosUnary : ∀ { d} → (d≥2 : d ≥ 2) → SurjCond 1 d 0 -- WithZeros : ∀ {b d} (b≥2 : b ≥ 2) → (d≥b : d ≥ b) → SurjCond b d 0 -- Zeroless : ∀ {b d} (b≥1 : b ≥ 1) → (d≥b : d ≥ b) → SurjCond b d 1 -- -- -- Conditions of non-surjectiveness -- data NonSurjCond : ℕ → ℕ → ℕ → Set where -- Base≡0 : ∀ { d o} → NonSurjCond 0 d o -- NoDigits : ∀ {b o} → NonSurjCond b 0 o -- Offset≥2 : ∀ {b d o} → o ≥ 2 → NonSurjCond b d o -- UnaryWithOnlyZeros : NonSurjCond 1 1 0 -- NotEnoughDigits : ∀ {b d o} → d ≥ 1 → d ≱ b → NonSurjCond b d o -- -- data SurjectionView : ℕ → ℕ → ℕ → Set where -- Surj : ∀ {b d o} → SurjCond b d o → SurjectionView b d o -- NonSurj : ∀ {b d o} → NonSurjCond b d o → SurjectionView b d o -- -- -- surjectionView : (b d o : ℕ) → SurjectionView b d o -- surjectionView 0 d o = NonSurj Base≡0 -- surjectionView (suc b) 0 o = NonSurj NoDigits -- surjectionView (suc b) (suc d) o with suc b ≤? suc d -- surjectionView 1 1 0 | yes p = NonSurj UnaryWithOnlyZeros -- surjectionView 1 (suc (suc d)) 0 | yes p = Surj (WithZerosUnary (s≤s (s≤s z≤n))) -- surjectionView (suc (suc b)) (suc d) 0 | yes p = Surj (WithZeros (s≤s (s≤s z≤n)) p) -- surjectionView (suc b) (suc d) 1 | yes p = Surj (Zeroless (s≤s z≤n) p) -- surjectionView (suc b) (suc d) (suc (suc o)) | yes p = NonSurj (Offset≥2 (s≤s (s≤s z≤n))) -- surjectionView (suc b) (suc d) o | no ¬p = NonSurj (NotEnoughDigits (s≤s z≤n) ¬p) -- -- IsSurjective : ℕ → ℕ → ℕ → Set -- IsSurjective b d o with surjectionView b d o -- IsSurjective b d o | Surj _ = ⊤ -- IsSurjective b d o | NonSurj _ = ⊥ -- -- SurjCond⇒b≥1 : ∀ {b d o} → SurjCond b d o → b ≥ 1 -- SurjCond⇒b≥1 (WithZerosUnary d≥2) = s≤s z≤n -- SurjCond⇒b≥1 (WithZeros (s≤s b≥1) d≥b) = s≤s z≤n -- SurjCond⇒b≥1 (Zeroless b≥1 d≥b) = b≥1 -- -- SurjCond⇒d≥b : ∀ {b d o} → SurjCond b d o → d ≥ b -- SurjCond⇒d≥b (WithZerosUnary (s≤s d≥1)) = s≤s z≤n -- SurjCond⇒d≥b (WithZeros b≥2 d≥b) = d≥b -- SurjCond⇒d≥b (Zeroless b≥1 d≥b) = d≥b -- -- SurjCond⇒IsSurj : ∀ {b d o} → SurjCond b d o → IsSurjective b d o -- SurjCond⇒IsSurj {b} {d} {o} cond with surjectionView b d o -- SurjCond⇒IsSurj cond | Surj x = tt -- SurjCond⇒IsSurj (WithZeros () d≥b) | NonSurj Base≡0 -- SurjCond⇒IsSurj (Zeroless () d≥b) | NonSurj Base≡0 -- SurjCond⇒IsSurj (WithZerosUnary ()) | NonSurj NoDigits -- SurjCond⇒IsSurj (WithZeros () z≤n) | NonSurj NoDigits -- SurjCond⇒IsSurj (Zeroless () z≤n) | NonSurj NoDigits -- SurjCond⇒IsSurj (WithZerosUnary _) | NonSurj (Offset≥2 ()) -- SurjCond⇒IsSurj (WithZeros _ _) | NonSurj (Offset≥2 ()) -- SurjCond⇒IsSurj (Zeroless _ _) | NonSurj (Offset≥2 (s≤s ())) -- SurjCond⇒IsSurj (WithZerosUnary (s≤s ())) | NonSurj UnaryWithOnlyZeros -- SurjCond⇒IsSurj (WithZeros (s≤s ()) _) | NonSurj UnaryWithOnlyZeros -- SurjCond⇒IsSurj (WithZerosUnary _) | NonSurj (NotEnoughDigits d≥1 d≱1) = contradiction d≥1 d≱1 -- SurjCond⇒IsSurj (WithZeros _ d≥b) | NonSurj (NotEnoughDigits _ d≱b) = contradiction d≥b d≱b -- SurjCond⇒IsSurj (Zeroless _ d≥b) | NonSurj (NotEnoughDigits _ d≱b) = contradiction d≥b d≱b -- -- ------------------------------------------------------------------------ -- -- Operations on Num (which does not necessary needs to be Surj) -- ------------------------------------------------------------------------ -- -- starting-digit : ∀ {b d o} → SurjCond b d o → Digit d -- starting-digit (WithZerosUnary d≥2) = fromℕ≤ {1} d≥2 -- starting-digit (WithZeros b≥2 d≥b) = fromℕ≤ {1} (≤-trans b≥2 d≥b) -- starting-digit (Zeroless b≥1 d≥b) = fromℕ≤ {0} (≤-trans b≥1 d≥b) -- 1+ : ∀ {b d o} → Num b d o → Num b d o -- 1+ {b} {d} {o} xs with surjectionView b d o -- 1+ ∙ | Surj cond = starting-digit cond ∷ ∙ -- 1+ (x ∷ xs) | Surj cond with greatest x -- 1+ (x ∷ xs) | Surj cond | yes p = digit+1-b-legacy x (SurjCond⇒b≥1 cond) p ∷ 1+ xs -- carry -- 1+ (x ∷ xs) | Surj cond | no ¬p = digit+1 x ¬p ∷ xs -- 1+ ∙ | NonSurj reason = ∙ -- 1+ (x ∷ xs) | NonSurj reason = xs -- -- -- n+ : ∀ {b d o} → ℕ → Num b d o → Num b d o -- n+ zero xs = xs -- n+ (suc n) xs = 1+ (n+ n xs) -- -- fromℕ : ∀ {b d o} → ℕ → Num b d o -- fromℕ {b} {d} {o} n with surjectionView b d o -- fromℕ n | Surj x = n+ n ∙ -- fromℕ n | NonSurj x = ∙ -- -- -- -- fromℕ that preserves equality -- ℕ⟶Num : ∀ b d o → setoid ℕ ⟶ setoid (Num b d o) -- ℕ⟶Num b d o = record -- { _⟨$⟩_ = fromℕ -- ; cong = cong fromℕ -- } -- -- toℕ-digit+1-b : ∀ {d b} (x : Digit d) -- → (b≥1 : b ≥ 1) → (p : suc (Fin.toℕ x) ≡ d) -- required props -- → Fin.toℕ (digit+1-b-legacy x b≥1 p) ≡ suc (Fin.toℕ x) ∸ b -- toℕ-digit+1-b {d} {b} x b≥1 p = toℕ-fromℕ≤ $ start -- suc (suc (Fin.toℕ x) ∸ b) -- ≤⟨ s≤s (∸-mono ≤-refl b≥1) ⟩ -- suc (Fin.toℕ x) -- ≈⟨ p ⟩ -- d -- □ -- -- ------------------------------------------------------------------------ -- -- toℕ-1+ : toℕ (1+ xs) ≡ suc (toℕ xs) -- ------------------------------------------------------------------------ -- -- toℕ-1+-x∷xs-greatest-lemma : ∀ {b d o} -- → (x : Digit d) → (xs : Num b d o) -- → (cond : SurjCond b d o) -- → (p : suc (Fin.toℕ x) ≡ d) -- → (toℕ-1+-xs : toℕ (1+ xs) ≡ suc (toℕ xs)) -- → toℕ (digit+1-b-legacy x (SurjCond⇒b≥1 cond) p ∷ 1+ xs) ≡ suc (toℕ (x ∷ xs)) -- toℕ-1+-x∷xs-greatest-lemma {b} {d} {o} x xs cond p toℕ-1+-xs = -- begin -- toℕ (digit+1-b-legacy x (SurjCond⇒b≥1 cond) p ∷ 1+ xs) -- -- toℕ-fromℕ≤ : toℕ (fromℕ≤ m<n) ≡ m -- ≡⟨ cong (λ w → o + w + toℕ (1+ xs) * b) (toℕ-fromℕ≤ ((digit+1-b-legacy-lemma x (SurjCond⇒b≥1 cond) p))) ⟩ -- o + (suc (Fin.toℕ x) ∸ b) + toℕ (1+ xs) * b -- -- induction hypothesis -- ≡⟨ cong (λ w → o + (suc (Fin.toℕ x) ∸ b) + w * b) toℕ-1+-xs ⟩ -- o + (suc (Fin.toℕ x) ∸ b) + (b + toℕ xs * b) -- ≡⟨ +-assoc o (suc (Fin.toℕ x) ∸ b) (b + toℕ xs * b) ⟩ -- o + (suc (Fin.toℕ x) ∸ b + (b + toℕ xs * b)) -- ≡⟨ cong (λ w → o + w) (sym (+-assoc (suc (Fin.toℕ x) ∸ b) b (toℕ xs * b))) ⟩ -- o + (suc (Fin.toℕ x) ∸ b + b + toℕ xs * b) -- ≡⟨ cong (λ w → o + (w + toℕ xs * b)) (+-comm (suc (Fin.toℕ x) ∸ b) b) ⟩ -- o + (b + (suc (Fin.toℕ x) ∸ b) + toℕ xs * b) -- -- m+n∸m≡n : m + (n ∸ m) ≡ n -- ≡⟨ cong (λ w → o + (w + toℕ xs * b)) (m+n∸m≡n ( -- start -- b -- ≤⟨ SurjCond⇒d≥b cond ⟩ -- d -- ≈⟨ sym p ⟩ -- suc (Fin.toℕ x) -- □)) ⟩ -- o + suc (Fin.toℕ x + toℕ xs * b) -- ≡⟨ +-suc o (Fin.toℕ x + toℕ xs * b) ⟩ -- suc (o + (Fin.toℕ x + toℕ xs * b)) -- ≡⟨ cong suc (sym (+-assoc o (Fin.toℕ x) (toℕ xs * b))) ⟩ -- suc (o + Fin.toℕ x + toℕ xs * b) -- ∎ -- -- toℕ-1+-x∷xs-not-greatest-lemma : ∀ {b d o} -- → (x : Digit d) → (xs : Num b d o) -- → (¬p : suc (Fin.toℕ x) ≢ d) -- → toℕ (digit+1 x ¬p ∷ xs) ≡ suc (toℕ (x ∷ xs)) -- toℕ-1+-x∷xs-not-greatest-lemma {b} {d} {o} x xs ¬p = -- begin -- o + Fin.toℕ (fromℕ≤ (≤∧≢⇒< (bounded x) ¬p)) + toℕ xs * b -- -- toℕ-fromℕ≤ -- ≡⟨ cong (λ w → o + w + toℕ xs * b) (toℕ-fromℕ≤ (≤∧≢⇒< (bounded x) ¬p)) ⟩ -- o + suc (Fin.toℕ x) + toℕ xs * b -- ≡⟨ +-assoc o (suc (Fin.toℕ x)) (toℕ xs * b) ⟩ -- o + suc (Fin.toℕ x + toℕ xs * b) -- ≡⟨ +-suc o (Fin.toℕ x + toℕ xs * b) ⟩ -- suc (o + (Fin.toℕ x + toℕ xs * b)) -- ≡⟨ cong suc (sym (+-assoc o (Fin.toℕ x) (toℕ xs * b))) ⟩ -- suc (o + Fin.toℕ x + toℕ xs * b) -- ∎ -- -- toℕ-1+ : ∀ {b d o} -- → {isSurj : IsSurjective b d o} -- → (xs : Num b d o) -- → toℕ (1+ xs) ≡ suc (toℕ xs) -- toℕ-1+ {b} {d} {o} xs with surjectionView b d o -- toℕ-1+ {1} {d} {0} ∙ | Surj (WithZerosUnary d≥2) = -- begin -- Fin.toℕ (fromℕ≤ d≥2) + zero -- ≡⟨ +-right-identity (Fin.toℕ (fromℕ≤ d≥2)) ⟩ -- Fin.toℕ (fromℕ≤ d≥2) -- ≡⟨ toℕ-fromℕ≤ d≥2 ⟩ -- suc zero -- ∎ -- toℕ-1+ {b} {d} {0} ∙ | Surj (WithZeros b≥2 d≥b) = -- begin -- Fin.toℕ (fromℕ≤ (≤-trans b≥2 d≥b)) + zero * b -- ≡⟨ +-right-identity (Fin.toℕ (fromℕ≤ (≤-trans b≥2 d≥b))) ⟩ -- Fin.toℕ (fromℕ≤ (≤-trans b≥2 d≥b)) -- ≡⟨ toℕ-fromℕ≤ (≤-trans b≥2 d≥b) ⟩ -- suc zero -- ∎ -- toℕ-1+ {b} {d} {_} ∙ | Surj (Zeroless b≥1 d≥b) = -- begin -- suc (Fin.toℕ (fromℕ≤ (≤-trans b≥1 d≥b)) + zero) -- ≡⟨ +-right-identity (suc (Fin.toℕ (fromℕ≤ (≤-trans b≥1 d≥b)))) ⟩ -- suc (Fin.toℕ (fromℕ≤ (≤-trans b≥1 d≥b))) -- ≡⟨ cong suc (toℕ-fromℕ≤ (≤-trans b≥1 d≥b)) ⟩ -- suc zero -- ∎ -- toℕ-1+ {b} {d} {o} (x ∷ xs) | Surj condition with greatest x -- toℕ-1+ {b} {d} {o} (x ∷ xs) | Surj condition | yes p = toℕ-1+-x∷xs-greatest-lemma x xs condition p (toℕ-1+ {isSurj = SurjCond⇒IsSurj condition} xs) -- toℕ-1+ {b} {d} {o} (x ∷ xs) | Surj condition | no ¬p = toℕ-1+-x∷xs-not-greatest-lemma x xs ¬p -- toℕ-1+ {isSurj = ()} xs | NonSurj reason -- -- ------------------------------------------------------------------------ -- -- toℕ-n+ : toℕ (n+ n xs) ≡ n + (toℕ xs) -- ------------------------------------------------------------------------ -- -- toℕ-n+ : ∀ {b d o} -- → {isSurj : IsSurjective b d o} -- → (n : ℕ) -- → (xs : Num b d o) -- → toℕ (n+ n xs) ≡ n + (toℕ xs) -- toℕ-n+ {b} {d} {o} n xs with surjectionView b d o -- toℕ-n+ zero xs | Surj cond = refl -- toℕ-n+ (suc n) xs | Surj cond = -- begin -- toℕ (n+ (suc n) xs) -- ≡⟨ refl ⟩ -- toℕ (1+ (n+ n xs)) -- ≡⟨ toℕ-1+ {isSurj = SurjCond⇒IsSurj cond} (n+ n xs) ⟩ -- suc (toℕ (n+ n xs)) -- ≡⟨ cong suc (toℕ-n+ {isSurj = SurjCond⇒IsSurj cond} n xs) ⟩ -- suc (n + toℕ xs) -- ∎ -- toℕ-n+ {isSurj = ()} n xs | NonSurj reason -- -- ------------------------------------------------------------------------ -- -- toℕ-fromℕ : toℕ (fromℕ n) ≡ n -- ------------------------------------------------------------------------ -- -- toℕ-fromℕ : ∀ {b d o} -- → {isSurjective : IsSurjective b d o} -- → (n : ℕ) -- → toℕ (fromℕ {b} {d} {o} n) ≡ n -- toℕ-fromℕ {b} {d} {o} n with surjectionView b d o -- toℕ-fromℕ zero | Surj (WithZerosUnary d≥2) = refl -- toℕ-fromℕ {_} {d} {_} (suc n) | Surj (WithZerosUnary d≥2) = -- begin -- toℕ (1+ (n+ {1} {d} {0} n ∙)) -- ≡⟨ toℕ-1+ {1} {d} {0} {SurjCond⇒IsSurj (WithZerosUnary d≥2)} (n+ n ∙) ⟩ -- suc (toℕ (n+ n ∙)) -- ≡⟨ cong suc (toℕ-n+ {1} {d} {0} {SurjCond⇒IsSurj (WithZerosUnary d≥2)} n ∙) ⟩ -- suc (n + zero) -- ≡⟨ cong suc (+-right-identity n) ⟩ -- suc n -- ∎ -- toℕ-fromℕ zero | Surj (WithZeros b≥2 d≥b) = refl -- toℕ-fromℕ {b} {d} {_} (suc n) | Surj (WithZeros b≥2 d≥b) = -- begin -- toℕ (1+ (n+ {b} {d} {0} n ∙)) -- ≡⟨ toℕ-1+ {b} {d} {0} {SurjCond⇒IsSurj (WithZeros b≥2 d≥b)} (n+ n ∙) ⟩ -- suc (toℕ (n+ n ∙)) -- ≡⟨ cong suc (toℕ-n+ {b} {d} {0} {SurjCond⇒IsSurj (WithZeros b≥2 d≥b)} n ∙) ⟩ -- suc (n + zero) -- ≡⟨ cong suc (+-right-identity n) ⟩ -- suc n -- ∎ -- toℕ-fromℕ {b} {d} {_} zero | Surj (Zeroless b≥1 d≥b) = refl -- toℕ-fromℕ {b} {d} {_} (suc n) | Surj (Zeroless b≥1 d≥b) = -- begin -- toℕ (1+ (n+ {b} {d} {1} n ∙)) -- ≡⟨ toℕ-1+ {b} {d} {1} {SurjCond⇒IsSurj (Zeroless b≥1 d≥b)} (n+ n ∙) ⟩ -- suc (toℕ (n+ n ∙)) -- ≡⟨ cong suc (toℕ-n+ {b} {d} {1} {SurjCond⇒IsSurj (Zeroless b≥1 d≥b)} n ∙) ⟩ -- suc (n + zero) -- ≡⟨ cong suc (+-right-identity n) ⟩ -- suc n -- ∎ -- toℕ-fromℕ {isSurjective = ()} n | NonSurj x -- -- -- ------------------------------------------------------------------------ -- -- Lemmata for proving Spurious cases not surjective -- ------------------------------------------------------------------------ -- -- NonSurjCond-Base≡0 : ∀ {d o} → (xs : Num 0 d o) → toℕ xs ≢ suc (o + d) -- NonSurjCond-Base≡0 {d} {o} ∙ () -- NonSurjCond-Base≡0 {d} {o} (x ∷ xs) p = contradiction p (<⇒≢ ⟦x∷xs⟧<1+o+d) -- where -- ⟦x∷xs⟧<1+o+d : o + Fin.toℕ x + toℕ xs * 0 < suc (o + d) -- ⟦x∷xs⟧<1+o+d = s≤s $ -- start -- o + Fin.toℕ x + toℕ xs * zero -- ≈⟨ cong (λ w → o + Fin.toℕ x + w) (*-right-zero (toℕ xs)) ⟩ -- o + Fin.toℕ x + zero -- ≈⟨ +-right-identity (o + Fin.toℕ x) ⟩ -- o + Fin.toℕ x -- ≤⟨ n+-mono o ( -- start -- Fin.toℕ x -- ≤⟨ n≤1+n (Fin.toℕ x) ⟩ -- suc (Fin.toℕ x) -- ≤⟨ bounded x ⟩ -- d -- □ -- )⟩ -- o + d -- □ -- -- NonSurjCond-NoDigits : ∀ {b o} → (xs : Num b 0 o) → toℕ xs ≢ 1 -- NonSurjCond-NoDigits ∙ () -- NonSurjCond-NoDigits (() ∷ xs) -- -- NonSurjCond-Offset≥2 : ∀ {b d o} → o ≥ 2 → (xs : Num b d o) → toℕ xs ≢ 1 -- NonSurjCond-Offset≥2 o≥2 ∙ () -- NonSurjCond-Offset≥2 {o = 0} () (x ∷ xs) p -- NonSurjCond-Offset≥2 {o = 1} (s≤s ()) (x ∷ xs) p -- NonSurjCond-Offset≥2 {o = suc (suc o)} o≥2 (x ∷ xs) () -- -- NonSurjCond-UnaryWithOnlyZeros : (xs : Num 1 1 0) → toℕ xs ≢ 1 -- NonSurjCond-UnaryWithOnlyZeros ∙ () -- NonSurjCond-UnaryWithOnlyZeros (z ∷ xs) p = contradiction ( -- begin -- toℕ xs -- ≡⟨ sym (*-right-identity (toℕ xs)) ⟩ -- toℕ xs * 1 -- ≡⟨ p ⟩ -- suc zero -- ∎) (NonSurjCond-UnaryWithOnlyZeros xs) -- NonSurjCond-UnaryWithOnlyZeros (s () ∷ xs) -- -- NonSurjCond-NotEnoughDigits : ∀ {b d o} → d ≥ 1 → b ≰ d → (xs : Num b d o) → toℕ xs ≢ o + d -- NonSurjCond-NotEnoughDigits {_} {_} {o} d≥1 b≰d ∙ = <⇒≢ (≤-steps o d≥1) -- NonSurjCond-NotEnoughDigits {b} {d} {o} d≥1 b≰d (x ∷ xs) p with toℕ xs ≤? 0 -- NonSurjCond-NotEnoughDigits {b} {d} {o} d≥1 b≰d (x ∷ xs) p | yes q = -- contradiction p (<⇒≢ ⟦x∷xs⟧>o+d) -- where -- ⟦xs⟧≡0 : toℕ xs ≡ 0 -- ⟦xs⟧≡0 = ≤0⇒≡0 (toℕ xs) q -- ⟦x∷xs⟧>o+d : o + Fin.toℕ x + toℕ xs * b < o + d -- ⟦x∷xs⟧>o+d = start -- suc (o + Fin.toℕ x + toℕ xs * b) -- ≈⟨ begin -- suc (o + Fin.toℕ x + toℕ xs * b) -- ≡⟨ cong (λ w → suc (o + Fin.toℕ x + w * b)) ⟦xs⟧≡0 ⟩ -- suc (o + Fin.toℕ x + zero) -- ≡⟨ +-right-identity (suc (o + Fin.toℕ x)) ⟩ -- suc (o + Fin.toℕ x) -- ≡⟨ sym (+-suc o (Fin.toℕ x)) ⟩ -- o + suc (Fin.toℕ x) -- ∎ ⟩ -- o + suc (Fin.toℕ x) -- ≤⟨ n+-mono o (bounded x) ⟩ -- o + d -- □ -- -- NonSurjCond-NotEnoughDigits {b} {d} {o} d≥1 b≰d (x ∷ xs) p | no ¬q = -- contradiction p (>⇒≢ ⟦x∷xs⟧>o+d) -- where -- ⟦x∷xs⟧>o+d : o + Fin.toℕ x + toℕ xs * b > o + d -- ⟦x∷xs⟧>o+d = start -- suc (o + d) -- ≈⟨ sym (+-suc o d) ⟩ -- o + suc d -- ≤⟨ n+-mono o ( -- start -- suc d -- ≤⟨ ≰⇒> b≰d ⟩ -- b -- ≈⟨ sym (*-left-identity b) ⟩ -- 1 * b -- ≤⟨ _*-mono_ {1} {toℕ xs} {b} {b} (≰⇒> ¬q) ≤-refl ⟩ -- toℕ xs * b -- ≤⟨ n≤m+n (Fin.toℕ x) (toℕ xs * b) ⟩ -- Fin.toℕ x + toℕ xs * b -- □ -- ) ⟩ -- o + (Fin.toℕ x + toℕ xs * b) -- ≈⟨ sym (+-assoc o (Fin.toℕ x) (toℕ xs * b)) ⟩ -- o + Fin.toℕ x + toℕ xs * b -- □ -- -- NonSurjCond⇏Surjective : ∀ {b} {d} {o} → NonSurjCond b d o → ¬ (Surjective (Num⟶ℕ b d o)) -- NonSurjCond⇏Surjective {_} {d} {o} Base≡0 claim = -- NonSurjCond-Base≡0 -- (from claim ⟨$⟩ suc o + d) -- (right-inverse-of claim (suc (o + d))) -- NonSurjCond⇏Surjective NoDigits claim = -- NonSurjCond-NoDigits -- (from claim ⟨$⟩ 1) -- (right-inverse-of claim 1) -- NonSurjCond⇏Surjective (Offset≥2 p) claim = -- NonSurjCond-Offset≥2 p -- (from claim ⟨$⟩ 1) -- (right-inverse-of claim 1) -- NonSurjCond⇏Surjective UnaryWithOnlyZeros claim = -- NonSurjCond-UnaryWithOnlyZeros -- (from claim ⟨$⟩ 1) -- (right-inverse-of claim 1) -- NonSurjCond⇏Surjective {_} {d} {o} (NotEnoughDigits p q) claim = -- NonSurjCond-NotEnoughDigits p q -- (from claim ⟨$⟩ o + d) -- (right-inverse-of claim (o + d)) -- -- SurjCond⇒Surjective : ∀ {b} {d} {o} → SurjCond b d o → Surjective (Num⟶ℕ b d o) -- SurjCond⇒Surjective {b} {d} {o} cond = record -- { from = ℕ⟶Num b d o -- ; right-inverse-of = toℕ-fromℕ {b} {d} {o} {SurjCond⇒IsSurj cond} -- } -- -- Surjective? : ∀ b d o → Dec (Surjective (Num⟶ℕ b d o)) -- Surjective? b d o with surjectionView b d o -- Surjective? b d o | Surj cond = yes (record -- { from = ℕ⟶Num b d o -- ; right-inverse-of = toℕ-fromℕ {b} {d} {o} {SurjCond⇒IsSurj cond} -- }) -- Surjective? b d o | NonSurj reason = no (NonSurjCond⇏Surjective reason) -- -- ------------------------------------------------------------------------ -- -- -- ------------------------------------------------------------------------ -- -- -- Surjective⇒SurjCond {b} {d} {o} surj = {! !} -- Surjective⇒SurjCond : ∀ {b} {d} {o} -- → Surjective (Num⟶ℕ b d o) -- → SurjCond b d o -- Surjective⇒SurjCond {b} {d} {o} surj with surjectionView b d o -- Surjective⇒SurjCond surj | Surj condition = condition -- Surjective⇒SurjCond surj | NonSurj reason = contradiction surj (NonSurjCond⇏Surjective reason) -- -- Surjective⇒IsSurj : ∀ {b} {d} {o} → Surjective (Num⟶ℕ b d o) → IsSurjective b d o -- Surjective⇒IsSurj = SurjCond⇒IsSurj ∘ Surjective⇒SurjCond -- -- Surjective⇒b≥1 : ∀ {b} {d} {o} → Surjective (Num⟶ℕ b d o) → b ≥ 1 -- Surjective⇒b≥1 = SurjCond⇒b≥1 ∘ Surjective⇒SurjCond -- -- Surjective⇒d≥b : ∀ {b} {d} {o} → Surjective (Num⟶ℕ b d o) → b ≤ d -- Surjective⇒d≥b = SurjCond⇒d≥b ∘ Surjective⇒SurjCond
41.844758
150
0.458106
035b58e869b76dfbf2c7129e086369f5a37ef6d6
99
agda
Agda
test/Fail/MissingDefinitionDataOrRec.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Fail/MissingDefinitionDataOrRec.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Fail/MissingDefinitionDataOrRec.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
data U : Set T : U -> Set record V u (t : T u) : Set -- note that u's Set is found by unification
19.8
71
0.606061
3031b6a8a8396a62041591df3c6e8080f06ce6b0
930
agda
Agda
Cubical/Codata/Everything.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
301
2018-10-17T18:00:24.000Z
2022-03-24T02:10:47.000Z
Cubical/Codata/Everything.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
584
2018-10-15T09:49:02.000Z
2022-03-30T12:09:17.000Z
Cubical/Codata/Everything.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
134
2018-11-16T06:11:03.000Z
2022-03-23T16:22:13.000Z
{-# OPTIONS --guardedness #-} module Cubical.Codata.Everything where open import Cubical.Codata.EverythingSafe public --- Modules making assumptions that might be incompatible with other -- flags or make use of potentially unsafe features. -- Assumes --guardedness open import Cubical.Codata.Stream public open import Cubical.Codata.Conat public open import Cubical.Codata.M public -- Also uses {-# TERMINATING #-}. open import Cubical.Codata.M.Bisimilarity public {- -- Alternative M type implemetation, based on -- https://arxiv.org/pdf/1504.02949.pdf -- "Non-wellfounded trees in Homotopy Type Theory" -- Benedikt Ahrens, Paolo Capriotti, Régis Spadotti -} open import Cubical.Codata.M.AsLimit.M open import Cubical.Codata.M.AsLimit.Coalg open import Cubical.Codata.M.AsLimit.helper open import Cubical.Codata.M.AsLimit.Container open import Cubical.Codata.M.AsLimit.itree open import Cubical.Codata.M.AsLimit.stream
28.181818
68
0.787097
4b167b0d77092a2185aee36e588538835443a8c0
296
agda
Agda
test/Fail/Issue3983.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Fail/Issue3983.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Fail/Issue3983.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
{-# OPTIONS --safe #-} data ⊥ : Set where private {-# TERMINATING #-} f : ⊥ f = f mutual {-# TERMINATING #-} g : ⊥ g = f abstract {-# TERMINATING #-} h : ⊥ h = f record I : Set where {-# TERMINATING #-} i : ⊥ i = f instance {-# TERMINATING #-} j : I j = j
8.969697
22
0.466216
31ab2abf761290b701fa78475d49898a686d0299
8,036
agda
Agda
vendor/stdlib/src/Relation/Binary/Product/Pointwise.agda
isabella232/Lemmachine
8ef786b40e4a9ab274c6103dc697dcb658cf3db3
[ "MIT" ]
56
2015-01-20T02:11:42.000Z
2021-12-21T17:02:19.000Z
vendor/stdlib/src/Relation/Binary/Product/Pointwise.agda
larrytheliquid/Lemmachine
8ef786b40e4a9ab274c6103dc697dcb658cf3db3
[ "MIT" ]
1
2022-03-12T12:17:51.000Z
2022-03-12T12:17:51.000Z
vendor/stdlib/src/Relation/Binary/Product/Pointwise.agda
isabella232/Lemmachine
8ef786b40e4a9ab274c6103dc697dcb658cf3db3
[ "MIT" ]
3
2015-07-21T16:37:58.000Z
2022-03-12T11:54:10.000Z
------------------------------------------------------------------------ -- Pointwise products of binary relations ------------------------------------------------------------------------ module Relation.Binary.Product.Pointwise where open import Data.Function open import Data.Product open import Data.Sum open import Relation.Nullary.Product open import Relation.Binary private module Dummy {a₁ a₂ : Set} where infixr 2 _×-Rel_ _×-Rel_ : Rel a₁ → Rel a₂ → Rel (a₁ × a₂) ∼₁ ×-Rel ∼₂ = (∼₁ on₁ proj₁) -×- (∼₂ on₁ proj₂) -- Some properties which are preserved by ×-Rel (under certain -- assumptions). _×-reflexive_ : ∀ {≈₁ ∼₁ ≈₂ ∼₂} → ≈₁ ⇒ ∼₁ → ≈₂ ⇒ ∼₂ → (≈₁ ×-Rel ≈₂) ⇒ (∼₁ ×-Rel ∼₂) refl₁ ×-reflexive refl₂ = λ x≈y → (refl₁ (proj₁ x≈y) , refl₂ (proj₂ x≈y)) _×-refl_ : ∀ {∼₁ ∼₂} → Reflexive ∼₁ → Reflexive ∼₂ → Reflexive (∼₁ ×-Rel ∼₂) refl₁ ×-refl refl₂ = (refl₁ , refl₂) ×-irreflexive₁ : ∀ {≈₁ <₁ ≈₂ <₂} → Irreflexive ≈₁ <₁ → Irreflexive (≈₁ ×-Rel ≈₂) (<₁ ×-Rel <₂) ×-irreflexive₁ ir = λ x≈y x<y → ir (proj₁ x≈y) (proj₁ x<y) ×-irreflexive₂ : ∀ {≈₁ <₁ ≈₂ <₂} → Irreflexive ≈₂ <₂ → Irreflexive (≈₁ ×-Rel ≈₂) (<₁ ×-Rel <₂) ×-irreflexive₂ ir = λ x≈y x<y → ir (proj₂ x≈y) (proj₂ x<y) _×-symmetric_ : ∀ {∼₁ ∼₂} → Symmetric ∼₁ → Symmetric ∼₂ → Symmetric (∼₁ ×-Rel ∼₂) sym₁ ×-symmetric sym₂ = λ x∼y → sym₁ (proj₁ x∼y) , sym₂ (proj₂ x∼y) _×-transitive_ : ∀ {∼₁ ∼₂} → Transitive ∼₁ → Transitive ∼₂ → Transitive (∼₁ ×-Rel ∼₂) trans₁ ×-transitive trans₂ = λ x∼y y∼z → trans₁ (proj₁ x∼y) (proj₁ y∼z) , trans₂ (proj₂ x∼y) (proj₂ y∼z) _×-antisymmetric_ : ∀ {≈₁ ≤₁ ≈₂ ≤₂} → Antisymmetric ≈₁ ≤₁ → Antisymmetric ≈₂ ≤₂ → Antisymmetric (≈₁ ×-Rel ≈₂) (≤₁ ×-Rel ≤₂) antisym₁ ×-antisymmetric antisym₂ = λ x≤y y≤x → ( antisym₁ (proj₁ x≤y) (proj₁ y≤x) , antisym₂ (proj₂ x≤y) (proj₂ y≤x) ) ×-asymmetric₁ : ∀ {<₁ ∼₂} → Asymmetric <₁ → Asymmetric (<₁ ×-Rel ∼₂) ×-asymmetric₁ asym₁ = λ x<y y<x → asym₁ (proj₁ x<y) (proj₁ y<x) ×-asymmetric₂ : ∀ {∼₁ <₂} → Asymmetric <₂ → Asymmetric (∼₁ ×-Rel <₂) ×-asymmetric₂ asym₂ = λ x<y y<x → asym₂ (proj₂ x<y) (proj₂ y<x) _×-≈-respects₂_ : ∀ {≈₁ ∼₁ ≈₂ ∼₂} → ∼₁ Respects₂ ≈₁ → ∼₂ Respects₂ ≈₂ → (∼₁ ×-Rel ∼₂) Respects₂ (≈₁ ×-Rel ≈₂) _×-≈-respects₂_ {≈₁ = ≈₁} {∼₁ = ∼₁} {≈₂ = ≈₂} {∼₂ = ∼₂} resp₁ resp₂ = (λ {x y z} → resp¹ {x} {y} {z}) , (λ {x y z} → resp² {x} {y} {z}) where ∼ = ∼₁ ×-Rel ∼₂ resp¹ : ∀ {x} → (∼ x) Respects (≈₁ ×-Rel ≈₂) resp¹ y≈y' x∼y = proj₁ resp₁ (proj₁ y≈y') (proj₁ x∼y) , proj₁ resp₂ (proj₂ y≈y') (proj₂ x∼y) resp² : ∀ {y} → (flip₁ ∼ y) Respects (≈₁ ×-Rel ≈₂) resp² x≈x' x∼y = proj₂ resp₁ (proj₁ x≈x') (proj₁ x∼y) , proj₂ resp₂ (proj₂ x≈x') (proj₂ x∼y) ×-total : ∀ {∼₁ ∼₂} → Symmetric ∼₁ → Total ∼₁ → Total ∼₂ → Total (∼₁ ×-Rel ∼₂) ×-total {∼₁ = ∼₁} {∼₂ = ∼₂} sym₁ total₁ total₂ = total where total : Total (∼₁ ×-Rel ∼₂) total x y with total₁ (proj₁ x) (proj₁ y) | total₂ (proj₂ x) (proj₂ y) ... | inj₁ x₁∼y₁ | inj₁ x₂∼y₂ = inj₁ ( x₁∼y₁ , x₂∼y₂) ... | inj₁ x₁∼y₁ | inj₂ y₂∼x₂ = inj₂ (sym₁ x₁∼y₁ , y₂∼x₂) ... | inj₂ y₁∼x₁ | inj₂ y₂∼x₂ = inj₂ ( y₁∼x₁ , y₂∼x₂) ... | inj₂ y₁∼x₁ | inj₁ x₂∼y₂ = inj₁ (sym₁ y₁∼x₁ , x₂∼y₂) _×-decidable_ : ∀ {∼₁ ∼₂} → Decidable ∼₁ → Decidable ∼₂ → Decidable (∼₁ ×-Rel ∼₂) dec₁ ×-decidable dec₂ = λ x y → dec₁ (proj₁ x) (proj₁ y) ×-dec dec₂ (proj₂ x) (proj₂ y) -- Some collections of properties which are preserved by ×-Rel. _×-isEquivalence_ : ∀ {≈₁ ≈₂} → IsEquivalence ≈₁ → IsEquivalence ≈₂ → IsEquivalence (≈₁ ×-Rel ≈₂) _×-isEquivalence_ {≈₁ = ≈₁} {≈₂ = ≈₂} eq₁ eq₂ = record { refl = λ {x} → _×-refl_ {∼₁ = ≈₁} {∼₂ = ≈₂} (refl eq₁) (refl eq₂) {x} ; sym = λ {x y} → _×-symmetric_ {∼₁ = ≈₁} {∼₂ = ≈₂} (sym eq₁) (sym eq₂) {x} {y} ; trans = λ {x y z} → _×-transitive_ {∼₁ = ≈₁} {∼₂ = ≈₂} (trans eq₁) (trans eq₂) {x} {y} {z} } where open IsEquivalence _×-isPreorder_ : ∀ {≈₁ ∼₁ ≈₂ ∼₂} → IsPreorder ≈₁ ∼₁ → IsPreorder ≈₂ ∼₂ → IsPreorder (≈₁ ×-Rel ≈₂) (∼₁ ×-Rel ∼₂) _×-isPreorder_ {∼₁ = ∼₁} {∼₂ = ∼₂} pre₁ pre₂ = record { isEquivalence = isEquivalence pre₁ ×-isEquivalence isEquivalence pre₂ ; reflexive = λ {x y} → _×-reflexive_ {∼₁ = ∼₁} {∼₂ = ∼₂} (reflexive pre₁) (reflexive pre₂) {x} {y} ; trans = λ {x y z} → _×-transitive_ {∼₁ = ∼₁} {∼₂ = ∼₂} (trans pre₁) (trans pre₂) {x} {y} {z} ; ∼-resp-≈ = ∼-resp-≈ pre₁ ×-≈-respects₂ ∼-resp-≈ pre₂ } where open IsPreorder _×-isDecEquivalence_ : ∀ {≈₁ ≈₂} → IsDecEquivalence ≈₁ → IsDecEquivalence ≈₂ → IsDecEquivalence (≈₁ ×-Rel ≈₂) eq₁ ×-isDecEquivalence eq₂ = record { isEquivalence = isEquivalence eq₁ ×-isEquivalence isEquivalence eq₂ ; _≟_ = _≟_ eq₁ ×-decidable _≟_ eq₂ } where open IsDecEquivalence _×-isPartialOrder_ : ∀ {≈₁ ≤₁ ≈₂ ≤₂} → IsPartialOrder ≈₁ ≤₁ → IsPartialOrder ≈₂ ≤₂ → IsPartialOrder (≈₁ ×-Rel ≈₂) (≤₁ ×-Rel ≤₂) _×-isPartialOrder_ {≤₁ = ≤₁} {≤₂ = ≤₂} po₁ po₂ = record { isPreorder = isPreorder po₁ ×-isPreorder isPreorder po₂ ; antisym = λ {x y} → _×-antisymmetric_ {≤₁ = ≤₁} {≤₂ = ≤₂} (antisym po₁) (antisym po₂) {x} {y} } where open IsPartialOrder _×-isStrictPartialOrder_ : ∀ {≈₁ <₁ ≈₂ <₂} → IsStrictPartialOrder ≈₁ <₁ → IsStrictPartialOrder ≈₂ <₂ → IsStrictPartialOrder (≈₁ ×-Rel ≈₂) (<₁ ×-Rel <₂) _×-isStrictPartialOrder_ {<₁ = <₁} {≈₂ = ≈₂} {<₂ = <₂} spo₁ spo₂ = record { isEquivalence = isEquivalence spo₁ ×-isEquivalence isEquivalence spo₂ ; irrefl = λ {x y} → ×-irreflexive₁ {<₁ = <₁} {≈₂ = ≈₂} {<₂ = <₂} (irrefl spo₁) {x} {y} ; trans = λ {x y z} → _×-transitive_ {∼₁ = <₁} {∼₂ = <₂} (trans spo₁) (trans spo₂) {x} {y} {z} ; <-resp-≈ = <-resp-≈ spo₁ ×-≈-respects₂ <-resp-≈ spo₂ } where open IsStrictPartialOrder open Dummy public -- "Packages" (e.g. setoids) can also be combined. _×-preorder_ : Preorder → Preorder → Preorder p₁ ×-preorder p₂ = record { isPreorder = isPreorder p₁ ×-isPreorder isPreorder p₂ } where open Preorder _×-setoid_ : Setoid → Setoid → Setoid s₁ ×-setoid s₂ = record { isEquivalence = isEquivalence s₁ ×-isEquivalence isEquivalence s₂ } where open Setoid _×-decSetoid_ : DecSetoid → DecSetoid → DecSetoid s₁ ×-decSetoid s₂ = record { isDecEquivalence = isDecEquivalence s₁ ×-isDecEquivalence isDecEquivalence s₂ } where open DecSetoid _×-poset_ : Poset → Poset → Poset s₁ ×-poset s₂ = record { isPartialOrder = isPartialOrder s₁ ×-isPartialOrder isPartialOrder s₂ } where open Poset _×-strictPartialOrder_ : StrictPartialOrder → StrictPartialOrder → StrictPartialOrder s₁ ×-strictPartialOrder s₂ = record { isStrictPartialOrder = isStrictPartialOrder s₁ ×-isStrictPartialOrder isStrictPartialOrder s₂ } where open StrictPartialOrder
37.551402
72
0.484694
03392cf130068e15745851b57037973f2395ad66
1,516
agda
Agda
test/asset/agda-stdlib-1.0/Data/DifferenceVec.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Data/DifferenceVec.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Data/DifferenceVec.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- The Agda standard library -- -- Vectors with fast append ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.DifferenceVec where open import Data.DifferenceNat open import Data.Vec as V using (Vec) open import Function import Data.Nat.Base as N infixr 5 _∷_ _++_ DiffVec : ∀ {ℓ} → Set ℓ → Diffℕ → Set ℓ DiffVec A m = ∀ {n} → Vec A n → Vec A (m n) [] : ∀ {a} {A : Set a} → DiffVec A 0# [] = λ k → k _∷_ : ∀ {a} {A : Set a} {n} → A → DiffVec A n → DiffVec A (suc n) x ∷ xs = λ k → V._∷_ x (xs k) [_] : ∀ {a} {A : Set a} → A → DiffVec A 1# [ x ] = x ∷ [] _++_ : ∀ {a} {A : Set a} {m n} → DiffVec A m → DiffVec A n → DiffVec A (m + n) xs ++ ys = λ k → xs (ys k) toVec : ∀ {a} {A : Set a} {n} → DiffVec A n → Vec A (toℕ n) toVec xs = xs V.[] -- fromVec xs is linear in the length of xs. fromVec : ∀ {a} {A : Set a} {n} → Vec A n → DiffVec A (fromℕ n) fromVec xs = λ k → xs ⟨ V._++_ ⟩ k head : ∀ {a} {A : Set a} {n} → DiffVec A (suc n) → A head xs = V.head (toVec xs) tail : ∀ {a} {A : Set a} {n} → DiffVec A (suc n) → DiffVec A n tail xs = λ k → V.tail (xs k) take : ∀ {a} {A : Set a} m {n} → DiffVec A (fromℕ m + n) → DiffVec A (fromℕ m) take N.zero xs = [] take (N.suc m) xs = head xs ∷ take m (tail xs) drop : ∀ {a} {A : Set a} m {n} → DiffVec A (fromℕ m + n) → DiffVec A n drop N.zero xs = xs drop (N.suc m) xs = drop m (tail xs)
26.596491
72
0.479551
5e25f3e54879f6528f8f8e093f4e4c720f31bfdf
2,349
agda
Agda
test/asset/agda-stdlib-1.0/Relation/Binary/Construct/Union.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Relation/Binary/Construct/Union.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
test/asset/agda-stdlib-1.0/Relation/Binary/Construct/Union.agda
omega12345/agda-mode
0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71
[ "MIT" ]
null
null
null
------------------------------------------------------------------------ -- The Agda standard library -- -- Union of two binary relations ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Relation.Binary.Construct.Union where open import Data.Product open import Data.Sum open import Function using (_∘_) open import Level using (_⊔_) open import Relation.Binary open import Relation.Nullary using (yes; no) ------------------------------------------------------------------------ -- Definition _∪_ : ∀ {a b ℓ₁ ℓ₂} {A : Set a} {B : Set b} → REL A B ℓ₁ → REL A B ℓ₂ → REL A B (ℓ₁ ⊔ ℓ₂) L ∪ R = λ i j → L i j ⊎ R i j ------------------------------------------------------------------------ -- Properties module _ {a ℓ} {A : Set a} (L : Rel A ℓ) (R : Rel A ℓ) where reflexive : Reflexive L ⊎ Reflexive R → Reflexive (L ∪ R) reflexive (inj₁ L-refl) = inj₁ L-refl reflexive (inj₂ R-refl) = inj₂ R-refl total : Total L ⊎ Total R → Total (L ∪ R) total (inj₁ L-total) x y = [ inj₁ ∘ inj₁ , inj₂ ∘ inj₁ ] (L-total x y) total (inj₂ R-total) x y = [ inj₁ ∘ inj₂ , inj₂ ∘ inj₂ ] (R-total x y) min : ∀ {⊤} → Minimum L ⊤ ⊎ Minimum R ⊤ → Minimum (L ∪ R) ⊤ min = [ inj₁ ∘_ , inj₂ ∘_ ] max : ∀ {⊥} → Maximum L ⊥ ⊎ Maximum R ⊥ → Maximum (L ∪ R) ⊥ max = [ inj₁ ∘_ , inj₂ ∘_ ] module _ {a ℓ} {A : Set a} {L : Rel A ℓ} {R : Rel A ℓ} where symmetric : Symmetric L → Symmetric R → Symmetric (L ∪ R) symmetric L-sym R-sym = [ inj₁ ∘ L-sym , inj₂ ∘ R-sym ] respects : ∀ {p} {P : A → Set p} → P Respects L → P Respects R → P Respects (L ∪ R) respects resp-L resp-R = [ resp-L , resp-R ] module _ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} (≈ : REL A B ℓ₁) (L : REL A B ℓ₂) (R : REL A B ℓ₃) where implies : (≈ ⇒ L) ⊎ (≈ ⇒ R) → ≈ ⇒ (L ∪ R) implies = [ inj₁ ∘_ , inj₂ ∘_ ] irreflexive : Irreflexive ≈ L → Irreflexive ≈ R → Irreflexive ≈ (L ∪ R) irreflexive L-irrefl R-irrefl x≈y = [ L-irrefl x≈y , R-irrefl x≈y ] module _ {a b ℓ₁ ℓ₂} {A : Set a} {B : Set b} {L : REL A B ℓ₁} {R : REL A B ℓ₂} where decidable : Decidable L → Decidable R → Decidable (L ∪ R) decidable L? R? x y with L? x y | R? x y ... | yes Lxy | _ = yes (inj₁ Lxy) ... | no _ | yes Rxy = yes (inj₂ Rxy) ... | no ¬Lxy | no ¬Rxy = no [ ¬Lxy , ¬Rxy ]
34.043478
84
0.488293
3042d0d3183dc72623d7408bb638ac45b1030ab1
1,082
agda
Agda
Cubical/Algebra/RingSolver/Utility.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
301
2018-10-17T18:00:24.000Z
2022-03-24T02:10:47.000Z
Cubical/Algebra/RingSolver/Utility.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
584
2018-10-15T09:49:02.000Z
2022-03-30T12:09:17.000Z
Cubical/Algebra/RingSolver/Utility.agda
FernandoLarrain/cubical
9acdecfa6437ec455568be4e5ff04849cc2bc13b
[ "MIT" ]
134
2018-11-16T06:11:03.000Z
2022-03-23T16:22:13.000Z
{-# OPTIONS --safe #-} module Cubical.Algebra.RingSolver.Utility where open import Cubical.Foundations.Prelude open import Cubical.Data.Bool open import Cubical.Data.Empty using (⊥) renaming (rec to recEmpty) open import Cubical.Data.Sigma open import Cubical.Relation.Nullary.Base private variable ℓ ℓ′ : Level byBoolAbsurdity : {Anything : Type ℓ} → false ≡ true → Anything byBoolAbsurdity p = recEmpty (false≢true p) byAbsurdity : {Anything : Type ℓ} → ⊥ → Anything byAbsurdity x = recEmpty x extractFromAnd : (P Q : Bool) → P and Q ≡ true → (P ≡ true) × (Q ≡ true) extractFromAnd false false eq = byBoolAbsurdity eq extractFromAnd false true eq = byBoolAbsurdity eq extractFromAnd true false eq = byBoolAbsurdity eq extractFromAnd true true eq = eq , eq extractFromAndLeft : {P Q : Bool} → P and Q ≡ true → P ≡ true extractFromAndLeft eq = fst (extractFromAnd _ _ eq) extractFromAndRight : {P Q : Bool} → P and Q ≡ true → Q ≡ true extractFromAndRight eq = snd (extractFromAnd _ _ eq)
28.473684
67
0.679298
2e50115f9c2fcefdbda5cf4334a33f06333d4557
975
agda
Agda
test/interaction/Issue373.agda
pthariensflame/agda
222c4c64b2ccf8e0fc2498492731c15e8fef32d4
[ "BSD-3-Clause" ]
null
null
null
test/interaction/Issue373.agda
pthariensflame/agda
222c4c64b2ccf8e0fc2498492731c15e8fef32d4
[ "BSD-3-Clause" ]
null
null
null
test/interaction/Issue373.agda
pthariensflame/agda
222c4c64b2ccf8e0fc2498492731c15e8fef32d4
[ "BSD-3-Clause" ]
null
null
null
module Issue373 where data ⊤ : Set where tt : ⊤ {-# COMPILED_DATA ⊤ () () #-} data ℕ : Set where zero : ℕ suc : (n : ℕ) → ℕ {-# BUILTIN NATURAL ℕ #-} {-# IMPORT Imports.Nat #-} data List (A : Set) : Set where [] : List A _∷_ : A → List A → List A {-# BUILTIN LIST List #-} {-# BUILTIN NIL [] #-} {-# BUILTIN CONS _∷_ #-} {-# COMPILED_DATA List [] [] (:) #-} postulate String : Set {-# BUILTIN STRING String #-} postulate IO : Set → Set {-# BUILTIN IO IO #-} {-# COMPILED_TYPE IO IO #-} infixl 1 _>>=_ postulate _>>=_ : ∀ {A B} → IO A → (A → IO B) → IO B {-# COMPILED _>>=_ (\_ _ -> (>>=) :: IO a -> (a -> IO b) -> IO b) #-} {-# IMPORT Data.Text.IO #-} postulate putStrLn : String → IO ⊤ {-# COMPILED putStrLn Data.Text.IO.putStrLn #-} f : ℕ → String f zero = "bad" f _ = "ok" -- Works: -- main = putStrLn (f (suc zero)) -- Compiles, but when the program is run we (used to) get the output -- "bad": main = putStrLn (f 1)
15.983607
69
0.530256
13318c52876630f4a8d271573975e68be98439d9
276
agda
Agda
test/Succeed/Issue712.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Succeed/Issue712.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Succeed/Issue712.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
{-# OPTIONS --without-K #-} module Issue712 where data _≡_ {A : Set} : A → A → Set where refl : (x : A) → x ≡ x record _×_ (A B : Set) : Set where field p1 : A p2 : B open _×_ lemma : {A B : Set} {u v : A × B} (p : u ≡ v) → p1 u ≡ p1 v lemma (refl _) = refl _
17.25
59
0.5
a0740ef46301274d95d2c19813305dfc4a9a1230
219
agda
Agda
test/Fail/Prop-NoMatch.agda
mdimjasevic/agda
8fb548356b275c7a1e79b768b64511ae937c738b
[ "BSD-3-Clause" ]
1,989
2015-01-09T23:51:16.000Z
2022-03-30T18:20:48.000Z
test/Fail/Prop-NoMatch.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
4,066
2015-01-10T11:24:51.000Z
2022-03-31T21:14:49.000Z
test/Fail/Prop-NoMatch.agda
Seanpm2001-languages/agda
9911f73061e21a87fad76c662463257afe02c861
[ "BSD-2-Clause" ]
371
2015-01-03T14:04:08.000Z
2022-03-30T19:00:30.000Z
-- Pattern matching on a datatype in Prop is disallowed {-# OPTIONS --prop #-} open import Agda.Builtin.Bool data TestProp : Prop where p₁ p₂ : TestProp toBool : TestProp → Bool toBool p₁ = true toBool p₂ = false
16.846154
55
0.712329