Search is not available for this dataset
text
string
meta
dict
{-# OPTIONS --without-K #-} module M-types.Base where open import M-types.Base.Core public open import M-types.Base.Sum public open import M-types.Base.Prod public open import M-types.Base.Eq public open import M-types.Base.Equi public open import M-types.Base.Rel public open import M-types.Base.Contr public open import M-types.Base.Axiom public
{ "alphanum_fraction": 0.7172774869, "avg_line_length": 29.3846153846, "ext": "agda", "hexsha": "cbda517d996a5dbbbc07f074c0f2b393025bab0b", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "5b70f4b3dc3e50365ad7a3a80b0cd14efbfa4369", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "DDOtten/M-types", "max_forks_repo_path": "Base.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "5b70f4b3dc3e50365ad7a3a80b0cd14efbfa4369", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "DDOtten/M-types", "max_issues_repo_path": "Base.agda", "max_line_length": 41, "max_stars_count": null, "max_stars_repo_head_hexsha": "5b70f4b3dc3e50365ad7a3a80b0cd14efbfa4369", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "DDOtten/M-types", "max_stars_repo_path": "Base.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 91, "size": 382 }
module Injections where open import Data.Product open import Relation.Nullary open import Data.Empty open import Data.Sum open import Support.Equality open ≡-Reasoning open import Vars public open import Injections.Type public invert : ∀ {A : Set} {xs ys : List A} (i : Inj xs ys) → ∀ {t} (y : ys ∋ t) → Dec (∃ \ x → i $ x ≡ y) invert [] y = no (λ { (() , _)}) invert ( z ∷ i [ pf ]) y with z ≅∋? y invert (.y ∷ i [ pf ]) y | yes refl` = yes (zero , refl) invert ( z ∷ i [ pf ]) y | no z≢y with invert i y invert ( z ∷ i [ pf ]) y | no z≢y | yes (x , i$x≡y) = yes (suc x , i$x≡y) invert ( z ∷ i [ pf ]) y | no z≢y | no ¬[i⁻¹y] = no (neither z≢y ¬[i⁻¹y]) where neither : ∀ {t} {y : _ ∋ t} → ¬ z ≅∋ y → ¬ (∃ \ x → i $ x ≡ y) → ¬ Σ (_ ∷ _ ∋ _) (λ x → (z ∷ i [ pf ]) $ x ≡ y) neither ¬1 ¬2 (zero , p) = ¬1 (refl , ≡-to-≅ p) neither ¬1 ¬2 (suc x , p) = ¬2 (x , p) abstract _∘i_ : ∀ {A : Set}{xs ys zs : List A} → Inj ys zs → Inj xs ys → Inj xs zs f ∘i g = quo (λ x x₁ → f $ (g $ x₁)) {λ x x₁ → injective g _ _ (injective f _ _ x₁)} mutual id-i : ∀ {A : Set}{xs : List A} → Inj xs xs id-i = quo (\ _ x → x) {\ _ e → e} Inj-thin : ∀ {A : Set}{x : A}{xs ys} → (v : ys ∋ x) -> Inj xs (ys - v) → Inj xs ys Inj-thin v f = quo (λ x x₁ → thin v x (f $ x₁)) {λ x x₁ → injective f _ _ (thin-inj v x₁)} abstract id-i$ : ∀ {A : Set}{xs : List A} -> ∀ {x}(v : xs ∋ x) -> id-i $ v ≡ v id-i$ v = iso2 _ _ v right-id : ∀ {A : Set}{xs ys : List A} → (i : Inj xs ys) → i ∘i id-i ≡ i right-id i = begin quo (λ x z → i $ (id-i $ z)) ≡⟨ quo-ext (λ x v → cong (_$_ i) (iso2 _ _ v)) ⟩ quo (λ x → _$_ i) ≡⟨ iso1 i (λ x eq → injective i _ _ eq) ⟩ i ∎ left-id : ∀ {A : Set}{xs ys : List A} → (i : Inj xs ys) → id-i ∘i i ≡ i left-id i = begin quo (λ x z → id-i $ (i $ z)) ≡⟨ quo-ext (λ x v → (iso2 _ _ (i $ v))) ⟩ quo (λ x → _$_ i) ≡⟨ iso1 i (λ x eq → injective i _ _ eq) ⟩ i ∎ apply-∘ : ∀ {A : Set}{xs ys zs : List A} → (j : Inj ys zs) → (i : Inj xs ys) → ∀ {x} {v : x ∈ xs} → (j ∘i i) $ v ≡ j $ (i $ v) apply-∘ j i {x}{v} = iso2 _ _ v assoc-∘i : ∀ {A : Set}{xs ys ws zs : List A} {f : Inj ws zs}{g : Inj _ ws}{h : Inj xs ys} → f ∘i (g ∘i h) ≡ (f ∘i g) ∘i h assoc-∘i {f = f}{g = g}{h = h} = quo-ext λ x v → begin f $ (quo (λ x₁ x₂ → g $ (h $ x₂)) $ v) ≡⟨ cong (_$_ f) (iso2 _ _ v) ⟩ f $ (g $ (h $ v)) ≡⟨ sym (iso2 _ _ (h $ v)) ⟩ quo (λ x₁ x₂ → f $ (g $ x₂)) $ (h $ v) ∎ cong-$ : ∀ {A : Set}{xs ys : List A} {f g : _} {inj1 inj2} → quo {_} {xs} {ys} f {inj1} ≡ quo g {inj2} → ∀ {s} (x : xs ∋ s) → f s x ≡ g s x cong-$ {A} {xs} {ys} {f} {g} eq x = begin f _ x ≡⟨ sym (iso2 f _ x) ⟩ quo f $ x ≡⟨ cong (λ f₁ → f₁ $ x) eq ⟩ quo g $ x ≡⟨ iso2 g _ x ⟩ g _ x ∎ ∘i-inj : ∀ {A : Set}{xs ys zs : List A} → (i : Inj ys zs) (j1 j2 : Inj xs ys) → (i ∘i j1) ≡ (i ∘i j2) → j1 ≡ j2 ∘i-inj i j1 j2 eq = begin j1 ≡⟨ sym (iso1 j1 (λ x x₁ → injective j1 _ _ x₁)) ⟩ quo (λ x → _$_ j1) ≡⟨ quo-ext (λ x v → injective i _ _ (cong-$ eq v)) ⟩ quo (λ x → _$_ j2) ≡⟨ iso1 j2 (λ x x₁ → injective j2 _ _ x₁) ⟩ j2 ∎ Inj-thin-$ : ∀ {A : Set}{x : A}{xs ys} → (v : ys ∋ x) -> (f : Inj xs (ys - v)) -> ∀ {y}(u : xs ∋ y) -> Inj-thin v f $ u ≡ thin v _ (f $ u) Inj-thin-$ v f u = iso2 _ _ u Inj-thin-inj : ∀ {A : Set}{x : A}{xs ys} → (v : ys ∋ x) -> (f g : Inj xs (ys - v)) -> Inj-thin v f ≡ Inj-thin v g -> f ≡ g Inj-thin-inj v f g eq = ext-$ f g (λ x v₁ → thin-inj v (cong-$ {inj1 = λ x₁ x₂ → injective f _ _ (thin-inj v x₂)} {inj2 = λ x₁ x₂ → injective g _ _ (thin-inj v x₂)} eq v₁)) -- XXX regression Inj-thin-∘i : ∀ {A : Set}{x : A}{zs xs ys} → (v : ys ∋ x) -> (f : Inj xs (ys - v)) (m : Inj zs xs) -> Inj-thin v f ∘i m ≡ Inj-thin v (f ∘i m) Inj-thin-∘i v f m = quo-ext (λ x v₁ → trans (iso2 _ _ (m $ v₁)) (cong (thin v x) (sym (iso2 _ _ v₁)))) v∉Inj-thinv : ∀ {A : Set}{x : A}{xs ys} → (v : ys ∋ x) -> (f : Inj xs (ys - v)) -> v ∉ Inj-thin v f v∉Inj-thinv v f = ∉Im$-∉ (λ x x₁ → thin v _ (f $ x₁)) v (λ b → x∉thinx v (f $ b)) test : ∀ {A : Set} {xs ys} → (f : ∀ (x : A) → x ∈ xs → x ∈ ys){inj1 inj2 : ∀ x → {i j : x ∈ xs} → f x i ≡ f x j → i ≡ j} → quo f {inj1} ≡ quo f {inj2} test f = refl weak : ∀ {A : Set}{x : A}{xs ys} → Inj xs ys → Inj xs (x ∷ ys) weak f = Inj-thin zero f apply-weakid : ∀ {A : Set}{xs : List A}{x y}(i : xs ∋ x) -> weak {x = y} id-i $ i ≡ suc i apply-weakid i = begin quo (λ x v → thin zero x (id-i $ v)) $ i ≡⟨ iso2 _ _ i ⟩ suc (id-i $ i) ≡⟨ cong suc (id-i$ i) ⟩ suc i ∎ _∷[]_ : ∀ {A : Set}{x : A}{xs ys} → (v : ys ∋ x) -> Inj xs (ys - v) → Inj (x ∷ xs) ys v ∷[] f = v ∷ Inj-thin v f [ v∉Inj-thinv v f ] cons : ∀ {A : Set}{x : A}{xs ys} → Inj xs ys → Inj (x ∷ xs) (x ∷ ys) cons z = zero ∷[] z abstract cons-id : ∀ {A : Set}{x : A}{xs} -> cons id-i ≡ id-i {_} {x ∷ xs} cons-id = cong-∷[] refl (quo-ext (λ x v → cong suc (id-i$ v))) cons-∘i : ∀ {A : Set}{xs ys zs : List A}{x} → (j : Inj ys zs) → (i : Inj xs ys) → cons {A} {x} (j ∘i i) ≡ cons j ∘i cons i cons-∘i j i = cong-∷[] refl (begin quo (λ x z → suc (proj₁ (quo' (λ v v₁ → j $ (i $ v₁))) $ z)) ≡⟨ quo-ext {injg = λ x x₁ → injective i _ _ (injective (weak j) _ _ x₁)} (λ x v → begin suc (proj₁ (quo' (λ v₁ v₂ → j $ (i $ v₂))) $ v) ≡⟨ cong suc (iso2 _ _ v) ⟩ suc (j $ (i $ v)) ≡⟨ sym (iso2 _ _ (i $ v)) ⟩ quo (λ x₁ x₂ → suc (j $ x₂)) $ (i $ v) ∎) ⟩ quo (λ x v → cons j $ suc (i $ v)) ≡⟨ sym (quo-ext (λ x₁ v → cong (_$_ (cons j)) (iso2 (λ _ x → suc (i $ x)) _ v))) ⟩ quo (λ x v → cons j $ (quo (λ z x₁ → suc (i $ x₁)) $ v)) ∎) ∘-ext : ∀ {A : Set}{xs ys zs ws : List A} {f : Inj ys zs}{g : Inj xs ys}{f1 : Inj ws zs}{g1 : Inj xs ws} -> f ∘i g ≡ f1 ∘i g1 -> (∀ x (v : xs ∋ x) -> f $ (g $ v) ≡ f1 $ (g1 $ v)) ∘-ext eq = (\ x v -> trans (sym (apply-∘ _ _)) (trans (cong (\ f -> f $ v) eq) ((apply-∘ _ _)))) ext-∘ : ∀ {A : Set}{xs ys zs ws : List A} {f : Inj ys zs}{g : Inj xs ys}{f1 : Inj ws zs}{g1 : Inj xs ws} -> (∀ x (v : xs ∋ x) -> f $ (g $ v) ≡ f1 $ (g1 $ v)) -> f ∘i g ≡ f1 ∘i g1 ext-∘ eq = ext-$ _ _ (\ x v -> trans (apply-∘ _ _) (trans (eq x v) (sym (apply-∘ _ _)))) -- Transforming pointwise representations of universal morphisms into Inj ones. Equ-universal-quote : ∀ {A : Set} {xs ys : List A} → (i j : Inj xs ys) → ∀ {E} → (e : Inj E xs) -> (∀ a (y : xs ∋ a) -> i $ y ≡ j $ y -> ∃ \ z -> y ≡ e $ z) -> {as : List A} (h : Inj as xs) → i ∘i h ≡ j ∘i h → Σ (Inj as E) (λ z → e ∘i z ≡ h ) Equ-universal-quote {A} {xs} {ys} i j {E} e c {as} h eq = quo u {λ x {v} {w} eq1 → injective h v w (begin h $ v ≡⟨ proj₂ (f x v) ⟩ e $ u x v ≡⟨ cong (_$_ e) eq1 ⟩ e $ u x w ≡⟨ sym (proj₂ (f x w)) ⟩ h $ w ∎)} , ext-$ (e ∘i quo u) h (λ x v → begin (e ∘i quo u) $ v ≡⟨ apply-∘ _ _ ⟩ e $ (quo u $ v) ≡⟨ cong (_$_ e) (iso2 _ _ v) ⟩ e $ u x v ≡⟨ sym (proj₂ (f x v)) ⟩ h $ v ∎) where f : ∀ a (y : as ∋ a) -> ∃ \ z -> h $ y ≡ e $ z f a y = c a (h $ y) (∘-ext eq a y) u = (λ x v → proj₁ (f x v)) Pull-universal-quote : ∀ {A : Set} {X Y Z : List A} → (i : Inj X Z)(j : Inj Y Z) -> ∀ {P} -> (p₁ : Inj P X) (p₂ : Inj P Y) -> (∀ (a : A) (y : Y ∋ a)(x : X ∋ a) -> i $ x ≡ j $ y -> (∃ \ z -> p₁ $ z ≡ x × p₂ $ z ≡ y)) -> ∀ {Q} -> (q₁ : Inj Q X) (q₂ : Inj Q Y) -> i ∘i q₁ ≡ j ∘i q₂ -> ∃ \ u -> q₁ ≡ p₁ ∘i u × q₂ ≡ p₂ ∘i u Pull-universal-quote i j p₁ p₂ uni {Q} q₁ q₂ commutes = quo u {λ x {v} {w} eq → injective q₁ v w (begin q₁ $ v ≡⟨ sym (proj₁ (proj₂ (f x v))) ⟩ p₁ $ u x v ≡⟨ cong (_$_ p₁) eq ⟩ p₁ $ u x w ≡⟨ proj₁ (proj₂ (f x w)) ⟩ q₁ $ w ∎)} , ext-$ q₁ (p₁ ∘i quo u) (λ x v → begin q₁ $ v ≡⟨ sym (proj₁ (proj₂ (f x v))) ⟩ p₁ $ u x v ≡⟨ cong (_$_ p₁) (sym (iso2 _ _ v)) ⟩ p₁ $ (quo u $ v) ≡⟨ sym (apply-∘ _ _) ⟩ (p₁ ∘i quo u) $ v ∎) , ext-$ q₂ (p₂ ∘i quo u) (λ x v → begin q₂ $ v ≡⟨ sym (proj₂ (proj₂ (f x v))) ⟩ p₂ $ u x v ≡⟨ cong (_$_ p₂) (sym (iso2 _ _ v)) ⟩ p₂ $ (quo u $ v) ≡⟨ sym (apply-∘ _ _) ⟩ (p₂ ∘i quo u) $ v ∎) where f : ∀ a (v : Q ∋ a) -> (∃ \ z -> p₁ $ z ≡ q₁ $ v × p₂ $ z ≡ q₂ $ v) f a v = uni a (q₂ $ v) (q₁ $ v) (∘-ext commutes a v) u : ∀ a (v : Q ∋ a) -> _ u a v = proj₁ (f a v)
{ "alphanum_fraction": 0.3912716328, "avg_line_length": 54.7235294118, "ext": "agda", "hexsha": "31995b9f2ea95922a7928e9120a732bca7b17a8e", "lang": "Agda", "max_forks_count": 3, "max_forks_repo_forks_event_max_datetime": "2022-01-06T19:34:26.000Z", "max_forks_repo_forks_event_min_datetime": "2019-11-13T12:44:41.000Z", "max_forks_repo_head_hexsha": "34e2980af98ff2ded500619edce3e0907a6e9050", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "ajnavarro/language-dataset", "max_forks_repo_path": "data/github.com/Saizan/miller/17637ec5267fac2f2072f8c5d5e2a82d11505a46/Injections.agda", "max_issues_count": 91, "max_issues_repo_head_hexsha": "34e2980af98ff2ded500619edce3e0907a6e9050", "max_issues_repo_issues_event_max_datetime": "2022-03-21T04:17:18.000Z", "max_issues_repo_issues_event_min_datetime": "2019-11-11T15:41:26.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "ajnavarro/language-dataset", "max_issues_repo_path": "data/github.com/Saizan/miller/17637ec5267fac2f2072f8c5d5e2a82d11505a46/Injections.agda", "max_line_length": 192, "max_stars_count": 9, "max_stars_repo_head_hexsha": "34e2980af98ff2ded500619edce3e0907a6e9050", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "ajnavarro/language-dataset", "max_stars_repo_path": "data/github.com/Saizan/miller/17637ec5267fac2f2072f8c5d5e2a82d11505a46/Injections.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-11T09:48:45.000Z", "max_stars_repo_stars_event_min_datetime": "2018-08-07T11:54:33.000Z", "num_tokens": 4112, "size": 9303 }
{-# OPTIONS --without-K --safe #-} module Polynomial.Simple.Reflection where open import Agda.Builtin.Reflection open import Reflection.Helpers open import Polynomial.Simple.Solver renaming (solve to solve-fn) open AlmostCommutativeRing open import Data.Nat.Table open import Data.Fin as Fin using (Fin) open import Data.Vec as Vec using (Vec; _∷_; []) open import Data.List as List using (List; _∷_; []) open import Data.Maybe as Maybe using (Maybe; just; nothing; fromMaybe) open import Agda.Builtin.Nat using (_<_) open import Data.Nat using (ℕ; suc; zero) open import Data.Bool using (Bool; if_then_else_; true; false) open import Data.Unit using (⊤) open import Data.String using (String) open import Data.Product using (_,_) open import Function module Internal where _∈Ring : Term → TC Term ring ∈Ring = checkType ring (def (quote AlmostCommutativeRing) (unknown ⟨∷⟩ unknown ⟨∷⟩ [])) vars : Term → Maybe Table vars = go [] where go : Table → Term → Maybe Table go t (con (quote List._∷_) (_ ∷ _ ∷ var i [] ⟨∷⟩ xs ⟨∷⟩ _)) = go (insert i t) xs go t (con (quote List.List.[]) _) = just t go _ _ = nothing module OverRing (ring : Term) where _∈List⟨Carrier⟩ : Term → TC Term t ∈List⟨Carrier⟩ = checkType t (quote List ⟨ def ⟩ 1 ⋯⟅∷⟆ def (quote Carrier) (2 ⋯⟅∷⟆ ring ⟨∷⟩ []) ⟨∷⟩ []) >>= normalise record Ring⇓ : Set where constructor +⇒_*⇒_^⇒_-⇒_ field +′ *′ ^′ -′ : Maybe Name ring⇓ : TC Ring⇓ ring⇓ = ⦇ +⇒ ⟦ quote _+_ ⇓⟧ₙ *⇒ ⟦ quote _*_ ⇓⟧ₙ ^⇒ ⟦ quote _^_ ⇓⟧ₙ -⇒ ⟦ quote -_ ⇓⟧ₙ ⦈ where ⟦_⇓⟧ₙ : Name → TC (Maybe Name) ⟦ nm ⇓⟧ₙ = normalise (nm ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ []) <&> λ where (def f args) → just f _ → nothing module _ (nms : Ring⇓) where open Ring⇓ nms module _ (numVars : ℕ) where -- This function applies the hidden arguments that the constructors -- that Expr needs. The first is the universe level, the second is the -- type it contains, and the third is the number of variables it's -- indexed by. All three of these could likely be inferred, but to -- make things easier we supply the third because we know it. infixr 5 E⟅∷⟆_ E⟅∷⟆_ : List (Arg Term) → List (Arg Term) E⟅∷⟆ xs = 1 ⋯⟅∷⟆ (quote Carrier ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ []) ⟅∷⟆ ℕ′ numVars ⟅∷⟆ xs -- A constant expression. Κ′ : Term → Term Κ′ x = quote Κ ⟨ con ⟩ E⟅∷⟆ x ⟨∷⟩ [] _⇓≟_ : Maybe Name → Name → Bool nothing ⇓≟ _ = false just x ⇓≟ y = primQNameEquality x y {-# INLINE _⇓≟_ #-} module ToExpr (Ι′ : ℕ → Maybe Term) where mutual -- Application of a ring operator often doesn't have a type as -- simple as "Carrier → Carrier → Carrier": there may be hidden -- arguments, etc. Here, we do our best to handle those cases, -- by just taking the last two explicit arguments. E⟨_⟩₂ : Name → List (Arg Term) → Term E⟨ nm ⟩₂ (x ⟨∷⟩ y ⟨∷⟩ []) = nm ⟨ con ⟩ E⟅∷⟆ E x ⟨∷⟩ E y ⟨∷⟩ [] E⟨ nm ⟩₂ (x ∷ xs) = E⟨ nm ⟩₂ xs E⟨ nm ⟩₂ _ = unknown E⟨_⟩₁ : Name → List (Arg Term) → Term E⟨ nm ⟩₁ (x ⟨∷⟩ []) = nm ⟨ con ⟩ E⟅∷⟆ E x ⟨∷⟩ [] E⟨ nm ⟩₁ (x ∷ xs) = E⟨ nm ⟩₁ xs E⟨ _ ⟩₁ _ = unknown E⟨^⟩ : List (Arg Term) → Term E⟨^⟩ (x ⟨∷⟩ y ⟨∷⟩ []) = quote _⊛_ ⟨ con ⟩ E⟅∷⟆ E x ⟨∷⟩ y ⟨∷⟩ [] E⟨^⟩ (x ∷ xs) = E⟨^⟩ xs E⟨^⟩ _ = unknown -- When trying to figure out the shape of an expression, one of -- the difficult tasks is recognizing where constants in the -- underlying ring are used. If we were only dealing with ℕ, we -- might look for its constructors: however, we want to deal with -- arbitrary types which implement AlmostCommutativeRing. If the -- Term type contained type information we might be able to -- recognize it there, but it doesn't. -- -- We're in luck, though, because all other cases in the following -- function *are* recognizable. As a result, the "catch-all" case -- will just assume that it has a constant expression. E : Term → Term E (def (quote _+_) xs) = E⟨ quote _⊕_ ⟩₂ xs E (def (quote _*_) xs) = E⟨ quote _⊗_ ⟩₂ xs E (def (quote _^_) xs) = E⟨^⟩ xs E (def (quote -_) xs) = E⟨ quote ⊝_ ⟩₁ xs E (def nm xs) = if +′ ⇓≟ nm then E⟨ quote _⊕_ ⟩₂ xs else if *′ ⇓≟ nm then E⟨ quote _⊗_ ⟩₂ xs else if ^′ ⇓≟ nm then E⟨^⟩ xs else if -′ ⇓≟ nm then E⟨ quote ⊝_ ⟩₁ xs else Κ′ (def nm xs) E (con (quote ℕ.suc) (x ⟨∷⟩ [])) = quote _⊕_ ⟨ con ⟩ E⟅∷⟆ Κ′ (ℕ′ (ℕ.suc ℕ.zero)) ⟨∷⟩ E x ⟨∷⟩ [] E v@(var x _) = fromMaybe (Κ′ v) (Ι′ x) E t = Κ′ t callSolver : Vec String numVars → Term → Term → List (Arg Type) callSolver nms lhs rhs = 2 ⋯⟅∷⟆ ring ⟨∷⟩ ℕ′ numVars ⟨∷⟩ vlams nms (quote _⊜_ ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ ℕ′ numVars ⟨∷⟩ E lhs ⟨∷⟩ E rhs ⟨∷⟩ []) ⟨∷⟩ hlams nms (quote refl ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ 1 ⋯⟅∷⟆ []) ⟨∷⟩ [] where Ι′ : ℕ → Maybe Term Ι′ i = if i < numVars then just (var i []) else nothing open ToExpr Ι′ constructSoln : Table → Term → Term → Term constructSoln t lhs rhs = quote trans ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ 3 ⋯⟅∷⟆ (quote sym ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ 2 ⋯⟅∷⟆ (quote Ops.correct ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ 1 ⋯⟅∷⟆ E lhs ⟨∷⟩ ρ ⟨∷⟩ []) ⟨∷⟩ []) ⟨∷⟩ (quote Ops.correct ⟨ def ⟩ 2 ⋯⟅∷⟆ ring ⟨∷⟩ 1 ⋯⟅∷⟆ E rhs ⟨∷⟩ ρ ⟨∷⟩ []) ⟨∷⟩ [] where Ι′ : ℕ → Maybe Term Ι′ i = Maybe.map (λ x → quote Ι ⟨ con ⟩ E⟅∷⟆ Fin′ x ⟨∷⟩ []) (member i t) open ToExpr Ι′ ρ : Term ρ = curriedTerm t open Internal -- This is the main macro you'll probably be using. Call it like this: -- -- lemma : ∀ x y → x + y ≈ y + x -- lemma = solve TypeRing -- -- where TypRing is your implementation of AlmostCommutativeRing. (Find some -- example implementations in Polynomial.Solver.Ring.AlmostCommutativeRing.Instances). macro solve : Name → Term → TC ⊤ solve ring hole = do ring′ ← def ring [] ∈Ring commitTC let open OverRing ring′ nms ← ring⇓ hole′ ← inferType hole >>= reduce let i , k , xs = underPi hole′ just (lhs ∷ rhs ∷ []) ← pure (getArgs 2 xs) where nothing → typeError (strErr "Malformed call to solve." ∷ strErr "Expected target type to be like: ∀ x y → x + y ≈ y + x." ∷ strErr "Instead: " ∷ termErr hole′ ∷ []) unify hole (quote solve-fn ⟨ def ⟩ callSolver nms i k lhs rhs) -- Use this macro when you want to solve something *under* a lambda. For example: -- say you have a long proof, and you just want the solver to deal with an -- intermediate step. Call it like so: -- -- lemma₃ : ∀ x y → x + y * 1 + 3 ≈ 2 + 1 + y + x -- lemma₃ x y = begin -- x + y * 1 + 3 ≈⟨ +-comm x (y * 1) ⟨ +-cong ⟩ refl ⟩ -- y * 1 + x + 3 ≈⟨ solveOver (x ∷ y ∷ []) Int.ring ⟩ -- 3 + y + x ≡⟨ refl ⟩ -- 2 + 1 + y + x ∎ -- -- The first argument is the free variables, and the second is the -- ring implementation (as before). -- -- One thing to note here is that we need to be able to infer *both* sides of -- the equality, which the normal equaltional reasoning combinators don't let you -- do. You'll need the combinators defined in Relation.Binary.Reasoning.Inference. -- These are just as powerful as the others, but have slightly better inference properties. solveOver-macro : Term → Name → Term → TC ⊤ solveOver-macro i ring hole = do ring′ ← def ring [] ∈Ring commitTC let open OverRing ring′ nms ← ring⇓ i′ ← i ∈List⟨Carrier⟩ commitTC hole′ ← inferType hole >>= reduce just vars′ ← pure (vars i′) where nothing → typeError (strErr "Malformed call to solveOver." ∷ strErr "First argument should be a list of free variables." ∷ strErr "Instead: " ∷ termErr i′ ∷ []) just (lhs ∷ rhs ∷ []) ← pure (getArgs 2 hole′) where nothing → typeError (strErr "Malformed call to solveOver." ∷ strErr "First argument should be a list of free variables." ∷ strErr "Instead: " ∷ termErr hole′ ∷ []) unify hole (constructSoln nms (List.length vars′) vars′ lhs rhs) macro solveOver : Term → Name → Term → TC ⊤ solveOver = solveOver-macro
{ "alphanum_fraction": 0.514201442, "avg_line_length": 40.6844444444, "ext": "agda", "hexsha": "b6f50e6f76fa1a388f2d2f5b6aac6e99e28318e0", "lang": "Agda", "max_forks_count": 4, "max_forks_repo_forks_event_max_datetime": "2022-01-20T07:07:11.000Z", "max_forks_repo_forks_event_min_datetime": "2019-04-16T02:23:16.000Z", "max_forks_repo_head_hexsha": "f18d9c6bdfae5b4c3ead9a83e06f16a0b7204500", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "mckeankylej/agda-ring-solver", "max_forks_repo_path": "src/Polynomial/Simple/Reflection.agda", "max_issues_count": 5, "max_issues_repo_head_hexsha": "f18d9c6bdfae5b4c3ead9a83e06f16a0b7204500", "max_issues_repo_issues_event_max_datetime": "2022-03-12T01:55:42.000Z", "max_issues_repo_issues_event_min_datetime": "2019-04-17T20:48:48.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "mckeankylej/agda-ring-solver", "max_issues_repo_path": "src/Polynomial/Simple/Reflection.agda", "max_line_length": 107, "max_stars_count": 36, "max_stars_repo_head_hexsha": "f18d9c6bdfae5b4c3ead9a83e06f16a0b7204500", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "mckeankylej/agda-ring-solver", "max_stars_repo_path": "src/Polynomial/Simple/Reflection.agda", "max_stars_repo_stars_event_max_datetime": "2022-02-15T00:57:55.000Z", "max_stars_repo_stars_event_min_datetime": "2019-01-25T16:40:52.000Z", "num_tokens": 3054, "size": 9154 }
open import Relation.Binary.PropositionalEquality using (_≡_) module AKS.Primality.Base where open import AKS.Nat using (ℕ; _<_) open import AKS.Nat.GCD using (_∣_; _∤_) record IsPrime (p : ℕ) : Set where constructor IsPrime✓ field 1<p : 1 < p ∀i∣p[i≡p] : ∀ {i} → 1 < i → i ∣ p → i ≡ p record IsComposite (c : ℕ) : Set where constructor IsComposite✓ field p : ℕ p<c : p < c p-isPrime : IsPrime p p∣c : p ∣ c record Prime : Set where constructor Prime✓ field prime : ℕ isPrime : IsPrime prime record Composite : Set where constructor Composite✓ field composite : ℕ isComposite : IsComposite composite data Compositionality (n : ℕ) : Set where Composite✓ : IsComposite n → Compositionality n Prime✓ : (∀ {p} → p < n → IsPrime p → p ∤ n) → Compositionality n data Primality (n : ℕ) : Set where Composite✓ : IsComposite n → Primality n Prime✓ : IsPrime n → Primality n
{ "alphanum_fraction": 0.6467449306, "avg_line_length": 22.8536585366, "ext": "agda", "hexsha": "0146e586b99d5f7e8b6307c266bddbe8a1a2ce4c", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "ddad4c0d5f384a0219b2177461a68dae06952dde", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "mckeankylej/thesis", "max_forks_repo_path": "proofs/AKS/Primality/Base.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "ddad4c0d5f384a0219b2177461a68dae06952dde", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "mckeankylej/thesis", "max_issues_repo_path": "proofs/AKS/Primality/Base.agda", "max_line_length": 67, "max_stars_count": 1, "max_stars_repo_head_hexsha": "ddad4c0d5f384a0219b2177461a68dae06952dde", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "mckeankylej/thesis", "max_stars_repo_path": "proofs/AKS/Primality/Base.agda", "max_stars_repo_stars_event_max_datetime": "2020-12-01T22:38:27.000Z", "max_stars_repo_stars_event_min_datetime": "2020-12-01T22:38:27.000Z", "num_tokens": 322, "size": 937 }
module Properties.StepBeta where open import Data.List open import Data.List.All open import Data.Product open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Typing open import Syntax open import Global open import Channel open import Values open import Session open import Schedule open import ProcessSyntax open import ProcessRun open import Properties.Base -- V: (λx.e)v = e[v/x] -- let f = λx.e in let r = f v in E --> [let x = v in] let r = e in E mklhs : ∀ {Φ tin tout} (e : Expr (tin ∷ []) tout) (E : Expr (tout ∷ Φ) TUnit) → Expr (tin ∷ Φ) TUnit mklhs {Φ} e E = letbind (rght (split-all-right Φ)) (ulambda [] [] [] e) (letbind (left (left (split-all-right Φ))) (app (left (rght [])) (here []) (here [])) E) mkrhs : ∀ {Φ tin tout} (e : Expr (tin ∷ []) tout) (E : Expr (tout ∷ Φ) TUnit) → Expr (tin ∷ Φ) TUnit mkrhs {Φ} e E = letbind (left (split-all-right Φ)) e E reductionT : Set reductionT = ∀ {tin tout} (e : Expr (tin ∷ []) tout) (E : Expr (tout ∷ []) TUnit) (v : Val [] tin) → let ϱ = vcons ss-[] v (vnil []-inactive) in let lhs = run (left []) ss-[] (mklhs e E) ϱ (halt []-inactive UUnit) in let rhs = run (left []) ss-[] (mkrhs e E) ϱ (halt []-inactive UUnit) in restart (restart lhs) ≡ rhs reduction : reductionT reduction e E v with split-env (rght []) (vcons ss-[] v (vnil []-inactive)) ... | sperght = refl -- open reduction reduction-open-type : Set reduction-open-type = ∀ {Φ tin tout} (e : Expr (tin ∷ []) tout) (E : Expr (tout ∷ Φ) TUnit) (ϱ : VEnv [] (tin ∷ Φ)) → let lhs = run (left (split-all-left Φ)) ss-[] (mklhs e E) ϱ (halt []-inactive UUnit) in let rhs = run (left (split-all-left Φ)) ss-[] (mkrhs e E) ϱ (halt []-inactive UUnit) in restart (restart lhs) ≡ rhs reduction-open : reduction-open-type reduction-open {Φ} e E (vcons ss-[] v ϱ) rewrite split-rotate-lemma {Φ} | split-env-right-lemma0 ϱ with ssplit-compose3 ss-[] ss-[] ... | ssc3 rewrite split-env-right-lemma0 ϱ | split-rotate-lemma {Φ} = refl -- open reduction with split between closure and context mktype' : Set mktype' = ∀ {Φ Φ₁ Φ₂ tin tout} (sp : Split Φ Φ₁ Φ₂) (un-Φ₁ : All Unr Φ₁) (e : Expr (tin ∷ Φ₁) tout) (E : Expr (tout ∷ Φ₂) TUnit) → Expr (tin ∷ Φ) TUnit mklhs' : mktype' mklhs' {Φ} {Φ₁} {Φ₂} sp un-Φ₁ e E = letbind (rght sp) (ulambda (split-all-left Φ₁) un-Φ₁ [] e) (letbind (left (left (split-all-right Φ₂))) (app (left (rght [])) (here []) (here [])) E) mkrhs' : mktype' mkrhs' {Φ} {Φ₁} {Φ₂} sp un-Φ₁ e E = letbind (left sp) e E reduction-open-type' : Set reduction-open-type' = ∀ {Φ Φ₁ Φ₂ tin tout} (sp : Split Φ Φ₁ Φ₂) (un-Φ₁ : All Unr Φ₁) (e : Expr (tin ∷ Φ₁) tout) (E : Expr (tout ∷ Φ₂) TUnit) (ϱ : VEnv [] (tin ∷ Φ)) → let lhs = run (left (split-all-left Φ)) ss-[] (mklhs' sp un-Φ₁ e E) ϱ (halt []-inactive UUnit) in let rhs = run (left (split-all-left Φ)) ss-[] (mkrhs' sp un-Φ₁ e E) ϱ (halt []-inactive UUnit) in restart (restart lhs) ≡ rhs -- this runs into the split-from-disjoint, which was hacked into function application -- it's not clear if there's a way round -- hence the proposition needs to be proved with a more specific assumption {- reduction-open' : reduction-open-type' reduction-open' {Φ} {Φ₁} {Φ₂} sp un-Φ₁ e E (vcons ss-[] v ϱ) rewrite split-rotate-lemma' sp with split-env sp ϱ ... | ([] , []) , ss-[] , ϱ₁ , ϱ₂ rewrite split-env-left-lemma0 ϱ₁ with ssplit-compose3 ss-[] ss-[] ... | ssc3 rewrite split-env-right-lemma0 ϱ₂ with ssplit-compose3 ss-[] ss-[] ... | ssc3' rewrite split-rotate-lemma {Φ₂} = {!!} -} -- straightforward generalization of the inspect pattern record Reveal2_·_·_is_ {A B : Set} {C : A → B → Set} (f : (x : A) (y : B) → C x y) (x : A) (y : B) (z : C x y) : Set₁ where constructor [[_]] field eq : f x y ≡ z inspect2 : ∀ {A B : Set} {C : A → B → Set} (f : (x : A) (y : B) → C x y) (x : A) (y : B) → Reveal2 f · x · y is f x y inspect2 f x y = [[ refl ]] reduction-open-type'' : Set reduction-open-type'' = ∀ {Φ₁ Φ₂ tin tout} → let Φ,sp = split-from-disjoint Φ₁ Φ₂ in let Φ = proj₁ Φ,sp in let sp = proj₂ Φ,sp in (un-Φ₁ : All Unr Φ₁) (e : Expr (tin ∷ Φ₁) tout) (E : Expr (tout ∷ Φ₂) TUnit) (ϱ : VEnv [] (tin ∷ Φ)) → let lhs = run (left (split-all-left Φ)) ss-[] (mklhs' sp un-Φ₁ e E) ϱ (halt []-inactive UUnit) in let rhs = run (left (split-all-left Φ)) ss-[] (mkrhs' sp un-Φ₁ e E) ϱ (halt []-inactive UUnit) in restart (restart lhs) ≡ rhs reduction-open'' : reduction-open-type'' reduction-open'' {Φ₁} {Φ₂} un-Φ₁ e E (vcons ss-[] v ϱ) with split-from-disjoint Φ₁ Φ₂ | inspect2 split-from-disjoint Φ₁ Φ₂ ... | Φ , sp | [[ eq ]] rewrite split-rotate-lemma' sp with split-env sp ϱ ... | ([] , []) , ss-[] , ϱ₁ , ϱ₂ rewrite split-env-left-lemma0 ϱ₁ with ssplit-compose3 ss-[] ss-[] ... | ssc3 rewrite split-env-right-lemma0 ϱ₂ with ssplit-compose3 ss-[] ss-[] ... | ssc3' rewrite split-rotate-lemma {Φ₂} | eq = refl
{ "alphanum_fraction": 0.6022659511, "avg_line_length": 32.4580645161, "ext": "agda", "hexsha": "cc3d0adc2dafa303652653962e216d9f94657c6f", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "c2213909c8a308fb1c1c1e4e789d65ba36f6042c", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "peterthiemann/definitional-session", "max_forks_repo_path": "src/Properties/StepBeta.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "c2213909c8a308fb1c1c1e4e789d65ba36f6042c", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "peterthiemann/definitional-session", "max_issues_repo_path": "src/Properties/StepBeta.agda", "max_line_length": 101, "max_stars_count": 9, "max_stars_repo_head_hexsha": "c2213909c8a308fb1c1c1e4e789d65ba36f6042c", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "peterthiemann/definitional-session", "max_stars_repo_path": "src/Properties/StepBeta.agda", "max_stars_repo_stars_event_max_datetime": "2021-01-18T08:10:14.000Z", "max_stars_repo_stars_event_min_datetime": "2019-01-19T16:33:27.000Z", "num_tokens": 1966, "size": 5031 }
{-# OPTIONS --without-K --safe #-} module Categories.Category.Restriction.Instance.PartialFunctions where -- The Category of partial functions is a restriction category -- The proof is straightforward in the sense that it's all unwinding definitions, -- but also no-trivial in that they need to be unwound with care (a lot of -- case analyses with 'with' and inspect is used a lot). open import Data.Maybe using (Maybe; map; just; nothing; _>>=_) open import Data.Maybe.Properties open import Function using (const) open import Level using (Level) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; inspect; [_]) open import Categories.Category.Core using (Category) open import Categories.Category.Instance.PartialFunctions using (PartialFunctions) open import Categories.Category.Restriction using (Restriction) private variable o : Level A B C : Set o Restriction-PF : ∀ {o} → Restriction (PartialFunctions o) Restriction-PF {o} = record { _↓ = λ f x → map (const x) (f x) ; pidʳ = pidʳ ; ↓-comm = λ {_} {_} {_} {g} {f} → ↓-comm {g = g} {f} ; ↓-denestʳ = λ {_} {_} {_} {f} {g} → ↓-denestʳ {f = f} {g} ; ↓-skew-comm = λ {_} {_} {_} {g} {f} → ↓-skew-comm {g = g} {f} ; ↓-cong = ↓-cong } where open Category (PartialFunctions o) _↓ : (A → Maybe B) → (A → Maybe A) _↓ = λ f x → map (const x) (f x) pidʳ : {f : A → Maybe B} → f ∘ f ↓ ≈ f pidʳ {f = f} x with f x | inspect f x ... | just z | [ eq ] = eq ... | nothing | _ = refl ↓-comm : {g : A → Maybe C} {f : A → Maybe B} → g ↓ ∘ f ↓ ≈ f ↓ ∘ g ↓ ↓-comm {g = g} {f} x with f x | g x | inspect f x | inspect g x ... | just b | just b′ | [ fx=jb ] | [ gx=jb′ ] rewrite fx=jb | gx=jb′ = refl ... | just b | nothing | _ | [ eq ] rewrite eq = refl ... | nothing | just b′ | [ eq ] | _ rewrite eq = refl ... | nothing | nothing | _ | _ = refl ↓-denestʳ : {A B C : Obj} {f : A ⇒ B} {g : A ⇒ C} → (g ∘ f ↓) ↓ ≈ g ↓ ∘ f ↓ ↓-denestʳ {f = f} a with f a ... | just b = refl ... | nothing = refl ↓-skew-comm : {A B C : Obj} {g : A ⇒ B} {f : C ⇒ A} → g ↓ ∘ f ≈ f ∘ (g ∘ f) ↓ ↓-skew-comm {g = g} {f = f} a with f a | inspect f a ... | just b | [ eq ] with g b ... | just c = sym eq ... | nothing = refl ↓-skew-comm _ | nothing | _ = refl ↓-cong : {A B : Obj} {f g : A ⇒ B} → f ≈ g → f ↓ ≈ g ↓ ↓-cong eq a rewrite eq a = refl
{ "alphanum_fraction": 0.5440938511, "avg_line_length": 38.0307692308, "ext": "agda", "hexsha": "2e51af9035330a1af8ab4e4881007ca9eb9b0c38", "lang": "Agda", "max_forks_count": 64, "max_forks_repo_forks_event_max_datetime": "2022-03-14T02:00:59.000Z", "max_forks_repo_forks_event_min_datetime": "2019-06-02T16:58:15.000Z", "max_forks_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Code-distancing/agda-categories", "max_forks_repo_path": "src/Categories/Category/Restriction/Instance/PartialFunctions.agda", "max_issues_count": 236, "max_issues_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_issues_repo_issues_event_max_datetime": "2022-03-28T14:31:43.000Z", "max_issues_repo_issues_event_min_datetime": "2019-06-01T14:53:54.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Code-distancing/agda-categories", "max_issues_repo_path": "src/Categories/Category/Restriction/Instance/PartialFunctions.agda", "max_line_length": 86, "max_stars_count": 279, "max_stars_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Trebor-Huang/agda-categories", "max_stars_repo_path": "src/Categories/Category/Restriction/Instance/PartialFunctions.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-22T00:40:14.000Z", "max_stars_repo_stars_event_min_datetime": "2019-06-01T14:36:40.000Z", "num_tokens": 868, "size": 2472 }
{-# OPTIONS --cubical --safe #-} module Data.Maybe.Sugar where open import Prelude open import Data.Maybe infixl 4 _<*>_ _>>=_ : Maybe A → (A → Maybe B) → Maybe B nothing >>= f = nothing just x >>= f = f x pure : A → Maybe A pure = just _<*>_ : Maybe (A → B) → Maybe A → Maybe B nothing <*> xs = nothing just f <*> nothing = nothing just f <*> just x = just (f x) _>>_ : Maybe A → Maybe B → Maybe B nothing >> _ = nothing just _ >> y = y guard : Bool → Maybe ⊤ guard false = nothing guard true = just tt _<|>_ : Maybe A → Maybe A → Maybe A nothing <|> ys = ys xs@(just _) <|> _ = xs
{ "alphanum_fraction": 0.5534591195, "avg_line_length": 18.7058823529, "ext": "agda", "hexsha": "26a8c582d72a32d0f3c46a181b938340314ff501", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-11T12:30:21.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-11T12:30:21.000Z", "max_forks_repo_head_hexsha": "97a3aab1282b2337c5f43e2cfa3fa969a94c11b7", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "oisdk/agda-playground", "max_forks_repo_path": "Data/Maybe/Sugar.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "97a3aab1282b2337c5f43e2cfa3fa969a94c11b7", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "oisdk/agda-playground", "max_issues_repo_path": "Data/Maybe/Sugar.agda", "max_line_length": 41, "max_stars_count": 6, "max_stars_repo_head_hexsha": "97a3aab1282b2337c5f43e2cfa3fa969a94c11b7", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "oisdk/agda-playground", "max_stars_repo_path": "Data/Maybe/Sugar.agda", "max_stars_repo_stars_event_max_datetime": "2021-11-16T08:11:34.000Z", "max_stars_repo_stars_event_min_datetime": "2020-09-11T17:45:41.000Z", "num_tokens": 208, "size": 636 }
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.DStructures.Structures.Universe where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import Cubical.Data.Sigma open import Cubical.DStructures.Base open import Cubical.DStructures.Meta.Properties private variable ℓ ℓ' ℓ'' ℓ₁ ℓ₁' ℓ₁'' ℓ₂ ℓA ℓ≅A ℓB ℓ≅B ℓ≅ᴰ : Level -- Universes and equivalences form a URGStr 𝒮-universe : URGStr (Type ℓ) ℓ 𝒮-universe = make-𝒮 {_≅_ = _≃_} idEquiv λ A → isContrRespectEquiv (Σ-cong-equiv-snd (λ A' → isoToEquiv (equivInv A' A))) (equivContr' A) where module _ (A : Type ℓ) where equivInv : (A' : Type ℓ) → Iso (A ≃ A') (A' ≃ A) Iso.fun (equivInv A') = invEquiv Iso.inv (equivInv A') = invEquiv Iso.leftInv (equivInv A') = λ e → equivEq (invEquiv (invEquiv e)) e (funExt (λ x → refl)) Iso.rightInv (equivInv A') = λ e → equivEq (invEquiv (invEquiv e)) e (funExt (λ x → refl)) equivContr' : isContr (Σ[ A' ∈ Type ℓ ] A' ≃ A) equivContr' = EquivContr A 𝒮ᴰ-pointed : {ℓ : Level} → URGStrᴰ (𝒮-universe {ℓ}) (λ A → A) ℓ 𝒮ᴰ-pointed {ℓ} = make-𝒮ᴰ (λ a e b → equivFun e a ≡ b) (λ _ → refl) p where p : (A : Type ℓ) (a : A) → isContr (Σ[ b ∈ A ] a ≡ b) p _ a = isContrSingl a 𝒮-pointed : {ℓ : Level} → URGStr (Σ[ A ∈ Type ℓ ] A) ℓ 𝒮-pointed = ∫⟨ 𝒮-universe ⟩ 𝒮ᴰ-pointed
{ "alphanum_fraction": 0.6071205497, "avg_line_length": 34.0638297872, "ext": "agda", "hexsha": "3b5a597106cdf0fad2ed68f9e40df17e409479ac", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "c345dc0c49d3950dc57f53ca5f7099bb53a4dc3a", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Schippmunk/cubical", "max_forks_repo_path": "Cubical/DStructures/Structures/Universe.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "c345dc0c49d3950dc57f53ca5f7099bb53a4dc3a", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Schippmunk/cubical", "max_issues_repo_path": "Cubical/DStructures/Structures/Universe.agda", "max_line_length": 96, "max_stars_count": null, "max_stars_repo_head_hexsha": "c345dc0c49d3950dc57f53ca5f7099bb53a4dc3a", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Schippmunk/cubical", "max_stars_repo_path": "Cubical/DStructures/Structures/Universe.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 617, "size": 1601 }
------------------------------------------------------------------------ -- The Agda standard library -- -- Property related to Grouped ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.List.Relation.Unary.Grouped.Properties where open import Data.Bool using (true; false) open import Data.List open import Data.List.Relation.Unary.All as All using (All; []; _∷_) import Data.List.Relation.Unary.All.Properties as All open import Data.List.Relation.Unary.AllPairs as AllPairs using (AllPairs; []; _∷_) open import Data.List.Relation.Unary.Grouped open import Function using (_∘_; _⇔_; Equivalence) open import Function.Equality using (_⟨$⟩_) open import Relation.Binary as B using (REL; Rel) open import Relation.Unary as U using (Pred) open import Relation.Nullary using (¬_; does; yes; no) open import Relation.Nullary.Negation using (contradiction) open import Level private variable a b c p q : Level A : Set a B : Set b C : Set c ------------------------------------------------------------------------ -- map module _ (P : Rel A p) (Q : Rel B q) where map⁺ : ∀ {f xs} → (∀ {x y} → P x y ⇔ Q (f x) (f y)) → Grouped P xs → Grouped Q (map f xs) map⁺ {f} {[]} P⇔Q [] = [] map⁺ {f} {x ∷ xs} P⇔Q (all[¬Px,xs] ∷≉ g) = aux all[¬Px,xs] ∷≉ map⁺ P⇔Q g where aux : ∀ {ys} → All (λ y → ¬ P x y) ys → All (λ y → ¬ Q (f x) y) (map f ys) aux [] = [] aux (py ∷ pys) = py ∘ Equivalence.g P⇔Q ∷ aux pys map⁺ {f} {x₁ ∷ x₂ ∷ xs} P⇔Q (Px₁x₂ ∷≈ g) = Equivalence.f P⇔Q Px₁x₂ ∷≈ map⁺ P⇔Q g map⁻ : ∀ {f xs} → (∀ {x y} → P x y ⇔ Q (f x) (f y)) → Grouped Q (map f xs) → Grouped P xs map⁻ {f} {[]} P⇔Q [] = [] map⁻ {f} {x ∷ []} P⇔Q ([] ∷≉ []) = [] ∷≉ [] map⁻ {f} {x₁ ∷ x₂ ∷ xs} P⇔Q (all[¬Qx,xs] ∷≉ g) = aux all[¬Qx,xs] ∷≉ map⁻ P⇔Q g where aux : ∀ {ys} → All (λ y → ¬ Q (f x₁) y) (map f ys) → All (λ y → ¬ P x₁ y) ys aux {[]} [] = [] aux {y ∷ ys} (py ∷ pys) = py ∘ Equivalence.f P⇔Q ∷ aux pys map⁻ {f} {x₁ ∷ x₂ ∷ xs} P⇔Q (Qx₁x₂ ∷≈ g) = Equivalence.g P⇔Q Qx₁x₂ ∷≈ map⁻ P⇔Q g ------------------------------------------------------------------------ -- [_] module _ (P : Rel A p) where [_]⁺ : ∀ x → Grouped P [ x ] [_]⁺ x = [] ∷≉ [] ------------------------------------------------------------------------ -- derun module _ {P : Rel A p} (P? : B.Decidable P) where grouped[xs]⇒unique[derun[xs]] : ∀ xs → Grouped P xs → AllPairs (λ x y → ¬ P x y) (derun P? xs) grouped[xs]⇒unique[derun[xs]] [] [] = [] grouped[xs]⇒unique[derun[xs]] (x ∷ []) ([] ∷≉ []) = [] ∷ [] grouped[xs]⇒unique[derun[xs]] (x ∷ y ∷ xs) (all[¬Px,y∷xs]@(¬Pxy ∷ _) ∷≉ grouped[y∷xs]) with P? x y ... | yes Pxy = contradiction Pxy ¬Pxy ... | no _ = All.derun⁺ P? all[¬Px,y∷xs] ∷ grouped[xs]⇒unique[derun[xs]] (y ∷ xs) grouped[y∷xs] grouped[xs]⇒unique[derun[xs]] (x ∷ y ∷ xs) (Pxy ∷≈ grouped[xs]) with P? x y ... | yes _ = grouped[xs]⇒unique[derun[xs]] (y ∷ xs) grouped[xs] ... | no ¬Pxy = contradiction Pxy ¬Pxy
{ "alphanum_fraction": 0.490241482, "avg_line_length": 39.7763157895, "ext": "agda", "hexsha": "5664d6f24f3cde8ab242e5b91540b7ed78d728ec", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "DreamLinuxer/popl21-artifact", "max_forks_repo_path": "agda-stdlib/src/Data/List/Relation/Unary/Grouped/Properties.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "DreamLinuxer/popl21-artifact", "max_issues_repo_path": "agda-stdlib/src/Data/List/Relation/Unary/Grouped/Properties.agda", "max_line_length": 101, "max_stars_count": 5, "max_stars_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "DreamLinuxer/popl21-artifact", "max_stars_repo_path": "agda-stdlib/src/Data/List/Relation/Unary/Grouped/Properties.agda", "max_stars_repo_stars_event_max_datetime": "2020-10-10T21:41:32.000Z", "max_stars_repo_stars_event_min_datetime": "2020-10-07T12:07:53.000Z", "num_tokens": 1182, "size": 3023 }
------------------------------------------------------------------------------ -- Properties related with the forest type ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOTC.Program.Mirror.Forest.PropertiesATP where open import Common.FOL.Relation.Binary.EqReasoning open import FOTC.Base open import FOTC.Base.List open import FOTC.Base.List.PropertiesATP using ( ∷-rightCong ) open import FOTC.Data.List open import FOTC.Data.List.PropertiesATP using ( ++-leftIdentity ; mapCong₂ ; ++-leftCong ; reverse-[x]≡[x] ) open import FOTC.Program.Mirror.Forest.TotalityATP open import FOTC.Program.Mirror.Type ------------------------------------------------------------------------------ ++-rightIdentity : ∀ {xs} → Forest xs → xs ++ [] ≡ xs ++-rightIdentity fnil = ++-leftIdentity [] ++-rightIdentity (fcons {x} {xs} Tx Fxs) = prf (++-rightIdentity Fxs) where postulate prf : xs ++ [] ≡ xs → (x ∷ xs) ++ [] ≡ x ∷ xs {-# ATP prove prf #-} ++-assoc : ∀ {xs} → Forest xs → ∀ ys zs → (xs ++ ys) ++ zs ≡ xs ++ (ys ++ zs) ++-assoc fnil ys zs = prf where postulate prf : ([] ++ ys) ++ zs ≡ [] ++ ys ++ zs {-# ATP prove prf #-} ++-assoc (fcons {x} {xs} Tx Fxs) ys zs = prf (++-assoc Fxs ys zs) where postulate prf : (xs ++ ys) ++ zs ≡ xs ++ ys ++ zs → ((x ∷ xs) ++ ys) ++ zs ≡ (x ∷ xs) ++ ys ++ zs {-# ATP prove prf #-} -- We don't use an automatic proof, because it is necessary to erase a -- proof term which we don't know how to erase. map-++ : ∀ f {xs} → (∀ {x} → Tree x → Tree (f · x)) → Forest xs → ∀ ys → map f (xs ++ ys) ≡ map f xs ++ map f ys map-++ f h fnil ys = map f ([] ++ ys) ≡⟨ mapCong₂ (++-leftIdentity ys) ⟩ map f ys ≡⟨ sym (++-leftIdentity (map f ys)) ⟩ [] ++ map f ys ≡⟨ ++-leftCong (sym (map-[] f)) ⟩ map f [] ++ map f ys ∎ map-++ f h (fcons {x} {xs} Tx Fxs) ys = map f ((x ∷ xs) ++ ys) ≡⟨ mapCong₂ (++-∷ x xs ys) ⟩ map f (x ∷ xs ++ ys) ≡⟨ map-∷ f x (xs ++ ys) ⟩ f · x ∷ map f (xs ++ ys) ≡⟨ ∷-rightCong (map-++ f h Fxs ys) ⟩ f · x ∷ (map f xs ++ map f ys) ≡⟨ sym (++-∷ (f · x) (map f xs) (map f ys)) ⟩ (f · x ∷ map f xs) ++ map f ys ≡⟨ ++-leftCong (sym (map-∷ f x xs)) ⟩ map f (x ∷ xs) ++ map f ys ∎ rev-++ : ∀ {xs} → Forest xs → ∀ ys → rev xs ys ≡ rev xs [] ++ ys rev-++ fnil ys = prf where postulate prf : rev [] ys ≡ rev [] [] ++ ys {-# ATP prove prf #-} rev-++ (fcons {x} {xs} Tx Fxs) ys = prf (rev-++ Fxs (x ∷ ys)) (rev-++ Fxs (x ∷ [])) where postulate prf : rev xs (x ∷ ys) ≡ rev xs [] ++ x ∷ ys → rev xs (x ∷ []) ≡ rev xs [] ++ x ∷ [] → rev (x ∷ xs) ys ≡ rev (x ∷ xs) [] ++ ys {-# ATP prove prf ++-assoc rev-Forest #-} reverse-++ : ∀ {xs ys} → Forest xs → Forest ys → reverse (xs ++ ys) ≡ reverse ys ++ reverse xs reverse-++ {ys = ys} fnil Fys = prf where postulate prf : reverse ([] ++ ys) ≡ reverse ys ++ reverse [] {-# ATP prove prf ++-rightIdentity reverse-Forest #-} reverse-++ (fcons {x} {xs} Tx Fxs) fnil = prf where postulate prf : reverse ((x ∷ xs) ++ []) ≡ reverse [] ++ reverse (x ∷ xs) {-# ATP prove prf ++-rightIdentity #-} reverse-++ (fcons {x} {xs} Tx Fxs) (fcons {y} {ys} Ty Fys) = prf (reverse-++ Fxs (fcons Ty Fys)) where postulate prf : reverse (xs ++ y ∷ ys) ≡ reverse (y ∷ ys) ++ reverse xs → reverse ((x ∷ xs) ++ y ∷ ys) ≡ reverse (y ∷ ys) ++ reverse (x ∷ xs) {-# ATP prove prf reverse-Forest ++-Forest rev-++ ++-assoc #-} reverse-∷ : ∀ {x ys} → Tree x → Forest ys → reverse (x ∷ ys) ≡ reverse ys ++ (x ∷ []) reverse-∷ {x} Tx fnil = prf where postulate prf : reverse (x ∷ []) ≡ reverse [] ++ x ∷ [] {-# ATP prove prf #-} reverse-∷ {x} Tx (fcons {y} {ys} Ty Fys) = prf where postulate prf : reverse (x ∷ y ∷ ys) ≡ reverse (y ∷ ys) ++ x ∷ [] {-# ATP prove prf reverse-[x]≡[x] reverse-++ #-}
{ "alphanum_fraction": 0.4687426832, "avg_line_length": 37.1391304348, "ext": "agda", "hexsha": "2c949a9f71498c4769c475b4ed8d73bbf0b7dce3", "lang": "Agda", "max_forks_count": 3, "max_forks_repo_forks_event_max_datetime": "2018-03-14T08:50:00.000Z", "max_forks_repo_forks_event_min_datetime": "2016-09-19T14:18:30.000Z", "max_forks_repo_head_hexsha": "2fc9f2b81052a2e0822669f02036c5750371b72d", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "asr/fotc", "max_forks_repo_path": "src/fot/FOTC/Program/Mirror/Forest/PropertiesATP.agda", "max_issues_count": 2, "max_issues_repo_head_hexsha": "2fc9f2b81052a2e0822669f02036c5750371b72d", "max_issues_repo_issues_event_max_datetime": "2017-01-01T14:34:26.000Z", "max_issues_repo_issues_event_min_datetime": "2016-10-12T17:28:16.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "asr/fotc", "max_issues_repo_path": "src/fot/FOTC/Program/Mirror/Forest/PropertiesATP.agda", "max_line_length": 78, "max_stars_count": 11, "max_stars_repo_head_hexsha": "2fc9f2b81052a2e0822669f02036c5750371b72d", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/fotc", "max_stars_repo_path": "src/fot/FOTC/Program/Mirror/Forest/PropertiesATP.agda", "max_stars_repo_stars_event_max_datetime": "2021-09-12T16:09:54.000Z", "max_stars_repo_stars_event_min_datetime": "2015-09-03T20:53:42.000Z", "num_tokens": 1453, "size": 4271 }
------------------------------------------------------------------------ -- The Agda standard library -- -- Some theory for commutative semigroup ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Algebra using (CommutativeSemigroup) module Algebra.Properties.CommutativeSemigroup {a ℓ} (CS : CommutativeSemigroup a ℓ) where open CommutativeSemigroup CS open import Relation.Binary.Reasoning.Setoid setoid ------------------------------------------------------------------------------ -- Re-export the contents of semigroup open import Algebra.Properties.Semigroup semigroup public ------------------------------------------------------------------------------ -- Permutation laws for _∙_ for three factors. ------------------------------------------------------------------------------ -- Partitions (1,1). -- There are five nontrivial permutations. ------------------------------------------------------------------------------ x∙yz≈y∙xz : ∀ x y z → x ∙ (y ∙ z) ≈ y ∙ (x ∙ z) x∙yz≈y∙xz x y z = begin x ∙ (y ∙ z) ≈⟨ sym (assoc x y z) ⟩ (x ∙ y) ∙ z ≈⟨ ∙-congʳ (comm x y) ⟩ (y ∙ x) ∙ z ≈⟨ assoc y x z ⟩ y ∙ (x ∙ z) ∎ x∙yz≈z∙yx : ∀ x y z → x ∙ (y ∙ z) ≈ z ∙ (y ∙ x) x∙yz≈z∙yx x y z = begin x ∙ (y ∙ z) ≈⟨ ∙-congˡ (comm y z) ⟩ x ∙ (z ∙ y) ≈⟨ x∙yz≈y∙xz x z y ⟩ z ∙ (x ∙ y) ≈⟨ ∙-congˡ (comm x y) ⟩ z ∙ (y ∙ x) ∎ x∙yz≈x∙zy : ∀ x y z → x ∙ (y ∙ z) ≈ x ∙ (z ∙ y) x∙yz≈x∙zy _ y z = ∙-congˡ (comm y z) x∙yz≈y∙zx : ∀ x y z → x ∙ (y ∙ z) ≈ y ∙ (z ∙ x) x∙yz≈y∙zx x y z = begin x ∙ (y ∙ z) ≈⟨ comm x _ ⟩ (y ∙ z) ∙ x ≈⟨ assoc y z x ⟩ y ∙ (z ∙ x) ∎ x∙yz≈z∙xy : ∀ x y z → x ∙ (y ∙ z) ≈ z ∙ (x ∙ y) x∙yz≈z∙xy x y z = begin x ∙ (y ∙ z) ≈⟨ sym (assoc x y z) ⟩ (x ∙ y) ∙ z ≈⟨ comm _ z ⟩ z ∙ (x ∙ y) ∎ ------------------------------------------------------------------------------ -- Partitions (1,2). -- These permutation laws are proved by composing the proofs for -- partitions (1,1) with \p → trans p (sym (assoc _ _ _)). ------------------------------------------------------------------------------ x∙yz≈yx∙z : ∀ x y z → x ∙ (y ∙ z) ≈ (y ∙ x) ∙ z x∙yz≈yx∙z x y z = trans (x∙yz≈y∙xz x y z) (sym (assoc y x z)) x∙yz≈zy∙x : ∀ x y z → x ∙ (y ∙ z) ≈ (z ∙ y) ∙ x x∙yz≈zy∙x x y z = trans (x∙yz≈z∙yx x y z) (sym (assoc z y x)) x∙yz≈xz∙y : ∀ x y z → x ∙ (y ∙ z) ≈ (x ∙ z) ∙ y x∙yz≈xz∙y x y z = trans (x∙yz≈x∙zy x y z) (sym (assoc x z y)) x∙yz≈yz∙x : ∀ x y z → x ∙ (y ∙ z) ≈ (y ∙ z) ∙ x x∙yz≈yz∙x x y z = trans (x∙yz≈y∙zx _ _ _) (sym (assoc y z x)) x∙yz≈zx∙y : ∀ x y z → x ∙ (y ∙ z) ≈ (z ∙ x) ∙ y x∙yz≈zx∙y x y z = trans (x∙yz≈z∙xy x y z) (sym (assoc z x y)) ------------------------------------------------------------------------------ -- Partitions (2,1). -- Their laws are proved by composing proofs for partitions (1,1) with -- trans (assoc x y z). ------------------------------------------------------------------------------ xy∙z≈y∙xz : ∀ x y z → (x ∙ y) ∙ z ≈ y ∙ (x ∙ z) xy∙z≈y∙xz x y z = trans (assoc x y z) (x∙yz≈y∙xz x y z) xy∙z≈z∙yx : ∀ x y z → (x ∙ y) ∙ z ≈ z ∙ (y ∙ x) xy∙z≈z∙yx x y z = trans (assoc x y z) (x∙yz≈z∙yx x y z) xy∙z≈x∙zy : ∀ x y z → (x ∙ y) ∙ z ≈ x ∙ (z ∙ y) xy∙z≈x∙zy x y z = trans (assoc x y z) (x∙yz≈x∙zy x y z) xy∙z≈y∙zx : ∀ x y z → (x ∙ y) ∙ z ≈ y ∙ (z ∙ x) xy∙z≈y∙zx x y z = trans (assoc x y z) (x∙yz≈y∙zx x y z) xy∙z≈z∙xy : ∀ x y z → (x ∙ y) ∙ z ≈ z ∙ (x ∙ y) xy∙z≈z∙xy x y z = trans (assoc x y z) (x∙yz≈z∙xy x y z) ------------------------------------------------------------------------------ -- Partitions (2,2). -- These proofs are by composing with the proofs for (2,1). ------------------------------------------------------------------------------ xy∙z≈yx∙z : ∀ x y z → (x ∙ y) ∙ z ≈ (y ∙ x) ∙ z xy∙z≈yx∙z x y z = trans (xy∙z≈y∙xz _ _ _) (sym (assoc y x z)) xy∙z≈zy∙x : ∀ x y z → (x ∙ y) ∙ z ≈ (z ∙ y) ∙ x xy∙z≈zy∙x x y z = trans (xy∙z≈z∙yx x y z) (sym (assoc z y x)) xy∙z≈xz∙y : ∀ x y z → (x ∙ y) ∙ z ≈ (x ∙ z) ∙ y xy∙z≈xz∙y x y z = trans (xy∙z≈x∙zy x y z) (sym (assoc x z y)) xy∙z≈yz∙x : ∀ x y z → (x ∙ y) ∙ z ≈ (y ∙ z) ∙ x xy∙z≈yz∙x x y z = trans (xy∙z≈y∙zx x y z) (sym (assoc y z x)) xy∙z≈zx∙y : ∀ x y z → (x ∙ y) ∙ z ≈ (z ∙ x) ∙ y xy∙z≈zx∙y x y z = trans (xy∙z≈z∙xy x y z) (sym (assoc z x y))
{ "alphanum_fraction": 0.3839925977, "avg_line_length": 35.1463414634, "ext": "agda", "hexsha": "1516fd4c984918f8919ef29f92bd512540b945b8", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "DreamLinuxer/popl21-artifact", "max_forks_repo_path": "agda-stdlib/src/Algebra/Properties/CommutativeSemigroup.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "DreamLinuxer/popl21-artifact", "max_issues_repo_path": "agda-stdlib/src/Algebra/Properties/CommutativeSemigroup.agda", "max_line_length": 78, "max_stars_count": 5, "max_stars_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "DreamLinuxer/popl21-artifact", "max_stars_repo_path": "agda-stdlib/src/Algebra/Properties/CommutativeSemigroup.agda", "max_stars_repo_stars_event_max_datetime": "2020-10-10T21:41:32.000Z", "max_stars_repo_stars_event_min_datetime": "2020-10-07T12:07:53.000Z", "num_tokens": 1986, "size": 4323 }
open import Relation.Binary.Core module TreeSort.Impl2 {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) where open import BBSTree _≤_ open import Bound.Total A open import Bound.Total.Order _≤_ open import Data.List open import Data.Sum insert : {x : A}{b t : Bound} → LeB b (val x) → LeB (val x) t → BBSTree b t → BBSTree b t insert b≤x x≤t (bslf _) = bsnd b≤x x≤t (bslf b≤x) (bslf x≤t) insert {x = x} b≤x x≤t (bsnd {x = y} b≤y y≤t l r) with tot≤ x y ... | inj₁ x≤y = bsnd b≤y y≤t (insert b≤x (lexy x≤y) l) r ... | inj₂ y≤x = bsnd b≤y y≤t l (insert (lexy y≤x) x≤t r) treeSort : List A → BBSTree bot top treeSort [] = bslf lebx treeSort (x ∷ xs) = insert {x = x} lebx lext (treeSort xs)
{ "alphanum_fraction": 0.5832205683, "avg_line_length": 27.3703703704, "ext": "agda", "hexsha": "669efe0c46ccb7fb374adfe09c5f4f3a25e44d93", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "b8d428bccbdd1b13613e8f6ead6c81a8f9298399", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "bgbianchi/sorting", "max_forks_repo_path": "agda/TreeSort/Impl2.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "b8d428bccbdd1b13613e8f6ead6c81a8f9298399", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "bgbianchi/sorting", "max_issues_repo_path": "agda/TreeSort/Impl2.agda", "max_line_length": 89, "max_stars_count": 6, "max_stars_repo_head_hexsha": "b8d428bccbdd1b13613e8f6ead6c81a8f9298399", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "bgbianchi/sorting", "max_stars_repo_path": "agda/TreeSort/Impl2.agda", "max_stars_repo_stars_event_max_datetime": "2021-08-24T22:11:15.000Z", "max_stars_repo_stars_event_min_datetime": "2015-05-21T12:50:35.000Z", "num_tokens": 320, "size": 739 }
open import Oscar.Prelude open import Oscar.Class.Successor₀ open import Oscar.Class.Successor₁ open import Oscar.Class.Injectivity open import Oscar.Class.Pure module Oscar.Class.Thickandthin where module _ {x} {X : Ø x} {a} (A : X → Ø a) {b} (B : X → Ø b) where record [𝓣hin] : Ø₀ where no-eta-equality constructor ∁ module _ ⦃ _ : 𝓢uccessor₀ X ⦄ where 𝔱hin : ∀ (m : X) → A (⇑₀ m) → B m → Ø b 𝔱hin m = λ _ _ → B (⇑₀ m) 𝓽hin = ∀ {m : X} → A (⇑₀ m) → B m → B (⇑₀ m) record 𝓣hin ⦃ _ : [𝓣hin] ⦄ : Ø x ∙̂ a ∙̂ b where field thin : 𝓽hin instance `𝓘njection₂ : ∀ {m} → 𝓘njection₂ (𝔱hin m) `𝓘njection₂ = ∁ thin open 𝓣hin ⦃ … ⦄ public module _ {x} {X : Ø x} {a} (A : X → Ø a) {b} (B : X → Ø b) where record [𝓣hick] : Ø₀ where no-eta-equality constructor ∁ module _ ⦃ _ : 𝓢uccessor₀ X ⦄ where 𝓽hick = ∀ {m} → A m → B (⇑₀ m) → B m record 𝓣hick ⦃ _ : [𝓣hick] ⦄ : Ø x ∙̂ a ∙̂ b where field thick : 𝓽hick open 𝓣hick ⦃ … ⦄ public module _ {x} {X : Ø x} {a} (A : X → Ø a) {b} (B : X → Ø b) {ℓ} (_≈_ : ∀ {x} → B x → B x → Ø ℓ) where record [𝓣hick/thin=1] : Ø₀ where no-eta-equality constructor ∁ module _ ⦃ _ : 𝓢uccessor₀ X ⦄ ⦃ _ : [𝓢uccessor₁] A ⦄ ⦃ _ : 𝓢uccessor₁ A ⦄ ⦃ _ : [𝓣hin] A B ⦄ ⦃ _ : 𝓣hin A B ⦄ ⦃ _ : [𝓣hick] A B ⦄ ⦃ _ : 𝓣hick A B ⦄ where 𝓽hick/thin=1 = ∀ {m} (x : A m) (y : B m) → thick x (thin (⇑₁ x) y) ≈ y record 𝓣hick/thin=1 : Ø x ∙̂ a ∙̂ b ∙̂ ℓ where field thick/thin=1 : 𝓽hick/thin=1 open 𝓣hick/thin=1 ⦃ … ⦄ public module _ {x} {X : Ø x} {a} (A : X → Ø a) {b} (B : X → Ø b) {c} (C : Ø b → Ø c) where record [𝓒heck] : Ø₀ where no-eta-equality constructor ∁ module _ ⦃ _ : 𝓢uccessor₀ X ⦄ where 𝓬heck = ∀ {m} → A (⇑₀ m) → B (⇑₀ m) → C (B m) record 𝓒heck ⦃ _ : [𝓒heck] ⦄ : Ø x ∙̂ a ∙̂ b ∙̂ c where field check : 𝓬heck open 𝓒heck ⦃ … ⦄ public check[_] : ∀ {x} {X : Ø x} {a} {A : X → Ø a} {b} {B : X → Ø b} {c} (C : Ø b → Ø c) ⦃ _ : [𝓒heck] A B C ⦄ ⦃ _ : 𝓢uccessor₀ X ⦄ ⦃ _ : 𝓒heck A B C ⦄ → 𝓬heck A B C check[ _ ] = check module _ {x} {X : Ø x} {a} (A : X → Ø a) {b} (B : X → Ø b) {c} (C : Ø b → Ø c) {ℓ} (_≈_ : ∀ {x} → C (B x) → C (B x) → Ø ℓ) where record [𝓒heck/thin=1] : Ø₀ where no-eta-equality constructor ∁ module _ ⦃ _ : 𝓢uccessor₀ X ⦄ ⦃ _ : [𝓣hin] A B ⦄ ⦃ _ : 𝓣hin A B ⦄ ⦃ _ : [𝓒heck] A B C ⦄ ⦃ _ : 𝓒heck A B C ⦄ ⦃ _ : 𝓟ure C ⦄ where 𝓬heck/thin=1 = ∀ {n} (x : A (⇑₀ n)) (y : B n) → check x (thin x y) ≈ pure y record 𝓒heck/thin=1 ⦃ _ : [𝓒heck/thin=1] ⦄ : Ø x ∙̂ a ∙̂ b ∙̂ c ∙̂ ℓ where field check/thin=1 : 𝓬heck/thin=1 open 𝓒heck/thin=1 ⦃ … ⦄ public check/thin=1[_] : ∀ {x} {X : Ø x} {a} {A : X → Ø a} {b} {B : X → Ø b} {c} {C : Ø b → Ø c} {ℓ} (_≈_ : ∀ {x} → C (B x) → C (B x) → Ø ℓ) ⦃ _ : 𝓢uccessor₀ X ⦄ ⦃ _ : [𝓣hin] A B ⦄ ⦃ _ : 𝓣hin A B ⦄ ⦃ _ : [𝓒heck] A B C ⦄ ⦃ _ : 𝓒heck A B C ⦄ ⦃ _ : 𝓟ure C ⦄ ⦃ _ : [𝓒heck/thin=1] A B C _≈_ ⦄ ⦃ _ : 𝓒heck/thin=1 A B C _≈_ ⦄ → 𝓬heck/thin=1 A B C _≈_ check/thin=1[ _ ] = check/thin=1 record IsThickandthin {x a b c ℓb ℓc} {X : Ø x} (A : X → Ø a) (B : X → Ø b) (_≈B_ : ∀ {x} → B x → B x → Ø ℓb) (C : Ø b → Ø c) (_≈C_ : ∀ {x} → C (B x) → C (B x) → Ø ℓc) : Ø x ∙̂ a ∙̂ ↑̂ b ∙̂ ℓb ∙̂ c ∙̂ ℓc where constructor ∁ field overlap ⦃ `𝓢uccessor₀ ⦄ : 𝓢uccessor₀ X overlap ⦃ `[𝓢uccessor₁] ⦄ : [𝓢uccessor₁] A overlap ⦃ `𝓢uccessor₁ ⦄ : 𝓢uccessor₁ A overlap ⦃ `[𝓣hick] ⦄ : [𝓣hick] A B overlap ⦃ `𝓣hick ⦄ : 𝓣hick A B overlap ⦃ `[𝓣hin] ⦄ : [𝓣hin] A B overlap ⦃ `𝓣hin ⦄ : 𝓣hin A B overlap ⦃ `[𝓘njectivity₂,₁] ⦄ : ∀ {m} → [𝓘njectivity₂,₁] (𝔱hin A B m) _≈B_ _≈B_ overlap ⦃ `𝓘njectivity₂,₁ ⦄ : ∀ {m} → 𝓘njectivity₂,₁ (𝔱hin A B m) _≈B_ _≈B_ overlap ⦃ `[𝓒heck] ⦄ : [𝓒heck] A B C overlap ⦃ `𝓒heck ⦄ : 𝓒heck A B C overlap ⦃ `[𝓣hick/thin=1] ⦄ : [𝓣hick/thin=1] A B _≈B_ overlap ⦃ `𝓣hick/thin=1 ⦄ : 𝓣hick/thin=1 A B _≈B_ overlap ⦃ `[𝓒heck/thin=1] ⦄ : [𝓒heck/thin=1] A B C _≈C_ overlap ⦃ `𝓟ure ⦄ : 𝓟ure C overlap ⦃ `𝓒heck/thin=1 ⦄ : 𝓒heck/thin=1 A B C _≈C_ record Thickandthin x a b ℓb c ℓc : Ø ↑̂ (x ∙̂ a ∙̂ b ∙̂ ℓb ∙̂ c ∙̂ ℓc) where constructor ∁ field {X} : Ø x A : X → Ø a B : X → Ø b _≈B_ : ∀ {x} → B x → B x → Ø ℓb C : Ø b → Ø c _≈C_ : ∀ {x} → C (B x) → C (B x) → Ø ℓc ⦃ `IsThickandthin ⦄ : IsThickandthin A B _≈B_ C _≈C_
{ "alphanum_fraction": 0.4842387659, "avg_line_length": 26.625, "ext": "agda", "hexsha": "06281ff4a3b24df6b720b8c6673f9ed66ec9906f", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "52e1cdbdee54d9a8eaee04ee518a0d7f61d25afb", "max_forks_repo_licenses": [ "RSA-MD" ], "max_forks_repo_name": "m0davis/oscar", "max_forks_repo_path": "archive/agda-3/src/Oscar/Class/Thickandthin.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "52e1cdbdee54d9a8eaee04ee518a0d7f61d25afb", "max_issues_repo_issues_event_max_datetime": "2019-05-11T23:33:04.000Z", "max_issues_repo_issues_event_min_datetime": "2019-04-29T00:35:04.000Z", "max_issues_repo_licenses": [ "RSA-MD" ], "max_issues_repo_name": "m0davis/oscar", "max_issues_repo_path": "archive/agda-3/src/Oscar/Class/Thickandthin.agda", "max_line_length": 112, "max_stars_count": null, "max_stars_repo_head_hexsha": "52e1cdbdee54d9a8eaee04ee518a0d7f61d25afb", "max_stars_repo_licenses": [ "RSA-MD" ], "max_stars_repo_name": "m0davis/oscar", "max_stars_repo_path": "archive/agda-3/src/Oscar/Class/Thickandthin.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 2575, "size": 4473 }
-- simply-typed λ-calculus w/ DeBruijn indices module LC where open import Agda.Primitive open import Agda.Builtin.Bool open import Data.Bool.Properties hiding (≤-trans ; <-trans ; ≤-refl ; <-irrefl) open import Data.Empty open import Data.Nat renaming (_+_ to _+ᴺ_ ; _≤_ to _≤ᴺ_ ; _≥_ to _≥ᴺ_ ; _<_ to _<ᴺ_ ; _>_ to _>ᴺ_) open import Data.Nat.Properties renaming (_<?_ to _<ᴺ?_) open import Data.Integer renaming (_+_ to _+ᶻ_ ; _≤_ to _≤ᶻ_ ; _≥_ to _≥ᶻ_ ; _<_ to _<ᶻ_ ; _>_ to _>ᶻ_) open import Data.Integer.Properties using (⊖-≥ ; 0≤n⇒+∣n∣≡n ; +-monoˡ-≤) open import Data.List open import Data.List.Relation.Unary.All open import Relation.Binary.PropositionalEquality open import Relation.Nullary open import Relation.Nullary.Decidable open import Relation.Nullary.Negation open import Auxiliary module defs where data Exp : Set where Var : ℕ → Exp Abs : Exp → Exp App : Exp → Exp → Exp data Ty : Set where Fun : Ty → Ty → Ty -- typing Env = List Ty data _∶_∈_ : ℕ → Ty → Env → Set where here : {T : Ty} {Γ : Env} → 0 ∶ T ∈ (T ∷ Γ) there : {n : ℕ} {T₁ T₂ : Ty} {Γ : Env} → n ∶ T₁ ∈ Γ → (ℕ.suc n) ∶ T₁ ∈ (T₂ ∷ Γ) data _⊢_∶_ : Env → Exp → Ty → Set where TVar : {n : ℕ} {Γ : Env} {T : Ty} → n ∶ T ∈ Γ → Γ ⊢ (Var n) ∶ T TAbs : {Γ : Env} {T₁ T₂ : Ty} {e : Exp} → (T₁ ∷ Γ) ⊢ e ∶ T₂ → Γ ⊢ (Abs e) ∶ (Fun T₁ T₂) TApp : {Γ : Env} {T₁ T₂ : Ty} {e₁ e₂ : Exp} → Γ ⊢ e₁ ∶ (Fun T₁ T₂) → Γ ⊢ e₂ ∶ T₁ → Γ ⊢ (App e₁ e₂) ∶ T₂ -- denotational semantics module denotational where open defs Valᵈ : Ty → Set Valᵈ (Fun Ty₁ Ty₂) = (Valᵈ Ty₁) → (Valᵈ Ty₂) access : {n : ℕ} {Γ : Env} {T : Ty} → n ∶ T ∈ Γ → All Valᵈ Γ → Valᵈ T access here (V ∷ Γ) = V access (there J) (V ∷ Γ) = access J Γ eval : {Γ : Env} {T : Ty} {e : Exp} → Γ ⊢ e ∶ T → All Valᵈ Γ → Valᵈ T eval (TVar c) Val-Γ = access c Val-Γ eval (TAbs TJ) Val-Γ = λ V → eval TJ (V ∷ Val-Γ) eval (TApp TJ TJ₁) Val-Γ = (eval TJ Val-Γ) (eval TJ₁ Val-Γ) -- operational semantics (call-by-value) module operational where open defs -- shifting, required to avoid variable-capturing in substitution -- see Pierce 2002, pg. 78/79 ↑_,_[_] : ℤ → ℕ → Exp → Exp ↑ d , c [ Var x ] with (x <ᴺ? c) ... | yes p = Var x ... | no ¬p = Var (∣ (ℤ.pos x) +ᶻ d ∣) -- should always be positive anyway ↑ d , c [ Abs t ] = Abs (↑ d , (ℕ.suc c) [ t ]) ↑ d , c [ App t t₁ ] = App (↑ d , c [ t ]) (↑ d , c [ t₁ ]) -- shifting in range [n, m]; by def. m < n implies no shift ↑[_,_]_[_] : ℕ → ℕ → ℤ → Exp → Exp ↑[ n , m ] d [ Var x ] with (x <ᴺ? n) ... | yes p = Var x ... | no ¬p with (m <ᴺ? x) ... | yes p' = Var x ... | no ¬p' = Var (∣ (ℤ.pos x) +ᶻ d ∣) ↑[ n , m ] d [ Abs e ] = Abs (↑[ ℕ.suc n , ℕ.suc m ] d [ e ]) ↑[ n , m ] d [ App e e₁ ] = App (↑[ n , m ] d [ e ]) (↑[ n , m ] d [ e₁ ]) -- shorthands ↑¹[_] : Exp → Exp ↑¹[ e ] = ↑ (ℤ.pos 1) , 0 [ e ] ↑⁻¹[_] : Exp → Exp ↑⁻¹[ e ] = ↑ (ℤ.negsuc 0) , 0 [ e ] -- substitution -- see Pierce 2002, pg. 80 [_↦_]_ : ℕ → Exp → Exp → Exp [ k ↦ s ] Var x with (Data.Nat._≟_ x k) ... | yes p = s ... | no ¬p = Var x [ k ↦ s ] Abs t = Abs ([ ℕ.suc k ↦ ↑¹[ s ] ] t) [ k ↦ s ] App t t₁ = App ([ k ↦ s ] t) ([ k ↦ s ] t₁) data Val : Exp → Set where VFun : {e : Exp} → Val (Abs e) -- reduction relation data _⇒_ : Exp → Exp → Set where ξ-App1 : {e₁ e₁' e₂ : Exp} → e₁ ⇒ e₁' → App e₁ e₂ ⇒ App e₁' e₂ ξ-App2 : {e e' v : Exp} → Val v → e ⇒ e' → App v e ⇒ App v e' β-App : {e v : Exp} → Val v → (App (Abs e) v) ⇒ (↑⁻¹[ ([ 0 ↦ ↑¹[ v ] ] e) ]) ---- properties & lemmas --- properties of shifting ↑-var-refl : {d : ℤ} {c : ℕ} {x : ℕ} {le : ℕ.suc x ≤ᴺ c} → ↑ d , c [ Var x ] ≡ Var x ↑-var-refl {d} {c} {x} {le} with (x <ᴺ? c) ... | no ¬p = contradiction le ¬p ... | yes p = refl ↑[]-var-refl-< : {n m x : ℕ} {d : ℤ} {le : x <ᴺ n} → ↑[ n , m ] d [ Var x ] ≡ Var x ↑[]-var-refl-< {n} {m} {x} {d} {le} with (x <ᴺ? n) ... | yes p = refl ... | no ¬p = contradiction le ¬p ↑[]-var-refl-> : {n m x : ℕ} {d : ℤ} {le : m <ᴺ x} → ↑[ n , m ] d [ Var x ] ≡ Var x ↑[]-var-refl-> {n} {m} {x} {d} {le} with (x <ᴺ? n) ... | yes p = refl ... | no p with (m <ᴺ? x) ... | no ¬q = contradiction le ¬q ... | yes q = refl ↑[]-var-shift : {n m x : ℕ} {d : ℤ} (le1 : n ≤ᴺ x) (le2 : x ≤ᴺ m) → ↑[ n , m ] d [ Var x ] ≡ Var (∣ (ℤ.pos x) +ᶻ d ∣) ↑[]-var-shift {n} {m} {x} {d} le1 le2 with x <ᴺ? n ... | yes p = contradiction p (<⇒≱ (s≤s le1)) ... | no ¬p with m <ᴺ? x ... | yes p' = contradiction p' (<⇒≱ (s≤s le2)) ... | no ¬p' = refl ↑¹-var : {x : ℕ} → ↑¹[ Var x ] ≡ Var (ℕ.suc x) ↑¹-var {zero} = refl ↑¹-var {ℕ.suc x} rewrite (sym (n+1≡sucn{x +ᴺ 1})) | (sym (n+1≡sucn{x})) = cong ↑¹[_] (↑¹-var{x}) ↑⁻¹ₖ[↑¹ₖ[s]]≡s : {e : Exp} {k : ℕ} → ↑ -[1+ 0 ] , k [ ↑ + 1 , k [ e ] ] ≡ e ↑⁻¹ₖ[↑¹ₖ[s]]≡s {Var x} {k} with (x <ᴺ? k) -- x < k -- => ↑⁻¹ₖ(↑¹ₖ(Var n)) = ↑⁻¹ₖ(Var n) = Var n ... | yes p = ↑-var-refl{ -[1+ 0 ]}{k}{x}{p} -- x ≥ k -- => ↑⁻¹ₖ(↑¹ₖ(Var n)) = ↑⁻¹ₖ(Var |n + 1|) = Var (||n + 1| - 1|) = Var n ... | no ¬p with (¬[x≤k]⇒¬[sucx≤k] ¬p) ... | ¬p' with (x +ᴺ 1) <ᴺ? k ... | yes pp = contradiction pp ¬p' ... | no ¬pp rewrite (∣nℕ+1⊖1∣≡n{x}) = refl ↑⁻¹ₖ[↑¹ₖ[s]]≡s {Abs e} {k} = cong Abs ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑⁻¹ₖ[↑¹ₖ[s]]≡s {App e e₁} = cong₂ App ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] : {k l : ℤ} {c : ℕ} {s : Exp} → l ≥ᶻ +0 → ↑ k , c [ ↑ l , c [ s ] ] ≡ ↑ (l +ᶻ k) , c [ s ] ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {k} {l} {c} {Var x} ge with x <ᴺ? c ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {k} {l} {c} {Var x} ge | no ¬p with ∣ + x +ᶻ l ∣ <ᴺ? c ... | yes q = contradiction q (<⇒≱ (n≤m⇒n<sucm (≤-trans (≮⇒≥ ¬p) (m≥0⇒∣n+m∣≥n ge)))) ... | no ¬q rewrite (0≤n⇒+∣n∣≡n{+ x +ᶻ l} (m≥0⇒n+m≥0 ge)) | (Data.Integer.Properties.+-assoc (+_ x) l k) = refl ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {k} {l} {c} {Var x} ge | yes p with x <ᴺ? c ... | yes p' = refl ... | no ¬p' = contradiction p ¬p' ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {k} {l} {c} {Abs s} le = cong Abs (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{k}{l}{ℕ.suc c}{s} le) ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {k} {l} {c} {App s s₁} le = cong₂ App (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{k}{l}{c}{s} le) (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{k}{l}{c}{s₁} le) ↑k,q[↑l,c[s]]≡↑l+k,c[s] : {k l : ℤ} {q c : ℕ} {s : Exp} → + q ≤ᶻ + c +ᶻ l → c ≤ᴺ q → ↑ k , q [ ↑ l , c [ s ] ] ≡ ↑ (l +ᶻ k) , c [ s ] ↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {q} {c} {Var x} ge₁ ge₂ with x <ᴺ? c ... | yes p with x <ᴺ? q ... | yes p' = refl ... | no ¬p' = contradiction (≤-trans p ge₂) ¬p' ↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {q} {c} {Var x} ge₁ ge₂ | no ¬p with ∣ + x +ᶻ l ∣ <ᴺ? q ... | yes p' = contradiction p' (≤⇒≯ (+a≤b⇒a≤∣b∣{q}{+ x +ᶻ l} (Data.Integer.Properties.≤-trans ge₁ ((Data.Integer.Properties.+-monoˡ-≤ l (+≤+ (≮⇒≥ ¬p))))))) ... | no ¬p' rewrite (0≤n⇒+∣n∣≡n{+ x +ᶻ l} (Data.Integer.Properties.≤-trans (+≤+ z≤n) ((Data.Integer.Properties.≤-trans ge₁ ((Data.Integer.Properties.+-monoˡ-≤ l (+≤+ (≮⇒≥ ¬p)))))))) | (Data.Integer.Properties.+-assoc (+_ x) l k) = refl ↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {q} {c} {Abs s} ge₁ ge₂ = cong Abs (↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {ℕ.suc q} {ℕ.suc c} {s} (+q≤+c+l⇒+1q≤+1c+l{q}{c}{l} ge₁) (s≤s ge₂)) ↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {q} {c} {App s s₁} ge₁ ge₂ = cong₂ App (↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {q} {c} {s} ge₁ ge₂) (↑k,q[↑l,c[s]]≡↑l+k,c[s] {k} {l} {q} {c} {s₁} ge₁ ge₂) --- properties of substitution subst-trivial : {x : ℕ} {s : Exp} → [ x ↦ s ] Var x ≡ s subst-trivial {x} {s} with x Data.Nat.≟ x ... | no ¬p = contradiction refl ¬p ... | yes p = refl var-subst-refl : {n m : ℕ} {neq : n ≢ m} {e : Exp} → [ n ↦ e ] (Var m) ≡ (Var m) var-subst-refl {n} {m} {neq} {e} with Data.Nat._≟_ n m | map′ (≡ᵇ⇒≡ m n) (≡⇒≡ᵇ m n) (Data.Bool.Properties.T? (m ≡ᵇ n)) ... | yes p | _ = contradiction p neq ... | no ¬p | yes q = contradiction q (≢-sym ¬p) ... | no ¬p | no ¬q = refl --- properties and manipulation of environments var-env-< : {Γ : Env} {T : Ty} {n : ℕ} (j : n ∶ T ∈ Γ) → n <ᴺ (length Γ) var-env-< {.(T ∷ _)} {T} {.0} here = s≤s z≤n var-env-< {.(_ ∷ _)} {T} {.(ℕ.suc _)} (there j) = s≤s (var-env-< j) -- type to determine whether var type judgement in env. (Δ ++ Γ) is in Δ or Γ data extract-env-or {Δ Γ : Env} {T : Ty} {x : ℕ} : Set where in-Δ : x ∶ T ∈ Δ → extract-env-or -- x ≥ length Δ makes sure that x really is in Γ; e.g. -- x = 1, Δ = (S ∷ T), Γ = (T ∷ Γ'); here 1 ∶ T ∈ Δ as well as (1 ∸ 2) ≡ 0 ∶ T ∈ Γ in-Γ : (x ≥ᴺ length Δ) → (x ∸ length Δ) ∶ T ∈ Γ → extract-env-or extract : {Δ Γ : Env} {T : Ty} {x : ℕ} (j : x ∶ T ∈ (Δ ++ Γ)) → extract-env-or{Δ}{Γ}{T}{x} extract {[]} {Γ} {T} {x} j = in-Γ z≤n j extract {x₁ ∷ Δ} {Γ} {.x₁} {.0} here = in-Δ here extract {x₁ ∷ Δ} {Γ} {T} {ℕ.suc x} (there j) with extract {Δ} {Γ} {T} {x} j ... | in-Δ j' = in-Δ (there j') ... | in-Γ ge j'' = in-Γ (s≤s ge) j'' ext-behind : {Δ Γ : Env} {T : Ty} {x : ℕ} → x ∶ T ∈ Δ → x ∶ T ∈ (Δ ++ Γ) ext-behind here = here ext-behind (there j) = there (ext-behind j) ext-front : {n : ℕ} {Γ Δ : Env} {S : Ty} → n ∶ S ∈ Γ → (n +ᴺ (length Δ)) ∶ S ∈ (Δ ++ Γ) ext-front {n} {Γ} {[]} {S} j rewrite (n+length[]≡n{A = Ty}{n = n}) = j ext-front {n} {Γ} {T ∷ Δ} {S} j rewrite (+-suc n (foldr (λ _ → ℕ.suc) 0 Δ)) = there (ext-front j) swap-env-behind : {Γ Δ : Env} {T : Ty} → 0 ∶ T ∈ (T ∷ Γ) → 0 ∶ T ∈ (T ∷ Δ) swap-env-behind {Γ} {Δ} {T} j = here swap-type : {Δ ∇ Γ : Env} {T : Ty} → (length Δ) ∶ T ∈ (Δ ++ T ∷ ∇ ++ Γ) → (length Δ +ᴺ length ∇) ∶ T ∈ (Δ ++ ∇ ++ T ∷ Γ) swap-type {Δ} {∇} {Γ} {T} j with extract{Δ}{T ∷ ∇ ++ Γ} j ... | in-Δ x = contradiction (var-env-< {Δ} {T} x) (<-irrefl refl) ... | in-Γ le j' with extract{T ∷ ∇}{Γ} j' ... | in-Δ j'' rewrite (n∸n≡0 (length Δ)) | (sym (length[A++B]≡length[A]+length[B]{lzero}{Ty}{Δ}{∇})) | (sym (++-assoc{lzero}{Ty}{Δ}{∇}{T ∷ Γ})) = ext-front{0}{T ∷ Γ}{Δ ++ ∇}{T} (swap-env-behind{∇}{Γ}{T} j'') ... | in-Γ le' j'' rewrite (length[A∷B]≡suc[length[B]]{lzero}{Ty}{T}{∇}) | (n∸n≡0 (length Δ)) = contradiction le' (<⇒≱ (s≤s z≤n)) env-pred : {Γ : Env} {S T : Ty} {y : ℕ} {gt : y ≢ 0} → y ∶ T ∈ (S ∷ Γ) → ∣ y ⊖ 1 ∣ ∶ T ∈ Γ env-pred {Γ} {S} {.S} {.0} {gt} here = contradiction refl gt env-pred {Γ} {S} {T} {.(ℕ.suc _)} {gt} (there j) = j env-type-equiv-here : {Γ : Env} {S T : Ty} → 0 ∶ T ∈ (S ∷ Γ) → T ≡ S env-type-equiv-here {Γ} {S} {.S} here = refl env-type-equiv : {Δ ∇ : Env} {S T : Ty} → length Δ ∶ T ∈ (Δ ++ S ∷ ∇) → T ≡ S env-type-equiv {Δ} {∇} {S} {T} j with extract{Δ}{S ∷ ∇} j ... | in-Δ x = contradiction (var-env-< x) (≤⇒≯ ≤-refl) ... | in-Γ x j' rewrite (n∸n≡0 (length Δ)) = env-type-equiv-here {∇} {S} {T} j' env-type-equiv-j : {Γ : Env} {S T : Ty} {n : ℕ} → T ≡ S → n ∶ T ∈ Γ → n ∶ S ∈ Γ env-type-equiv-j {Γ} {S} {T} {n} eq j rewrite eq = j -- extension of environment ext : {Γ Δ ∇ : Env} {S : Ty} {s : Exp} → (∇ ++ Γ) ⊢ s ∶ S → (∇ ++ Δ ++ Γ) ⊢ ↑ (ℤ.pos (length Δ)) , length ∇ [ s ] ∶ S ext {Γ} {Δ} {∇} (TVar {n} x) with extract{∇}{Γ} x ... | in-Δ x₁ with n <ᴺ? length ∇ ... | yes p = TVar (ext-behind x₁) ... | no ¬p = contradiction (var-env-< x₁) ¬p ext {Γ} {Δ} {∇} (TVar {n} x) | in-Γ x₁ x₂ with n <ᴺ? length ∇ ... | yes p = contradiction x₁ (<⇒≱ p) ... | no ¬p with (ext-front{n ∸ length ∇}{Γ}{∇ ++ Δ} x₂) ... | w rewrite (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{Δ}) | (sym (+-assoc (n ∸ length ∇) (length ∇) (length Δ))) | (m∸n+n≡m{n}{length ∇} (≮⇒≥ ¬p)) | (++-assoc{lzero}{Ty}{∇}{Δ}{Γ}) = TVar w ext {Γ} {Δ} {∇} {Fun T₁ T₂} {Abs e} (TAbs j) = TAbs (ext{Γ}{Δ}{T₁ ∷ ∇} j) ext {Γ} {Δ} {∇} {S} {App s₁ s₂} (TApp{T₁ = T₁} j₁ j₂) = TApp (ext{Γ}{Δ}{∇}{Fun T₁ S} j₁) (ext{Γ}{Δ}{∇}{T₁} j₂) ---- progress and preservation -- progress theorem, i.e. a well-typed closed expression is either a value -- or can be reduced further data Progress (e : Exp) {T : Ty} {j : [] ⊢ e ∶ T} : Set where step : {e' : Exp} → e ⇒ e' → Progress e value : Val e → Progress e progress : (e : Exp) {T : Ty} {j : [] ⊢ e ∶ T} → Progress e {T} {j} progress (Var x) {T} {TVar ()} progress (Abs e) = value VFun progress (App e e₁) {T} {TApp{T₁ = T₁}{T₂ = .T} j j₁} with progress e {Fun T₁ T} {j} ... | step x = step (ξ-App1 x) ... | value VFun with progress e₁ {T₁} {j₁} ... | step x₁ = step (ξ-App2 VFun x₁) ... | value x₁ = step (β-App x₁) --- -- preservation under substitution preserve-subst : {T S : Ty} {Γ Δ : Env} {e s : Exp} (j : (Δ ++ (S ∷ Γ)) ⊢ e ∶ T) (j' : Γ ⊢ s ∶ S) → (Δ ++ Γ) ⊢ ↑ -[1+ 0 ] , length Δ [ [ length Δ ↦ ↑ (ℤ.pos (ℕ.suc (length Δ))) , 0 [ s ] ] e ] ∶ T preserve-subst {T} {S} {Γ} {Δ} {e} {s} (TVar{n} x) j' with extract{Δ}{S ∷ Γ}{T}{n} x ... | in-Δ x₁ with n Data.Nat.≟ length Δ ... | yes p = contradiction p (<⇒≢ (var-env-< x₁)) ... | no ¬p with n <ᴺ? length Δ ... | yes q = TVar (ext-behind{Δ}{Γ} x₁) ... | no ¬q = contradiction (var-env-< x₁) ¬q preserve-subst {T} {S} {Γ} {Δ} {e} {s} (TVar{n} x) j' | in-Γ x₁ x₂ with n Data.Nat.≟ length Δ ... | yes p rewrite (↑k,q[↑l,c[s]]≡↑l+k,c[s]{ -[1+ 0 ]}{+[1+ length Δ ]}{length Δ}{0}{s} (+≤+ n≤sucn) z≤n) | p | (env-type-equiv x) = ext{Γ}{Δ}{[]} j' ... | no ¬p with n <ᴺ? length Δ ... | yes q = contradiction x₁ (<⇒≱ q) ... | no ¬q rewrite (sym (minus-1{n}{length Δ}{≤∧≢⇒< x₁ (≢-sym ¬p)})) = TVar (ext-front{Δ = Δ} (env-pred{Γ}{S}{T}{gt = ≢-sym (<⇒≢ (m>n⇒m∸n≥1 (≤∧≢⇒< x₁ (≢-sym ¬p))))} x₂)) preserve-subst {T} {S} {Γ} {Δ} {Abs e'} {s} (TAbs{T₁ = T₁}{T₂} j) j' with preserve-subst{T₂}{S}{Γ}{T₁ ∷ Δ}{e'}{s} j j' ... | w rewrite (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{+ 1}{+[1+ length Δ ]}{0}{s} (+≤+ z≤n)) | (length[A∷B]≡suc[length[B]]{lzero}{Ty}{T₁}{Δ}) | (n+1≡sucn{length Δ}) = TAbs w preserve-subst (TApp j j₁) j' = TApp (preserve-subst j j') (preserve-subst j₁ j') -- preservation theorem, i.e. a well-typed expression reduces to a well-typed expression preserve : {T : Ty} {Γ : Env} (e e' : Exp) (j : Γ ⊢ e ∶ T) (r : e ⇒ e') → Γ ⊢ e' ∶ T preserve (App s₁ s₂) .(App _ s₂) (TApp j j') (ξ-App1{e₁' = s₁'} r) = TApp (preserve s₁ s₁' j r) j' -- IH on inner reduction preserve (App s₁ s₂) .(App s₁ _) (TApp j j') (ξ-App2{e' = s₂'} x r) = TApp j (preserve s₂ s₂' j' r) preserve (App (Abs e) s') .(↑⁻¹[ [ 0 ↦ ↑¹[ s' ] ] e ]) (TApp (TAbs j) j') (β-App x) = preserve-subst{Δ = []} j j' ----------------------------------------------------------------------------------------------------------- -- swap-subst lemma: swap the position of a type in an environment (did not need this after all) -- aux. calculations length-≡ : {Δ ∇ Γ : Env} {S : Ty} → ℕ.suc (length Δ +ᴺ (length Γ +ᴺ length ∇)) ≡ length (Δ ++ S ∷ ∇ ++ Γ) length-≡ {Δ} {∇} {Γ} {S} rewrite (length[A++B]≡length[A]+length[B]{lzero}{Ty}{Δ}{S ∷ ∇ ++ Γ}) | (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{Γ}) | (+-suc (length Δ) (length ∇ +ᴺ length Γ)) | (+-comm (length ∇) (length Γ)) = refl length-≡' : {Δ ∇ : Env} {S : Ty} → length (Δ ++ ∇ ++ S ∷ []) ≡ length Δ +ᴺ ℕ.suc (length ∇) length-≡' {Δ} {∇} {S} rewrite (length[A++B]≡length[A]+length[B]{lzero}{Ty}{Δ}{∇ ++ S ∷ []}) | (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{S ∷ []}) | (+-suc (length ∇) (0)) | (+-identityʳ (length ∇)) = refl length-≡'' : {Δ ∇ : Env} {S : Ty} → length (Δ ++ ∇ ++ S ∷ []) ≡ ℕ.suc (length ∇ +ᴺ length Δ) length-≡'' {Δ} {∇} {S} rewrite (cong (ℕ.suc) (+-comm (length ∇) (length Δ))) | (sym (+-suc (length Δ) (length ∇))) = length-≡'{Δ}{∇}{S} --- why the "r"? we have to "remember" where S was --- cannot substitute its position for zero, since ↑ would increase that --- cannot do ↑ and then subtitute its position for zero, since (position - 1) would be affected aswell --- fix: cache in unreachable variable r swap-subst : {T S : Ty} {Γ Δ ∇ : Env} {e : Exp} {r : ℕ} {gt : r >ᴺ ℕ.suc (length Δ +ᴺ (length Γ +ᴺ length ∇))} → (Δ ++ (S ∷ ∇) ++ Γ) ⊢ e ∶ T → (Δ ++ ∇ ++ (S ∷ Γ)) ⊢ [ r ↦ Var (length Δ +ᴺ length ∇) ] ↑[ ℕ.suc (length Δ) , length Δ +ᴺ length ∇ ] -[1+ 0 ] [ [ length Δ ↦ Var r ] e ] ∶ T swap-subst {(Fun T₁ T₂)} {S} {Γ} {Δ} {∇} {(Abs e)} {r} {gt} (TAbs j) rewrite (↑¹-var{length Δ +ᴺ length ∇}) | (n+1≡sucn{r}) = TAbs (swap-subst{T₂}{S}{Γ}{T₁ ∷ Δ}{∇}{e}{ℕ.suc r}{s≤s gt} j) swap-subst {T} {S} {Γ} {Δ} {∇} {(App e e₁)} {r} {gt} (TApp{T₁ = T₁}{T₂} j j₁) = TApp (swap-subst{Fun T₁ T₂}{S}{Γ}{Δ}{∇}{e}{r}{gt} j) (swap-subst{T₁}{S}{Γ}{Δ}{∇}{e₁}{r}{gt} j₁) swap-subst {T} {S} {Γ} {Δ} {∇} {Var y} {r} {gt} (TVar j) with extract{Δ} {(S ∷ ∇) ++ Γ} {T} {y} j | y <ᴺ? (foldr (λ _ → ℕ.suc) 0 Δ) | Data.Nat._≟_ y (length Δ) -- y ∈ Δ ... | in-Δ x | yes p | yes q = contradiction q (<⇒≢ p) ... | in-Δ x | yes p | no ¬q rewrite (↑[]-var-refl-<{ℕ.suc (length Δ)}{length Δ +ᴺ length ∇}{y}{ -[1+ 0 ] }{[k<x]⇒[k<sucx] p}) | (var-subst-refl{r}{y}{≢-sym (<⇒≢ (a<b≤c⇒a<c p (≤-trans (n≤m⇒n≤sucm (m≤m+n (length Δ) (length Γ +ᴺ length ∇))) (<-trans (s≤s ≤-refl) gt))) )} {Var (foldr (λ _ → ℕ.suc) 0 Δ +ᴺ foldr (λ _ → ℕ.suc) 0 ∇)}) = TVar (ext-behind x) ... | in-Δ x | no ¬p | _ = contradiction (var-env-< x) ¬p -- y ∈ (S ∷ ∇ ++ Γ) ... | in-Γ ge x | p | q with extract{S ∷ ∇} {Γ} {T} {y ∸ length Δ} x --- y ∈ (S ∷ ∇) ---- y @ S swap-subst {T} {S} {Γ} {Δ} {∇} {Var y} {r} {gt} (TVar j) | in-Γ ge x | p | yes q' | in-Δ x' rewrite (↑[]-var-refl->{ℕ.suc (length Δ)}{length Δ +ᴺ length ∇}{r}{ -[1+ 0 ] }{<-trans (s≤s (n+m≤n+q+m {length Δ} {length ∇} {length Γ})) gt}) | (subst-trivial{r} {Var (length Δ +ᴺ length ∇)}) | q' | (env-type-equiv j) = TVar (swap-type{Δ}{∇}{Γ}{S} (env-type-equiv-j (env-type-equiv j) j)) ---- y ∈ ∇ swap-subst {T} {S} {Γ} {Δ} {∇} {Var y} {r} {gt} (TVar j) | in-Γ ge x | p | no ¬q' | in-Δ x' rewrite (↑[]-var-shift{ℕ.suc (length Δ)}{length Δ +ᴺ length ∇}{y}{ -[1+ 0 ]} (≤∧≢⇒< ge (≢-sym ¬q')) (≤-trans (≤-pred (m≤n∧m≡q⇒q≤n (m≤n⇒m+o≤n+o{o = length Δ} (var-env-< x')) (cong ℕ.suc (m∸n+n≡m ge)))) (≤-refl-+-comm{length ∇}{length Δ}))) | length-≡ {Δ} {∇} {Γ} {S} | (var-subst-refl {r} {∣ y ⊖ 1 ∣} {≢-sym (<⇒≢ (<-trans (n>0⇒n>∣n⊖1∣ (≤-trans (s≤s z≤n) ((≤∧≢⇒< ge (≢-sym ¬q'))))) (<-trans (var-env-< j) gt)))} {Var (length Δ +ᴺ length ∇)}) | sym (minus-1{y}{length Δ}{≤∧≢⇒< ge (≢-sym ¬q')} ) = TVar (ext-front{Δ = Δ}(ext-behind{∇}{S ∷ Γ}{T} (env-pred{gt = ≢-sym (<⇒≢ (m>n⇒m∸n≥1{y}{length Δ} ((≤∧≢⇒< ge (≢-sym ¬q')))))} x'))) --- y ∈ Γ swap-subst {T} {S} {Γ} {Δ} {∇} {Var y} {r} {gt} (TVar j) | in-Γ ge x | no ¬p | yes q | in-Γ ge' x' = contradiction q (≢-sym (<⇒≢ (m∸n≢0⇒n<m{y}{length Δ} (≢-sym (<⇒≢ (a<b≤c⇒a<c (s≤s z≤n) (≤-trans (length[A∷B]≥1{lzero}{Ty}{S}{∇}) ge'))))))) swap-subst {T} {S} {Γ} {Δ} {∇} {Var y} {r} {gt} (TVar j) | in-Γ ge x | yes p | yes q | in-Γ ge' x' = contradiction q (<⇒≢ p) swap-subst {T} {S} {Γ} {Δ} {∇} {Var y} {r} {gt} (TVar j) | in-Γ ge x | p | no ¬q' | in-Γ ge' x' rewrite (↑[]-var-refl->{ℕ.suc (length Δ)}{length Δ +ᴺ length ∇}{y}{ -[1+ 0 ]}{a<b≤c⇒a<c (s≤s (≤-refl-+-comm{length Δ}{length ∇})) (m≤n∧n≡q⇒m≤q (m≤n⇒m+o≤n+o{o = length Δ} ge') (m∸n+n≡m ge))}) | (var-subst-refl{r}{y}{≢-sym (<⇒≢ (<-trans (var-env-< j) (m≤n∧m≡q⇒q≤n gt (cong ℕ.suc (length-≡{Δ}{∇}{Γ}{S})))))}{ Var (foldr (λ _ → ℕ.suc) 0 Δ +ᴺ foldr (λ _ → ℕ.suc) 0 ∇)}) with ext-front{((y ∸ (length Δ)) ∸ ℕ.suc (length ∇))}{Γ}{Δ ++ ∇ ++ (S ∷ [])}{T} ... | w rewrite (∸-+-assoc y (length Δ) (ℕ.suc (length ∇))) | (sym (length-≡'{Δ}{∇}{S})) | (m∸n+n≡m{y}{length (Δ ++ ∇ ++ S ∷ [])} (m≤n∧m≡q⇒q≤n (m≤n∧n≡q⇒m≤q (m≤n⇒m+o≤n+o{o = length Δ} ge') (m∸n+n≡m ge)) (sym (length-≡''{Δ}{∇}{S})))) | (A++B++D∷[]++C≡A++B++D∷C{lzero}{Ty}{Δ}{∇}{Γ}{S}) = TVar (w x')
{ "alphanum_fraction": 0.4419054061, "avg_line_length": 44.5139784946, "ext": "agda", "hexsha": "1d025dabede913ffacb172151beda179d6c3bc05", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2019-03-14T17:52:29.000Z", "max_forks_repo_forks_event_min_datetime": "2019-03-14T17:52:29.000Z", "max_forks_repo_head_hexsha": "a87fb6402639c3d2bb393cc5466426c28e7a0398", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "kcaliban/ldlc", "max_forks_repo_path": "src/lc/LC.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "a87fb6402639c3d2bb393cc5466426c28e7a0398", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "kcaliban/ldlc", "max_issues_repo_path": "src/lc/LC.agda", "max_line_length": 199, "max_stars_count": null, "max_stars_repo_head_hexsha": "a87fb6402639c3d2bb393cc5466426c28e7a0398", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "kcaliban/ldlc", "max_stars_repo_path": "src/lc/LC.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 10284, "size": 20699 }
module subst where open import lib open import cedille-types open import ctxt-types open import is-free open import rename open import general-util open import syntax-util substh-ret-t : Set → Set substh-ret-t T = ∀ {ed} → ctxt → renamectxt → trie ⟦ ed ⟧ → T → T substh : ∀ {ed} → substh-ret-t ⟦ ed ⟧ substh-term : substh-ret-t term substh-type : substh-ret-t type substh-kind : substh-ret-t kind substh-tk : substh-ret-t tk substh-optClass : substh-ret-t optClass substh-optGuide : substh-ret-t optGuide substh-optTerm : substh-ret-t optTerm substh-optType : substh-ret-t optType substh-liftingType : substh-ret-t liftingType substh-arg : substh-ret-t arg substh-args : substh-ret-t args substh-params : substh-ret-t params substh-cases : substh-ret-t cases substh-varargs : {ed : exprd} → ctxt → renamectxt → trie ⟦ ed ⟧ → varargs → varargs × renamectxt substh{TERM} = substh-term substh{TYPE} = substh-type substh{KIND} = substh-kind substh{LIFTINGTYPE} = substh-liftingType substh{TK} = substh-tk substh{ARG} = substh-arg substh{QUALIF} = λ Γ ρ σ q → q subst-rename-var-if : {ed : exprd} → ctxt → renamectxt → var → trie ⟦ ed ⟧ → var subst-rename-var-if Γ ρ "_" σ = "_" subst-rename-var-if Γ ρ x σ = {- rename bound variable x iff it is one of the vars being substituted for, or if x occurs free in one of the terms we are substituting for vars, or if it is the renamed version of any variable -} if trie-contains σ x || trie-any (is-free-in check-erased x) σ || renamectxt-in-range ρ x || ctxt-binds-var Γ x then rename-away-from x (λ s → ctxt-binds-var Γ s || trie-contains σ s) ρ else x substh-term Γ ρ σ (App t m t') = App (substh-term Γ ρ σ t) m (substh-term Γ ρ σ t') substh-term Γ ρ σ (AppTp t tp) = AppTp (substh-term Γ ρ σ t) (substh-type Γ ρ σ tp) substh-term Γ ρ σ (Hole x₁) = Hole x₁ substh-term Γ ρ σ (Lam _ b _ x oc t) = let x' = subst-rename-var-if Γ ρ x σ in Lam posinfo-gen b posinfo-gen x' (substh-optClass Γ ρ σ oc) (substh-term (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t) substh-term Γ ρ σ (Let _ (DefTerm _ x m t) t') = let x' = subst-rename-var-if Γ ρ x σ in (Let posinfo-gen (DefTerm posinfo-gen x' (substh-optType Γ ρ σ m) (substh-term Γ ρ σ t)) (substh-term (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t')) substh-term Γ ρ σ (Let _ (DefType _ x k t) t') = let x' = subst-rename-var-if Γ ρ x σ in (Let posinfo-gen (DefType posinfo-gen x' (substh-kind Γ ρ σ k) (substh-type Γ ρ σ t)) (substh-term (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t')) substh-term Γ ρ σ (Open _ x t) = Open posinfo-gen x (substh-term Γ ρ σ t) substh-term Γ ρ σ (Parens _ t _) = substh-term Γ ρ σ t substh-term{TERM} Γ ρ σ (Var _ x) = let x' = renamectxt-rep ρ x in trie-lookup-else (Var posinfo-gen x') σ x' substh-term{ARG} Γ ρ σ (Var _ x) = let x' = renamectxt-rep ρ x in inst-lookup-term σ x' substh-term{QUALIF} Γ ρ σ (Var _ x) = let x' = renamectxt-rep ρ x in qualif-lookup-term σ x' substh-term Γ ρ σ (Var _ x) = Var posinfo-gen (renamectxt-rep ρ x) substh-term Γ ρ σ (Beta _ ot ot') = Beta posinfo-gen (substh-optTerm Γ ρ σ ot) (substh-optTerm Γ ρ σ ot') substh-term Γ ρ σ (IotaPair _ t1 t2 og pi') = IotaPair posinfo-gen (substh-term Γ ρ σ t1) (substh-term Γ ρ σ t2) (substh-optGuide Γ ρ σ og) pi' substh-term Γ ρ σ (IotaProj t n _) = IotaProj (substh-term Γ ρ σ t) n posinfo-gen substh-term Γ ρ σ (Epsilon _ lr m t) = Epsilon posinfo-gen lr m (substh-term Γ ρ σ t) substh-term Γ ρ σ (Sigma _ t) = Sigma posinfo-gen (substh-term Γ ρ σ t) substh-term Γ ρ σ (Phi _ t t₁ t₂ _) = Phi posinfo-gen (substh-term Γ ρ σ t) (substh-term Γ ρ σ t₁) (substh-term Γ ρ σ t₂) posinfo-gen substh-term Γ ρ σ (Rho _ op on t og t') = Rho posinfo-gen op on (substh-term Γ ρ σ t) (substh-optGuide Γ ρ σ og) (substh-term Γ ρ σ t') substh-term Γ ρ σ (Chi _ T t') = Chi posinfo-gen (substh-optType Γ ρ σ T) (substh-term Γ ρ σ t') substh-term Γ ρ σ (Delta _ T t') = Delta posinfo-gen (substh-optType Γ ρ σ T) (substh-term Γ ρ σ t') substh-term Γ ρ σ (Theta _ θ t ls) = Theta posinfo-gen (substh-theta θ) (substh-term Γ ρ σ t) (substh-lterms ls) where substh-lterms : lterms → lterms substh-lterms (LtermsNil pi) = LtermsNil pi substh-lterms (LtermsCons m t ls) = LtermsCons m (substh-term Γ ρ σ t) (substh-lterms ls) substh-vars : vars → vars substh-vars (VarsStart x) = VarsStart (renamectxt-rep ρ x) substh-vars (VarsNext x xs) = VarsNext (renamectxt-rep ρ x) (substh-vars xs) substh-theta : theta → theta substh-theta (AbstractVars xs) = AbstractVars (substh-vars xs) substh-theta θ = θ substh-term Γ ρ σ (Mu _ x t ot _ cs _) = let x' = subst-rename-var-if Γ ρ x σ in let ρ' = renamectxt-insert ρ x x' in Mu posinfo-gen x' (substh-term (ctxt-var-decl x' Γ) ρ' σ t) (substh-optType Γ ρ σ ot) posinfo-gen (substh-cases Γ ρ' σ cs) posinfo-gen substh-term Γ ρ σ (Mu' _ t ot _ cs _) = Mu' posinfo-gen (substh-term Γ ρ σ t) (substh-optType Γ ρ σ ot) posinfo-gen (substh-cases Γ ρ σ cs) posinfo-gen substh-cases Γ ρ σ NoCase = NoCase substh-cases Γ ρ σ (SomeCase _ x varargs t cs) = let res = substh-varargs Γ ρ σ varargs in SomeCase posinfo-gen x (fst res) (substh-term Γ (snd res) σ t) (substh-cases Γ ρ σ cs) substh-varargs Γ ρ σ NoVarargs = NoVarargs , ρ substh-varargs Γ ρ σ (NormalVararg x varargs) = let x' = subst-rename-var-if Γ ρ x σ in let ρ' = renamectxt-insert ρ x x' in let res = substh-varargs Γ ρ' σ varargs in NormalVararg x' (fst res) , snd res substh-varargs Γ ρ σ (ErasedVararg x varargs) = let x' = subst-rename-var-if Γ ρ x σ in let ρ' = renamectxt-insert ρ x x' in let res = substh-varargs Γ ρ' σ varargs in ErasedVararg x' (fst res) , snd res substh-varargs Γ ρ σ (TypeVararg x varargs) = let x' = subst-rename-var-if Γ ρ x σ in let ρ' = renamectxt-insert ρ x x' in let res = substh-varargs Γ ρ' σ varargs in TypeVararg x' (fst res) , snd res substh-type Γ ρ σ (Abs _ b _ x atk t) = let x' = subst-rename-var-if Γ ρ x σ in Abs posinfo-gen b posinfo-gen x' (substh-tk Γ ρ σ atk) (substh-type (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t) substh-type Γ ρ σ (TpLambda _ _ x atk t) = let x' = subst-rename-var-if Γ ρ x σ in TpLambda posinfo-gen posinfo-gen x' (substh-tk Γ ρ σ atk) (substh-type (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t) substh-type Γ ρ σ (Iota _ _ x m t) = let x' = subst-rename-var-if Γ ρ x σ in Iota posinfo-gen posinfo-gen x' (substh-type Γ ρ σ m) (substh-type (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t) substh-type Γ ρ σ (Lft _ _ x t l) = let x' = subst-rename-var-if Γ ρ x σ in Lft posinfo-gen posinfo-gen x' (substh-term (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t) (substh-liftingType Γ ρ σ l) substh-type Γ ρ σ (TpApp tp tp₁) = TpApp (substh-type Γ ρ σ tp) (substh-type Γ ρ σ tp₁) substh-type Γ ρ σ (TpAppt tp t) = TpAppt (substh-type Γ ρ σ tp) (substh-term Γ ρ σ t) substh-type Γ ρ σ (TpArrow tp arrowtype tp₁) = TpArrow (substh-type Γ ρ σ tp) arrowtype (substh-type Γ ρ σ tp₁) substh-type Γ ρ σ (TpEq _ x₁ x₂ _) = TpEq posinfo-gen (substh-term Γ ρ σ x₁) (substh-term Γ ρ σ x₂) posinfo-gen substh-type Γ ρ σ (TpParens _ tp _) = substh-type Γ ρ σ tp substh-type Γ ρ σ (NoSpans tp _) = substh-type Γ ρ σ tp substh-type{TYPE} Γ ρ σ (TpVar _ x) = let x' = renamectxt-rep ρ x in trie-lookup-else (TpVar posinfo-gen x') σ x' substh-type{ARG} Γ ρ σ (TpVar _ x) = let x' = renamectxt-rep ρ x in inst-lookup-type σ x' substh-type{QUALIF} Γ ρ σ (TpVar _ x) = let x' = renamectxt-rep ρ x in qualif-lookup-type σ x' substh-type Γ ρ σ (TpVar _ x) = TpVar posinfo-gen (renamectxt-rep ρ x) substh-type Γ ρ σ (TpHole _) = TpHole posinfo-gen --ACG substh-type Γ ρ σ (TpLet _ (DefTerm _ x m t) t') = let x' = subst-rename-var-if Γ ρ x σ in (TpLet posinfo-gen (DefTerm posinfo-gen x' (substh-optType Γ ρ σ m) (substh-term Γ ρ σ t)) (substh-type (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t')) substh-type Γ ρ σ (TpLet _ (DefType _ x k t) t') = let x' = subst-rename-var-if Γ ρ x σ in (TpLet posinfo-gen (DefType posinfo-gen x' (substh-kind Γ ρ σ k) (substh-type Γ ρ σ t)) (substh-type (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ t')) substh-kind Γ ρ σ (KndArrow k k₁) = KndArrow (substh-kind Γ ρ σ k) (substh-kind Γ ρ σ k₁) substh-kind Γ ρ σ (KndParens x₁ k x₂) = substh-kind Γ ρ σ k substh-kind Γ ρ σ (KndPi _ _ x atk k) = let x' = subst-rename-var-if Γ ρ x σ in KndPi posinfo-gen posinfo-gen x' (substh-tk Γ ρ σ atk) (substh-kind (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ k) substh-kind Γ ρ σ (KndTpArrow t k) = KndTpArrow (substh-type Γ ρ σ t) (substh-kind Γ ρ σ k) substh-kind{QUALIF} Γ ρ σ (KndVar _ x xs) = qualif-lookup-kind (substh-args Γ ρ σ xs) σ x substh-kind Γ ρ σ (KndVar _ x xs) = KndVar posinfo-gen x (substh-args Γ ρ σ xs) substh-kind Γ ρ σ (Star _) = Star posinfo-gen substh-arg Γ ρ σ (TermArg me t) = TermArg me (substh-term Γ ρ σ t) substh-arg Γ ρ σ (TypeArg T) = TypeArg (substh-type Γ ρ σ T) substh-args Γ ρ σ (ArgsCons a as) = ArgsCons (substh-arg Γ ρ σ a) (substh-args Γ ρ σ as) substh-args Γ ρ σ ArgsNil = ArgsNil substh-params{QUALIF} Γ ρ σ (ParamsCons (Decl _ pi me x atk _) ps) = ParamsCons (Decl posinfo-gen posinfo-gen me (pi % x) (substh-tk Γ ρ σ atk) posinfo-gen) (substh-params Γ (renamectxt-insert ρ x (pi % x)) (trie-remove σ (pi % x)) ps) substh-params Γ ρ σ (ParamsCons (Decl _ _ me x atk _) ps) = ParamsCons (Decl posinfo-gen posinfo-gen me x (substh-tk Γ ρ σ atk) posinfo-gen) (substh-params Γ (renamectxt-insert ρ x x) (trie-remove σ x) ps) substh-params Γ ρ σ ParamsNil = ParamsNil substh-tk Γ ρ σ (Tkk k) = Tkk (substh-kind Γ ρ σ k) substh-tk Γ ρ σ (Tkt t) = Tkt (substh-type Γ ρ σ t) substh-optClass Γ ρ σ NoClass = NoClass substh-optClass Γ ρ σ (SomeClass atk) = SomeClass (substh-tk Γ ρ σ atk) substh-liftingType Γ ρ σ (LiftArrow l l₁) = LiftArrow (substh-liftingType Γ ρ σ l) (substh-liftingType Γ ρ σ l₁) substh-liftingType Γ ρ σ (LiftParens _ l _) = substh-liftingType Γ ρ σ l substh-liftingType Γ ρ σ (LiftPi _ x tp l) = let x' = subst-rename-var-if Γ ρ x σ in LiftPi posinfo-gen x' (substh-type Γ ρ σ tp) (substh-liftingType (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ l) substh-liftingType Γ ρ σ (LiftStar _) = LiftStar posinfo-gen substh-liftingType Γ ρ σ (LiftTpArrow tp l) = LiftTpArrow (substh-type Γ ρ σ tp) (substh-liftingType Γ ρ σ l) substh-optType Γ ρ σ NoType = NoType substh-optType Γ ρ σ (SomeType T) = SomeType (substh-type Γ ρ σ T) substh-optTerm Γ ρ σ NoTerm = NoTerm substh-optTerm Γ ρ σ (SomeTerm t _) = (SomeTerm (substh-term Γ ρ σ t) posinfo-gen) substh-optGuide Γ ρ σ NoGuide = NoGuide substh-optGuide Γ ρ σ (Guide _ x T) = let x' = subst-rename-var-if Γ ρ x σ in Guide posinfo-gen x' (substh-type (ctxt-var-decl x' Γ) (renamectxt-insert ρ x x') σ T) subst-ret-t : Set → Set subst-ret-t T = {ed : exprd} → ctxt → ⟦ ed ⟧ → var → T → T subst : ∀ {ed} → subst-ret-t ⟦ ed ⟧ subst Γ t x = substh Γ empty-renamectxt (trie-single x t) subst-term = subst {TERM} subst-type = subst {TYPE} subst-kind = subst {KIND} subst-liftingType = subst {LIFTINGTYPE} subst-tk = subst {TK} subst-renamectxt : ∀ {ed : exprd} → ctxt → renamectxt → ⟦ ed ⟧ → ⟦ ed ⟧ subst-renamectxt {ed} Γ ρ = substh {ed} {ed} Γ ρ empty-trie rename-var : ∀ {ed} → ctxt → var → var → ⟦ ed ⟧ → ⟦ ed ⟧ rename-var Γ x x' = subst-renamectxt Γ (renamectxt-single x x') substs-ret-t : Set → Set substs-ret-t T = ∀ {ed} → ctxt → trie ⟦ ed ⟧ → T → T substs : ∀ {ed} → substs-ret-t ⟦ ed ⟧ substs Γ = substh Γ empty-renamectxt substs-term = substs {TERM} substs-type = substs {TYPE} substs-kind = substs {KIND} substs-liftingType = substs {LIFTINGTYPE} substs-tk = substs {TK} substs-args : substs-ret-t args substs-args Γ = substh-args Γ empty-renamectxt substs-params : substs-ret-t params substs-params Γ = substh-params Γ empty-renamectxt subst-params-args : ∀ {ed} → ctxt → params → args → ⟦ ed ⟧ → ⟦ ed ⟧ × params × args subst-params-args Γ (ParamsCons (Decl _ _ me x atk _) ps) (ArgsCons a as) t = subst-params-args Γ (substs-params Γ (trie-single x a) ps) as (subst Γ a x t) subst-params-args Γ ps as t = t , ps , as
{ "alphanum_fraction": 0.6647990256, "avg_line_length": 47.3653846154, "ext": "agda", "hexsha": "9ad27d2de1a2488628dd53cc4ade751da395d44a", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "acf691e37210607d028f4b19f98ec26c4353bfb5", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "xoltar/cedille", "max_forks_repo_path": "src/subst.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "acf691e37210607d028f4b19f98ec26c4353bfb5", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "xoltar/cedille", "max_issues_repo_path": "src/subst.agda", "max_line_length": 151, "max_stars_count": null, "max_stars_repo_head_hexsha": "acf691e37210607d028f4b19f98ec26c4353bfb5", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "xoltar/cedille", "max_stars_repo_path": "src/subst.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 4686, "size": 12315 }
module Iff where infix 20 _⇔_ record _⇔_ (A B : Set) : Set where field to : A → B from : B → A
{ "alphanum_fraction": 0.5462962963, "avg_line_length": 13.5, "ext": "agda", "hexsha": "1735ee8c52eb9f708065e1c15542929eadf433d4", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "b2e5e76c3cb6d0c0f3b2779cf20d439db42a33af", "max_forks_repo_licenses": [ "CC-BY-4.0" ], "max_forks_repo_name": "leopoulson/plfa.github.io", "max_forks_repo_path": "blame/Iff.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "b2e5e76c3cb6d0c0f3b2779cf20d439db42a33af", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "CC-BY-4.0" ], "max_issues_repo_name": "leopoulson/plfa.github.io", "max_issues_repo_path": "blame/Iff.agda", "max_line_length": 34, "max_stars_count": null, "max_stars_repo_head_hexsha": "b2e5e76c3cb6d0c0f3b2779cf20d439db42a33af", "max_stars_repo_licenses": [ "CC-BY-4.0" ], "max_stars_repo_name": "leopoulson/plfa.github.io", "max_stars_repo_path": "blame/Iff.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 48, "size": 108 }
module Data.BitVector.Peano where open import Data.BitVector open import Algebra.FunctionProperties.Core open import Data.Nat hiding (pred) renaming (suc to Nsuc; zero to Nzero) open import Data.Vec hiding (fromList) open import Relation.Binary.PropositionalEquality open import Data.Digit hiding (Bit) open import Data.Fin using () renaming (zero to Fzero; suc to Fsuc) open import Data.List open import Data.Product suc : ∀ {n} → Op₁ (BitVector n) suc [] = [] suc (0# ∷ xs) = 1# ∷ xs suc (1# ∷ xs) = 0# ∷ suc xs pred-helper : ∀ {n} → BitVector n → BitVector (Nsuc n) pred-helper [] = 1# ∷ [] pred-helper (0# ∷ xs) = 1# ∷ pred-helper xs pred-helper (1# ∷ xs) = 1# ∷ 0# ∷ xs pred : ∀ {n} → Op₁ (BitVector n) pred [] = [] pred (1# ∷ xs) = 0# ∷ xs pred (0# ∷ xs) = pred-helper xs suc∘pred-helper≡0# : ∀ {n} (x : BitVector n) → suc (pred-helper x) ≡ 0# ∷ x suc∘pred-helper≡0# [] = refl suc∘pred-helper≡0# (0# ∷ xs) = cong (_∷_ 0#) (suc∘pred-helper≡0# xs) suc∘pred-helper≡0# (1# ∷ xs) = refl pred-helper∘suc≡1# : ∀ {n} (x : BitVector n) → pred-helper (suc x) ≡ 1# ∷ x pred-helper∘suc≡1# [] = refl pred-helper∘suc≡1# (0# ∷ xs) = refl pred-helper∘suc≡1# (1# ∷ xs) = cong (_∷_ 1#) (pred-helper∘suc≡1# xs) suc∘pred≡id : ∀ {n} (x : BitVector n) → suc (pred x) ≡ x suc∘pred≡id [] = refl suc∘pred≡id (0# ∷ xs) = suc∘pred-helper≡0# xs suc∘pred≡id (1# ∷ xs) = refl pred∘suc≡id : ∀ {n} (x : BitVector n) → pred (suc x) ≡ x pred∘suc≡id [] = refl pred∘suc≡id (0# ∷ xs) = refl pred∘suc≡id (1# ∷ xs) = pred-helper∘suc≡1# xs data Peano : ∀ {n} → BitVector n → Set where Pzero : ∀ {n} → Peano (zero n) Psuc : ∀ {n} {x : BitVector n} → (p : Peano x) → Peano (suc x) Pdouble : ∀ {n} {x : BitVector n} → Peano x → Peano (0# ∷ x) Pdouble Pzero = Pzero Pdouble (Psuc p) = Psuc (Psuc (Pdouble p)) toPeano : ∀ {n} (x : BitVector n) → Peano x toPeano [] = Pzero toPeano (0# ∷ xs) = Pdouble (toPeano xs) toPeano (1# ∷ xs) = Psuc (Pdouble (toPeano xs)) peanoInduction : ∀ {n} → (P : ∀ {x : BitVector n} → Peano x → Set) → P Pzero → (∀ {x : BitVector n} {m : Peano x} → P m → P (Psuc m)) → ∀ {x : BitVector n} (q : Peano x) → P q peanoInduction P z s Pzero = z peanoInduction P z s (Psuc p) = s {_} {p} (peanoInduction P z s p) induction : ∀ {n} (P : BitVector n → Set) → P (zero n) → (∀ {m} → P m → P (suc m)) → ∀ x → P x induction P z s x = peanoInduction (λ {x} _ → P x) z s (toPeano x) toℕ : ∀ {n} → BitVector n → ℕ toℕ = induction _ 0 Nsuc fromDigit : Digit 2 → Bit fromDigit Fzero = 0# fromDigit (Fsuc Fzero) = 1# fromDigit (Fsuc (Fsuc ())) fromList : ∀ {n} → List (Digit 2) → BitVector n fromList [] = zero _ fromList {Nzero} (x ∷ xs) = [] fromList {Nsuc n} (x ∷ xs) = fromDigit x ∷ fromList xs fromℕ : ∀ {n} → ℕ → BitVector n fromℕ n with toDigits 2 n fromℕ .(fromDigits ds) | ds , refl = fromList ds -- TODO: the terrifying proofs that toℕ and fromℕ are inverses
{ "alphanum_fraction": 0.5964912281, "avg_line_length": 31.597826087, "ext": "agda", "hexsha": "395c602a58c5147e2cac949a5c0d4eacfa9d956d", "lang": "Agda", "max_forks_count": 3, "max_forks_repo_forks_event_max_datetime": "2021-11-12T01:40:57.000Z", "max_forks_repo_forks_event_min_datetime": "2016-05-25T00:15:43.000Z", "max_forks_repo_head_hexsha": "6902f4bce0330f1b58f48395dac4406056713687", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "copumpkin/bitvector", "max_forks_repo_path": "Data/BitVector/Peano.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "6902f4bce0330f1b58f48395dac4406056713687", "max_issues_repo_issues_event_max_datetime": "2016-05-25T02:00:59.000Z", "max_issues_repo_issues_event_min_datetime": "2016-05-25T02:00:59.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "copumpkin/bitvector", "max_issues_repo_path": "Data/BitVector/Peano.agda", "max_line_length": 76, "max_stars_count": 3, "max_stars_repo_head_hexsha": "6902f4bce0330f1b58f48395dac4406056713687", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "copumpkin/bitvector", "max_stars_repo_path": "Data/BitVector/Peano.agda", "max_stars_repo_stars_event_max_datetime": "2021-11-12T01:41:07.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-04T07:19:55.000Z", "num_tokens": 1256, "size": 2907 }
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020, 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 Optics.All open import LibraBFT.Prelude open import LibraBFT.Base.Types open import LibraBFT.Impl.Consensus.Types open import LibraBFT.Impl.NetworkMsg open import LibraBFT.Impl.Util.Crypto open import LibraBFT.Impl.Handle open EpochConfig open import LibraBFT.Yasm.Base ℓ-RoundManager -- In this module, we instantiate the system model with parameters to -- model a system using the simple implementation model we have so -- far, which aims to obey the VotesOnceRule, but not PreferredRoundRule -- yet. This will evolve as we build out a model of a real -- implementation. module LibraBFT.Concrete.System.Parameters where ConcSysParms : SystemParameters ConcSysParms = mkSysParms NodeId _≟NodeId_ GenesisInfo genInfo RoundManager initRM NetworkMsg Vote sig-Vote _⊂Msg_ ∈GenInfo initWrapper peerStep
{ "alphanum_fraction": 0.6648606811, "avg_line_length": 34, "ext": "agda", "hexsha": "0a9ab98e303291686912bd664f1052ad603397ce", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "71aa2168e4875ffdeece9ba7472ee3cee5fa9084", "max_forks_repo_licenses": [ "UPL-1.0" ], "max_forks_repo_name": "cwjnkins/bft-consensus-agda", "max_forks_repo_path": "LibraBFT/Concrete/System/Parameters.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "71aa2168e4875ffdeece9ba7472ee3cee5fa9084", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "UPL-1.0" ], "max_issues_repo_name": "cwjnkins/bft-consensus-agda", "max_issues_repo_path": "LibraBFT/Concrete/System/Parameters.agda", "max_line_length": 111, "max_stars_count": null, "max_stars_repo_head_hexsha": "71aa2168e4875ffdeece9ba7472ee3cee5fa9084", "max_stars_repo_licenses": [ "UPL-1.0" ], "max_stars_repo_name": "cwjnkins/bft-consensus-agda", "max_stars_repo_path": "LibraBFT/Concrete/System/Parameters.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 304, "size": 1292 }
{-# OPTIONS --no-unicode #-} open import Agda.Builtin.Nat pred : Nat -> Nat pred = \ { n -> {!!} }
{ "alphanum_fraction": 0.5445544554, "avg_line_length": 14.4285714286, "ext": "agda", "hexsha": "77e270296929d14a9b657131f68dbfa048ac595d", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/interaction/unicodelambdasplit.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/interaction/unicodelambdasplit.agda", "max_line_length": 28, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/interaction/unicodelambdasplit.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 31, "size": 101 }
module SizedPoly.Console where open import SizedPolyIO.Base open import SizedPolyIO.Console hiding (main) open import NativePolyIO open import Level using () renaming (zero to lzero) {-# TERMINATING #-} myProgram : ∀{i} → IOConsole i (Unit {lzero}) myProgram = exec getLine λ line → exec (putStrLn line) λ _ → exec (putStrLn line) λ _ → myProgram main : NativeIO Unit main = translateIOConsole myProgram
{ "alphanum_fraction": 0.6484210526, "avg_line_length": 22.619047619, "ext": "agda", "hexsha": "2e02458b640d4165598dfe281f81441155810500", "lang": "Agda", "max_forks_count": 2, "max_forks_repo_forks_event_max_datetime": "2022-03-12T11:41:00.000Z", "max_forks_repo_forks_event_min_datetime": "2018-09-01T15:02:37.000Z", "max_forks_repo_head_hexsha": "7cc45e0148a4a508d20ed67e791544c30fecd795", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "agda/ooAgda", "max_forks_repo_path": "examples/SizedPoly/Console.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "7cc45e0148a4a508d20ed67e791544c30fecd795", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "agda/ooAgda", "max_issues_repo_path": "examples/SizedPoly/Console.agda", "max_line_length": 51, "max_stars_count": 23, "max_stars_repo_head_hexsha": "7cc45e0148a4a508d20ed67e791544c30fecd795", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "agda/ooAgda", "max_stars_repo_path": "examples/SizedPoly/Console.agda", "max_stars_repo_stars_event_max_datetime": "2020-10-12T23:15:25.000Z", "max_stars_repo_stars_event_min_datetime": "2016-06-19T12:57:55.000Z", "num_tokens": 126, "size": 475 }
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Properties.Transitivity {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Typed open import Definition.Typed.Properties open import Definition.LogicalRelation open import Definition.LogicalRelation.ShapeView open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.Properties.Conversion open import Tools.Embedding open import Tools.Product import Tools.PropositionalEquality as PE mutual -- Helper function for transitivity of type equality using shape views. transEqT : ∀ {Γ A B C l l′ l″} {[A] : Γ ⊩⟨ l ⟩ A} {[B] : Γ ⊩⟨ l′ ⟩ B} {[C] : Γ ⊩⟨ l″ ⟩ C} → ShapeView₃ Γ l l′ l″ A B C [A] [B] [C] → Γ ⊩⟨ l ⟩ A ≡ B / [A] → Γ ⊩⟨ l′ ⟩ B ≡ C / [B] → Γ ⊩⟨ l ⟩ A ≡ C / [A] transEqT (ℕᵥ D D′ D″) A≡B (ιx (ℕ₌ B≡C)) = ιx (ℕ₌ B≡C) transEqT (ne (ne K [ ⊢A , ⊢B , D ] neK K≡K) (ne K₁ D₁ neK₁ _) (ne K₂ D₂ neK₂ _)) (ιx (ne₌ M D′ neM K≡M)) (ιx (ne₌ M₁ D″ neM₁ K≡M₁)) rewrite whrDet* (red D₁ , ne neK₁) (red D′ , ne neM) | whrDet* (red D₂ , ne neK₂) (red D″ , ne neM₁) = ιx (ne₌ M₁ D″ neM₁ (~-trans K≡M K≡M₁)) transEqT {Γ} {l = l} {l′ = l′} {l″ = l″} (Πᵥ (Πᵣ 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₂ ⊢F₂ ⊢G₂ A≡A₂ [F]₂ [G]₂ G-ext₂)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) (Π₌ F″ G″ D″ A≡B₁ [F≡F′]₁ [G≡G′]₁) = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) F₁≡F′ , G₁≡G′ = Π-PE-injectivity ΠF₁G₁≡ΠF′G′ F₂≡F″ , G₂≡G″ = Π-PE-injectivity (whrDet* (red D₂ , Πₙ) (D″ , Πₙ)) substLift {Δ} {l} {a} ρ x = Δ ⊩⟨ l ⟩ wk (lift ρ) x [ a ] [F′] : ∀ {ρ Δ} [ρ] ⊢Δ → Δ ⊩⟨ l′ ⟩ wk ρ F′ [F′] {ρ} [ρ] ⊢Δ = PE.subst (λ x → _ ⊩⟨ _ ⟩ wk ρ x) F₁≡F′ ([F]₁ [ρ] ⊢Δ) [F″] : ∀ {ρ} {Δ} [ρ] ⊢Δ → Δ ⊩⟨ l″ ⟩ wk ρ F″ [F″] {ρ} [ρ] ⊢Δ = PE.subst (λ x → _ ⊩⟨ _ ⟩ wk ρ x) F₂≡F″ ([F]₂ [ρ] ⊢Δ) [F′≡F″] : ∀ {ρ} {Δ} [ρ] ⊢Δ → Δ ⊩⟨ l′ ⟩ wk ρ F′ ≡ wk ρ F″ / [F′] [ρ] ⊢Δ [F′≡F″] {ρ} [ρ] ⊢Δ = irrelevanceEq′ (PE.cong (wk ρ) F₁≡F′) ([F]₁ [ρ] ⊢Δ) ([F′] [ρ] ⊢Δ) ([F≡F′]₁ [ρ] ⊢Δ) [G′] : ∀ {ρ Δ a} [ρ] ⊢Δ → Δ ⊩⟨ l′ ⟩ a ∷ wk ρ F′ / [F′] [ρ] ⊢Δ → Δ ⊩⟨ l′ ⟩ wk (lift ρ) G′ [ a ] [G′] {ρ} [ρ] ⊢Δ [a] = let [a′] = irrelevanceTerm′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F′] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [a] in PE.subst (substLift ρ) G₁≡G′ ([G]₁ [ρ] ⊢Δ [a′]) [G″] : ∀ {ρ Δ a} [ρ] ⊢Δ → Δ ⊩⟨ l″ ⟩ a ∷ wk ρ F″ / [F″] [ρ] ⊢Δ → Δ ⊩⟨ l″ ⟩ wk (lift ρ) G″ [ a ] [G″] {ρ} [ρ] ⊢Δ [a] = let [a″] = irrelevanceTerm′ (PE.cong (wk ρ) (PE.sym F₂≡F″)) ([F″] [ρ] ⊢Δ) ([F]₂ [ρ] ⊢Δ) [a] in PE.subst (substLift ρ) G₂≡G″ ([G]₂ [ρ] ⊢Δ [a″]) [G′≡G″] : ∀ {ρ Δ a} [ρ] ⊢Δ ([a] : Δ ⊩⟨ l′ ⟩ a ∷ wk ρ F′ / [F′] [ρ] ⊢Δ) → Δ ⊩⟨ l′ ⟩ wk (lift ρ) G′ [ a ] ≡ wk (lift ρ) G″ [ a ] / [G′] [ρ] ⊢Δ [a] [G′≡G″] {ρ} [ρ] ⊢Δ [a′] = let [a]₁ = irrelevanceTerm′ (PE.cong (wk ρ) (PE.sym F₁≡F′)) ([F′] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) [a′] in irrelevanceEq′ (PE.cong (λ x → wk (lift ρ) x [ _ ]) G₁≡G′) ([G]₁ [ρ] ⊢Δ [a]₁) ([G′] [ρ] ⊢Δ [a′]) ([G≡G′]₁ [ρ] ⊢Δ [a]₁) in Π₌ F″ G″ D″ (≅-trans A≡B (PE.subst (λ x → Γ ⊢ x ≅ Π F″ ▹ G″) ΠF₁G₁≡ΠF′G′ A≡B₁)) (λ ρ ⊢Δ → transEq ([F] ρ ⊢Δ) ([F′] ρ ⊢Δ) ([F″] ρ ⊢Δ) ([F≡F′] ρ ⊢Δ) ([F′≡F″] ρ ⊢Δ)) (λ ρ ⊢Δ [a] → let [a′] = convTerm₁ ([F] ρ ⊢Δ) ([F′] ρ ⊢Δ) ([F≡F′] ρ ⊢Δ) [a] [a″] = convTerm₁ ([F′] ρ ⊢Δ) ([F″] ρ ⊢Δ) ([F′≡F″] ρ ⊢Δ) [a′] in transEq ([G] ρ ⊢Δ [a]) ([G′] ρ ⊢Δ [a′]) ([G″] ρ ⊢Δ [a″]) ([G≡G′] ρ ⊢Δ [a]) ([G′≡G″] ρ ⊢Δ [a′])) transEqT (Uᵥ _ _ _ _ _ _ _ _ _) A≡B B≡C = A≡B transEqT (emb⁰¹¹ PE.refl AB) (ιx A≡B) B≡C = ιx (transEqT AB A≡B B≡C) transEqT (emb¹⁰¹ PE.refl AB) A≡B (ιx B≡C) = transEqT AB A≡B B≡C transEqT (emb¹¹⁰ PE.refl AB) A≡B B≡C = transEqT AB A≡B B≡C -- Transitivty of type equality. transEq : ∀ {Γ A B C l l′ l″} ([A] : Γ ⊩⟨ l ⟩ A) ([B] : Γ ⊩⟨ l′ ⟩ B) ([C] : Γ ⊩⟨ l″ ⟩ C) → Γ ⊩⟨ l ⟩ A ≡ B / [A] → Γ ⊩⟨ l′ ⟩ B ≡ C / [B] → Γ ⊩⟨ l ⟩ A ≡ C / [A] transEq [A] [B] [C] A≡B B≡C = transEqT (combine (goodCases [A] [B] A≡B) (goodCases [B] [C] B≡C)) A≡B B≡C -- Transitivty of type equality with some propositonally equal types. transEq′ : ∀ {Γ A B B′ C C′ l l′ l″} → B PE.≡ B′ → C PE.≡ C′ → ([A] : Γ ⊩⟨ l ⟩ A) ([B] : Γ ⊩⟨ l′ ⟩ B) ([C] : Γ ⊩⟨ l″ ⟩ C) → Γ ⊩⟨ l ⟩ A ≡ B′ / [A] → Γ ⊩⟨ l′ ⟩ B ≡ C′ / [B] → Γ ⊩⟨ l ⟩ A ≡ C / [A] transEq′ PE.refl PE.refl [A] [B] [C] A≡B B≡C = transEq [A] [B] [C] A≡B B≡C transEqTermNe : ∀ {Γ n n′ n″ A} → Γ ⊩neNf n ≡ n′ ∷ A → Γ ⊩neNf n′ ≡ n″ ∷ A → Γ ⊩neNf n ≡ n″ ∷ A transEqTermNe (neNfₜ₌ neK neM k≡m) (neNfₜ₌ neK₁ neM₁ k≡m₁) = neNfₜ₌ neK neM₁ (~-trans k≡m k≡m₁) mutual transEqTermℕ : ∀ {Γ n n′ n″} → _⊩ℕ_≡_∷ℕ Γ n n′ → _⊩ℕ_≡_∷ℕ Γ n′ n″ → _⊩ℕ_≡_∷ℕ Γ n n″ transEqTermℕ (ℕₜ₌ k k′ d d′ t≡u prop) (ℕₜ₌ k₁ k″ d₁ d″ t≡u₁ prop₁) = let k₁Whnf = naturalWhnf (proj₁ (split prop₁)) k′Whnf = naturalWhnf (proj₂ (split prop)) k₁≡k′ = whrDet*Term (redₜ d₁ , k₁Whnf) (redₜ d′ , k′Whnf) prop′ = PE.subst (λ x → [Natural]-prop _ x _) k₁≡k′ prop₁ in ℕₜ₌ k k″ d d″ (≅ₜ-trans t≡u (PE.subst (λ x → _ ⊢ x ≅ _ ∷ _) k₁≡k′ t≡u₁)) (transNatural-prop prop prop′) transNatural-prop : ∀ {Γ k k′ k″} → [Natural]-prop Γ k k′ → [Natural]-prop Γ k′ k″ → [Natural]-prop Γ k k″ transNatural-prop (sucᵣ x) (sucᵣ x₁) = sucᵣ (transEqTermℕ x x₁) transNatural-prop (sucᵣ x) (ne (neNfₜ₌ () neM k≡m)) transNatural-prop zeroᵣ prop₁ = prop₁ transNatural-prop prop zeroᵣ = prop transNatural-prop (ne (neNfₜ₌ neK () k≡m)) (sucᵣ x₃) transNatural-prop (ne [k≡k′]) (ne [k′≡k″]) = ne (transEqTermNe [k≡k′] [k′≡k″]) -- Transitivty of term equality. transEqTerm : ∀ {l Γ A t u v} ([A] : Γ ⊩⟨ l ⟩ A) → Γ ⊩⟨ l ⟩ t ≡ u ∷ A / [A] → Γ ⊩⟨ l ⟩ u ≡ v ∷ A / [A] → Γ ⊩⟨ l ⟩ t ≡ v ∷ A / [A] transEqTerm (Uᵣ′ .⁰ 0<1 ⊢Γ) (Uₜ₌ A B d d′ typeA typeB t≡u [t] [u] [t≡u]) (Uₜ₌ A₁ B₁ d₁ d₁′ typeA₁ typeB₁ t≡u₁ [t]₁ [u]₁ [t≡u]₁) rewrite whrDet*Term (redₜ d′ , typeWhnf typeB) (redₜ d₁ , typeWhnf typeA₁) = Uₜ₌ A B₁ d d₁′ typeA typeB₁ (≅ₜ-trans t≡u t≡u₁) [t] [u]₁ (transEq [t] [u] [u]₁ [t≡u] (irrelevanceEq [t]₁ [u] [t≡u]₁)) transEqTerm (ℕᵣ D) (ιx [t≡u]) (ιx [u≡v]) = ιx (transEqTermℕ [t≡u] [u≡v]) transEqTerm (ne′ K D neK K≡K) (ιx (neₜ₌ k m d d′ (neNfₜ₌ neK₁ neM k≡m))) (ιx (neₜ₌ k₁ m₁ d₁ d″ (neNfₜ₌ neK₂ neM₁ k≡m₁))) = let k₁≡m = whrDet*Term (redₜ d₁ , ne neK₂) (redₜ d′ , ne neM) in ιx (neₜ₌ k m₁ d d″ (neNfₜ₌ neK₁ neM₁ (~-trans k≡m (PE.subst (λ x → _ ⊢ x ~ _ ∷ _) k₁≡m k≡m₁)))) transEqTerm (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πₜ₌ f g d d′ funcF funcG f≡g [f] [g] [f≡g]) (Πₜ₌ f₁ g₁ d₁ d₁′ funcF₁ funcG₁ f≡g₁ [f]₁ [g]₁ [f≡g]₁) rewrite whrDet*Term (redₜ d′ , functionWhnf funcG) (redₜ d₁ , functionWhnf funcF₁) = Πₜ₌ f g₁ d d₁′ funcF funcG₁ (≅ₜ-trans f≡g f≡g₁) [f] [g]₁ (λ ρ ⊢Δ [a] → transEqTerm ([G] ρ ⊢Δ [a]) ([f≡g] ρ ⊢Δ [a]) ([f≡g]₁ ρ ⊢Δ [a])) transEqTerm (emb′ 0<1 x) (ιx t≡u) (ιx u≡v) = ιx (transEqTerm x t≡u u≡v)
{ "alphanum_fraction": 0.4235323138, "avg_line_length": 47.1395348837, "ext": "agda", "hexsha": "ce69fb1c06d926d792f8f3b806aef845888fcb9f", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "2251b8da423be0c6fb916f2675d7bd8537e4cd96", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "loic-p/logrel-mltt", "max_forks_repo_path": "Definition/LogicalRelation/Properties/Transitivity.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "2251b8da423be0c6fb916f2675d7bd8537e4cd96", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "loic-p/logrel-mltt", "max_issues_repo_path": "Definition/LogicalRelation/Properties/Transitivity.agda", "max_line_length": 88, "max_stars_count": null, "max_stars_repo_head_hexsha": "2251b8da423be0c6fb916f2675d7bd8537e4cd96", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "loic-p/logrel-mltt", "max_stars_repo_path": "Definition/LogicalRelation/Properties/Transitivity.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 4220, "size": 8108 }
module Text.Greek.SBLGNT.1Pet where open import Data.List open import Text.Greek.Bible open import Text.Greek.Script open import Text.Greek.Script.Unicode ΠΕΤΡΟΥ-Α : List (Word) ΠΕΤΡΟΥ-Α = word (Π ∷ έ ∷ τ ∷ ρ ∷ ο ∷ ς ∷ []) "1Pet.1.1" ∷ word (ἀ ∷ π ∷ ό ∷ σ ∷ τ ∷ ο ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.1.1" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.1.1" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.1" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ε ∷ κ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.1.1" ∷ word (π ∷ α ∷ ρ ∷ ε ∷ π ∷ ι ∷ δ ∷ ή ∷ μ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.1.1" ∷ word (δ ∷ ι ∷ α ∷ σ ∷ π ∷ ο ∷ ρ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.1" ∷ word (Π ∷ ό ∷ ν ∷ τ ∷ ο ∷ υ ∷ []) "1Pet.1.1" ∷ word (Γ ∷ α ∷ ∙λ ∷ α ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.1" ∷ word (Κ ∷ α ∷ π ∷ π ∷ α ∷ δ ∷ ο ∷ κ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.1" ∷ word (Ἀ ∷ σ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.1" ∷ word (Β ∷ ι ∷ θ ∷ υ ∷ ν ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.1" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.1.2" ∷ word (π ∷ ρ ∷ ό ∷ γ ∷ ν ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.1.2" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.1.2" ∷ word (π ∷ α ∷ τ ∷ ρ ∷ ό ∷ ς ∷ []) "1Pet.1.2" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.2" ∷ word (ἁ ∷ γ ∷ ι ∷ α ∷ σ ∷ μ ∷ ῷ ∷ []) "1Pet.1.2" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.2" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.2" ∷ word (ὑ ∷ π ∷ α ∷ κ ∷ ο ∷ ὴ ∷ ν ∷ []) "1Pet.1.2" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.2" ∷ word (ῥ ∷ α ∷ ν ∷ τ ∷ ι ∷ σ ∷ μ ∷ ὸ ∷ ν ∷ []) "1Pet.1.2" ∷ word (α ∷ ἵ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.2" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.1.2" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.2" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ς ∷ []) "1Pet.1.2" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.1.2" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.2" ∷ word (ε ∷ ἰ ∷ ρ ∷ ή ∷ ν ∷ η ∷ []) "1Pet.1.2" ∷ word (π ∷ ∙λ ∷ η ∷ θ ∷ υ ∷ ν ∷ θ ∷ ε ∷ ί ∷ η ∷ []) "1Pet.1.2" ∷ word (Ε ∷ ὐ ∷ ∙λ ∷ ο ∷ γ ∷ η ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.1.3" ∷ word (ὁ ∷ []) "1Pet.1.3" ∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1Pet.1.3" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.3" ∷ word (π ∷ α ∷ τ ∷ ὴ ∷ ρ ∷ []) "1Pet.1.3" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.3" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.1.3" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.3" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.1.3" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.3" ∷ word (ὁ ∷ []) "1Pet.1.3" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.1.3" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.3" ∷ word (π ∷ ο ∷ ∙λ ∷ ὺ ∷ []) "1Pet.1.3" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.3" ∷ word (ἔ ∷ ∙λ ∷ ε ∷ ο ∷ ς ∷ []) "1Pet.1.3" ∷ word (ἀ ∷ ν ∷ α ∷ γ ∷ ε ∷ ν ∷ ν ∷ ή ∷ σ ∷ α ∷ ς ∷ []) "1Pet.1.3" ∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.3" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.3" ∷ word (ἐ ∷ ∙λ ∷ π ∷ ί ∷ δ ∷ α ∷ []) "1Pet.1.3" ∷ word (ζ ∷ ῶ ∷ σ ∷ α ∷ ν ∷ []) "1Pet.1.3" ∷ word (δ ∷ ι ∷ []) "1Pet.1.3" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ά ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.1.3" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.1.3" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.3" ∷ word (ἐ ∷ κ ∷ []) "1Pet.1.3" ∷ word (ν ∷ ε ∷ κ ∷ ρ ∷ ῶ ∷ ν ∷ []) "1Pet.1.3" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.4" ∷ word (κ ∷ ∙λ ∷ η ∷ ρ ∷ ο ∷ ν ∷ ο ∷ μ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.1.4" ∷ word (ἄ ∷ φ ∷ θ ∷ α ∷ ρ ∷ τ ∷ ο ∷ ν ∷ []) "1Pet.1.4" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.4" ∷ word (ἀ ∷ μ ∷ ί ∷ α ∷ ν ∷ τ ∷ ο ∷ ν ∷ []) "1Pet.1.4" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.4" ∷ word (ἀ ∷ μ ∷ ά ∷ ρ ∷ α ∷ ν ∷ τ ∷ ο ∷ ν ∷ []) "1Pet.1.4" ∷ word (τ ∷ ε ∷ τ ∷ η ∷ ρ ∷ η ∷ μ ∷ έ ∷ ν ∷ η ∷ ν ∷ []) "1Pet.1.4" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.4" ∷ word (ο ∷ ὐ ∷ ρ ∷ α ∷ ν ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.1.4" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.4" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.4" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.1.5" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.5" ∷ word (δ ∷ υ ∷ ν ∷ ά ∷ μ ∷ ε ∷ ι ∷ []) "1Pet.1.5" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.1.5" ∷ word (φ ∷ ρ ∷ ο ∷ υ ∷ ρ ∷ ο ∷ υ ∷ μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.1.5" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.1.5" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.1.5" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.5" ∷ word (σ ∷ ω ∷ τ ∷ η ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.1.5" ∷ word (ἑ ∷ τ ∷ ο ∷ ί ∷ μ ∷ η ∷ ν ∷ []) "1Pet.1.5" ∷ word (ἀ ∷ π ∷ ο ∷ κ ∷ α ∷ ∙λ ∷ υ ∷ φ ∷ θ ∷ ῆ ∷ ν ∷ α ∷ ι ∷ []) "1Pet.1.5" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.5" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ῷ ∷ []) "1Pet.1.5" ∷ word (ἐ ∷ σ ∷ χ ∷ ά ∷ τ ∷ ῳ ∷ []) "1Pet.1.5" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.6" ∷ word (ᾧ ∷ []) "1Pet.1.6" ∷ word (ἀ ∷ γ ∷ α ∷ ∙λ ∷ ∙λ ∷ ι ∷ ᾶ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.1.6" ∷ word (ὀ ∷ ∙λ ∷ ί ∷ γ ∷ ο ∷ ν ∷ []) "1Pet.1.6" ∷ word (ἄ ∷ ρ ∷ τ ∷ ι ∷ []) "1Pet.1.6" ∷ word (ε ∷ ἰ ∷ []) "1Pet.1.6" ∷ word (δ ∷ έ ∷ ο ∷ ν ∷ []) "1Pet.1.6" ∷ word (∙λ ∷ υ ∷ π ∷ η ∷ θ ∷ έ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.6" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.6" ∷ word (π ∷ ο ∷ ι ∷ κ ∷ ί ∷ ∙λ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.1.6" ∷ word (π ∷ ε ∷ ι ∷ ρ ∷ α ∷ σ ∷ μ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.1.6" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.1.7" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.7" ∷ word (δ ∷ ο ∷ κ ∷ ί ∷ μ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.1.7" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.7" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.7" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.1.7" ∷ word (π ∷ ο ∷ ∙λ ∷ υ ∷ τ ∷ ι ∷ μ ∷ ό ∷ τ ∷ ε ∷ ρ ∷ ο ∷ ν ∷ []) "1Pet.1.7" ∷ word (χ ∷ ρ ∷ υ ∷ σ ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.1.7" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.7" ∷ word (ἀ ∷ π ∷ ο ∷ ∙λ ∷ ∙λ ∷ υ ∷ μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ []) "1Pet.1.7" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.1.7" ∷ word (π ∷ υ ∷ ρ ∷ ὸ ∷ ς ∷ []) "1Pet.1.7" ∷ word (δ ∷ ὲ ∷ []) "1Pet.1.7" ∷ word (δ ∷ ο ∷ κ ∷ ι ∷ μ ∷ α ∷ ζ ∷ ο ∷ μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ []) "1Pet.1.7" ∷ word (ε ∷ ὑ ∷ ρ ∷ ε ∷ θ ∷ ῇ ∷ []) "1Pet.1.7" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.7" ∷ word (ἔ ∷ π ∷ α ∷ ι ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.1.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.7" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ ν ∷ []) "1Pet.1.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.7" ∷ word (τ ∷ ι ∷ μ ∷ ὴ ∷ ν ∷ []) "1Pet.1.7" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.7" ∷ word (ἀ ∷ π ∷ ο ∷ κ ∷ α ∷ ∙λ ∷ ύ ∷ ψ ∷ ε ∷ ι ∷ []) "1Pet.1.7" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.1.7" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.7" ∷ word (ὃ ∷ ν ∷ []) "1Pet.1.8" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "1Pet.1.8" ∷ word (ἰ ∷ δ ∷ ό ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.8" ∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾶ ∷ τ ∷ ε ∷ []) "1Pet.1.8" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.8" ∷ word (ὃ ∷ ν ∷ []) "1Pet.1.8" ∷ word (ἄ ∷ ρ ∷ τ ∷ ι ∷ []) "1Pet.1.8" ∷ word (μ ∷ ὴ ∷ []) "1Pet.1.8" ∷ word (ὁ ∷ ρ ∷ ῶ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.8" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.8" ∷ word (δ ∷ ὲ ∷ []) "1Pet.1.8" ∷ word (ἀ ∷ γ ∷ α ∷ ∙λ ∷ ∙λ ∷ ι ∷ ᾶ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.1.8" ∷ word (χ ∷ α ∷ ρ ∷ ᾷ ∷ []) "1Pet.1.8" ∷ word (ἀ ∷ ν ∷ ε ∷ κ ∷ ∙λ ∷ α ∷ ∙λ ∷ ή ∷ τ ∷ ῳ ∷ []) "1Pet.1.8" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.8" ∷ word (δ ∷ ε ∷ δ ∷ ο ∷ ξ ∷ α ∷ σ ∷ μ ∷ έ ∷ ν ∷ ῃ ∷ []) "1Pet.1.8" ∷ word (κ ∷ ο ∷ μ ∷ ι ∷ ζ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.1.9" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.9" ∷ word (τ ∷ έ ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.1.9" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.9" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.1.9" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.9" ∷ word (σ ∷ ω ∷ τ ∷ η ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.1.9" ∷ word (ψ ∷ υ ∷ χ ∷ ῶ ∷ ν ∷ []) "1Pet.1.9" ∷ word (Π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1Pet.1.10" ∷ word (ἧ ∷ ς ∷ []) "1Pet.1.10" ∷ word (σ ∷ ω ∷ τ ∷ η ∷ ρ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.10" ∷ word (ἐ ∷ ξ ∷ ε ∷ ζ ∷ ή ∷ τ ∷ η ∷ σ ∷ α ∷ ν ∷ []) "1Pet.1.10" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.10" ∷ word (ἐ ∷ ξ ∷ η ∷ ρ ∷ α ∷ ύ ∷ ν ∷ η ∷ σ ∷ α ∷ ν ∷ []) "1Pet.1.10" ∷ word (π ∷ ρ ∷ ο ∷ φ ∷ ῆ ∷ τ ∷ α ∷ ι ∷ []) "1Pet.1.10" ∷ word (ο ∷ ἱ ∷ []) "1Pet.1.10" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1Pet.1.10" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.10" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.10" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.10" ∷ word (π ∷ ρ ∷ ο ∷ φ ∷ η ∷ τ ∷ ε ∷ ύ ∷ σ ∷ α ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.10" ∷ word (ἐ ∷ ρ ∷ α ∷ υ ∷ ν ∷ ῶ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.11" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.11" ∷ word (τ ∷ ί ∷ ν ∷ α ∷ []) "1Pet.1.11" ∷ word (ἢ ∷ []) "1Pet.1.11" ∷ word (π ∷ ο ∷ ῖ ∷ ο ∷ ν ∷ []) "1Pet.1.11" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ὸ ∷ ν ∷ []) "1Pet.1.11" ∷ word (ἐ ∷ δ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ []) "1Pet.1.11" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.11" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.11" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.1.11" ∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1Pet.1.11" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.11" ∷ word (π ∷ ρ ∷ ο ∷ μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.1.11" ∷ word (τ ∷ ὰ ∷ []) "1Pet.1.11" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.11" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.11" ∷ word (π ∷ α ∷ θ ∷ ή ∷ μ ∷ α ∷ τ ∷ α ∷ []) "1Pet.1.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.11" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "1Pet.1.11" ∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "1Pet.1.11" ∷ word (τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "1Pet.1.11" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ ς ∷ []) "1Pet.1.11" ∷ word (ο ∷ ἷ ∷ ς ∷ []) "1Pet.1.12" ∷ word (ἀ ∷ π ∷ ε ∷ κ ∷ α ∷ ∙λ ∷ ύ ∷ φ ∷ θ ∷ η ∷ []) "1Pet.1.12" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.1.12" ∷ word (ο ∷ ὐ ∷ χ ∷ []) "1Pet.1.12" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.1.12" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.1.12" ∷ word (δ ∷ ὲ ∷ []) "1Pet.1.12" ∷ word (δ ∷ ι ∷ η ∷ κ ∷ ό ∷ ν ∷ ο ∷ υ ∷ ν ∷ []) "1Pet.1.12" ∷ word (α ∷ ὐ ∷ τ ∷ ά ∷ []) "1Pet.1.12" ∷ word (ἃ ∷ []) "1Pet.1.12" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "1Pet.1.12" ∷ word (ἀ ∷ ν ∷ η ∷ γ ∷ γ ∷ έ ∷ ∙λ ∷ η ∷ []) "1Pet.1.12" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.1.12" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.1.12" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.1.12" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ι ∷ σ ∷ α ∷ μ ∷ έ ∷ ν ∷ ω ∷ ν ∷ []) "1Pet.1.12" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.12" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.1.12" ∷ word (ἁ ∷ γ ∷ ί ∷ ῳ ∷ []) "1Pet.1.12" ∷ word (ἀ ∷ π ∷ ο ∷ σ ∷ τ ∷ α ∷ ∙λ ∷ έ ∷ ν ∷ τ ∷ ι ∷ []) "1Pet.1.12" ∷ word (ἀ ∷ π ∷ []) "1Pet.1.12" ∷ word (ο ∷ ὐ ∷ ρ ∷ α ∷ ν ∷ ο ∷ ῦ ∷ []) "1Pet.1.12" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.12" ∷ word (ἃ ∷ []) "1Pet.1.12" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ο ∷ ῦ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.1.12" ∷ word (ἄ ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ο ∷ ι ∷ []) "1Pet.1.12" ∷ word (π ∷ α ∷ ρ ∷ α ∷ κ ∷ ύ ∷ ψ ∷ α ∷ ι ∷ []) "1Pet.1.12" ∷ word (Δ ∷ ι ∷ ὸ ∷ []) "1Pet.1.13" ∷ word (ἀ ∷ ν ∷ α ∷ ζ ∷ ω ∷ σ ∷ ά ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.1.13" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "1Pet.1.13" ∷ word (ὀ ∷ σ ∷ φ ∷ ύ ∷ α ∷ ς ∷ []) "1Pet.1.13" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.13" ∷ word (δ ∷ ι ∷ α ∷ ν ∷ ο ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.13" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.13" ∷ word (ν ∷ ή ∷ φ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.13" ∷ word (τ ∷ ε ∷ ∙λ ∷ ε ∷ ί ∷ ω ∷ ς ∷ []) "1Pet.1.13" ∷ word (ἐ ∷ ∙λ ∷ π ∷ ί ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.1.13" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "1Pet.1.13" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.1.13" ∷ word (φ ∷ ε ∷ ρ ∷ ο ∷ μ ∷ έ ∷ ν ∷ η ∷ ν ∷ []) "1Pet.1.13" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.1.13" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ν ∷ []) "1Pet.1.13" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.13" ∷ word (ἀ ∷ π ∷ ο ∷ κ ∷ α ∷ ∙λ ∷ ύ ∷ ψ ∷ ε ∷ ι ∷ []) "1Pet.1.13" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.1.13" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.13" ∷ word (ὡ ∷ ς ∷ []) "1Pet.1.14" ∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1Pet.1.14" ∷ word (ὑ ∷ π ∷ α ∷ κ ∷ ο ∷ ῆ ∷ ς ∷ []) "1Pet.1.14" ∷ word (μ ∷ ὴ ∷ []) "1Pet.1.14" ∷ word (σ ∷ υ ∷ σ ∷ χ ∷ η ∷ μ ∷ α ∷ τ ∷ ι ∷ ζ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.1.14" ∷ word (τ ∷ α ∷ ῖ ∷ ς ∷ []) "1Pet.1.14" ∷ word (π ∷ ρ ∷ ό ∷ τ ∷ ε ∷ ρ ∷ ο ∷ ν ∷ []) "1Pet.1.14" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.14" ∷ word (τ ∷ ῇ ∷ []) "1Pet.1.14" ∷ word (ἀ ∷ γ ∷ ν ∷ ο ∷ ί ∷ ᾳ ∷ []) "1Pet.1.14" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.14" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.1.14" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.1.15" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.1.15" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.15" ∷ word (κ ∷ α ∷ ∙λ ∷ έ ∷ σ ∷ α ∷ ν ∷ τ ∷ α ∷ []) "1Pet.1.15" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.15" ∷ word (ἅ ∷ γ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.1.15" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.15" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ὶ ∷ []) "1Pet.1.15" ∷ word (ἅ ∷ γ ∷ ι ∷ ο ∷ ι ∷ []) "1Pet.1.15" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.15" ∷ word (π ∷ ά ∷ σ ∷ ῃ ∷ []) "1Pet.1.15" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ῇ ∷ []) "1Pet.1.15" ∷ word (γ ∷ ε ∷ ν ∷ ή ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.1.15" ∷ word (δ ∷ ι ∷ ό ∷ τ ∷ ι ∷ []) "1Pet.1.16" ∷ word (γ ∷ έ ∷ γ ∷ ρ ∷ α ∷ π ∷ τ ∷ α ∷ ι ∷ []) "1Pet.1.16" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.1.16" ∷ word (Ἅ ∷ γ ∷ ι ∷ ο ∷ ι ∷ []) "1Pet.1.16" ∷ word (ἔ ∷ σ ∷ ε ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.1.16" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.1.16" ∷ word (ἐ ∷ γ ∷ ὼ ∷ []) "1Pet.1.16" ∷ word (ἅ ∷ γ ∷ ι ∷ ο ∷ ς ∷ []) "1Pet.1.16" ∷ word (Κ ∷ α ∷ ὶ ∷ []) "1Pet.1.17" ∷ word (ε ∷ ἰ ∷ []) "1Pet.1.17" ∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1Pet.1.17" ∷ word (ἐ ∷ π ∷ ι ∷ κ ∷ α ∷ ∙λ ∷ ε ∷ ῖ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.1.17" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.17" ∷ word (ἀ ∷ π ∷ ρ ∷ ο ∷ σ ∷ ω ∷ π ∷ ο ∷ ∙λ ∷ ή ∷ μ ∷ π ∷ τ ∷ ω ∷ ς ∷ []) "1Pet.1.17" ∷ word (κ ∷ ρ ∷ ί ∷ ν ∷ ο ∷ ν ∷ τ ∷ α ∷ []) "1Pet.1.17" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.1.17" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.17" ∷ word (ἑ ∷ κ ∷ ά ∷ σ ∷ τ ∷ ο ∷ υ ∷ []) "1Pet.1.17" ∷ word (ἔ ∷ ρ ∷ γ ∷ ο ∷ ν ∷ []) "1Pet.1.17" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.17" ∷ word (φ ∷ ό ∷ β ∷ ῳ ∷ []) "1Pet.1.17" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.17" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.17" ∷ word (π ∷ α ∷ ρ ∷ ο ∷ ι ∷ κ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.17" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.17" ∷ word (χ ∷ ρ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.1.17" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ά ∷ φ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.1.17" ∷ word (ε ∷ ἰ ∷ δ ∷ ό ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.18" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.1.18" ∷ word (ο ∷ ὐ ∷ []) "1Pet.1.18" ∷ word (φ ∷ θ ∷ α ∷ ρ ∷ τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.1.18" ∷ word (ἀ ∷ ρ ∷ γ ∷ υ ∷ ρ ∷ ί ∷ ῳ ∷ []) "1Pet.1.18" ∷ word (ἢ ∷ []) "1Pet.1.18" ∷ word (χ ∷ ρ ∷ υ ∷ σ ∷ ί ∷ ῳ ∷ []) "1Pet.1.18" ∷ word (ἐ ∷ ∙λ ∷ υ ∷ τ ∷ ρ ∷ ώ ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.1.18" ∷ word (ἐ ∷ κ ∷ []) "1Pet.1.18" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.18" ∷ word (μ ∷ α ∷ τ ∷ α ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.18" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.18" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ῆ ∷ ς ∷ []) "1Pet.1.18" ∷ word (π ∷ α ∷ τ ∷ ρ ∷ ο ∷ π ∷ α ∷ ρ ∷ α ∷ δ ∷ ό ∷ τ ∷ ο ∷ υ ∷ []) "1Pet.1.18" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.1.19" ∷ word (τ ∷ ι ∷ μ ∷ ί ∷ ῳ ∷ []) "1Pet.1.19" ∷ word (α ∷ ἵ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.1.19" ∷ word (ὡ ∷ ς ∷ []) "1Pet.1.19" ∷ word (ἀ ∷ μ ∷ ν ∷ ο ∷ ῦ ∷ []) "1Pet.1.19" ∷ word (ἀ ∷ μ ∷ ώ ∷ μ ∷ ο ∷ υ ∷ []) "1Pet.1.19" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.19" ∷ word (ἀ ∷ σ ∷ π ∷ ί ∷ ∙λ ∷ ο ∷ υ ∷ []) "1Pet.1.19" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.19" ∷ word (π ∷ ρ ∷ ο ∷ ε ∷ γ ∷ ν ∷ ω ∷ σ ∷ μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ []) "1Pet.1.20" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "1Pet.1.20" ∷ word (π ∷ ρ ∷ ὸ ∷ []) "1Pet.1.20" ∷ word (κ ∷ α ∷ τ ∷ α ∷ β ∷ ο ∷ ∙λ ∷ ῆ ∷ ς ∷ []) "1Pet.1.20" ∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1Pet.1.20" ∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ω ∷ θ ∷ έ ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.20" ∷ word (δ ∷ ὲ ∷ []) "1Pet.1.20" ∷ word (ἐ ∷ π ∷ []) "1Pet.1.20" ∷ word (ἐ ∷ σ ∷ χ ∷ ά ∷ τ ∷ ο ∷ υ ∷ []) "1Pet.1.20" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.1.20" ∷ word (χ ∷ ρ ∷ ό ∷ ν ∷ ω ∷ ν ∷ []) "1Pet.1.20" ∷ word (δ ∷ ι ∷ []) "1Pet.1.20" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.20" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.1.21" ∷ word (δ ∷ ι ∷ []) "1Pet.1.21" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.1.21" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.1.21" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.21" ∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1Pet.1.21" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.21" ∷ word (ἐ ∷ γ ∷ ε ∷ ί ∷ ρ ∷ α ∷ ν ∷ τ ∷ α ∷ []) "1Pet.1.21" ∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.21" ∷ word (ἐ ∷ κ ∷ []) "1Pet.1.21" ∷ word (ν ∷ ε ∷ κ ∷ ρ ∷ ῶ ∷ ν ∷ []) "1Pet.1.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.21" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ ν ∷ []) "1Pet.1.21" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1Pet.1.21" ∷ word (δ ∷ ό ∷ ν ∷ τ ∷ α ∷ []) "1Pet.1.21" ∷ word (ὥ ∷ σ ∷ τ ∷ ε ∷ []) "1Pet.1.21" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.1.21" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1Pet.1.21" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.21" ∷ word (ἐ ∷ ∙λ ∷ π ∷ ί ∷ δ ∷ α ∷ []) "1Pet.1.21" ∷ word (ε ∷ ἶ ∷ ν ∷ α ∷ ι ∷ []) "1Pet.1.21" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.21" ∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1Pet.1.21" ∷ word (Τ ∷ ὰ ∷ ς ∷ []) "1Pet.1.22" ∷ word (ψ ∷ υ ∷ χ ∷ ὰ ∷ ς ∷ []) "1Pet.1.22" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.1.22" ∷ word (ἡ ∷ γ ∷ ν ∷ ι ∷ κ ∷ ό ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.1.22" ∷ word (ἐ ∷ ν ∷ []) "1Pet.1.22" ∷ word (τ ∷ ῇ ∷ []) "1Pet.1.22" ∷ word (ὑ ∷ π ∷ α ∷ κ ∷ ο ∷ ῇ ∷ []) "1Pet.1.22" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.22" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.22" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.22" ∷ word (φ ∷ ι ∷ ∙λ ∷ α ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.1.22" ∷ word (ἀ ∷ ν ∷ υ ∷ π ∷ ό ∷ κ ∷ ρ ∷ ι ∷ τ ∷ ο ∷ ν ∷ []) "1Pet.1.22" ∷ word (ἐ ∷ κ ∷ []) "1Pet.1.22" ∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.1.22" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.1.22" ∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ή ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.1.22" ∷ word (ἐ ∷ κ ∷ τ ∷ ε ∷ ν ∷ ῶ ∷ ς ∷ []) "1Pet.1.22" ∷ word (ἀ ∷ ν ∷ α ∷ γ ∷ ε ∷ γ ∷ ε ∷ ν ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.1.23" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "1Pet.1.23" ∷ word (ἐ ∷ κ ∷ []) "1Pet.1.23" ∷ word (σ ∷ π ∷ ο ∷ ρ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.23" ∷ word (φ ∷ θ ∷ α ∷ ρ ∷ τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.23" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.1.23" ∷ word (ἀ ∷ φ ∷ θ ∷ ά ∷ ρ ∷ τ ∷ ο ∷ υ ∷ []) "1Pet.1.23" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.1.23" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ υ ∷ []) "1Pet.1.23" ∷ word (ζ ∷ ῶ ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.23" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.1.23" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.23" ∷ word (μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.23" ∷ word (δ ∷ ι ∷ ό ∷ τ ∷ ι ∷ []) "1Pet.1.24" ∷ word (π ∷ ᾶ ∷ σ ∷ α ∷ []) "1Pet.1.24" ∷ word (σ ∷ ὰ ∷ ρ ∷ ξ ∷ []) "1Pet.1.24" ∷ word (ὡ ∷ ς ∷ []) "1Pet.1.24" ∷ word (χ ∷ ό ∷ ρ ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.24" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.24" ∷ word (π ∷ ᾶ ∷ σ ∷ α ∷ []) "1Pet.1.24" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ []) "1Pet.1.24" ∷ word (α ∷ ὐ ∷ τ ∷ ῆ ∷ ς ∷ []) "1Pet.1.24" ∷ word (ὡ ∷ ς ∷ []) "1Pet.1.24" ∷ word (ἄ ∷ ν ∷ θ ∷ ο ∷ ς ∷ []) "1Pet.1.24" ∷ word (χ ∷ ό ∷ ρ ∷ τ ∷ ο ∷ υ ∷ []) "1Pet.1.24" ∷ word (ἐ ∷ ξ ∷ η ∷ ρ ∷ ά ∷ ν ∷ θ ∷ η ∷ []) "1Pet.1.24" ∷ word (ὁ ∷ []) "1Pet.1.24" ∷ word (χ ∷ ό ∷ ρ ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.1.24" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.1.24" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.24" ∷ word (ἄ ∷ ν ∷ θ ∷ ο ∷ ς ∷ []) "1Pet.1.24" ∷ word (ἐ ∷ ξ ∷ έ ∷ π ∷ ε ∷ σ ∷ ε ∷ ν ∷ []) "1Pet.1.24" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.25" ∷ word (δ ∷ ὲ ∷ []) "1Pet.1.25" ∷ word (ῥ ∷ ῆ ∷ μ ∷ α ∷ []) "1Pet.1.25" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.1.25" ∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1Pet.1.25" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.25" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.1.25" ∷ word (α ∷ ἰ ∷ ῶ ∷ ν ∷ α ∷ []) "1Pet.1.25" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1Pet.1.25" ∷ word (δ ∷ έ ∷ []) "1Pet.1.25" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1Pet.1.25" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.25" ∷ word (ῥ ∷ ῆ ∷ μ ∷ α ∷ []) "1Pet.1.25" ∷ word (τ ∷ ὸ ∷ []) "1Pet.1.25" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ι ∷ σ ∷ θ ∷ ὲ ∷ ν ∷ []) "1Pet.1.25" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.1.25" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.1.25" ∷ word (Ἀ ∷ π ∷ ο ∷ θ ∷ έ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.1" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "1Pet.2.1" ∷ word (π ∷ ᾶ ∷ σ ∷ α ∷ ν ∷ []) "1Pet.2.1" ∷ word (κ ∷ α ∷ κ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.2.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.1" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ α ∷ []) "1Pet.2.1" ∷ word (δ ∷ ό ∷ ∙λ ∷ ο ∷ ν ∷ []) "1Pet.2.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.1" ∷ word (ὑ ∷ π ∷ ο ∷ κ ∷ ρ ∷ ί ∷ σ ∷ ε ∷ ι ∷ ς ∷ []) "1Pet.2.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.1" ∷ word (φ ∷ θ ∷ ό ∷ ν ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.2.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.1" ∷ word (π ∷ ά ∷ σ ∷ α ∷ ς ∷ []) "1Pet.2.1" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ∙λ ∷ α ∷ ∙λ ∷ ι ∷ ά ∷ ς ∷ []) "1Pet.2.1" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.2" ∷ word (ἀ ∷ ρ ∷ τ ∷ ι ∷ γ ∷ έ ∷ ν ∷ ν ∷ η ∷ τ ∷ α ∷ []) "1Pet.2.2" ∷ word (β ∷ ρ ∷ έ ∷ φ ∷ η ∷ []) "1Pet.2.2" ∷ word (τ ∷ ὸ ∷ []) "1Pet.2.2" ∷ word (∙λ ∷ ο ∷ γ ∷ ι ∷ κ ∷ ὸ ∷ ν ∷ []) "1Pet.2.2" ∷ word (ἄ ∷ δ ∷ ο ∷ ∙λ ∷ ο ∷ ν ∷ []) "1Pet.2.2" ∷ word (γ ∷ ά ∷ ∙λ ∷ α ∷ []) "1Pet.2.2" ∷ word (ἐ ∷ π ∷ ι ∷ π ∷ ο ∷ θ ∷ ή ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.2.2" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.2.2" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.2" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1Pet.2.2" ∷ word (α ∷ ὐ ∷ ξ ∷ η ∷ θ ∷ ῆ ∷ τ ∷ ε ∷ []) "1Pet.2.2" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.2" ∷ word (σ ∷ ω ∷ τ ∷ η ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.2.2" ∷ word (ε ∷ ἰ ∷ []) "1Pet.2.3" ∷ word (ἐ ∷ γ ∷ ε ∷ ύ ∷ σ ∷ α ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.2.3" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.2.3" ∷ word (χ ∷ ρ ∷ η ∷ σ ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.2.3" ∷ word (ὁ ∷ []) "1Pet.2.3" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ς ∷ []) "1Pet.2.3" ∷ word (Π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1Pet.2.4" ∷ word (ὃ ∷ ν ∷ []) "1Pet.2.4" ∷ word (π ∷ ρ ∷ ο ∷ σ ∷ ε ∷ ρ ∷ χ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.4" ∷ word (∙λ ∷ ί ∷ θ ∷ ο ∷ ν ∷ []) "1Pet.2.4" ∷ word (ζ ∷ ῶ ∷ ν ∷ τ ∷ α ∷ []) "1Pet.2.4" ∷ word (ὑ ∷ π ∷ ὸ ∷ []) "1Pet.2.4" ∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ώ ∷ π ∷ ω ∷ ν ∷ []) "1Pet.2.4" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "1Pet.2.4" ∷ word (ἀ ∷ π ∷ ο ∷ δ ∷ ε ∷ δ ∷ ο ∷ κ ∷ ι ∷ μ ∷ α ∷ σ ∷ μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.2.4" ∷ word (π ∷ α ∷ ρ ∷ ὰ ∷ []) "1Pet.2.4" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.4" ∷ word (θ ∷ ε ∷ ῷ ∷ []) "1Pet.2.4" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ε ∷ κ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.4" ∷ word (ἔ ∷ ν ∷ τ ∷ ι ∷ μ ∷ ο ∷ ν ∷ []) "1Pet.2.4" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.5" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ὶ ∷ []) "1Pet.2.5" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.5" ∷ word (∙λ ∷ ί ∷ θ ∷ ο ∷ ι ∷ []) "1Pet.2.5" ∷ word (ζ ∷ ῶ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.5" ∷ word (ο ∷ ἰ ∷ κ ∷ ο ∷ δ ∷ ο ∷ μ ∷ ε ∷ ῖ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.2.5" ∷ word (ο ∷ ἶ ∷ κ ∷ ο ∷ ς ∷ []) "1Pet.2.5" ∷ word (π ∷ ν ∷ ε ∷ υ ∷ μ ∷ α ∷ τ ∷ ι ∷ κ ∷ ὸ ∷ ς ∷ []) "1Pet.2.5" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.5" ∷ word (ἱ ∷ ε ∷ ρ ∷ ά ∷ τ ∷ ε ∷ υ ∷ μ ∷ α ∷ []) "1Pet.2.5" ∷ word (ἅ ∷ γ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.2.5" ∷ word (ἀ ∷ ν ∷ ε ∷ ν ∷ έ ∷ γ ∷ κ ∷ α ∷ ι ∷ []) "1Pet.2.5" ∷ word (π ∷ ν ∷ ε ∷ υ ∷ μ ∷ α ∷ τ ∷ ι ∷ κ ∷ ὰ ∷ ς ∷ []) "1Pet.2.5" ∷ word (θ ∷ υ ∷ σ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.2.5" ∷ word (ε ∷ ὐ ∷ π ∷ ρ ∷ ο ∷ σ ∷ δ ∷ έ ∷ κ ∷ τ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.2.5" ∷ word (θ ∷ ε ∷ ῷ ∷ []) "1Pet.2.5" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.2.5" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.2.5" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.5" ∷ word (δ ∷ ι ∷ ό ∷ τ ∷ ι ∷ []) "1Pet.2.6" ∷ word (π ∷ ε ∷ ρ ∷ ι ∷ έ ∷ χ ∷ ε ∷ ι ∷ []) "1Pet.2.6" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.6" ∷ word (γ ∷ ρ ∷ α ∷ φ ∷ ῇ ∷ []) "1Pet.2.6" ∷ word (Ἰ ∷ δ ∷ ο ∷ ὺ ∷ []) "1Pet.2.6" ∷ word (τ ∷ ί ∷ θ ∷ η ∷ μ ∷ ι ∷ []) "1Pet.2.6" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.6" ∷ word (Σ ∷ ι ∷ ὼ ∷ ν ∷ []) "1Pet.2.6" ∷ word (∙λ ∷ ί ∷ θ ∷ ο ∷ ν ∷ []) "1Pet.2.6" ∷ word (ἀ ∷ κ ∷ ρ ∷ ο ∷ γ ∷ ω ∷ ν ∷ ι ∷ α ∷ ῖ ∷ ο ∷ ν ∷ []) "1Pet.2.6" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ε ∷ κ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.6" ∷ word (ἔ ∷ ν ∷ τ ∷ ι ∷ μ ∷ ο ∷ ν ∷ []) "1Pet.2.6" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.6" ∷ word (ὁ ∷ []) "1Pet.2.6" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ω ∷ ν ∷ []) "1Pet.2.6" ∷ word (ἐ ∷ π ∷ []) "1Pet.2.6" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1Pet.2.6" ∷ word (ο ∷ ὐ ∷ []) "1Pet.2.6" ∷ word (μ ∷ ὴ ∷ []) "1Pet.2.6" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ι ∷ σ ∷ χ ∷ υ ∷ ν ∷ θ ∷ ῇ ∷ []) "1Pet.2.6" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.2.7" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "1Pet.2.7" ∷ word (ἡ ∷ []) "1Pet.2.7" ∷ word (τ ∷ ι ∷ μ ∷ ὴ ∷ []) "1Pet.2.7" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.7" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.7" ∷ word (ἀ ∷ π ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.7" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.7" ∷ word (∙λ ∷ ί ∷ θ ∷ ο ∷ ς ∷ []) "1Pet.2.7" ∷ word (ὃ ∷ ν ∷ []) "1Pet.2.7" ∷ word (ἀ ∷ π ∷ ε ∷ δ ∷ ο ∷ κ ∷ ί ∷ μ ∷ α ∷ σ ∷ α ∷ ν ∷ []) "1Pet.2.7" ∷ word (ο ∷ ἱ ∷ []) "1Pet.2.7" ∷ word (ο ∷ ἰ ∷ κ ∷ ο ∷ δ ∷ ο ∷ μ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.7" ∷ word (ο ∷ ὗ ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.2.7" ∷ word (ἐ ∷ γ ∷ ε ∷ ν ∷ ή ∷ θ ∷ η ∷ []) "1Pet.2.7" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.7" ∷ word (κ ∷ ε ∷ φ ∷ α ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "1Pet.2.7" ∷ word (γ ∷ ω ∷ ν ∷ ί ∷ α ∷ ς ∷ []) "1Pet.2.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.8" ∷ word (∙λ ∷ ί ∷ θ ∷ ο ∷ ς ∷ []) "1Pet.2.8" ∷ word (π ∷ ρ ∷ ο ∷ σ ∷ κ ∷ ό ∷ μ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.2.8" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.8" ∷ word (π ∷ έ ∷ τ ∷ ρ ∷ α ∷ []) "1Pet.2.8" ∷ word (σ ∷ κ ∷ α ∷ ν ∷ δ ∷ ά ∷ ∙λ ∷ ο ∷ υ ∷ []) "1Pet.2.8" ∷ word (ο ∷ ἳ ∷ []) "1Pet.2.8" ∷ word (π ∷ ρ ∷ ο ∷ σ ∷ κ ∷ ό ∷ π ∷ τ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.8" ∷ word (τ ∷ ῷ ∷ []) "1Pet.2.8" ∷ word (∙λ ∷ ό ∷ γ ∷ ῳ ∷ []) "1Pet.2.8" ∷ word (ἀ ∷ π ∷ ε ∷ ι ∷ θ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.8" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.8" ∷ word (ὃ ∷ []) "1Pet.2.8" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.8" ∷ word (ἐ ∷ τ ∷ έ ∷ θ ∷ η ∷ σ ∷ α ∷ ν ∷ []) "1Pet.2.8" ∷ word (Ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1Pet.2.9" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.9" ∷ word (γ ∷ έ ∷ ν ∷ ο ∷ ς ∷ []) "1Pet.2.9" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ε ∷ κ ∷ τ ∷ ό ∷ ν ∷ []) "1Pet.2.9" ∷ word (β ∷ α ∷ σ ∷ ί ∷ ∙λ ∷ ε ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.2.9" ∷ word (ἱ ∷ ε ∷ ρ ∷ ά ∷ τ ∷ ε ∷ υ ∷ μ ∷ α ∷ []) "1Pet.2.9" ∷ word (ἔ ∷ θ ∷ ν ∷ ο ∷ ς ∷ []) "1Pet.2.9" ∷ word (ἅ ∷ γ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.2.9" ∷ word (∙λ ∷ α ∷ ὸ ∷ ς ∷ []) "1Pet.2.9" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.9" ∷ word (π ∷ ε ∷ ρ ∷ ι ∷ π ∷ ο ∷ ί ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.9" ∷ word (ὅ ∷ π ∷ ω ∷ ς ∷ []) "1Pet.2.9" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "1Pet.2.9" ∷ word (ἀ ∷ ρ ∷ ε ∷ τ ∷ ὰ ∷ ς ∷ []) "1Pet.2.9" ∷ word (ἐ ∷ ξ ∷ α ∷ γ ∷ γ ∷ ε ∷ ί ∷ ∙λ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.2.9" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.9" ∷ word (ἐ ∷ κ ∷ []) "1Pet.2.9" ∷ word (σ ∷ κ ∷ ό ∷ τ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.2.9" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.2.9" ∷ word (κ ∷ α ∷ ∙λ ∷ έ ∷ σ ∷ α ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.2.9" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.9" ∷ word (τ ∷ ὸ ∷ []) "1Pet.2.9" ∷ word (θ ∷ α ∷ υ ∷ μ ∷ α ∷ σ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.9" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.9" ∷ word (φ ∷ ῶ ∷ ς ∷ []) "1Pet.2.9" ∷ word (ο ∷ ἵ ∷ []) "1Pet.2.10" ∷ word (π ∷ ο ∷ τ ∷ ε ∷ []) "1Pet.2.10" ∷ word (ο ∷ ὐ ∷ []) "1Pet.2.10" ∷ word (∙λ ∷ α ∷ ὸ ∷ ς ∷ []) "1Pet.2.10" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "1Pet.2.10" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.10" ∷ word (∙λ ∷ α ∷ ὸ ∷ ς ∷ []) "1Pet.2.10" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.2.10" ∷ word (ο ∷ ἱ ∷ []) "1Pet.2.10" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "1Pet.2.10" ∷ word (ἠ ∷ ∙λ ∷ ε ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.10" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "1Pet.2.10" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.10" ∷ word (ἐ ∷ ∙λ ∷ ε ∷ η ∷ θ ∷ έ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.10" ∷ word (Ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1Pet.2.11" ∷ word (π ∷ α ∷ ρ ∷ α ∷ κ ∷ α ∷ ∙λ ∷ ῶ ∷ []) "1Pet.2.11" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.11" ∷ word (π ∷ α ∷ ρ ∷ ο ∷ ί ∷ κ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.2.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.11" ∷ word (π ∷ α ∷ ρ ∷ ε ∷ π ∷ ι ∷ δ ∷ ή ∷ μ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.2.11" ∷ word (ἀ ∷ π ∷ έ ∷ χ ∷ ε ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "1Pet.2.11" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.2.11" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ι ∷ κ ∷ ῶ ∷ ν ∷ []) "1Pet.2.11" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.2.11" ∷ word (α ∷ ἵ ∷ τ ∷ ι ∷ ν ∷ ε ∷ ς ∷ []) "1Pet.2.11" ∷ word (σ ∷ τ ∷ ρ ∷ α ∷ τ ∷ ε ∷ ύ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "1Pet.2.11" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.2.11" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.2.11" ∷ word (ψ ∷ υ ∷ χ ∷ ῆ ∷ ς ∷ []) "1Pet.2.11" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ὴ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.12" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.12" ∷ word (ἔ ∷ θ ∷ ν ∷ ε ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.12" ∷ word (κ ∷ α ∷ ∙λ ∷ ή ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.2.12" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ᾧ ∷ []) "1Pet.2.12" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ∙λ ∷ α ∷ ∙λ ∷ ο ∷ ῦ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.12" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.12" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἐ ∷ κ ∷ []) "1Pet.2.12" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.2.12" ∷ word (κ ∷ α ∷ ∙λ ∷ ῶ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἔ ∷ ρ ∷ γ ∷ ω ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἐ ∷ π ∷ ο ∷ π ∷ τ ∷ ε ∷ ύ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.12" ∷ word (δ ∷ ο ∷ ξ ∷ ά ∷ σ ∷ ω ∷ σ ∷ ι ∷ []) "1Pet.2.12" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.12" ∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.12" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ ᾳ ∷ []) "1Pet.2.12" ∷ word (ἐ ∷ π ∷ ι ∷ σ ∷ κ ∷ ο ∷ π ∷ ῆ ∷ ς ∷ []) "1Pet.2.12" ∷ word (Ὑ ∷ π ∷ ο ∷ τ ∷ ά ∷ γ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.2.13" ∷ word (π ∷ ά ∷ σ ∷ ῃ ∷ []) "1Pet.2.13" ∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ί ∷ ν ∷ ῃ ∷ []) "1Pet.2.13" ∷ word (κ ∷ τ ∷ ί ∷ σ ∷ ε ∷ ι ∷ []) "1Pet.2.13" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.2.13" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.13" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.2.13" ∷ word (ε ∷ ἴ ∷ τ ∷ ε ∷ []) "1Pet.2.13" ∷ word (β ∷ α ∷ σ ∷ ι ∷ ∙λ ∷ ε ∷ ῖ ∷ []) "1Pet.2.13" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.13" ∷ word (ὑ ∷ π ∷ ε ∷ ρ ∷ έ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ι ∷ []) "1Pet.2.13" ∷ word (ε ∷ ἴ ∷ τ ∷ ε ∷ []) "1Pet.2.14" ∷ word (ἡ ∷ γ ∷ ε ∷ μ ∷ ό ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.14" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.14" ∷ word (δ ∷ ι ∷ []) "1Pet.2.14" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.14" ∷ word (π ∷ ε ∷ μ ∷ π ∷ ο ∷ μ ∷ έ ∷ ν ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.2.14" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.14" ∷ word (ἐ ∷ κ ∷ δ ∷ ί ∷ κ ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.14" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.2.14" ∷ word (ἔ ∷ π ∷ α ∷ ι ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.2.14" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.14" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.2.14" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.2.15" ∷ word (ο ∷ ὕ ∷ τ ∷ ω ∷ ς ∷ []) "1Pet.2.15" ∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1Pet.2.15" ∷ word (τ ∷ ὸ ∷ []) "1Pet.2.15" ∷ word (θ ∷ έ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "1Pet.2.15" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.15" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.2.15" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.2.15" ∷ word (φ ∷ ι ∷ μ ∷ ο ∷ ῦ ∷ ν ∷ []) "1Pet.2.15" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.2.15" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.2.15" ∷ word (ἀ ∷ φ ∷ ρ ∷ ό ∷ ν ∷ ω ∷ ν ∷ []) "1Pet.2.15" ∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ώ ∷ π ∷ ω ∷ ν ∷ []) "1Pet.2.15" ∷ word (ἀ ∷ γ ∷ ν ∷ ω ∷ σ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.2.15" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.16" ∷ word (ἐ ∷ ∙λ ∷ ε ∷ ύ ∷ θ ∷ ε ∷ ρ ∷ ο ∷ ι ∷ []) "1Pet.2.16" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.16" ∷ word (μ ∷ ὴ ∷ []) "1Pet.2.16" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.16" ∷ word (ἐ ∷ π ∷ ι ∷ κ ∷ ά ∷ ∙λ ∷ υ ∷ μ ∷ μ ∷ α ∷ []) "1Pet.2.16" ∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.16" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.2.16" ∷ word (κ ∷ α ∷ κ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.2.16" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.2.16" ∷ word (ἐ ∷ ∙λ ∷ ε ∷ υ ∷ θ ∷ ε ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.2.16" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1Pet.2.16" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.16" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.2.16" ∷ word (δ ∷ ο ∷ ῦ ∷ ∙λ ∷ ο ∷ ι ∷ []) "1Pet.2.16" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.2.17" ∷ word (τ ∷ ι ∷ μ ∷ ή ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.2.17" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.2.17" ∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ό ∷ τ ∷ η ∷ τ ∷ α ∷ []) "1Pet.2.17" ∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾶ ∷ τ ∷ ε ∷ []) "1Pet.2.17" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.17" ∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1Pet.2.17" ∷ word (φ ∷ ο ∷ β ∷ ε ∷ ῖ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.2.17" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.17" ∷ word (β ∷ α ∷ σ ∷ ι ∷ ∙λ ∷ έ ∷ α ∷ []) "1Pet.2.17" ∷ word (τ ∷ ι ∷ μ ∷ ᾶ ∷ τ ∷ ε ∷ []) "1Pet.2.17" ∷ word (Ο ∷ ἱ ∷ []) "1Pet.2.18" ∷ word (ο ∷ ἰ ∷ κ ∷ έ ∷ τ ∷ α ∷ ι ∷ []) "1Pet.2.18" ∷ word (ὑ ∷ π ∷ ο ∷ τ ∷ α ∷ σ ∷ σ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.18" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.18" ∷ word (π ∷ α ∷ ν ∷ τ ∷ ὶ ∷ []) "1Pet.2.18" ∷ word (φ ∷ ό ∷ β ∷ ῳ ∷ []) "1Pet.2.18" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.18" ∷ word (δ ∷ ε ∷ σ ∷ π ∷ ό ∷ τ ∷ α ∷ ι ∷ ς ∷ []) "1Pet.2.18" ∷ word (ο ∷ ὐ ∷ []) "1Pet.2.18" ∷ word (μ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.2.18" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.18" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.18" ∷ word (ἐ ∷ π ∷ ι ∷ ε ∷ ι ∷ κ ∷ έ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.18" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.2.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.18" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.18" ∷ word (σ ∷ κ ∷ ο ∷ ∙λ ∷ ι ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.18" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1Pet.2.19" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.2.19" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ς ∷ []) "1Pet.2.19" ∷ word (ε ∷ ἰ ∷ []) "1Pet.2.19" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.2.19" ∷ word (σ ∷ υ ∷ ν ∷ ε ∷ ί ∷ δ ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.19" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.2.19" ∷ word (ὑ ∷ π ∷ ο ∷ φ ∷ έ ∷ ρ ∷ ε ∷ ι ∷ []) "1Pet.2.19" ∷ word (τ ∷ ι ∷ ς ∷ []) "1Pet.2.19" ∷ word (∙λ ∷ ύ ∷ π ∷ α ∷ ς ∷ []) "1Pet.2.19" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ω ∷ ν ∷ []) "1Pet.2.19" ∷ word (ἀ ∷ δ ∷ ί ∷ κ ∷ ω ∷ ς ∷ []) "1Pet.2.19" ∷ word (π ∷ ο ∷ ῖ ∷ ο ∷ ν ∷ []) "1Pet.2.20" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.2.20" ∷ word (κ ∷ ∙λ ∷ έ ∷ ο ∷ ς ∷ []) "1Pet.2.20" ∷ word (ε ∷ ἰ ∷ []) "1Pet.2.20" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.20" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.20" ∷ word (κ ∷ ο ∷ ∙λ ∷ α ∷ φ ∷ ι ∷ ζ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.20" ∷ word (ὑ ∷ π ∷ ο ∷ μ ∷ ε ∷ ν ∷ ε ∷ ῖ ∷ τ ∷ ε ∷ []) "1Pet.2.20" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1Pet.2.20" ∷ word (ε ∷ ἰ ∷ []) "1Pet.2.20" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.20" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.20" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.2.20" ∷ word (ὑ ∷ π ∷ ο ∷ μ ∷ ε ∷ ν ∷ ε ∷ ῖ ∷ τ ∷ ε ∷ []) "1Pet.2.20" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1Pet.2.20" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ς ∷ []) "1Pet.2.20" ∷ word (π ∷ α ∷ ρ ∷ ὰ ∷ []) "1Pet.2.20" ∷ word (θ ∷ ε ∷ ῷ ∷ []) "1Pet.2.20" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.2.21" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1Pet.2.21" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.2.21" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ή ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.2.21" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.2.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.21" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.2.21" ∷ word (ἔ ∷ π ∷ α ∷ θ ∷ ε ∷ ν ∷ []) "1Pet.2.21" ∷ word (ὑ ∷ π ∷ ὲ ∷ ρ ∷ []) "1Pet.2.21" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.2.21" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.2.21" ∷ word (ὑ ∷ π ∷ ο ∷ ∙λ ∷ ι ∷ μ ∷ π ∷ ά ∷ ν ∷ ω ∷ ν ∷ []) "1Pet.2.21" ∷ word (ὑ ∷ π ∷ ο ∷ γ ∷ ρ ∷ α ∷ μ ∷ μ ∷ ὸ ∷ ν ∷ []) "1Pet.2.21" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.2.21" ∷ word (ἐ ∷ π ∷ α ∷ κ ∷ ο ∷ ∙λ ∷ ο ∷ υ ∷ θ ∷ ή ∷ σ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.2.21" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.2.21" ∷ word (ἴ ∷ χ ∷ ν ∷ ε ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.2.21" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.21" ∷ word (ὃ ∷ ς ∷ []) "1Pet.2.22" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.2.22" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "1Pet.2.22" ∷ word (ἐ ∷ π ∷ ο ∷ ί ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "1Pet.2.22" ∷ word (ο ∷ ὐ ∷ δ ∷ ὲ ∷ []) "1Pet.2.22" ∷ word (ε ∷ ὑ ∷ ρ ∷ έ ∷ θ ∷ η ∷ []) "1Pet.2.22" ∷ word (δ ∷ ό ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.2.22" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.22" ∷ word (τ ∷ ῷ ∷ []) "1Pet.2.22" ∷ word (σ ∷ τ ∷ ό ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.2.22" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.22" ∷ word (ὃ ∷ ς ∷ []) "1Pet.2.23" ∷ word (∙λ ∷ ο ∷ ι ∷ δ ∷ ο ∷ ρ ∷ ο ∷ ύ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1Pet.2.23" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "1Pet.2.23" ∷ word (ἀ ∷ ν ∷ τ ∷ ε ∷ ∙λ ∷ ο ∷ ι ∷ δ ∷ ό ∷ ρ ∷ ε ∷ ι ∷ []) "1Pet.2.23" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ω ∷ ν ∷ []) "1Pet.2.23" ∷ word (ο ∷ ὐ ∷ κ ∷ []) "1Pet.2.23" ∷ word (ἠ ∷ π ∷ ε ∷ ί ∷ ∙λ ∷ ε ∷ ι ∷ []) "1Pet.2.23" ∷ word (π ∷ α ∷ ρ ∷ ε ∷ δ ∷ ί ∷ δ ∷ ο ∷ υ ∷ []) "1Pet.2.23" ∷ word (δ ∷ ὲ ∷ []) "1Pet.2.23" ∷ word (τ ∷ ῷ ∷ []) "1Pet.2.23" ∷ word (κ ∷ ρ ∷ ί ∷ ν ∷ ο ∷ ν ∷ τ ∷ ι ∷ []) "1Pet.2.23" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ί ∷ ω ∷ ς ∷ []) "1Pet.2.23" ∷ word (ὃ ∷ ς ∷ []) "1Pet.2.24" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "1Pet.2.24" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.2.24" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.2.24" ∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.2.24" ∷ word (ἀ ∷ ν ∷ ή ∷ ν ∷ ε ∷ γ ∷ κ ∷ ε ∷ ν ∷ []) "1Pet.2.24" ∷ word (ἐ ∷ ν ∷ []) "1Pet.2.24" ∷ word (τ ∷ ῷ ∷ []) "1Pet.2.24" ∷ word (σ ∷ ώ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.2.24" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.2.24" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "1Pet.2.24" ∷ word (τ ∷ ὸ ∷ []) "1Pet.2.24" ∷ word (ξ ∷ ύ ∷ ∙λ ∷ ο ∷ ν ∷ []) "1Pet.2.24" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.2.24" ∷ word (τ ∷ α ∷ ῖ ∷ ς ∷ []) "1Pet.2.24" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.2.24" ∷ word (ἀ ∷ π ∷ ο ∷ γ ∷ ε ∷ ν ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.24" ∷ word (τ ∷ ῇ ∷ []) "1Pet.2.24" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ ῃ ∷ []) "1Pet.2.24" ∷ word (ζ ∷ ή ∷ σ ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1Pet.2.24" ∷ word (ο ∷ ὗ ∷ []) "1Pet.2.24" ∷ word (τ ∷ ῷ ∷ []) "1Pet.2.24" ∷ word (μ ∷ ώ ∷ ∙λ ∷ ω ∷ π ∷ ι ∷ []) "1Pet.2.24" ∷ word (ἰ ∷ ά ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.2.24" ∷ word (ἦ ∷ τ ∷ ε ∷ []) "1Pet.2.25" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.2.25" ∷ word (ὡ ∷ ς ∷ []) "1Pet.2.25" ∷ word (π ∷ ρ ∷ ό ∷ β ∷ α ∷ τ ∷ α ∷ []) "1Pet.2.25" ∷ word (π ∷ ∙λ ∷ α ∷ ν ∷ ώ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.2.25" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.2.25" ∷ word (ἐ ∷ π ∷ ε ∷ σ ∷ τ ∷ ρ ∷ ά ∷ φ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.2.25" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "1Pet.2.25" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "1Pet.2.25" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.2.25" ∷ word (π ∷ ο ∷ ι ∷ μ ∷ έ ∷ ν ∷ α ∷ []) "1Pet.2.25" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.2.25" ∷ word (ἐ ∷ π ∷ ί ∷ σ ∷ κ ∷ ο ∷ π ∷ ο ∷ ν ∷ []) "1Pet.2.25" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.2.25" ∷ word (ψ ∷ υ ∷ χ ∷ ῶ ∷ ν ∷ []) "1Pet.2.25" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.2.25" ∷ word (Ὁ ∷ μ ∷ ο ∷ ί ∷ ω ∷ ς ∷ []) "1Pet.3.1" ∷ word (γ ∷ υ ∷ ν ∷ α ∷ ῖ ∷ κ ∷ ε ∷ ς ∷ []) "1Pet.3.1" ∷ word (ὑ ∷ π ∷ ο ∷ τ ∷ α ∷ σ ∷ σ ∷ ό ∷ μ ∷ ε ∷ ν ∷ α ∷ ι ∷ []) "1Pet.3.1" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.3.1" ∷ word (ἰ ∷ δ ∷ ί ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.3.1" ∷ word (ἀ ∷ ν ∷ δ ∷ ρ ∷ ά ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.1" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.3.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.1" ∷ word (ε ∷ ἴ ∷ []) "1Pet.3.1" ∷ word (τ ∷ ι ∷ ν ∷ ε ∷ ς ∷ []) "1Pet.3.1" ∷ word (ἀ ∷ π ∷ ε ∷ ι ∷ θ ∷ ο ∷ ῦ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.1" ∷ word (τ ∷ ῷ ∷ []) "1Pet.3.1" ∷ word (∙λ ∷ ό ∷ γ ∷ ῳ ∷ []) "1Pet.3.1" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.3.1" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.3.1" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.3.1" ∷ word (γ ∷ υ ∷ ν ∷ α ∷ ι ∷ κ ∷ ῶ ∷ ν ∷ []) "1Pet.3.1" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ῆ ∷ ς ∷ []) "1Pet.3.1" ∷ word (ἄ ∷ ν ∷ ε ∷ υ ∷ []) "1Pet.3.1" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ υ ∷ []) "1Pet.3.1" ∷ word (κ ∷ ε ∷ ρ ∷ δ ∷ η ∷ θ ∷ ή ∷ σ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "1Pet.3.1" ∷ word (ἐ ∷ π ∷ ο ∷ π ∷ τ ∷ ε ∷ ύ ∷ σ ∷ α ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.2" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.3.2" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.2" ∷ word (φ ∷ ό ∷ β ∷ ῳ ∷ []) "1Pet.3.2" ∷ word (ἁ ∷ γ ∷ ν ∷ ὴ ∷ ν ∷ []) "1Pet.3.2" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ὴ ∷ ν ∷ []) "1Pet.3.2" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.3.2" ∷ word (ὧ ∷ ν ∷ []) "1Pet.3.3" ∷ word (ἔ ∷ σ ∷ τ ∷ ω ∷ []) "1Pet.3.3" ∷ word (ο ∷ ὐ ∷ χ ∷ []) "1Pet.3.3" ∷ word (ὁ ∷ []) "1Pet.3.3" ∷ word (ἔ ∷ ξ ∷ ω ∷ θ ∷ ε ∷ ν ∷ []) "1Pet.3.3" ∷ word (ἐ ∷ μ ∷ π ∷ ∙λ ∷ ο ∷ κ ∷ ῆ ∷ ς ∷ []) "1Pet.3.3" ∷ word (τ ∷ ρ ∷ ι ∷ χ ∷ ῶ ∷ ν ∷ []) "1Pet.3.3" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.3" ∷ word (π ∷ ε ∷ ρ ∷ ι ∷ θ ∷ έ ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.3.3" ∷ word (χ ∷ ρ ∷ υ ∷ σ ∷ ί ∷ ω ∷ ν ∷ []) "1Pet.3.3" ∷ word (ἢ ∷ []) "1Pet.3.3" ∷ word (ἐ ∷ ν ∷ δ ∷ ύ ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.3.3" ∷ word (ἱ ∷ μ ∷ α ∷ τ ∷ ί ∷ ω ∷ ν ∷ []) "1Pet.3.3" ∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ς ∷ []) "1Pet.3.3" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1Pet.3.4" ∷ word (ὁ ∷ []) "1Pet.3.4" ∷ word (κ ∷ ρ ∷ υ ∷ π ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.3.4" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.3.4" ∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.3.4" ∷ word (ἄ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ ς ∷ []) "1Pet.3.4" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.4" ∷ word (τ ∷ ῷ ∷ []) "1Pet.3.4" ∷ word (ἀ ∷ φ ∷ θ ∷ ά ∷ ρ ∷ τ ∷ ῳ ∷ []) "1Pet.3.4" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.4" ∷ word (π ∷ ρ ∷ α ∷ έ ∷ ω ∷ ς ∷ []) "1Pet.3.4" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.4" ∷ word (ἡ ∷ σ ∷ υ ∷ χ ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.3.4" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.3.4" ∷ word (ὅ ∷ []) "1Pet.3.4" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1Pet.3.4" ∷ word (ἐ ∷ ν ∷ ώ ∷ π ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.3.4" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.4" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.3.4" ∷ word (π ∷ ο ∷ ∙λ ∷ υ ∷ τ ∷ ε ∷ ∙λ ∷ έ ∷ ς ∷ []) "1Pet.3.4" ∷ word (ο ∷ ὕ ∷ τ ∷ ω ∷ ς ∷ []) "1Pet.3.5" ∷ word (γ ∷ ά ∷ ρ ∷ []) "1Pet.3.5" ∷ word (π ∷ ο ∷ τ ∷ ε ∷ []) "1Pet.3.5" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.5" ∷ word (α ∷ ἱ ∷ []) "1Pet.3.5" ∷ word (ἅ ∷ γ ∷ ι ∷ α ∷ ι ∷ []) "1Pet.3.5" ∷ word (γ ∷ υ ∷ ν ∷ α ∷ ῖ ∷ κ ∷ ε ∷ ς ∷ []) "1Pet.3.5" ∷ word (α ∷ ἱ ∷ []) "1Pet.3.5" ∷ word (ἐ ∷ ∙λ ∷ π ∷ ί ∷ ζ ∷ ο ∷ υ ∷ σ ∷ α ∷ ι ∷ []) "1Pet.3.5" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.5" ∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1Pet.3.5" ∷ word (ἐ ∷ κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ ν ∷ []) "1Pet.3.5" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ά ∷ ς ∷ []) "1Pet.3.5" ∷ word (ὑ ∷ π ∷ ο ∷ τ ∷ α ∷ σ ∷ σ ∷ ό ∷ μ ∷ ε ∷ ν ∷ α ∷ ι ∷ []) "1Pet.3.5" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.3.5" ∷ word (ἰ ∷ δ ∷ ί ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.3.5" ∷ word (ἀ ∷ ν ∷ δ ∷ ρ ∷ ά ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.5" ∷ word (ὡ ∷ ς ∷ []) "1Pet.3.6" ∷ word (Σ ∷ ά ∷ ρ ∷ ρ ∷ α ∷ []) "1Pet.3.6" ∷ word (ὑ ∷ π ∷ ή ∷ κ ∷ ο ∷ υ ∷ σ ∷ ε ∷ ν ∷ []) "1Pet.3.6" ∷ word (τ ∷ ῷ ∷ []) "1Pet.3.6" ∷ word (Ἀ ∷ β ∷ ρ ∷ α ∷ ά ∷ μ ∷ []) "1Pet.3.6" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.3.6" ∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.3.6" ∷ word (κ ∷ α ∷ ∙λ ∷ ο ∷ ῦ ∷ σ ∷ α ∷ []) "1Pet.3.6" ∷ word (ἧ ∷ ς ∷ []) "1Pet.3.6" ∷ word (ἐ ∷ γ ∷ ε ∷ ν ∷ ή ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.3.6" ∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1Pet.3.6" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ σ ∷ α ∷ ι ∷ []) "1Pet.3.6" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.6" ∷ word (μ ∷ ὴ ∷ []) "1Pet.3.6" ∷ word (φ ∷ ο ∷ β ∷ ο ∷ ύ ∷ μ ∷ ε ∷ ν ∷ α ∷ ι ∷ []) "1Pet.3.6" ∷ word (μ ∷ η ∷ δ ∷ ε ∷ μ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.3.6" ∷ word (π ∷ τ ∷ ό ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.6" ∷ word (Ο ∷ ἱ ∷ []) "1Pet.3.7" ∷ word (ἄ ∷ ν ∷ δ ∷ ρ ∷ ε ∷ ς ∷ []) "1Pet.3.7" ∷ word (ὁ ∷ μ ∷ ο ∷ ί ∷ ω ∷ ς ∷ []) "1Pet.3.7" ∷ word (σ ∷ υ ∷ ν ∷ ο ∷ ι ∷ κ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.7" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.3.7" ∷ word (γ ∷ ν ∷ ῶ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.7" ∷ word (ὡ ∷ ς ∷ []) "1Pet.3.7" ∷ word (ἀ ∷ σ ∷ θ ∷ ε ∷ ν ∷ ε ∷ σ ∷ τ ∷ έ ∷ ρ ∷ ῳ ∷ []) "1Pet.3.7" ∷ word (σ ∷ κ ∷ ε ∷ ύ ∷ ε ∷ ι ∷ []) "1Pet.3.7" ∷ word (τ ∷ ῷ ∷ []) "1Pet.3.7" ∷ word (γ ∷ υ ∷ ν ∷ α ∷ ι ∷ κ ∷ ε ∷ ί ∷ ῳ ∷ []) "1Pet.3.7" ∷ word (ἀ ∷ π ∷ ο ∷ ν ∷ έ ∷ μ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.7" ∷ word (τ ∷ ι ∷ μ ∷ ή ∷ ν ∷ []) "1Pet.3.7" ∷ word (ὡ ∷ ς ∷ []) "1Pet.3.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.7" ∷ word (σ ∷ υ ∷ γ ∷ κ ∷ ∙λ ∷ η ∷ ρ ∷ ο ∷ ν ∷ ό ∷ μ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.3.7" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.3.7" ∷ word (ζ ∷ ω ∷ ῆ ∷ ς ∷ []) "1Pet.3.7" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.7" ∷ word (τ ∷ ὸ ∷ []) "1Pet.3.7" ∷ word (μ ∷ ὴ ∷ []) "1Pet.3.7" ∷ word (ἐ ∷ γ ∷ κ ∷ ό ∷ π ∷ τ ∷ ε ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "1Pet.3.7" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "1Pet.3.7" ∷ word (π ∷ ρ ∷ ο ∷ σ ∷ ε ∷ υ ∷ χ ∷ ὰ ∷ ς ∷ []) "1Pet.3.7" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.3.7" ∷ word (Τ ∷ ὸ ∷ []) "1Pet.3.8" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.8" ∷ word (τ ∷ έ ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.3.8" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.8" ∷ word (ὁ ∷ μ ∷ ό ∷ φ ∷ ρ ∷ ο ∷ ν ∷ ε ∷ ς ∷ []) "1Pet.3.8" ∷ word (σ ∷ υ ∷ μ ∷ π ∷ α ∷ θ ∷ ε ∷ ῖ ∷ ς ∷ []) "1Pet.3.8" ∷ word (φ ∷ ι ∷ ∙λ ∷ ά ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ο ∷ ι ∷ []) "1Pet.3.8" ∷ word (ε ∷ ὔ ∷ σ ∷ π ∷ ∙λ ∷ α ∷ γ ∷ χ ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.3.8" ∷ word (τ ∷ α ∷ π ∷ ε ∷ ι ∷ ν ∷ ό ∷ φ ∷ ρ ∷ ο ∷ ν ∷ ε ∷ ς ∷ []) "1Pet.3.8" ∷ word (μ ∷ ὴ ∷ []) "1Pet.3.9" ∷ word (ἀ ∷ π ∷ ο ∷ δ ∷ ι ∷ δ ∷ ό ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.9" ∷ word (κ ∷ α ∷ κ ∷ ὸ ∷ ν ∷ []) "1Pet.3.9" ∷ word (ἀ ∷ ν ∷ τ ∷ ὶ ∷ []) "1Pet.3.9" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ ῦ ∷ []) "1Pet.3.9" ∷ word (ἢ ∷ []) "1Pet.3.9" ∷ word (∙λ ∷ ο ∷ ι ∷ δ ∷ ο ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.3.9" ∷ word (ἀ ∷ ν ∷ τ ∷ ὶ ∷ []) "1Pet.3.9" ∷ word (∙λ ∷ ο ∷ ι ∷ δ ∷ ο ∷ ρ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.3.9" ∷ word (τ ∷ ο ∷ ὐ ∷ ν ∷ α ∷ ν ∷ τ ∷ ί ∷ ο ∷ ν ∷ []) "1Pet.3.9" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.9" ∷ word (ε ∷ ὐ ∷ ∙λ ∷ ο ∷ γ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.9" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.3.9" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.9" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1Pet.3.9" ∷ word (ἐ ∷ κ ∷ ∙λ ∷ ή ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.3.9" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.3.9" ∷ word (ε ∷ ὐ ∷ ∙λ ∷ ο ∷ γ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.3.9" ∷ word (κ ∷ ∙λ ∷ η ∷ ρ ∷ ο ∷ ν ∷ ο ∷ μ ∷ ή ∷ σ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.3.9" ∷ word (ὁ ∷ []) "1Pet.3.10" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.3.10" ∷ word (θ ∷ έ ∷ ∙λ ∷ ω ∷ ν ∷ []) "1Pet.3.10" ∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1Pet.3.10" ∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾶ ∷ ν ∷ []) "1Pet.3.10" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.10" ∷ word (ἰ ∷ δ ∷ ε ∷ ῖ ∷ ν ∷ []) "1Pet.3.10" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ α ∷ ς ∷ []) "1Pet.3.10" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ὰ ∷ ς ∷ []) "1Pet.3.10" ∷ word (π ∷ α ∷ υ ∷ σ ∷ ά ∷ τ ∷ ω ∷ []) "1Pet.3.10" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.3.10" ∷ word (γ ∷ ∙λ ∷ ῶ ∷ σ ∷ σ ∷ α ∷ ν ∷ []) "1Pet.3.10" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1Pet.3.10" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ ῦ ∷ []) "1Pet.3.10" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.10" ∷ word (χ ∷ ε ∷ ί ∷ ∙λ ∷ η ∷ []) "1Pet.3.10" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.10" ∷ word (μ ∷ ὴ ∷ []) "1Pet.3.10" ∷ word (∙λ ∷ α ∷ ∙λ ∷ ῆ ∷ σ ∷ α ∷ ι ∷ []) "1Pet.3.10" ∷ word (δ ∷ ό ∷ ∙λ ∷ ο ∷ ν ∷ []) "1Pet.3.10" ∷ word (ἐ ∷ κ ∷ κ ∷ ∙λ ∷ ι ∷ ν ∷ ά ∷ τ ∷ ω ∷ []) "1Pet.3.11" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.11" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1Pet.3.11" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ ῦ ∷ []) "1Pet.3.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.11" ∷ word (π ∷ ο ∷ ι ∷ η ∷ σ ∷ ά ∷ τ ∷ ω ∷ []) "1Pet.3.11" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ό ∷ ν ∷ []) "1Pet.3.11" ∷ word (ζ ∷ η ∷ τ ∷ η ∷ σ ∷ ά ∷ τ ∷ ω ∷ []) "1Pet.3.11" ∷ word (ε ∷ ἰ ∷ ρ ∷ ή ∷ ν ∷ η ∷ ν ∷ []) "1Pet.3.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.11" ∷ word (δ ∷ ι ∷ ω ∷ ξ ∷ ά ∷ τ ∷ ω ∷ []) "1Pet.3.11" ∷ word (α ∷ ὐ ∷ τ ∷ ή ∷ ν ∷ []) "1Pet.3.11" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.3.12" ∷ word (ὀ ∷ φ ∷ θ ∷ α ∷ ∙λ ∷ μ ∷ ο ∷ ὶ ∷ []) "1Pet.3.12" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.3.12" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "1Pet.3.12" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ί ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.3.12" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.12" ∷ word (ὦ ∷ τ ∷ α ∷ []) "1Pet.3.12" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.12" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.12" ∷ word (δ ∷ έ ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.12" ∷ word (α ∷ ὐ ∷ τ ∷ ῶ ∷ ν ∷ []) "1Pet.3.12" ∷ word (π ∷ ρ ∷ ό ∷ σ ∷ ω ∷ π ∷ ο ∷ ν ∷ []) "1Pet.3.12" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.12" ∷ word (κ ∷ υ ∷ ρ ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.3.12" ∷ word (ἐ ∷ π ∷ ὶ ∷ []) "1Pet.3.12" ∷ word (π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.3.12" ∷ word (κ ∷ α ∷ κ ∷ ά ∷ []) "1Pet.3.12" ∷ word (Κ ∷ α ∷ ὶ ∷ []) "1Pet.3.13" ∷ word (τ ∷ ί ∷ ς ∷ []) "1Pet.3.13" ∷ word (ὁ ∷ []) "1Pet.3.13" ∷ word (κ ∷ α ∷ κ ∷ ώ ∷ σ ∷ ω ∷ ν ∷ []) "1Pet.3.13" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.3.13" ∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1Pet.3.13" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.13" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ ῦ ∷ []) "1Pet.3.13" ∷ word (ζ ∷ η ∷ ∙λ ∷ ω ∷ τ ∷ α ∷ ὶ ∷ []) "1Pet.3.13" ∷ word (γ ∷ έ ∷ ν ∷ η ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.3.13" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1Pet.3.14" ∷ word (ε ∷ ἰ ∷ []) "1Pet.3.14" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.14" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ο ∷ ι ∷ τ ∷ ε ∷ []) "1Pet.3.14" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.3.14" ∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ν ∷ []) "1Pet.3.14" ∷ word (μ ∷ α ∷ κ ∷ ά ∷ ρ ∷ ι ∷ ο ∷ ι ∷ []) "1Pet.3.14" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.3.14" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.14" ∷ word (φ ∷ ό ∷ β ∷ ο ∷ ν ∷ []) "1Pet.3.14" ∷ word (α ∷ ὐ ∷ τ ∷ ῶ ∷ ν ∷ []) "1Pet.3.14" ∷ word (μ ∷ ὴ ∷ []) "1Pet.3.14" ∷ word (φ ∷ ο ∷ β ∷ η ∷ θ ∷ ῆ ∷ τ ∷ ε ∷ []) "1Pet.3.14" ∷ word (μ ∷ η ∷ δ ∷ ὲ ∷ []) "1Pet.3.14" ∷ word (τ ∷ α ∷ ρ ∷ α ∷ χ ∷ θ ∷ ῆ ∷ τ ∷ ε ∷ []) "1Pet.3.14" ∷ word (κ ∷ ύ ∷ ρ ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.3.15" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.15" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.3.15" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ν ∷ []) "1Pet.3.15" ∷ word (ἁ ∷ γ ∷ ι ∷ ά ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.3.15" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.15" ∷ word (τ ∷ α ∷ ῖ ∷ ς ∷ []) "1Pet.3.15" ∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.3.15" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.3.15" ∷ word (ἕ ∷ τ ∷ ο ∷ ι ∷ μ ∷ ο ∷ ι ∷ []) "1Pet.3.15" ∷ word (ἀ ∷ ε ∷ ὶ ∷ []) "1Pet.3.15" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1Pet.3.15" ∷ word (ἀ ∷ π ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ί ∷ α ∷ ν ∷ []) "1Pet.3.15" ∷ word (π ∷ α ∷ ν ∷ τ ∷ ὶ ∷ []) "1Pet.3.15" ∷ word (τ ∷ ῷ ∷ []) "1Pet.3.15" ∷ word (α ∷ ἰ ∷ τ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ι ∷ []) "1Pet.3.15" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.3.15" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ν ∷ []) "1Pet.3.15" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1Pet.3.15" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.3.15" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.15" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.3.15" ∷ word (ἐ ∷ ∙λ ∷ π ∷ ί ∷ δ ∷ ο ∷ ς ∷ []) "1Pet.3.15" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.3.16" ∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "1Pet.3.16" ∷ word (π ∷ ρ ∷ α ∷ ΰ ∷ τ ∷ η ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.3.16" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.16" ∷ word (φ ∷ ό ∷ β ∷ ο ∷ υ ∷ []) "1Pet.3.16" ∷ word (σ ∷ υ ∷ ν ∷ ε ∷ ί ∷ δ ∷ η ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.16" ∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.16" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ή ∷ ν ∷ []) "1Pet.3.16" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.3.16" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.16" ∷ word (ᾧ ∷ []) "1Pet.3.16" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ∙λ ∷ α ∷ ∙λ ∷ ε ∷ ῖ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.3.16" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ι ∷ σ ∷ χ ∷ υ ∷ ν ∷ θ ∷ ῶ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.16" ∷ word (ο ∷ ἱ ∷ []) "1Pet.3.16" ∷ word (ἐ ∷ π ∷ η ∷ ρ ∷ ε ∷ ά ∷ ζ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.3.16" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.3.16" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.3.16" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ὴ ∷ ν ∷ []) "1Pet.3.16" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.16" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "1Pet.3.16" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ρ ∷ ο ∷ φ ∷ ή ∷ ν ∷ []) "1Pet.3.16" ∷ word (κ ∷ ρ ∷ ε ∷ ῖ ∷ τ ∷ τ ∷ ο ∷ ν ∷ []) "1Pet.3.17" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.3.17" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.3.17" ∷ word (ε ∷ ἰ ∷ []) "1Pet.3.17" ∷ word (θ ∷ έ ∷ ∙λ ∷ ο ∷ ι ∷ []) "1Pet.3.17" ∷ word (τ ∷ ὸ ∷ []) "1Pet.3.17" ∷ word (θ ∷ έ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "1Pet.3.17" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.17" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.3.17" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ε ∷ ι ∷ ν ∷ []) "1Pet.3.17" ∷ word (ἢ ∷ []) "1Pet.3.17" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.3.17" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.3.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.18" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.3.18" ∷ word (ἅ ∷ π ∷ α ∷ ξ ∷ []) "1Pet.3.18" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1Pet.3.18" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.3.18" ∷ word (ἔ ∷ π ∷ α ∷ θ ∷ ε ∷ ν ∷ []) "1Pet.3.18" ∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ο ∷ ς ∷ []) "1Pet.3.18" ∷ word (ὑ ∷ π ∷ ὲ ∷ ρ ∷ []) "1Pet.3.18" ∷ word (ἀ ∷ δ ∷ ί ∷ κ ∷ ω ∷ ν ∷ []) "1Pet.3.18" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.3.18" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.3.18" ∷ word (π ∷ ρ ∷ ο ∷ σ ∷ α ∷ γ ∷ ά ∷ γ ∷ ῃ ∷ []) "1Pet.3.18" ∷ word (τ ∷ ῷ ∷ []) "1Pet.3.18" ∷ word (θ ∷ ε ∷ ῷ ∷ []) "1Pet.3.18" ∷ word (θ ∷ α ∷ ν ∷ α ∷ τ ∷ ω ∷ θ ∷ ε ∷ ὶ ∷ ς ∷ []) "1Pet.3.18" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "1Pet.3.18" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὶ ∷ []) "1Pet.3.18" ∷ word (ζ ∷ ῳ ∷ ο ∷ π ∷ ο ∷ ι ∷ η ∷ θ ∷ ε ∷ ὶ ∷ ς ∷ []) "1Pet.3.18" ∷ word (δ ∷ ὲ ∷ []) "1Pet.3.18" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.3.18" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.19" ∷ word (ᾧ ∷ []) "1Pet.3.19" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.19" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.3.19" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.19" ∷ word (φ ∷ υ ∷ ∙λ ∷ α ∷ κ ∷ ῇ ∷ []) "1Pet.3.19" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.3.19" ∷ word (π ∷ ο ∷ ρ ∷ ε ∷ υ ∷ θ ∷ ε ∷ ὶ ∷ ς ∷ []) "1Pet.3.19" ∷ word (ἐ ∷ κ ∷ ή ∷ ρ ∷ υ ∷ ξ ∷ ε ∷ ν ∷ []) "1Pet.3.19" ∷ word (ἀ ∷ π ∷ ε ∷ ι ∷ θ ∷ ή ∷ σ ∷ α ∷ σ ∷ ί ∷ ν ∷ []) "1Pet.3.20" ∷ word (π ∷ ο ∷ τ ∷ ε ∷ []) "1Pet.3.20" ∷ word (ὅ ∷ τ ∷ ε ∷ []) "1Pet.3.20" ∷ word (ἀ ∷ π ∷ ε ∷ ξ ∷ ε ∷ δ ∷ έ ∷ χ ∷ ε ∷ τ ∷ ο ∷ []) "1Pet.3.20" ∷ word (ἡ ∷ []) "1Pet.3.20" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.20" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.3.20" ∷ word (μ ∷ α ∷ κ ∷ ρ ∷ ο ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ []) "1Pet.3.20" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.20" ∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ α ∷ ι ∷ ς ∷ []) "1Pet.3.20" ∷ word (Ν ∷ ῶ ∷ ε ∷ []) "1Pet.3.20" ∷ word (κ ∷ α ∷ τ ∷ α ∷ σ ∷ κ ∷ ε ∷ υ ∷ α ∷ ζ ∷ ο ∷ μ ∷ έ ∷ ν ∷ η ∷ ς ∷ []) "1Pet.3.20" ∷ word (κ ∷ ι ∷ β ∷ ω ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.20" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.20" ∷ word (ἣ ∷ ν ∷ []) "1Pet.3.20" ∷ word (ὀ ∷ ∙λ ∷ ί ∷ γ ∷ ο ∷ ι ∷ []) "1Pet.3.20" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ []) "1Pet.3.20" ∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1Pet.3.20" ∷ word (ὀ ∷ κ ∷ τ ∷ ὼ ∷ []) "1Pet.3.20" ∷ word (ψ ∷ υ ∷ χ ∷ α ∷ ί ∷ []) "1Pet.3.20" ∷ word (δ ∷ ι ∷ ε ∷ σ ∷ ώ ∷ θ ∷ η ∷ σ ∷ α ∷ ν ∷ []) "1Pet.3.20" ∷ word (δ ∷ ι ∷ []) "1Pet.3.20" ∷ word (ὕ ∷ δ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.3.20" ∷ word (ὃ ∷ []) "1Pet.3.21" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.21" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.3.21" ∷ word (ἀ ∷ ν ∷ τ ∷ ί ∷ τ ∷ υ ∷ π ∷ ο ∷ ν ∷ []) "1Pet.3.21" ∷ word (ν ∷ ῦ ∷ ν ∷ []) "1Pet.3.21" ∷ word (σ ∷ ῴ ∷ ζ ∷ ε ∷ ι ∷ []) "1Pet.3.21" ∷ word (β ∷ ά ∷ π ∷ τ ∷ ι ∷ σ ∷ μ ∷ α ∷ []) "1Pet.3.21" ∷ word (ο ∷ ὐ ∷ []) "1Pet.3.21" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὸ ∷ ς ∷ []) "1Pet.3.21" ∷ word (ἀ ∷ π ∷ ό ∷ θ ∷ ε ∷ σ ∷ ι ∷ ς ∷ []) "1Pet.3.21" ∷ word (ῥ ∷ ύ ∷ π ∷ ο ∷ υ ∷ []) "1Pet.3.21" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.3.21" ∷ word (σ ∷ υ ∷ ν ∷ ε ∷ ι ∷ δ ∷ ή ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.3.21" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ῆ ∷ ς ∷ []) "1Pet.3.21" ∷ word (ἐ ∷ π ∷ ε ∷ ρ ∷ ώ ∷ τ ∷ η ∷ μ ∷ α ∷ []) "1Pet.3.21" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.21" ∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1Pet.3.21" ∷ word (δ ∷ ι ∷ []) "1Pet.3.21" ∷ word (ἀ ∷ ν ∷ α ∷ σ ∷ τ ∷ ά ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "1Pet.3.21" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.3.21" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.3.21" ∷ word (ὅ ∷ ς ∷ []) "1Pet.3.22" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1Pet.3.22" ∷ word (ἐ ∷ ν ∷ []) "1Pet.3.22" ∷ word (δ ∷ ε ∷ ξ ∷ ι ∷ ᾷ ∷ []) "1Pet.3.22" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.3.22" ∷ word (π ∷ ο ∷ ρ ∷ ε ∷ υ ∷ θ ∷ ε ∷ ὶ ∷ ς ∷ []) "1Pet.3.22" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.3.22" ∷ word (ο ∷ ὐ ∷ ρ ∷ α ∷ ν ∷ ὸ ∷ ν ∷ []) "1Pet.3.22" ∷ word (ὑ ∷ π ∷ ο ∷ τ ∷ α ∷ γ ∷ έ ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.3.22" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1Pet.3.22" ∷ word (ἀ ∷ γ ∷ γ ∷ έ ∷ ∙λ ∷ ω ∷ ν ∷ []) "1Pet.3.22" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.22" ∷ word (ἐ ∷ ξ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.3.22" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.3.22" ∷ word (δ ∷ υ ∷ ν ∷ ά ∷ μ ∷ ε ∷ ω ∷ ν ∷ []) "1Pet.3.22" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.1" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "1Pet.4.1" ∷ word (π ∷ α ∷ θ ∷ ό ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.4.1" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὶ ∷ []) "1Pet.4.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.1" ∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1Pet.4.1" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.4.1" ∷ word (α ∷ ὐ ∷ τ ∷ ὴ ∷ ν ∷ []) "1Pet.4.1" ∷ word (ἔ ∷ ν ∷ ν ∷ ο ∷ ι ∷ α ∷ ν ∷ []) "1Pet.4.1" ∷ word (ὁ ∷ π ∷ ∙λ ∷ ί ∷ σ ∷ α ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.4.1" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.4.1" ∷ word (ὁ ∷ []) "1Pet.4.1" ∷ word (π ∷ α ∷ θ ∷ ὼ ∷ ν ∷ []) "1Pet.4.1" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὶ ∷ []) "1Pet.4.1" ∷ word (π ∷ έ ∷ π ∷ α ∷ υ ∷ τ ∷ α ∷ ι ∷ []) "1Pet.4.1" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.4.1" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.2" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.2" ∷ word (μ ∷ η ∷ κ ∷ έ ∷ τ ∷ ι ∷ []) "1Pet.4.2" ∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ώ ∷ π ∷ ω ∷ ν ∷ []) "1Pet.4.2" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.4.2" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.4.2" ∷ word (θ ∷ ε ∷ ∙λ ∷ ή ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.4.2" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.2" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.4.2" ∷ word (ἐ ∷ π ∷ ί ∷ ∙λ ∷ ο ∷ ι ∷ π ∷ ο ∷ ν ∷ []) "1Pet.4.2" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.2" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὶ ∷ []) "1Pet.4.2" ∷ word (β ∷ ι ∷ ῶ ∷ σ ∷ α ∷ ι ∷ []) "1Pet.4.2" ∷ word (χ ∷ ρ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.4.2" ∷ word (ἀ ∷ ρ ∷ κ ∷ ε ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.4.3" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.4.3" ∷ word (ὁ ∷ []) "1Pet.4.3" ∷ word (π ∷ α ∷ ρ ∷ ε ∷ ∙λ ∷ η ∷ ∙λ ∷ υ ∷ θ ∷ ὼ ∷ ς ∷ []) "1Pet.4.3" ∷ word (χ ∷ ρ ∷ ό ∷ ν ∷ ο ∷ ς ∷ []) "1Pet.4.3" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.3" ∷ word (β ∷ ο ∷ ύ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "1Pet.4.3" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.4.3" ∷ word (ἐ ∷ θ ∷ ν ∷ ῶ ∷ ν ∷ []) "1Pet.4.3" ∷ word (κ ∷ α ∷ τ ∷ ε ∷ ι ∷ ρ ∷ γ ∷ ά ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "1Pet.4.3" ∷ word (π ∷ ε ∷ π ∷ ο ∷ ρ ∷ ε ∷ υ ∷ μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.4.3" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.3" ∷ word (ἀ ∷ σ ∷ ε ∷ ∙λ ∷ γ ∷ ε ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (ο ∷ ἰ ∷ ν ∷ ο ∷ φ ∷ ∙λ ∷ υ ∷ γ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (κ ∷ ώ ∷ μ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (π ∷ ό ∷ τ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.3" ∷ word (ἀ ∷ θ ∷ ε ∷ μ ∷ ί ∷ τ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (ε ∷ ἰ ∷ δ ∷ ω ∷ ∙λ ∷ ο ∷ ∙λ ∷ α ∷ τ ∷ ρ ∷ ί ∷ α ∷ ι ∷ ς ∷ []) "1Pet.4.3" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.4" ∷ word (ᾧ ∷ []) "1Pet.4.4" ∷ word (ξ ∷ ε ∷ ν ∷ ί ∷ ζ ∷ ο ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "1Pet.4.4" ∷ word (μ ∷ ὴ ∷ []) "1Pet.4.4" ∷ word (σ ∷ υ ∷ ν ∷ τ ∷ ρ ∷ ε ∷ χ ∷ ό ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.4.4" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.4.4" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.4" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.4.4" ∷ word (α ∷ ὐ ∷ τ ∷ ὴ ∷ ν ∷ []) "1Pet.4.4" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.4.4" ∷ word (ἀ ∷ σ ∷ ω ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1Pet.4.4" ∷ word (ἀ ∷ ν ∷ ά ∷ χ ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.4.4" ∷ word (β ∷ ∙λ ∷ α ∷ σ ∷ φ ∷ η ∷ μ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.4.4" ∷ word (ο ∷ ἳ ∷ []) "1Pet.4.5" ∷ word (ἀ ∷ π ∷ ο ∷ δ ∷ ώ ∷ σ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.4.5" ∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ν ∷ []) "1Pet.4.5" ∷ word (τ ∷ ῷ ∷ []) "1Pet.4.5" ∷ word (ἑ ∷ τ ∷ ο ∷ ί ∷ μ ∷ ω ∷ ς ∷ []) "1Pet.4.5" ∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ι ∷ []) "1Pet.4.5" ∷ word (κ ∷ ρ ∷ ῖ ∷ ν ∷ α ∷ ι ∷ []) "1Pet.4.5" ∷ word (ζ ∷ ῶ ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.4.5" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.5" ∷ word (ν ∷ ε ∷ κ ∷ ρ ∷ ο ∷ ύ ∷ ς ∷ []) "1Pet.4.5" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.6" ∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1Pet.4.6" ∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1Pet.4.6" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.6" ∷ word (ν ∷ ε ∷ κ ∷ ρ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.4.6" ∷ word (ε ∷ ὐ ∷ η ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ σ ∷ θ ∷ η ∷ []) "1Pet.4.6" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.4.6" ∷ word (κ ∷ ρ ∷ ι ∷ θ ∷ ῶ ∷ σ ∷ ι ∷ []) "1Pet.4.6" ∷ word (μ ∷ ὲ ∷ ν ∷ []) "1Pet.4.6" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.4.6" ∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ώ ∷ π ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.4.6" ∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὶ ∷ []) "1Pet.4.6" ∷ word (ζ ∷ ῶ ∷ σ ∷ ι ∷ []) "1Pet.4.6" ∷ word (δ ∷ ὲ ∷ []) "1Pet.4.6" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.4.6" ∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1Pet.4.6" ∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.4.6" ∷ word (Π ∷ ά ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.4.7" ∷ word (δ ∷ ὲ ∷ []) "1Pet.4.7" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.7" ∷ word (τ ∷ έ ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.4.7" ∷ word (ἤ ∷ γ ∷ γ ∷ ι ∷ κ ∷ ε ∷ ν ∷ []) "1Pet.4.7" ∷ word (σ ∷ ω ∷ φ ∷ ρ ∷ ο ∷ ν ∷ ή ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.4.7" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "1Pet.4.7" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.7" ∷ word (ν ∷ ή ∷ ψ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.4.7" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.7" ∷ word (π ∷ ρ ∷ ο ∷ σ ∷ ε ∷ υ ∷ χ ∷ ά ∷ ς ∷ []) "1Pet.4.7" ∷ word (π ∷ ρ ∷ ὸ ∷ []) "1Pet.4.8" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.4.8" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.4.8" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.8" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.4.8" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ν ∷ []) "1Pet.4.8" ∷ word (ἐ ∷ κ ∷ τ ∷ ε ∷ ν ∷ ῆ ∷ []) "1Pet.4.8" ∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.4.8" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.4.8" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1Pet.4.8" ∷ word (κ ∷ α ∷ ∙λ ∷ ύ ∷ π ∷ τ ∷ ε ∷ ι ∷ []) "1Pet.4.8" ∷ word (π ∷ ∙λ ∷ ῆ ∷ θ ∷ ο ∷ ς ∷ []) "1Pet.4.8" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ι ∷ ῶ ∷ ν ∷ []) "1Pet.4.8" ∷ word (φ ∷ ι ∷ ∙λ ∷ ό ∷ ξ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.4.9" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.9" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.4.9" ∷ word (ἄ ∷ ν ∷ ε ∷ υ ∷ []) "1Pet.4.9" ∷ word (γ ∷ ο ∷ γ ∷ γ ∷ υ ∷ σ ∷ μ ∷ ο ∷ ῦ ∷ []) "1Pet.4.9" ∷ word (ἕ ∷ κ ∷ α ∷ σ ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.4.10" ∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1Pet.4.10" ∷ word (ἔ ∷ ∙λ ∷ α ∷ β ∷ ε ∷ ν ∷ []) "1Pet.4.10" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ σ ∷ μ ∷ α ∷ []) "1Pet.4.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.10" ∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.4.10" ∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ []) "1Pet.4.10" ∷ word (δ ∷ ι ∷ α ∷ κ ∷ ο ∷ ν ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.4.10" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.10" ∷ word (κ ∷ α ∷ ∙λ ∷ ο ∷ ὶ ∷ []) "1Pet.4.10" ∷ word (ο ∷ ἰ ∷ κ ∷ ο ∷ ν ∷ ό ∷ μ ∷ ο ∷ ι ∷ []) "1Pet.4.10" ∷ word (π ∷ ο ∷ ι ∷ κ ∷ ί ∷ ∙λ ∷ η ∷ ς ∷ []) "1Pet.4.10" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.4.10" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.10" ∷ word (ε ∷ ἴ ∷ []) "1Pet.4.11" ∷ word (τ ∷ ι ∷ ς ∷ []) "1Pet.4.11" ∷ word (∙λ ∷ α ∷ ∙λ ∷ ε ∷ ῖ ∷ []) "1Pet.4.11" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.11" ∷ word (∙λ ∷ ό ∷ γ ∷ ι ∷ α ∷ []) "1Pet.4.11" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.11" ∷ word (ε ∷ ἴ ∷ []) "1Pet.4.11" ∷ word (τ ∷ ι ∷ ς ∷ []) "1Pet.4.11" ∷ word (δ ∷ ι ∷ α ∷ κ ∷ ο ∷ ν ∷ ε ∷ ῖ ∷ []) "1Pet.4.11" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.11" ∷ word (ἐ ∷ ξ ∷ []) "1Pet.4.11" ∷ word (ἰ ∷ σ ∷ χ ∷ ύ ∷ ο ∷ ς ∷ []) "1Pet.4.11" ∷ word (ἧ ∷ ς ∷ []) "1Pet.4.11" ∷ word (χ ∷ ο ∷ ρ ∷ η ∷ γ ∷ ε ∷ ῖ ∷ []) "1Pet.4.11" ∷ word (ὁ ∷ []) "1Pet.4.11" ∷ word (θ ∷ ε ∷ ό ∷ ς ∷ []) "1Pet.4.11" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.4.11" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.11" ∷ word (π ∷ ᾶ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.4.11" ∷ word (δ ∷ ο ∷ ξ ∷ ά ∷ ζ ∷ η ∷ τ ∷ α ∷ ι ∷ []) "1Pet.4.11" ∷ word (ὁ ∷ []) "1Pet.4.11" ∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1Pet.4.11" ∷ word (δ ∷ ι ∷ ὰ ∷ []) "1Pet.4.11" ∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1Pet.4.11" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.11" ∷ word (ᾧ ∷ []) "1Pet.4.11" ∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1Pet.4.11" ∷ word (ἡ ∷ []) "1Pet.4.11" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ []) "1Pet.4.11" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.11" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.11" ∷ word (κ ∷ ρ ∷ ά ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.4.11" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.4.11" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.4.11" ∷ word (α ∷ ἰ ∷ ῶ ∷ ν ∷ α ∷ ς ∷ []) "1Pet.4.11" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.4.11" ∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ω ∷ ν ∷ []) "1Pet.4.11" ∷ word (ἀ ∷ μ ∷ ή ∷ ν ∷ []) "1Pet.4.11" ∷ word (Ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1Pet.4.12" ∷ word (μ ∷ ὴ ∷ []) "1Pet.4.12" ∷ word (ξ ∷ ε ∷ ν ∷ ί ∷ ζ ∷ ε ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.4.12" ∷ word (τ ∷ ῇ ∷ []) "1Pet.4.12" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.12" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.4.12" ∷ word (π ∷ υ ∷ ρ ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "1Pet.4.12" ∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1Pet.4.12" ∷ word (π ∷ ε ∷ ι ∷ ρ ∷ α ∷ σ ∷ μ ∷ ὸ ∷ ν ∷ []) "1Pet.4.12" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.4.12" ∷ word (γ ∷ ι ∷ ν ∷ ο ∷ μ ∷ έ ∷ ν ∷ ῃ ∷ []) "1Pet.4.12" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.12" ∷ word (ξ ∷ έ ∷ ν ∷ ο ∷ υ ∷ []) "1Pet.4.12" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.4.12" ∷ word (σ ∷ υ ∷ μ ∷ β ∷ α ∷ ί ∷ ν ∷ ο ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.4.12" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.4.13" ∷ word (κ ∷ α ∷ θ ∷ ὸ ∷ []) "1Pet.4.13" ∷ word (κ ∷ ο ∷ ι ∷ ν ∷ ω ∷ ν ∷ ε ∷ ῖ ∷ τ ∷ ε ∷ []) "1Pet.4.13" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.4.13" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.13" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.13" ∷ word (π ∷ α ∷ θ ∷ ή ∷ μ ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.4.13" ∷ word (χ ∷ α ∷ ί ∷ ρ ∷ ε ∷ τ ∷ ε ∷ []) "1Pet.4.13" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.4.13" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.13" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.13" ∷ word (τ ∷ ῇ ∷ []) "1Pet.4.13" ∷ word (ἀ ∷ π ∷ ο ∷ κ ∷ α ∷ ∙λ ∷ ύ ∷ ψ ∷ ε ∷ ι ∷ []) "1Pet.4.13" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.4.13" ∷ word (δ ∷ ό ∷ ξ ∷ η ∷ ς ∷ []) "1Pet.4.13" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.13" ∷ word (χ ∷ α ∷ ρ ∷ ῆ ∷ τ ∷ ε ∷ []) "1Pet.4.13" ∷ word (ἀ ∷ γ ∷ α ∷ ∙λ ∷ ∙λ ∷ ι ∷ ώ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.4.13" ∷ word (ε ∷ ἰ ∷ []) "1Pet.4.14" ∷ word (ὀ ∷ ν ∷ ε ∷ ι ∷ δ ∷ ί ∷ ζ ∷ ε ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.4.14" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.14" ∷ word (ὀ ∷ ν ∷ ό ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.4.14" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.14" ∷ word (μ ∷ α ∷ κ ∷ ά ∷ ρ ∷ ι ∷ ο ∷ ι ∷ []) "1Pet.4.14" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.4.14" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.14" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.4.14" ∷ word (δ ∷ ό ∷ ξ ∷ η ∷ ς ∷ []) "1Pet.4.14" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.14" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.14" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.14" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.14" ∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1Pet.4.14" ∷ word (ἐ ∷ φ ∷ []) "1Pet.4.14" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.4.14" ∷ word (ἀ ∷ ν ∷ α ∷ π ∷ α ∷ ύ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1Pet.4.14" ∷ word (μ ∷ ὴ ∷ []) "1Pet.4.15" ∷ word (γ ∷ ά ∷ ρ ∷ []) "1Pet.4.15" ∷ word (τ ∷ ι ∷ ς ∷ []) "1Pet.4.15" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.4.15" ∷ word (π ∷ α ∷ σ ∷ χ ∷ έ ∷ τ ∷ ω ∷ []) "1Pet.4.15" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.15" ∷ word (φ ∷ ο ∷ ν ∷ ε ∷ ὺ ∷ ς ∷ []) "1Pet.4.15" ∷ word (ἢ ∷ []) "1Pet.4.15" ∷ word (κ ∷ ∙λ ∷ έ ∷ π ∷ τ ∷ η ∷ ς ∷ []) "1Pet.4.15" ∷ word (ἢ ∷ []) "1Pet.4.15" ∷ word (κ ∷ α ∷ κ ∷ ο ∷ π ∷ ο ∷ ι ∷ ὸ ∷ ς ∷ []) "1Pet.4.15" ∷ word (ἢ ∷ []) "1Pet.4.15" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.15" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ο ∷ τ ∷ ρ ∷ ι ∷ ε ∷ π ∷ ί ∷ σ ∷ κ ∷ ο ∷ π ∷ ο ∷ ς ∷ []) "1Pet.4.15" ∷ word (ε ∷ ἰ ∷ []) "1Pet.4.16" ∷ word (δ ∷ ὲ ∷ []) "1Pet.4.16" ∷ word (ὡ ∷ ς ∷ []) "1Pet.4.16" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ι ∷ α ∷ ν ∷ ό ∷ ς ∷ []) "1Pet.4.16" ∷ word (μ ∷ ὴ ∷ []) "1Pet.4.16" ∷ word (α ∷ ἰ ∷ σ ∷ χ ∷ υ ∷ ν ∷ έ ∷ σ ∷ θ ∷ ω ∷ []) "1Pet.4.16" ∷ word (δ ∷ ο ∷ ξ ∷ α ∷ ζ ∷ έ ∷ τ ∷ ω ∷ []) "1Pet.4.16" ∷ word (δ ∷ ὲ ∷ []) "1Pet.4.16" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.4.16" ∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1Pet.4.16" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.16" ∷ word (τ ∷ ῷ ∷ []) "1Pet.4.16" ∷ word (ὀ ∷ ν ∷ ό ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.4.16" ∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1Pet.4.16" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.4.17" ∷ word (ὁ ∷ []) "1Pet.4.17" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ὸ ∷ ς ∷ []) "1Pet.4.17" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.17" ∷ word (ἄ ∷ ρ ∷ ξ ∷ α ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "1Pet.4.17" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.17" ∷ word (κ ∷ ρ ∷ ί ∷ μ ∷ α ∷ []) "1Pet.4.17" ∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1Pet.4.17" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.17" ∷ word (ο ∷ ἴ ∷ κ ∷ ο ∷ υ ∷ []) "1Pet.4.17" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.17" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.17" ∷ word (ε ∷ ἰ ∷ []) "1Pet.4.17" ∷ word (δ ∷ ὲ ∷ []) "1Pet.4.17" ∷ word (π ∷ ρ ∷ ῶ ∷ τ ∷ ο ∷ ν ∷ []) "1Pet.4.17" ∷ word (ἀ ∷ φ ∷ []) "1Pet.4.17" ∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.4.17" ∷ word (τ ∷ ί ∷ []) "1Pet.4.17" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.17" ∷ word (τ ∷ έ ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.4.17" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.4.17" ∷ word (ἀ ∷ π ∷ ε ∷ ι ∷ θ ∷ ο ∷ ύ ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.4.17" ∷ word (τ ∷ ῷ ∷ []) "1Pet.4.17" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.17" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.17" ∷ word (ε ∷ ὐ ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ ῳ ∷ []) "1Pet.4.17" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.18" ∷ word (ε ∷ ἰ ∷ []) "1Pet.4.18" ∷ word (ὁ ∷ []) "1Pet.4.18" ∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ο ∷ ς ∷ []) "1Pet.4.18" ∷ word (μ ∷ ό ∷ ∙λ ∷ ι ∷ ς ∷ []) "1Pet.4.18" ∷ word (σ ∷ ῴ ∷ ζ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1Pet.4.18" ∷ word (ὁ ∷ []) "1Pet.4.18" ∷ word (ἀ ∷ σ ∷ ε ∷ β ∷ ὴ ∷ ς ∷ []) "1Pet.4.18" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.18" ∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ω ∷ ∙λ ∷ ὸ ∷ ς ∷ []) "1Pet.4.18" ∷ word (π ∷ ο ∷ ῦ ∷ []) "1Pet.4.18" ∷ word (φ ∷ α ∷ ν ∷ ε ∷ ῖ ∷ τ ∷ α ∷ ι ∷ []) "1Pet.4.18" ∷ word (ὥ ∷ σ ∷ τ ∷ ε ∷ []) "1Pet.4.19" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.4.19" ∷ word (ο ∷ ἱ ∷ []) "1Pet.4.19" ∷ word (π ∷ ά ∷ σ ∷ χ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.4.19" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.4.19" ∷ word (τ ∷ ὸ ∷ []) "1Pet.4.19" ∷ word (θ ∷ έ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "1Pet.4.19" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.4.19" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.4.19" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "1Pet.4.19" ∷ word (κ ∷ τ ∷ ί ∷ σ ∷ τ ∷ ῃ ∷ []) "1Pet.4.19" ∷ word (π ∷ α ∷ ρ ∷ α ∷ τ ∷ ι ∷ θ ∷ έ ∷ σ ∷ θ ∷ ω ∷ σ ∷ α ∷ ν ∷ []) "1Pet.4.19" ∷ word (τ ∷ ὰ ∷ ς ∷ []) "1Pet.4.19" ∷ word (ψ ∷ υ ∷ χ ∷ ὰ ∷ ς ∷ []) "1Pet.4.19" ∷ word (α ∷ ὐ ∷ τ ∷ ῶ ∷ ν ∷ []) "1Pet.4.19" ∷ word (ἐ ∷ ν ∷ []) "1Pet.4.19" ∷ word (ἀ ∷ γ ∷ α ∷ θ ∷ ο ∷ π ∷ ο ∷ ι ∷ ΐ ∷ ᾳ ∷ []) "1Pet.4.19" ∷ word (Π ∷ ρ ∷ ε ∷ σ ∷ β ∷ υ ∷ τ ∷ έ ∷ ρ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.5.1" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "1Pet.5.1" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.1" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.5.1" ∷ word (π ∷ α ∷ ρ ∷ α ∷ κ ∷ α ∷ ∙λ ∷ ῶ ∷ []) "1Pet.5.1" ∷ word (ὁ ∷ []) "1Pet.5.1" ∷ word (σ ∷ υ ∷ μ ∷ π ∷ ρ ∷ ε ∷ σ ∷ β ∷ ύ ∷ τ ∷ ε ∷ ρ ∷ ο ∷ ς ∷ []) "1Pet.5.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.5.1" ∷ word (μ ∷ ά ∷ ρ ∷ τ ∷ υ ∷ ς ∷ []) "1Pet.5.1" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.5.1" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.1" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.1" ∷ word (π ∷ α ∷ θ ∷ η ∷ μ ∷ ά ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.5.1" ∷ word (ὁ ∷ []) "1Pet.5.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.5.1" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.5.1" ∷ word (μ ∷ ε ∷ ∙λ ∷ ∙λ ∷ ο ∷ ύ ∷ σ ∷ η ∷ ς ∷ []) "1Pet.5.1" ∷ word (ἀ ∷ π ∷ ο ∷ κ ∷ α ∷ ∙λ ∷ ύ ∷ π ∷ τ ∷ ε ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "1Pet.5.1" ∷ word (δ ∷ ό ∷ ξ ∷ η ∷ ς ∷ []) "1Pet.5.1" ∷ word (κ ∷ ο ∷ ι ∷ ν ∷ ω ∷ ν ∷ ό ∷ ς ∷ []) "1Pet.5.1" ∷ word (π ∷ ο ∷ ι ∷ μ ∷ ά ∷ ν ∷ α ∷ τ ∷ ε ∷ []) "1Pet.5.2" ∷ word (τ ∷ ὸ ∷ []) "1Pet.5.2" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.2" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.5.2" ∷ word (π ∷ ο ∷ ί ∷ μ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.5.2" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.2" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.5.2" ∷ word (ἐ ∷ π ∷ ι ∷ σ ∷ κ ∷ ο ∷ π ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.5.2" ∷ word (μ ∷ ὴ ∷ []) "1Pet.5.2" ∷ word (ἀ ∷ ν ∷ α ∷ γ ∷ κ ∷ α ∷ σ ∷ τ ∷ ῶ ∷ ς ∷ []) "1Pet.5.2" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.5.2" ∷ word (ἑ ∷ κ ∷ ο ∷ υ ∷ σ ∷ ί ∷ ω ∷ ς ∷ []) "1Pet.5.2" ∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1Pet.5.2" ∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1Pet.5.2" ∷ word (μ ∷ η ∷ δ ∷ ὲ ∷ []) "1Pet.5.2" ∷ word (α ∷ ἰ ∷ σ ∷ χ ∷ ρ ∷ ο ∷ κ ∷ ε ∷ ρ ∷ δ ∷ ῶ ∷ ς ∷ []) "1Pet.5.2" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.5.2" ∷ word (π ∷ ρ ∷ ο ∷ θ ∷ ύ ∷ μ ∷ ω ∷ ς ∷ []) "1Pet.5.2" ∷ word (μ ∷ η ∷ δ ∷ []) "1Pet.5.3" ∷ word (ὡ ∷ ς ∷ []) "1Pet.5.3" ∷ word (κ ∷ α ∷ τ ∷ α ∷ κ ∷ υ ∷ ρ ∷ ι ∷ ε ∷ ύ ∷ ο ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.5.3" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.5.3" ∷ word (κ ∷ ∙λ ∷ ή ∷ ρ ∷ ω ∷ ν ∷ []) "1Pet.5.3" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1Pet.5.3" ∷ word (τ ∷ ύ ∷ π ∷ ο ∷ ι ∷ []) "1Pet.5.3" ∷ word (γ ∷ ι ∷ ν ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ι ∷ []) "1Pet.5.3" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.3" ∷ word (π ∷ ο ∷ ι ∷ μ ∷ ν ∷ ί ∷ ο ∷ υ ∷ []) "1Pet.5.3" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.5.4" ∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ω ∷ θ ∷ έ ∷ ν ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.5.4" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.4" ∷ word (ἀ ∷ ρ ∷ χ ∷ ι ∷ π ∷ ο ∷ ί ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1Pet.5.4" ∷ word (κ ∷ ο ∷ μ ∷ ι ∷ ε ∷ ῖ ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.5.4" ∷ word (τ ∷ ὸ ∷ ν ∷ []) "1Pet.5.4" ∷ word (ἀ ∷ μ ∷ α ∷ ρ ∷ ά ∷ ν ∷ τ ∷ ι ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.5.4" ∷ word (τ ∷ ῆ ∷ ς ∷ []) "1Pet.5.4" ∷ word (δ ∷ ό ∷ ξ ∷ η ∷ ς ∷ []) "1Pet.5.4" ∷ word (σ ∷ τ ∷ έ ∷ φ ∷ α ∷ ν ∷ ο ∷ ν ∷ []) "1Pet.5.4" ∷ word (ὁ ∷ μ ∷ ο ∷ ί ∷ ω ∷ ς ∷ []) "1Pet.5.5" ∷ word (ν ∷ ε ∷ ώ ∷ τ ∷ ε ∷ ρ ∷ ο ∷ ι ∷ []) "1Pet.5.5" ∷ word (ὑ ∷ π ∷ ο ∷ τ ∷ ά ∷ γ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.5.5" ∷ word (π ∷ ρ ∷ ε ∷ σ ∷ β ∷ υ ∷ τ ∷ έ ∷ ρ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.5.5" ∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.5.5" ∷ word (δ ∷ ὲ ∷ []) "1Pet.5.5" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.5.5" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.5.5" ∷ word (τ ∷ α ∷ π ∷ ε ∷ ι ∷ ν ∷ ο ∷ φ ∷ ρ ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ν ∷ []) "1Pet.5.5" ∷ word (ἐ ∷ γ ∷ κ ∷ ο ∷ μ ∷ β ∷ ώ ∷ σ ∷ α ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.5.5" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.5.5" ∷ word (Ὁ ∷ []) "1Pet.5.5" ∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1Pet.5.5" ∷ word (ὑ ∷ π ∷ ε ∷ ρ ∷ η ∷ φ ∷ ά ∷ ν ∷ ο ∷ ι ∷ ς ∷ []) "1Pet.5.5" ∷ word (ἀ ∷ ν ∷ τ ∷ ι ∷ τ ∷ ά ∷ σ ∷ σ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1Pet.5.5" ∷ word (τ ∷ α ∷ π ∷ ε ∷ ι ∷ ν ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.5.5" ∷ word (δ ∷ ὲ ∷ []) "1Pet.5.5" ∷ word (δ ∷ ί ∷ δ ∷ ω ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.5.5" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ν ∷ []) "1Pet.5.5" ∷ word (Τ ∷ α ∷ π ∷ ε ∷ ι ∷ ν ∷ ώ ∷ θ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.5.6" ∷ word (ο ∷ ὖ ∷ ν ∷ []) "1Pet.5.6" ∷ word (ὑ ∷ π ∷ ὸ ∷ []) "1Pet.5.6" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.5.6" ∷ word (κ ∷ ρ ∷ α ∷ τ ∷ α ∷ ι ∷ ὰ ∷ ν ∷ []) "1Pet.5.6" ∷ word (χ ∷ ε ∷ ῖ ∷ ρ ∷ α ∷ []) "1Pet.5.6" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.6" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.5.6" ∷ word (ἵ ∷ ν ∷ α ∷ []) "1Pet.5.6" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.5.6" ∷ word (ὑ ∷ ψ ∷ ώ ∷ σ ∷ ῃ ∷ []) "1Pet.5.6" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.6" ∷ word (κ ∷ α ∷ ι ∷ ρ ∷ ῷ ∷ []) "1Pet.5.6" ∷ word (π ∷ ᾶ ∷ σ ∷ α ∷ ν ∷ []) "1Pet.5.7" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.5.7" ∷ word (μ ∷ έ ∷ ρ ∷ ι ∷ μ ∷ ν ∷ α ∷ ν ∷ []) "1Pet.5.7" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.5.7" ∷ word (ἐ ∷ π ∷ ι ∷ ρ ∷ ί ∷ ψ ∷ α ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.5.7" ∷ word (ἐ ∷ π ∷ []) "1Pet.5.7" ∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1Pet.5.7" ∷ word (ὅ ∷ τ ∷ ι ∷ []) "1Pet.5.7" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1Pet.5.7" ∷ word (μ ∷ έ ∷ ∙λ ∷ ε ∷ ι ∷ []) "1Pet.5.7" ∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1Pet.5.7" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.5.7" ∷ word (ν ∷ ή ∷ ψ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.5.8" ∷ word (γ ∷ ρ ∷ η ∷ γ ∷ ο ∷ ρ ∷ ή ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1Pet.5.8" ∷ word (ὁ ∷ []) "1Pet.5.8" ∷ word (ἀ ∷ ν ∷ τ ∷ ί ∷ δ ∷ ι ∷ κ ∷ ο ∷ ς ∷ []) "1Pet.5.8" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.5.8" ∷ word (δ ∷ ι ∷ ά ∷ β ∷ ο ∷ ∙λ ∷ ο ∷ ς ∷ []) "1Pet.5.8" ∷ word (ὡ ∷ ς ∷ []) "1Pet.5.8" ∷ word (∙λ ∷ έ ∷ ω ∷ ν ∷ []) "1Pet.5.8" ∷ word (ὠ ∷ ρ ∷ υ ∷ ό ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1Pet.5.8" ∷ word (π ∷ ε ∷ ρ ∷ ι ∷ π ∷ α ∷ τ ∷ ε ∷ ῖ ∷ []) "1Pet.5.8" ∷ word (ζ ∷ η ∷ τ ∷ ῶ ∷ ν ∷ []) "1Pet.5.8" ∷ word (τ ∷ ι ∷ ν ∷ α ∷ []) "1Pet.5.8" ∷ word (κ ∷ α ∷ τ ∷ α ∷ π ∷ ι ∷ ε ∷ ῖ ∷ ν ∷ []) "1Pet.5.8" ∷ word (ᾧ ∷ []) "1Pet.5.9" ∷ word (ἀ ∷ ν ∷ τ ∷ ί ∷ σ ∷ τ ∷ η ∷ τ ∷ ε ∷ []) "1Pet.5.9" ∷ word (σ ∷ τ ∷ ε ∷ ρ ∷ ε ∷ ο ∷ ὶ ∷ []) "1Pet.5.9" ∷ word (τ ∷ ῇ ∷ []) "1Pet.5.9" ∷ word (π ∷ ί ∷ σ ∷ τ ∷ ε ∷ ι ∷ []) "1Pet.5.9" ∷ word (ε ∷ ἰ ∷ δ ∷ ό ∷ τ ∷ ε ∷ ς ∷ []) "1Pet.5.9" ∷ word (τ ∷ ὰ ∷ []) "1Pet.5.9" ∷ word (α ∷ ὐ ∷ τ ∷ ὰ ∷ []) "1Pet.5.9" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.5.9" ∷ word (π ∷ α ∷ θ ∷ η ∷ μ ∷ ά ∷ τ ∷ ω ∷ ν ∷ []) "1Pet.5.9" ∷ word (τ ∷ ῇ ∷ []) "1Pet.5.9" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.9" ∷ word (τ ∷ ῷ ∷ []) "1Pet.5.9" ∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ῳ ∷ []) "1Pet.5.9" ∷ word (ὑ ∷ μ ∷ ῶ ∷ ν ∷ []) "1Pet.5.9" ∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ό ∷ τ ∷ η ∷ τ ∷ ι ∷ []) "1Pet.5.9" ∷ word (ἐ ∷ π ∷ ι ∷ τ ∷ ε ∷ ∙λ ∷ ε ∷ ῖ ∷ σ ∷ θ ∷ α ∷ ι ∷ []) "1Pet.5.9" ∷ word (ὁ ∷ []) "1Pet.5.10" ∷ word (δ ∷ ὲ ∷ []) "1Pet.5.10" ∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1Pet.5.10" ∷ word (π ∷ ά ∷ σ ∷ η ∷ ς ∷ []) "1Pet.5.10" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.5.10" ∷ word (ὁ ∷ []) "1Pet.5.10" ∷ word (κ ∷ α ∷ ∙λ ∷ έ ∷ σ ∷ α ∷ ς ∷ []) "1Pet.5.10" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.5.10" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.5.10" ∷ word (τ ∷ ὴ ∷ ν ∷ []) "1Pet.5.10" ∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1Pet.5.10" ∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.10" ∷ word (δ ∷ ό ∷ ξ ∷ α ∷ ν ∷ []) "1Pet.5.10" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.10" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "1Pet.5.10" ∷ word (ὀ ∷ ∙λ ∷ ί ∷ γ ∷ ο ∷ ν ∷ []) "1Pet.5.10" ∷ word (π ∷ α ∷ θ ∷ ό ∷ ν ∷ τ ∷ α ∷ ς ∷ []) "1Pet.5.10" ∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1Pet.5.10" ∷ word (κ ∷ α ∷ τ ∷ α ∷ ρ ∷ τ ∷ ί ∷ σ ∷ ε ∷ ι ∷ []) "1Pet.5.10" ∷ word (σ ∷ τ ∷ η ∷ ρ ∷ ί ∷ ξ ∷ ε ∷ ι ∷ []) "1Pet.5.10" ∷ word (σ ∷ θ ∷ ε ∷ ν ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "1Pet.5.10" ∷ word (θ ∷ ε ∷ μ ∷ ε ∷ ∙λ ∷ ι ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "1Pet.5.10" ∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1Pet.5.11" ∷ word (τ ∷ ὸ ∷ []) "1Pet.5.11" ∷ word (κ ∷ ρ ∷ ά ∷ τ ∷ ο ∷ ς ∷ []) "1Pet.5.11" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.5.11" ∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1Pet.5.11" ∷ word (α ∷ ἰ ∷ ῶ ∷ ν ∷ α ∷ ς ∷ []) "1Pet.5.11" ∷ word (τ ∷ ῶ ∷ ν ∷ []) "1Pet.5.11" ∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ω ∷ ν ∷ []) "1Pet.5.11" ∷ word (ἀ ∷ μ ∷ ή ∷ ν ∷ []) "1Pet.5.11" ∷ word (Δ ∷ ι ∷ ὰ ∷ []) "1Pet.5.12" ∷ word (Σ ∷ ι ∷ ∙λ ∷ ο ∷ υ ∷ α ∷ ν ∷ ο ∷ ῦ ∷ []) "1Pet.5.12" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.5.12" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.12" ∷ word (π ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.12" ∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ο ∷ ῦ ∷ []) "1Pet.5.12" ∷ word (ὡ ∷ ς ∷ []) "1Pet.5.12" ∷ word (∙λ ∷ ο ∷ γ ∷ ί ∷ ζ ∷ ο ∷ μ ∷ α ∷ ι ∷ []) "1Pet.5.12" ∷ word (δ ∷ ι ∷ []) "1Pet.5.12" ∷ word (ὀ ∷ ∙λ ∷ ί ∷ γ ∷ ω ∷ ν ∷ []) "1Pet.5.12" ∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1Pet.5.12" ∷ word (π ∷ α ∷ ρ ∷ α ∷ κ ∷ α ∷ ∙λ ∷ ῶ ∷ ν ∷ []) "1Pet.5.12" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.5.12" ∷ word (ἐ ∷ π ∷ ι ∷ μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ῶ ∷ ν ∷ []) "1Pet.5.12" ∷ word (τ ∷ α ∷ ύ ∷ τ ∷ η ∷ ν ∷ []) "1Pet.5.12" ∷ word (ε ∷ ἶ ∷ ν ∷ α ∷ ι ∷ []) "1Pet.5.12" ∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ῆ ∷ []) "1Pet.5.12" ∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ν ∷ []) "1Pet.5.12" ∷ word (τ ∷ ο ∷ ῦ ∷ []) "1Pet.5.12" ∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1Pet.5.12" ∷ word (ε ∷ ἰ ∷ ς ∷ []) "1Pet.5.12" ∷ word (ἣ ∷ ν ∷ []) "1Pet.5.12" ∷ word (σ ∷ τ ∷ ῆ ∷ τ ∷ ε ∷ []) "1Pet.5.12" ∷ word (ἀ ∷ σ ∷ π ∷ ά ∷ ζ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1Pet.5.13" ∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1Pet.5.13" ∷ word (ἡ ∷ []) "1Pet.5.13" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.13" ∷ word (Β ∷ α ∷ β ∷ υ ∷ ∙λ ∷ ῶ ∷ ν ∷ ι ∷ []) "1Pet.5.13" ∷ word (σ ∷ υ ∷ ν ∷ ε ∷ κ ∷ ∙λ ∷ ε ∷ κ ∷ τ ∷ ὴ ∷ []) "1Pet.5.13" ∷ word (κ ∷ α ∷ ὶ ∷ []) "1Pet.5.13" ∷ word (Μ ∷ ᾶ ∷ ρ ∷ κ ∷ ο ∷ ς ∷ []) "1Pet.5.13" ∷ word (ὁ ∷ []) "1Pet.5.13" ∷ word (υ ∷ ἱ ∷ ό ∷ ς ∷ []) "1Pet.5.13" ∷ word (μ ∷ ο ∷ υ ∷ []) "1Pet.5.13" ∷ word (ἀ ∷ σ ∷ π ∷ ά ∷ σ ∷ α ∷ σ ∷ θ ∷ ε ∷ []) "1Pet.5.14" ∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1Pet.5.14" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.14" ∷ word (φ ∷ ι ∷ ∙λ ∷ ή ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1Pet.5.14" ∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ς ∷ []) "1Pet.5.14" ∷ word (ε ∷ ἰ ∷ ρ ∷ ή ∷ ν ∷ η ∷ []) "1Pet.5.14" ∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1Pet.5.14" ∷ word (π ∷ ᾶ ∷ σ ∷ ι ∷ ν ∷ []) "1Pet.5.14" ∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1Pet.5.14" ∷ word (ἐ ∷ ν ∷ []) "1Pet.5.14" ∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "1Pet.5.14" ∷ []
{ "alphanum_fraction": 0.3389790016, "avg_line_length": 47.0870337478, "ext": "agda", "hexsha": "f7079e62693d95c84142acb1337507f69075cb37", "lang": "Agda", "max_forks_count": 5, "max_forks_repo_forks_event_max_datetime": "2017-06-11T11:25:09.000Z", "max_forks_repo_forks_event_min_datetime": "2015-02-27T22:34:13.000Z", "max_forks_repo_head_hexsha": "915c46c27c7f8aad5907474d8484f2685a4cd6a7", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "scott-fleischman/GreekGrammar", "max_forks_repo_path": "agda/Text/Greek/SBLGNT/1Pet.agda", "max_issues_count": 13, "max_issues_repo_head_hexsha": "915c46c27c7f8aad5907474d8484f2685a4cd6a7", "max_issues_repo_issues_event_max_datetime": "2020-09-07T11:58:38.000Z", "max_issues_repo_issues_event_min_datetime": "2015-05-28T20:04:08.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "scott-fleischman/GreekGrammar", "max_issues_repo_path": "agda/Text/Greek/SBLGNT/1Pet.agda", "max_line_length": 92, "max_stars_count": 44, "max_stars_repo_head_hexsha": "915c46c27c7f8aad5907474d8484f2685a4cd6a7", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "scott-fleischman/GreekGrammar", "max_stars_repo_path": "agda/Text/Greek/SBLGNT/1Pet.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-06T15:41:57.000Z", "max_stars_repo_stars_event_min_datetime": "2015-05-29T14:48:51.000Z", "num_tokens": 57260, "size": 79530 }
data Unit : Set where unit : Unit F : Unit → Set₁ F {x = unit} = Set
{ "alphanum_fraction": 0.5833333333, "avg_line_length": 12, "ext": "agda", "hexsha": "4103cfc550f0703916f84ab6a78c4944908fc40a", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/Fail/Issue2075.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/Fail/Issue2075.agda", "max_line_length": 21, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/Fail/Issue2075.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 27, "size": 72 }
{-# OPTIONS --cubical --safe #-} module Control.Applicative.Levels where
{ "alphanum_fraction": 0.6883116883, "avg_line_length": 11, "ext": "agda", "hexsha": "ea992e95dc1cb8b16552b5a5205bac87984de2c1", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-11T12:30:21.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-11T12:30:21.000Z", "max_forks_repo_head_hexsha": "97a3aab1282b2337c5f43e2cfa3fa969a94c11b7", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "oisdk/agda-playground", "max_forks_repo_path": "Control/Applicative/Levels.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "97a3aab1282b2337c5f43e2cfa3fa969a94c11b7", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "oisdk/agda-playground", "max_issues_repo_path": "Control/Applicative/Levels.agda", "max_line_length": 39, "max_stars_count": 6, "max_stars_repo_head_hexsha": "97a3aab1282b2337c5f43e2cfa3fa969a94c11b7", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "oisdk/agda-playground", "max_stars_repo_path": "Control/Applicative/Levels.agda", "max_stars_repo_stars_event_max_datetime": "2021-11-16T08:11:34.000Z", "max_stars_repo_stars_event_min_datetime": "2020-09-11T17:45:41.000Z", "num_tokens": 17, "size": 77 }
module PLRTree.Order.Properties {A : Set} where open import Data.Nat open import Data.Nat.Properties open import Data.Sum open import Function open import Induction.Nat open import Induction.WellFounded open import PLRTree {A} open import PLRTree.Order {A} open import Relation.Binary open import Relation.Binary.PropositionalEquality open DecTotalOrder decTotalOrder hiding (refl) open Inverse-image {_<_ = _<′_} height ≺-wf : Well-founded (_<′_ on height) ≺-wf = well-founded <-well-founded lemma-≺-left : (t : Tag)(x : A)(l r : PLRTree) → l ≺ node t x l r lemma-≺-left t x l r with total (height l) (height r) ... | inj₁ hl≤hr = s≤′s (≤⇒≤′ hl≤hr) ... | inj₂ hr≤hl = ≤′-refl lemma-≺-right : (t : Tag)(x : A)(l r : PLRTree) → r ≺ node t x l r lemma-≺-right t x l r with total (height l) (height r) ... | inj₁ hl≤hr = ≤′-refl ... | inj₂ hr≤hl = s≤′s (≤⇒≤′ hr≤hl) lemma-≡-height : (t : Tag)(x y : A)(l r : PLRTree) → height (node t x l r) ≡ height (node t y l r) lemma-≡-height t x y l r with total (height l) (height r) ... | inj₁ hl≤hr = refl ... | inj₂ hr≤hl = refl
{ "alphanum_fraction": 0.6413540714, "avg_line_length": 29.5405405405, "ext": "agda", "hexsha": "904b031489b7417397754b5afea3c926723ee257", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "b8d428bccbdd1b13613e8f6ead6c81a8f9298399", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "bgbianchi/sorting", "max_forks_repo_path": "agda/PLRTree/Order/Properties.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "b8d428bccbdd1b13613e8f6ead6c81a8f9298399", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "bgbianchi/sorting", "max_issues_repo_path": "agda/PLRTree/Order/Properties.agda", "max_line_length": 98, "max_stars_count": 6, "max_stars_repo_head_hexsha": "b8d428bccbdd1b13613e8f6ead6c81a8f9298399", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "bgbianchi/sorting", "max_stars_repo_path": "agda/PLRTree/Order/Properties.agda", "max_stars_repo_stars_event_max_datetime": "2021-08-24T22:11:15.000Z", "max_stars_repo_stars_event_min_datetime": "2015-05-21T12:50:35.000Z", "num_tokens": 417, "size": 1093 }
module Holes.Prelude where open import Agda.Primitive public using (Level; _⊔_; lzero; lsuc) open import Agda.Builtin.List public using (List; _∷_; []) open import Agda.Builtin.Unit public using (⊤; tt) open import Agda.Builtin.Bool public using (Bool; true; false) open import Agda.Builtin.Nat public using (zero; suc; _+_; _*_) renaming (Nat to ℕ; _==_ to _=ℕ?_) open import Agda.Builtin.Reflection public open import Agda.Builtin.String public open import Agda.Builtin.Char public infixr 4 _,_ infixr 2 _×_ infixr 9 _∘_ infixl 1 _⟨_⟩_ infixr 0 _$_ infix 0 case_of_ -------------------------------------------------------------------------------- -- Datatypes -------------------------------------------------------------------------------- data Maybe {a} (A : Set a) : Set a where just : (x : A) → Maybe A nothing : Maybe A record _×_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where constructor _,_ field proj₁ : A proj₂ : B open _×_ public -------------------------------------------------------------------------------- -- Combinators -------------------------------------------------------------------------------- _∘_ : ∀ {a b c} {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} → (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → ((x : A) → C (g x)) f ∘ g = λ x → f (g x) id : ∀ {a} {A : Set a} → A → A id x = x const : ∀ {a b} {A : Set a} {B : Set b} → A → B → A const x = λ _ → x flip : ∀ {a b c} {A : Set a}{B : Set b}{C : Set c} → (A → B → C) → B → A → C flip f y x = f x y _$_ : ∀ {a b} {A : Set a} {B : A → Set b} → ((x : A) → B x) → ((x : A) → B x) f $ x = f x _⟨_⟩_ : ∀ {a b c} {A : Set a} {B : Set b} {C : Set c} → A → (A → B → C) → B → C x ⟨ f ⟩ y = f x y curry : ∀ {a b c}{A : Set a}{B : Set b}{C : Set c} → (A × B → C) → A → B → C curry f x y = f (x , y) uncurry : ∀ {a b c}{A : Set a}{B : Set b}{C : Set c} → (A → B → C) → A × B → C uncurry f (x , y) = f x y case_of_ : ∀ {a b}{A : Set a}{B : Set b} → A → (A → B) → B case x of f = f x -------------------------------------------------------------------------------- -- Boolean operations -------------------------------------------------------------------------------- _∨_ : Bool → Bool → Bool false ∨ false = false _ ∨ _ = true _∧_ : Bool → Bool → Bool true ∧ true = true _ ∧ _ = false not : Bool → Bool not true = false not false = true if_then_else_ : ∀ {a} {A : Set a} → (b : Bool) → A → A → A if true then x else y = x if false then x else y = y -------------------------------------------------------------------------------- -- List operations -------------------------------------------------------------------------------- singleton : ∀ {a}{A : Set a} → A → List A singleton x = x ∷ [] map : ∀ {a b}{A : Set a}{B : Set b} → (A → B) → List A → List B map f [] = [] map f (x ∷ xs) = f x ∷ map f xs length : ∀ {a}{A : Set a} → List A → ℕ length [] = 0 length (_ ∷ xs) = suc (length xs) zip : ∀ {a b}{A : Set a}{B : Set b} → List A → List B → List (A × B) zip [] _ = [] zip _ [] = [] zip (x ∷ xs) (y ∷ ys) = (x , y) ∷ zip xs ys unzip : ∀ {a b}{A : Set a}{B : Set b} → List (A × B) → List A × List B unzip [] = [] , [] unzip ((x , y) ∷ xys) with unzip xys ... | xs , ys = x ∷ xs , y ∷ ys infixr 6 _++_ _++_ : ∀ {a}{A : Set a} → List A → List A → List A [] ++ ys = ys (x ∷ xs) ++ ys = x ∷ xs ++ ys concatMap : ∀ {a b}{A : Set a}{B : Set b} → (A → List B) → List A → List B concatMap f [] = [] concatMap f (x ∷ xs) = f x ++ concatMap f xs concat : ∀ {a}{A : Set a} → List (List A) → List A concat = concatMap id intersperse : ∀ {a}{A : Set a} → A → List A → List A intersperse e [] = [] intersperse e (x ∷ []) = x ∷ [] intersperse e (x ∷ y ∷ xs) = x ∷ e ∷ intersperse e (y ∷ xs) intercalate : ∀ {a}{A : Set a} → List A → List (List A) → List A intercalate e = concat ∘ intersperse e -------------------------------------------------------------------------------- -- Nat operations -------------------------------------------------------------------------------- -- A comparison view. Taken from "View from the left" (McBride/McKinna) via the -- Agda standard library data Ordering : ℕ → ℕ → Set where less : ∀ m k → Ordering m (suc (m + k)) equal : ∀ m → Ordering m m greater : ∀ m k → Ordering (suc (m + k)) m compare : ∀ m n → Ordering m n compare zero zero = equal zero compare (suc m) zero = greater zero m compare zero (suc n) = less zero n compare (suc m) (suc n) with compare m n compare (suc .m) (suc .(suc m + k)) | less m k = less (suc m) k compare (suc .m) (suc .m) | equal m = equal (suc m) compare (suc .(suc m + k)) (suc .m) | greater m k = greater (suc m) k _<?_ : ℕ → ℕ → Bool x <? y with compare x y ... | Ordering.less .x _ = true ... | _ = false -------------------------------------------------------------------------------- -- Typeclasses -------------------------------------------------------------------------------- record RawMonoid {f} (M : Set f) : Set f where field _<>_ : M → M → M mempty : M open RawMonoid {{...}} public instance listMonoid : ∀ {a} {A : Set a} → RawMonoid (List A) RawMonoid._<>_ listMonoid = _++_ RawMonoid.mempty listMonoid = [] record RawMonad {f} (M : Set f → Set f) : Set (lsuc f) where infixl 1 _>>=_ _>>_ _>=>_ _>>=²_ infixr 1 _=<<_ _<=<_ infixl 4 _<$>_ infixl 4 _⊛_ field _>>=_ : ∀ {A B} → M A → (A → M B) → M B return : ∀ {A} → A → M A _>>_ : ∀ {A B} → M A → M B → M B x >> y = x >>= λ _ → y _>=>_ : ∀ {ℓ}{A : Set ℓ}{B C} → (A → M B) → (B → M C) → A → M C f >=> g = λ x → f x >>= g _=<<_ : ∀ {A B} → (A → M B) → M A → M B f =<< x = x >>= f _<=<_ : ∀ {ℓ}{A : Set ℓ}{B C} → (B → M C) → (A → M B) → A → M C g <=< f = f >=> g _>>=²_ : {A B C : Set f} → M (A × B) → (A → B → M C) → M C x >>=² f = x >>= uncurry f join : ∀ {A} → M (M A) → M A join m = m >>= id fmap : ∀ {A B} → (A → B) → M A → M B fmap f x = x >>= return ∘ f _<$>_ = fmap _⊛_ : ∀ {A B} → M (A → B) → M A → M B f ⊛ x = f >>= flip fmap x open RawMonad {{...}} public record RawTraversable {t} (T : Set t → Set t) : Set (lsuc t) where field traverse : {M : Set t → Set t} {{monad : RawMonad M}} {A B : Set t} → (A → M B) → T A → M (T B) sequence : {M : Set t → Set t} {{monad : RawMonad M}} {A : Set t} → T (M A) → M (T A) sequence = traverse id open RawTraversable {{...}} public traverse- : {T M : Set → Set} {{traversable : RawTraversable T}} {{monad : RawMonad M}} {A B : Set} → (A → M B) → T A → M ⊤ traverse- f xs = traverse f xs >> return tt instance traversableList : ∀ {t} → RawTraversable (List {t}) traverse {{traversableList}} f [] = return [] traverse {{traversableList}} f (x ∷ xs) = _∷_ <$> f x ⊛ traverse f xs -------------------------------------------------------------------------------- -- Propositional Equality -------------------------------------------------------------------------------- module PropEq where open import Agda.Builtin.Equality using (_≡_; refl) public sym : ∀ {a} {A : Set a} {x y : A} → x ≡ y → y ≡ x sym refl = refl trans : ∀ {a} {A : Set a} {x y z : A} → x ≡ y → y ≡ z → x ≡ z trans refl eq = eq subst : ∀ {a p} {A : Set a} (P : A → Set p) {x y} → x ≡ y → P x → P y subst P refl p = p cong : ∀ {a b} {A : Set a} {B : Set b} (f : A → B) {x y} → x ≡ y → f x ≡ f y cong f refl = refl -------------------------------------------------------------------------------- -- Monads and useful instances -------------------------------------------------------------------------------- infixl 1 _>>=′_ -- _>>=_ in `RawMonad` only works on a single level, while bindTC is more -- level-polymorphic, which we will sometimes need. _>>=′_ = bindTC data Result {e r} (E : Set e) (R : Set r) : Set (e ⊔ r) where ok : (x : R) → Result E R err : (e : E) → Result E R Maybe→Result : ∀ {e r} {E : Set e} {R : Set r} → E → Maybe R → Result E R Maybe→Result e (just x) = ok x Maybe→Result e nothing = err e instance List-Monad : ∀ {a} → RawMonad (List {a}) RawMonad._>>=_ List-Monad = flip concatMap RawMonad.return List-Monad x = x ∷ [] TC-Monad : ∀ {a} → RawMonad {a} TC TC-Monad = record { return = returnTC ; _>>=_ = bindTC } Maybe-Monad : ∀ {a} → RawMonad {a} Maybe (RawMonad._>>=_ Maybe-Monad) (just x) f = f x (RawMonad._>>=_ Maybe-Monad) nothing f = nothing RawMonad.return Maybe-Monad = just Result-Monad : ∀ {ℓ}{E : Set ℓ} → RawMonad {ℓ} (Result E) Result-Monad = record { return = ok ; _>>=_ = λ { (err e) _ → err e ; (ok x) f → f x } } -------------------------------------------------------------------------------- -- RTC: A type checking monad with errors other than normal type errors -------------------------------------------------------------------------------- record RTC {e r} (E : Set e) (R : Set r) : Set (e ⊔ r) where field tryRunRTC : TC (Result E R) open RTC public runRTC : ∀ {e r} {E : Set e} {R : Set r} → (E → TC R) → RTC E R → TC R runRTC f x = tryRunRTC x >>=′ λ { (err e) → f e ; (ok y) → return y } module RTC′ {e} {E : Set e} where bind : ∀ {α β} {A : Set α}{B : Set β} → RTC E A → (A → RTC E B) → RTC E B tryRunRTC (bind x f) = tryRunRTC x >>=′ λ { (err e) → return (err e) ; (ok y) → tryRunRTC (f y) } instance RTC-monad : ∀ {ℓ} {E : Set ℓ} → RawMonad {ℓ} (RTC E) RTC-monad = record { return = λ x → record { tryRunRTC = return (return x) } ; _>>=_ = RTC′.bind } catchRTC : ∀ {ℓ} {E : Set ℓ}{R : Set ℓ} → RTC E R → RTC E R → RTC E R tryRunRTC (catchRTC rtc fallback) = tryRunRTC rtc ⟨ catchTC ⟩ tryRunRTC fallback -------------------------------------------------------------------------------- -- MonadCatch and instances -------------------------------------------------------------------------------- record MonadCatch {a e} (E : Set e) (M : Set a → Set a) : Set (lsuc a ⊔ e) where field catch : ∀ {A : Set a} → (E → M A) → M A → M A open MonadCatch {{...}} public instance Maybe-MonadCatch : ∀ {a} → MonadCatch {a} ⊤ Maybe Maybe-MonadCatch = record { catch = λ { f (just x) → just x ; f nothing → f tt } } Result-MonadCatch : ∀ {ℓ} {E : Set ℓ} → MonadCatch {ℓ} E (Result E) Result-MonadCatch = record { catch = λ { f (err e) → f e ; f (ok x) → ok x} } RTC-MonadCatch : ∀ {ℓ} {E : Set ℓ} → MonadCatch {ℓ} E (RTC E) RTC-MonadCatch = record { catch = λ f x → record { tryRunRTC = tryRunRTC x >>= λ { (err e) → tryRunRTC (f e) ; (ok y) → return (ok y) } } } -------------------------------------------------------------------------------- -- MonadThrow and instances -------------------------------------------------------------------------------- record MonadThrow {a e} (E : Set e) (M : Set a → Set a) : Set (lsuc a ⊔ e) where field {{monad}} : RawMonad M throw : ∀ {A : Set a} → E → M A open MonadThrow {{...}} public instance Maybe-MonadThrow : ∀ {a} → MonadThrow {a} ⊤ Maybe Maybe-MonadThrow = record { throw = λ _ → nothing } Result-MonadThrow : ∀ {ℓ} {E : Set ℓ} → MonadThrow {ℓ} E (Result E) Result-MonadThrow = record { throw = err } RTC-MonadThrow : ∀ {ℓ} {E : Set ℓ} → MonadThrow {ℓ} E (RTC E) RTC-MonadThrow = record { throw = λ e → record { tryRunRTC = return (err e) } } TC-MonadThrow : ∀ {ℓ} → MonadThrow {ℓ} (List ErrorPart) TC TC-MonadThrow = record { throw = typeError } liftResult′ : ∀ {e ℓ} {E E′ : Set e} {M : Set ℓ → Set ℓ} {{monadThrow : MonadThrow E′ M}} {A : Set ℓ} → (E → E′) → Result E A → M A liftResult′ _ (ok x) = return x liftResult′ f (err e) = throw (f e) liftResult : ∀ {e ℓ} {E : Set e} {M : Set ℓ → Set ℓ} {{monadThrow : MonadThrow E M}} {A : Set ℓ} → Result E A → M A liftResult = liftResult′ id liftMaybe : ∀ {e ℓ}{E : Set e} {M : Set ℓ → Set ℓ} {{monadThrow : MonadThrow E M}} {A : Set ℓ} → E → Maybe A → M A liftMaybe error (just x) = return x liftMaybe error nothing = throw error -------------------------------------------------------------------------------- -- Choice and instances -------------------------------------------------------------------------------- record Choice {a} (F : Set a → Set a) : Set (lsuc a) where field _<|>_ : ∀ {A} → F A → F A → F A open Choice {{...}} public instance Maybe-Choice : ∀ {a} → Choice {a} Maybe Maybe-Choice = record { _<|>_ = λ { (just x) _ → just x ; nothing (just y) → just y ; nothing nothing → nothing } } Result-Choice : ∀ {ℓ}{E : Set ℓ} → Choice {ℓ} (Result E) Result-Choice = record { _<|>_ = λ { (ok x) _ → ok x ; (err _) (ok y) → ok y ; (err e) (err _) → err e } } -------------------------------------------------------------------------------- -- General utility methods -------------------------------------------------------------------------------- successes : ∀ {ℓ e M} {E : Set e} {{monadCatch : MonadCatch E M}}{{monad : RawMonad M}} {A : Set ℓ} → List (M A) → M (List A) successes [] = return [] successes {{monadCatch}} {A = A} (x ∷ xs) = successes {{monadCatch}} xs >>= λ xs′ → catch {{monadCatch}} (λ _ → return xs′) (fmap (_∷ xs′) x) mapErr : ∀ {e r}{R : Set r}{E E′ : Set e} → (E → E′) → Result E R → Result E′ R mapErr f (ok x) = ok x mapErr f (err e) = err (f e) discardErr : ∀ {e r} {E : Set e}{R : Set r} → Result E R → Maybe R discardErr (ok x) = just x discardErr (err _) = nothing result : ∀ {e r a}{E : Set e}{R : Set r}{A : Set a} → (E → A) → (R → A) → Result E R → A result g f (ok x) = f x result g f (err e) = g e -------------------------------------------------------------------------------- -- Reflection utility methods -------------------------------------------------------------------------------- infix 4 _=Name?_ _=Name?_ : Name → Name → Bool _=Name?_ = primQNameEquality basicArg : Term → Arg Term basicArg = arg (arg-info visible relevant) implicitArg : Term → Arg Term implicitArg = arg (arg-info hidden relevant) getArg : Arg Term → Term getArg (arg _ x) = x mapArg : ∀ {A B} → (A → B) → Arg A → Arg B mapArg f (arg i x) = arg i (f x) getArglist : Term → List (Arg Term) getArglist (def _ args) = args getArglist (con _ args) = args getArglist (var _ args) = args getArglist _ = [] instance traversableArg : RawTraversable Arg traverse {{traversableArg}} f (arg i x) = arg i <$> f x liftTC : ∀ {e r} {E : Set e}{R : Set r} → TC R → RTC E R tryRunRTC (liftTC x) = x >>=′ return ∘ ok mapRtcErr : ∀ {ℓ}{R E E′ : Set ℓ} → (E → E′) → RTC E R → RTC E′ R tryRunRTC (mapRtcErr f x) = tryRunRTC x >>= return ∘ mapErr f runRtcOrTypeError : ∀ {ℓ} {E R : Set ℓ} → (E → List ErrorPart) → RTC E R → TC R runRtcOrTypeError error = tryRunRTC >=> result (typeError ∘ error) return typeError′ : ∀ {ℓ} {E R : Set ℓ} → List ErrorPart → RTC E R typeError′ = liftTC ∘ typeError -------------------------------------------------------------------------------- -- Macros that aid debugging -------------------------------------------------------------------------------- runTCTy : ∀ ℓ → Type → Term → Term → TC ⊤ runTCTy ℓ at-type tc-term target = unquoteTC at-type >>=′ λ (ty : Set ℓ) → unquoteTC tc-term >>=′ λ (TCx : TC ty) → TCx >>=′ quoteTC >>=′ unify target macro -- Quotes a term and expands to its reified syntax tree as a `Term`. quote-term : Term → Term → TC ⊤ quote-term term target = quoteTC term >>= unify target -- Runs a TC operation and splices its result into the expression. Only works -- with operations in Set₀. runTCTy′ : ∀ {ℓ} → Type → Term → Term → TC ⊤ runTCTy′ {ℓ} = runTCTy ℓ runTC : ∀ {ℓ} → Term → Term → TC ⊤ runTC {ℓ} tc-term target = inferType target >>=′ unquoteTC >>=′ λ (ty : Set ℓ) → unquoteTC tc-term >>=′ λ (TCx : TC ty) → TCx >>=′ quoteTC >>=′ unify target
{ "alphanum_fraction": 0.4531572689, "avg_line_length": 29.7560521415, "ext": "agda", "hexsha": "e8090258c3e48a4b9dfac59d809ce8f66a99a17c", "lang": "Agda", "max_forks_count": 2, "max_forks_repo_forks_event_max_datetime": "2021-02-02T18:57:17.000Z", "max_forks_repo_forks_event_min_datetime": "2017-01-27T14:57:39.000Z", "max_forks_repo_head_hexsha": "b5537c29e69febd7e89580398fac38d619aab3b4", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "bch29/agda-holes", "max_forks_repo_path": "src/Holes/Prelude.agda", "max_issues_count": 2, "max_issues_repo_head_hexsha": "b5537c29e69febd7e89580398fac38d619aab3b4", "max_issues_repo_issues_event_max_datetime": "2020-08-31T20:58:33.000Z", "max_issues_repo_issues_event_min_datetime": "2019-01-16T10:47:58.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "bch29/agda-holes", "max_issues_repo_path": "src/Holes/Prelude.agda", "max_line_length": 131, "max_stars_count": 24, "max_stars_repo_head_hexsha": "b5537c29e69febd7e89580398fac38d619aab3b4", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "bch29/agda-holes", "max_stars_repo_path": "src/Holes/Prelude.agda", "max_stars_repo_stars_event_max_datetime": "2021-11-03T15:02:41.000Z", "max_stars_repo_stars_event_min_datetime": "2017-01-28T10:56:46.000Z", "num_tokens": 5447, "size": 15979 }
open import Oscar.Prelude open import Oscar.Class open import Oscar.Class.Reflexivity open import Oscar.Class.Smap open import Oscar.Class.Surjextensionality open import Oscar.Class.Surjidentity open import Oscar.Class.Surjtranscommutativity open import Oscar.Class.HasEquivalence open import Oscar.Class.Transitivity open import Oscar.Class.Thickandthin open import Oscar.Class.IsPrefunctor open import Oscar.Class.IsFunctor open import Oscar.Data.Maybe open import Oscar.Data.¶ open import Oscar.Data.Fin open import Oscar.Data.Proposequality open import Oscar.Data.Substitunction open import Oscar.Data.Term open import Oscar.Data.Substitist open import Oscar.Data.Descender import Oscar.Property.Setoid.Proposextensequality import Oscar.Property.Functor.SubstitunctionExtensionTerm import Oscar.Property.Category.AListProposequality import Oscar.Property.Category.ExtensionProposextensequality import Oscar.Property.Thickandthin.FinFinProposequalityMaybeProposequality import Oscar.Class.HasEquivalence.Substitunction import Oscar.Class.Surjection.⋆ module Oscar.Property.Functor.SubstitistProposequalitySubstitunctionProposextensequality where module _ {𝔭} {𝔓 : Ø 𝔭} where open Substitunction 𝔓 open Term 𝔓 open Substitist 𝔓 _for_ : ∀ {n} (t' : Term n) (x : Fin (↑ n)) → Fin (↑ n) → Term n (t for x) y = maybe′ ε t (check[ Maybe ] x y) instance 𝓢urjectivitySubstitist,Substitunction : Smap.class Substitist Substitunction ¡ ¡ 𝓢urjectivitySubstitist,Substitunction .⋆ _ _ ∅ = i 𝓢urjectivitySubstitist,Substitunction .⋆ _ _ ((x , t) , σ) = 𝓢urjectivitySubstitist,Substitunction .⋆ _ _ σ ∙ (t for x) 𝓢urjextensionalitySubstitist,Substitunction : Surjextensionality.class Substitist Proposequality Substitunction _≈_ ¡ smap 𝓢urjextensionalitySubstitist,Substitunction .⋆ _ _ _ _ ∅ _ = ∅ 𝓢urjtranscommutativitySubstitist,Substitunction : Surjtranscommutativity.class Substitist Substitunction _≈_ smap transitivity transitivity 𝓢urjtranscommutativitySubstitist,Substitunction .⋆ ∅ _ _ = ∅ 𝓢urjtranscommutativitySubstitist,Substitunction .⋆ ((π₀ , π₁) , f) g = let _⟪∙⟫′_ = flip (𝓢urjtranscommutativitySubstitist,Substitunction .⋆) in -- kludge for Agda's termination checker ( § g ⟪∙⟫ §[ Substitunction ] f ∙ ⟪ g ⟪∙⟫′ f ⟫[ Proposextensequality ] ) ∘ π₁ for π₀ IsPrefunctorSubstitist,Substitunction : IsPrefunctor Substitist Proposequality transitivity Substitunction _≈_ transitivity smap IsPrefunctorSubstitist,Substitunction = ∁ 𝓢urjidentitySubstitist,Substitunction : Surjidentity.class Substitist Substitunction _≈_ smap ε ε 𝓢urjidentitySubstitist,Substitunction .⋆ _ = ∅ IsFunctorSubstitist,Substitunction : IsFunctor Substitist Proposequality ε transitivity Substitunction _≈_ ε transitivity smap IsFunctorSubstitist,Substitunction = ∁
{ "alphanum_fraction": 0.7791983414, "avg_line_length": 40.1944444444, "ext": "agda", "hexsha": "09c38133265d08162f7f2c7bc592430597fc00ea", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "52e1cdbdee54d9a8eaee04ee518a0d7f61d25afb", "max_forks_repo_licenses": [ "RSA-MD" ], "max_forks_repo_name": "m0davis/oscar", "max_forks_repo_path": "archive/agda-3/src/Oscar/Property/Functor/SubstitistProposequalitySubstitunctionProposextensequality.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "52e1cdbdee54d9a8eaee04ee518a0d7f61d25afb", "max_issues_repo_issues_event_max_datetime": "2019-05-11T23:33:04.000Z", "max_issues_repo_issues_event_min_datetime": "2019-04-29T00:35:04.000Z", "max_issues_repo_licenses": [ "RSA-MD" ], "max_issues_repo_name": "m0davis/oscar", "max_issues_repo_path": "archive/agda-3/src/Oscar/Property/Functor/SubstitistProposequalitySubstitunctionProposextensequality.agda", "max_line_length": 143, "max_stars_count": null, "max_stars_repo_head_hexsha": "52e1cdbdee54d9a8eaee04ee518a0d7f61d25afb", "max_stars_repo_licenses": [ "RSA-MD" ], "max_stars_repo_name": "m0davis/oscar", "max_stars_repo_path": "archive/agda-3/src/Oscar/Property/Functor/SubstitistProposequalitySubstitunctionProposextensequality.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 907, "size": 2894 }
{-# OPTIONS --without-K #-} module Substream (A : Set) where open import Relation.Binary open import Relation.Binary.PropositionalEquality as PE open import PropsAsTypes open import Stream open Bisim A open ~-Reasoning mutual record Sel : Set where coinductive field out : Selμ data Selμ : Set where pres : Sel → Selμ drop : Selμ → Selμ open Sel public filterμ : Selμ → Stream A → Stream A filter : Sel → Stream A → Stream A filter x = filterμ (x .out) filterμ (pres x) s .hd = s .hd filterμ (pres x) s .tl = filter x (s .tl) filterμ (drop u) s = filterμ u (s .tl) _≤[_]_ : Stream A → Sel → Stream A → Prop s ≤[ x ] t = s ~ filter x t _≤μ[_]_ : Stream A → Selμ → Stream A → Prop s ≤μ[ u ] t = s ~ filterμ u t _≤'_ : Stream A → Stream A → Prop s ≤' t = ∃[ x ∈ Sel ] (s ≤[ x ] t) _•_ : Sel → Sel → Sel _•μ_ : Selμ → Selμ → Selμ (x • y) .out = (x .out) •μ (y .out) (pres x') •μ (pres y') = pres (x' • y') (drop u') •μ (pres y') = drop (u' •μ (y' .out)) u •μ (drop v') = drop (u •μ v') filter-hom : ∀ x y s → filter (y • x) s ~ filter y (filter x s) filterμ-hom : ∀ u v s → filterμ (v •μ u) s ~ filterμ v (filterμ u s) filter-hom x y s = filterμ-hom (x .out) (y .out) s filterμ-hom (pres x) (pres y) s .hd≡ = refl filterμ-hom (pres x) (pres y) s .tl~ = filter-hom x y (s .tl) filterμ-hom (pres x) (drop v) s = filterμ-hom (x .out) v (s .tl) filterμ-hom (drop u) (pres x) s = filterμ-hom u (pres x) (s .tl) filterμ-hom (drop u) (drop v) s = filterμ-hom u (drop v) (s .tl) filter-resp~ : ∀{s t} (x : Sel) → s ~ t → filter x s ~ filter x t filterμ-resp~ : ∀{s t} (u : Selμ) → s ~ t → filterμ u s ~ filterμ u t filter-resp~ x p = filterμ-resp~ (x .out) p filterμ-resp~ (pres x) p .hd≡ = p .hd≡ filterμ-resp~ (pres x) p .tl~ = filter-resp~ x (p .tl~) filterμ-resp~ (drop u) p = filterμ-resp~ u (p .tl~) ≤-witness-trans : ∀{r s t} {x y} → r ≤[ x ] s → s ≤[ y ] t → r ≤[ x • y ] t ≤-witness-trans {r} {s} {t} {x} {y} p q = begin r ~⟨ p ⟩ filter x s ~⟨ filter-resp~ x q ⟩ filter x (filter y t) ~⟨ S.sym (filter-hom y x t) ⟩ filter (x • y) t ∎ where module S = Setoid stream-setoid ≤'-trans : ∀{r s t} → r ≤' s → s ≤' t → r ≤' t ≤'-trans = ∃₂-elim (λ x y p q → ∃-intro (x • y) (≤-witness-trans {x = x} {y} p q)) mutual record _≤_ (s t : Stream A) : Prop where coinductive field out≤ : s ≤μ t data _≤μ_ (s t : Stream A) : Prop where match : (s .hd ≡ t .hd) → (s .tl ≤ t .tl) → s ≤μ t skip : (s ≤μ t .tl) → s ≤μ t open _≤_ public witness : {s t : Stream A} → s ≤ t → Sel witnessμ : {s t : Stream A} → s ≤μ t → Selμ witness p .out = witnessμ (p .out≤) witnessμ (match _ t≤) = pres (witness t≤) witnessμ (skip u) = drop (witnessμ u) ≤-implies-witnessed≤ : ∀{s t} → (p : s ≤ t) → s ≤[ witness p ] t ≤μ-implies-witnessed≤μ : ∀{s t} → (p : s ≤μ t) → s ≤μ[ witnessμ p ] t ≤-implies-witnessed≤ {s} {t} p = ≤μ-implies-witnessed≤μ (p .out≤) ≤μ-implies-witnessed≤μ (match h≡ t≤) .hd≡ = h≡ ≤μ-implies-witnessed≤μ (match h≡ t≤) .tl~ = ≤-implies-witnessed≤ t≤ ≤μ-implies-witnessed≤μ (skip q) = ≤μ-implies-witnessed≤μ q ≤-implies-≤' : _≤_ ⊑ _≤'_ ≤-implies-≤' p = ∃-intro (witness p) (≤-implies-witnessed≤ p) witnessed≤-implies-≤ : ∀{s t} (x : Sel) → s ≤[ x ] t → s ≤ t witnessed≤μ-implies-≤μ : ∀{s t} (u : Selμ) → s ≤μ[ u ] t → s ≤μ t witnessed≤-implies-≤ x p .out≤ = witnessed≤μ-implies-≤μ (x .out) p witnessed≤μ-implies-≤μ (pres x) p = match (p .hd≡) (witnessed≤-implies-≤ x (p .tl~)) witnessed≤μ-implies-≤μ (drop u) p = skip (witnessed≤μ-implies-≤μ u p) ≤'-implies-≤ : _≤'_ ⊑ _≤_ ≤'-implies-≤ = ∃-elim witnessed≤-implies-≤ ≤-and-≤'-equivalent : ∀ {s t} → s ≤ t ⇔ s ≤' t ≤-and-≤'-equivalent = equivalence ≤-implies-≤' ≤'-implies-≤ ≤-trans : ∀{r s t} → r ≤ s → s ≤ t → r ≤ t ≤-trans p q = ≤'-implies-≤ (≤'-trans (≤-implies-≤' p) (≤-implies-≤' q))
{ "alphanum_fraction": 0.5401921132, "avg_line_length": 29.0882352941, "ext": "agda", "hexsha": "ca4d5a0e83f003efadc1b3bd9a578f1c19828a8a", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "8fc7a6cd878f37f9595124ee8dea62258da28aa4", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "hbasold/Sandbox", "max_forks_repo_path": "TypeTheory/Lecture/Substream.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "8fc7a6cd878f37f9595124ee8dea62258da28aa4", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "hbasold/Sandbox", "max_issues_repo_path": "TypeTheory/Lecture/Substream.agda", "max_line_length": 85, "max_stars_count": null, "max_stars_repo_head_hexsha": "8fc7a6cd878f37f9595124ee8dea62258da28aa4", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "hbasold/Sandbox", "max_stars_repo_path": "TypeTheory/Lecture/Substream.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 1814, "size": 3956 }
module Structure.Category.Functor.Functors.Proofs where import Functional as Fn import Function.Equals open Function.Equals.Dependent open import Function.Equals.Proofs open import Logic.Predicate open import Logic.Propositional import Lvl open import Relator.Equals.Proofs.Equivalence open import Structure.Category open import Structure.Category.Functor open import Structure.Category.Functor.Equiv open import Structure.Category.Functor.Functors open import Structure.Category.Morphism.IdTransport open import Structure.Category.NaturalTransformation open import Structure.Categorical.Properties open import Structure.Function open import Structure.Operator open import Structure.Relator.Properties open import Structure.Setoid open import Syntax.Transitivity open import Type private variable ℓₒ ℓₘ ℓₑ : Lvl.Level private variable A B C : CategoryObject{ℓₒ}{ℓₘ}{ℓₑ} open CategoryObject open Category ⦃ … ⦄ open Functor ⦃ … ⦄ module _ where open Wrapped -- TODO: Prove transport-of-congruenced-bifunctor [∘ᶠᵘⁿᶜᵗᵒʳ]-binaryOperator : BinaryOperator(_∘ᶠᵘⁿᶜᵗᵒʳ_ {A = A}{B = B}{C = C}) _≡ᶠᵘⁿᶜᵗᵒʳ_.functor-proof (BinaryOperator.congruence ([∘ᶠᵘⁿᶜᵗᵒʳ]-binaryOperator {A = A} {B = B} {C = C}) {[∃]-intro F₁} {[∃]-intro F₂} {[∃]-intro G₁} {[∃]-intro G₂} (intro fp₁ mp₁) (intro fp₂ mp₂)) = congruence₂(Fn._∘_) ⦃ [⊜][∘]-binaryOperator ⦃ function = [≡]-function ⦄ ⦄ fp₁ fp₂ where instance _ = [≡]-equiv {T = Object(B)} instance _ = [≡]-equiv {T = Object(C)} NaturalTransformation.natural (_≡ᶠᵘⁿᶜᵗᵒʳ_.map-proof (BinaryOperator.congruence ([∘ᶠᵘⁿᶜᵗᵒʳ]-binaryOperator {A = A} {B = B} {C = C}) {[∃]-intro F₁}{[∃]-intro F₂} {[∃]-intro G₁}{[∃]-intro G₂} (intro fp₁ mp₁) (intro fp₂ mp₂))) {x}{y} {f} = anything {- transport C (_⊜_.proof (congruence₂(Fn._∘_) ⦃ [⊜][∘]-binaryOperator ⦃ function = [≡]-function _ ⦄ ⦄ fp₁ fp₂)) ∘ map(map f) 🝖-[ {!x₂ y₂!} ] map(map f) ∘ transport C ([≡]-with-op (Object C) (λ v v₁ → {!v!}) (_⊜_.proof fp₁) (_⊜_.proof fp₂)) 🝖-[ {!!} ] map(map f) ∘ transport C (_⊜_.proof (congruence₂(Fn._∘_) ⦃ [⊜][∘]-binaryOperator ⦃ function = [≡]-function _ ⦄ ⦄ fp₁ fp₂)) 🝖-end-} where postulate anything : ∀{ℓ}{a : Type{ℓ}} → a open module MorphismEquivB {x}{y} = Equiv(morphism-equiv B {x}{y}) using () renaming (_≡_ to _≡B_) open module MorphismEquivC {x}{y} = Equiv(morphism-equiv C {x}{y}) using () renaming (_≡_ to _≡C_) instance _ = category A instance _ = category B instance _ = category C instance _ = [≡]-equiv {T = Object B} instance _ = [≡]-equiv {T = Object C} -- [≡]-with-op instance [∘ᶠᵘⁿᶜᵗᵒʳ]-identityₗ : Morphism.Identityₗ {Obj = CategoryObject{ℓₒ}{ℓₘ}{ℓₑ}} (\{A} → _∘ᶠᵘⁿᶜᵗᵒʳ_ {A = A})(idᶠᵘⁿᶜᵗᵒʳ) _≡ᶠᵘⁿᶜᵗᵒʳ_.functor-proof (Morphism.Identityₗ.proof ([∘ᶠᵘⁿᶜᵗᵒʳ]-identityₗ) {y = B}) = reflexivity(_⊜_) where instance _ = [≡]-equiv {T = Object(B)} NaturalTransformation.natural (_≡ᶠᵘⁿᶜᵗᵒʳ_.map-proof (Morphism.Identityₗ.proof [∘ᶠᵘⁿᶜᵗᵒʳ]-identityₗ {A} {B} {[∃]-intro F})) {x} {y} {f} = id ∘ map f 🝖-[ Morphism.identityₗ(_∘_)(id) ] map f 🝖-[ Morphism.identityᵣ(_∘_)(id) ]-sym map f ∘ id 🝖-end where open module MorphismEquivB {x}{y} = Equiv(morphism-equiv B {x}{y}) using () renaming (_≡_ to _≡B_) instance _ = category A instance _ = category B instance [∘ᶠᵘⁿᶜᵗᵒʳ]-identityᵣ : Morphism.Identityᵣ {Obj = CategoryObject{ℓₒ}{ℓₘ}{ℓₑ}} (\{A} → _∘ᶠᵘⁿᶜᵗᵒʳ_ {A = A})(idᶠᵘⁿᶜᵗᵒʳ) _≡ᶠᵘⁿᶜᵗᵒʳ_.functor-proof (Morphism.Identityᵣ.proof ([∘ᶠᵘⁿᶜᵗᵒʳ]-identityᵣ) {y = B}) = reflexivity(_⊜_) where instance _ = [≡]-equiv {T = Object(B)} NaturalTransformation.natural (_≡ᶠᵘⁿᶜᵗᵒʳ_.map-proof (Morphism.Identityᵣ.proof [∘ᶠᵘⁿᶜᵗᵒʳ]-identityᵣ {A} {B} {[∃]-intro F})) {x} {y} {f} = id ∘ map f 🝖-[ Morphism.identityₗ(_∘_)(id) ] map f 🝖-[ Morphism.identityᵣ(_∘_)(id) ]-sym map f ∘ id 🝖-end where open module MorphismEquivB {x}{y} = Equiv(morphism-equiv B {x}{y}) using () renaming (_≡_ to _≡B_) instance _ = category A instance _ = category B instance [∘ᶠᵘⁿᶜᵗᵒʳ]-identity : Morphism.Identity {Obj = CategoryObject{ℓₒ}{ℓₘ}{ℓₑ}} (\{A} → _∘ᶠᵘⁿᶜᵗᵒʳ_ {A = A})(idᶠᵘⁿᶜᵗᵒʳ) [∘ᶠᵘⁿᶜᵗᵒʳ]-identity = [∧]-intro [∘ᶠᵘⁿᶜᵗᵒʳ]-identityₗ [∘ᶠᵘⁿᶜᵗᵒʳ]-identityᵣ instance [∘ᶠᵘⁿᶜᵗᵒʳ]-associativity : Morphism.Associativity {Obj = CategoryObject{ℓₒ}{ℓₘ}{ℓₑ}} (\{A B C} → _∘ᶠᵘⁿᶜᵗᵒʳ_ {A = A}{B = B}{C = C}) _≡ᶠᵘⁿᶜᵗᵒʳ_.functor-proof (Morphism.Associativity.proof [∘ᶠᵘⁿᶜᵗᵒʳ]-associativity {w = D}) = reflexivity(_⊜_) where instance _ = [≡]-equiv {T = Object(D)} NaturalTransformation.natural (_≡ᶠᵘⁿᶜᵗᵒʳ_.map-proof (Morphism.Associativity.proof [∘ᶠᵘⁿᶜᵗᵒʳ]-associativity {A}{B}{C}{D} {[∃]-intro F}{[∃]-intro G}{[∃]-intro H})) {x}{y}{f} = id ∘ map(map(map f)) 🝖-[ Morphism.identityₗ(_∘_)(id) ] map(map(map f)) 🝖-[ Morphism.identityᵣ(_∘_)(id) ]-sym map(map(map f)) ∘ id 🝖-end where open module MorphismEquivₗ {x}{y} = Equiv(morphism-equiv D {x}{y}) using () renaming (_≡_ to _≡D_) instance _ = category A instance _ = category B instance _ = category C instance _ = category D
{ "alphanum_fraction": 0.6433108758, "avg_line_length": 51.95, "ext": "agda", "hexsha": "472a1bc909bbde98d24f4a4cadddb98ce0aa2894", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Lolirofle/stuff-in-agda", "max_forks_repo_path": "Structure/Category/Functor/Functors/Proofs.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Lolirofle/stuff-in-agda", "max_issues_repo_path": "Structure/Category/Functor/Functors/Proofs.agda", "max_line_length": 288, "max_stars_count": 6, "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_path": "Structure/Category/Functor/Functors/Proofs.agda", "max_stars_repo_stars_event_max_datetime": "2022-02-05T06:53:22.000Z", "max_stars_repo_stars_event_min_datetime": "2020-04-07T17:58:13.000Z", "num_tokens": 2438, "size": 5195 }
-- Andreas, 2015-06-28, issue reported by Nisse {-# OPTIONS -vtc.pos.occ:20 #-} -- KEEP!, this triggered the __IMPOSSIBLE__ -- {-# OPTIONS -vtc.pos.occ:70 -v tc.rec:80 --show-implicit #-} data ⊥ : Set where F : ⊥ → Set F () record R (i : ⊥) : Set₁ where constructor c field P Q : F i → Set -- An internal error has occurred. Please report this as a bug. -- Location of the error: src/full/Agda/Syntax/Translation/InternalToAbstract.hs:874 -- The error is triggered by the use of prettyTCM in -- Agda.TypeChecking.Positivity.getOccurrences. -- tel = (_ : Prop) (_ : Prop) -- WRONG -- perm = id -- ps = (c x x : R @0) _ -- body = λ x _y _z -> x _z -- type = F @1 → Set
{ "alphanum_fraction": 0.635431918, "avg_line_length": 24.3928571429, "ext": "agda", "hexsha": "1a24c51dccfa2425389ea2040d1f65544564f6fd", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "redfish64/autonomic-agda", "max_forks_repo_path": "test/Succeed/Issue1595.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "redfish64/autonomic-agda", "max_issues_repo_path": "test/Succeed/Issue1595.agda", "max_line_length": 84, "max_stars_count": 3, "max_stars_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "redfish64/autonomic-agda", "max_stars_repo_path": "test/Succeed/Issue1595.agda", "max_stars_repo_stars_event_max_datetime": "2015-12-07T20:14:00.000Z", "max_stars_repo_stars_event_min_datetime": "2015-03-28T14:51:03.000Z", "num_tokens": 224, "size": 683 }
open import Agda.Builtin.Nat f : Nat f with zero ... | n with (suc n) ... | m = m
{ "alphanum_fraction": 0.578313253, "avg_line_length": 11.8571428571, "ext": "agda", "hexsha": "96ad7bc5b45be99a746af32de60a90ed2844ac00", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "cc026a6a97a3e517bb94bafa9d49233b067c7559", "max_forks_repo_licenses": [ "BSD-2-Clause" ], "max_forks_repo_name": "cagix/agda", "max_forks_repo_path": "test/Succeed/Issue4704-nested-with.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "cc026a6a97a3e517bb94bafa9d49233b067c7559", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-2-Clause" ], "max_issues_repo_name": "cagix/agda", "max_issues_repo_path": "test/Succeed/Issue4704-nested-with.agda", "max_line_length": 28, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "cc026a6a97a3e517bb94bafa9d49233b067c7559", "max_stars_repo_licenses": [ "BSD-2-Clause" ], "max_stars_repo_name": "cagix/agda", "max_stars_repo_path": "test/Succeed/Issue4704-nested-with.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 32, "size": 83 }
data Li : (a : Set) -> Set where Ni : {a : Set} -> Li a Co : {a : Set} -> a -> Li a -> Li a {-# BUILTIN NATURAL name #-} t : Li (Set 2) -> Set 1 t li = Set 1
{ "alphanum_fraction": 0.4606060606, "avg_line_length": 16.5, "ext": "agda", "hexsha": "89e88ed365ff096d8c4ef74c475ed36260ba34a0", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2019-11-27T16:25:18.000Z", "max_forks_repo_forks_event_min_datetime": "2019-11-27T16:25:18.000Z", "max_forks_repo_head_hexsha": "a5f65e28cc9fdfefde49e7d8cf84486601b9e7b1", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "hjorthjort/IdrisToAgda", "max_forks_repo_path": "univ_old.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "a5f65e28cc9fdfefde49e7d8cf84486601b9e7b1", "max_issues_repo_issues_event_max_datetime": "2019-11-28T17:52:42.000Z", "max_issues_repo_issues_event_min_datetime": "2019-11-28T17:52:42.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "hjorthjort/IdrisToAgda", "max_issues_repo_path": "univ_old.agda", "max_line_length": 37, "max_stars_count": 2, "max_stars_repo_head_hexsha": "a5f65e28cc9fdfefde49e7d8cf84486601b9e7b1", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "hjorthjort/IdrisToAgda", "max_stars_repo_path": "univ_old.agda", "max_stars_repo_stars_event_max_datetime": "2020-06-29T20:42:43.000Z", "max_stars_repo_stars_event_min_datetime": "2020-02-16T23:22:50.000Z", "num_tokens": 69, "size": 165 }
------------------------------------------------------------------------ -- Recognisers form a Kleene algebra ------------------------------------------------------------------------ module TotalRecognisers.LeftRecursion.KleeneAlgebra (Tok : Set) where open import Algebra import Algebra.Properties.BooleanAlgebra open import Codata.Musical.Notation open import Data.Bool hiding (_∧_; _≤_) import Data.Bool.Properties as Bool private module BoolCS = CommutativeSemiring Bool.∨-∧-commutativeSemiring module BoolBA = Algebra.Properties.BooleanAlgebra Bool.∨-∧-booleanAlgebra open import Function.Base open import Function.Equality using (_⟨$⟩_) open import Function.Equivalence as Eq using (_⇔_; equivalence) open import Data.List open import Data.List.Properties private module ListMonoid {A : Set} = Monoid (++-monoid A) open import Data.Nat using (ℕ; zero; suc) open import Data.Product as Prod open import Relation.Binary.HeterogeneousEquality using (_≅_; refl) open import Relation.Binary.PropositionalEquality as P using (_≡_; refl; _≗_) open import Relation.Nullary import TotalRecognisers.LeftRecursion open TotalRecognisers.LeftRecursion Tok hiding (left-zero) import TotalRecognisers.LeftRecursion.Lib open TotalRecognisers.LeftRecursion.Lib Tok open ⊙ using (_⊙′_) open KleeneStar₂ ------------------------------------------------------------------------ -- The relation _≤_ is a partial order with respect to _≈_ module PartialOrder where reflexive : ∀ {n} {p : P n} → p ≤ p reflexive = id trans : ∀ {n₁ n₂ n₃} {p₁ : P n₁} {p₂ : P n₂} {p₃ : P n₃} → p₁ ≤ p₂ → p₂ ≤ p₃ → p₁ ≤ p₃ trans p₁≤p₂ p₂≤p₃ = p₂≤p₃ ∘ p₁≤p₂ antisym : ∀ {n₁ n₂} {p₁ : P n₁} {p₂ : P n₂} → p₁ ≤ p₂ → p₂ ≤ p₁ → p₁ ≈ p₂ antisym p₁≤p₂ p₂≤p₁ = equivalence p₁≤p₂ p₂≤p₁ ------------------------------------------------------------------------ -- The relation _≈_ is an equality, i.e. a congruential equivalence -- relation module Equivalence where reflexive : ∀ {n} {p : P n} → p ≈ p reflexive = Eq.id sym : ∀ {n₁ n₂} {p₁ : P n₁} {p₂ : P n₂} → p₁ ≈ p₂ → p₂ ≈ p₁ sym p₁≈p₂ = Eq.sym p₁≈p₂ trans : ∀ {n₁ n₂ n₃} {p₁ : P n₁} {p₂ : P n₂} {p₃ : P n₃} → p₁ ≈ p₂ → p₂ ≈ p₃ → p₁ ≈ p₃ trans p₁≈p₂ p₂≈p₃ = Eq._∘_ p₂≈p₃ p₁≈p₂ ♭♯-cong : ∀ {n₁ n₂} b₁ b₂ {p₁ : P n₁} {p₂ : P n₂} → p₁ ≈ p₂ → ♭? (♯? {b₁} p₁) ≈ ♭? (♯? {b₂} p₂) ♭♯-cong b₁ b₂ {p₁} {p₂} rewrite ♭?♯? b₁ {p = p₁} | ♭?♯? b₂ {p = p₂} = id fail-cong : fail ≈ fail fail-cong = Equivalence.reflexive empty-cong : empty ≈ empty empty-cong = Equivalence.reflexive sat-cong : {f₁ f₂ : Tok → Bool} → f₁ ≗ f₂ → sat f₁ ≈ sat f₂ sat-cong f₁≗f₂ = equivalence (helper f₁≗f₂) (helper (P.sym ∘ f₁≗f₂)) where helper : {f₁ f₂ : Tok → Bool} → f₁ ≗ f₂ → sat f₁ ≤ sat f₂ helper f₁≗f₂ (sat ok) = sat (P.subst T (f₁≗f₂ _) ok) ∣-cong : ∀ {n₁ n₂ n₃ n₄} {p₁ : P n₁} {p₂ : P n₂} {p₃ : P n₃} {p₄ : P n₄} → p₁ ≈′ p₃ → p₂ ≈′ p₄ → p₁ ∣ p₂ ≈′ p₃ ∣ p₄ ∣-cong (refl ∷ rest₁) (refl ∷ rest₂) = refl ∷ λ t → ♯ ∣-cong (♭ (rest₁ t)) (♭ (rest₂ t)) ·-cong : ∀ {n₁ n₂ n₃ n₄} {p₁ : ∞⟨ n₂ ⟩P n₁} {p₂ : ∞⟨ n₁ ⟩P n₂} {p₃ : ∞⟨ n₄ ⟩P n₃} {p₄ : ∞⟨ n₃ ⟩P n₄} → ♭? p₁ ≈ ♭? p₃ → ♭? p₂ ≈ ♭? p₄ → p₁ · p₂ ≈ p₃ · p₄ ·-cong p₁≈p₃ p₂≈p₄ = Eq.Equivalence.from ≈⇔≤≥ ⟨$⟩ Prod.zip helper helper (Eq.Equivalence.to ≈⇔≤≥ ⟨$⟩ p₁≈p₃) (Eq.Equivalence.to ≈⇔≤≥ ⟨$⟩ p₂≈p₄) where helper : ∀ {n₁ n₂ n₃ n₄} {p₁ : ∞⟨ n₂ ⟩P n₁} {p₂ : ∞⟨ n₁ ⟩P n₂} {p₃ : ∞⟨ n₄ ⟩P n₃} {p₄ : ∞⟨ n₃ ⟩P n₄} → ♭? p₁ ≤ ♭? p₃ → ♭? p₂ ≤ ♭? p₄ → p₁ · p₂ ≤ p₃ · p₄ helper ₁≤₃ ₂≤₄ (∈p₁ · ∈p₂) = ₁≤₃ ∈p₁ · ₂≤₄ ∈p₂ ⊙-cong : ∀ {n₁ n₂ n₃ n₄} {p₁ : P n₁} {p₂ : P n₂} {p₃ : P n₃} {p₄ : P n₄} → p₁ ≈ p₃ → p₂ ≈ p₄ → p₁ ⊙ p₂ ≈ p₃ ⊙ p₄ ⊙-cong {n₁} {n₂} {n₃} {n₄} ₁≈₃ ₂≈₄ = ·-cong (♭♯-cong n₂ n₄ ₁≈₃) (♭♯-cong n₁ n₃ ₂≈₄) nonempty-cong : ∀ {n₁ n₂} {p₁ : P n₁} {p₂ : P n₂} → p₁ ≈′ p₂ → nonempty p₁ ≈′ nonempty p₂ nonempty-cong (_ ∷ rest) = refl ∷ rest cast-cong : ∀ {n₁ n₂ n₁′ n₂′} {p₁ : P n₁} {p₂ : P n₂} {eq₁ : n₁ ≡ n₁′} {eq₂ : n₂ ≡ n₂′} → p₁ ≈′ p₂ → cast eq₁ p₁ ≈′ cast eq₂ p₂ cast-cong {eq₁ = refl} {refl} (init ∷ rest) = init ∷ rest ⋆-cong : ∀ {n₁ n₂} {p₁ : P n₁} {p₂ : P n₂} → p₁ ≈ p₂ → p₁ ⋆ ≈ p₂ ⋆ ⋆-cong p₁≈p₂ = Eq.Equivalence.from ≈⇔≤≥ ⟨$⟩ Prod.map helper helper (Eq.Equivalence.to ≈⇔≤≥ ⟨$⟩ p₁≈p₂) where helper : ∀ {n₁ n₂} {p₁ : P n₁} {p₂ : P n₂} → p₁ ≤ p₂ → p₁ ⋆ ≤ p₂ ⋆ helper p₁≤p₂ (∣-left empty) = ∣-left empty helper p₁≤p₂ (∣-right (nonempty ∈p₁ · ∈p₁⋆)) = ∣-right {p₁ = empty} (nonempty (p₁≤p₂ ∈p₁) · helper p₁≤p₂ ∈p₁⋆) ^-cong : ∀ {n₁ n₂ i₁ i₂} {p₁ : P n₁} {p₂ : P n₂} → p₁ ≈ p₂ → i₁ ≡ i₂ → p₁ ^ i₁ ≈ p₂ ^ i₂ ^-cong {i₁ = i} p₁≈p₂ refl = Eq.Equivalence.from ≈⇔≤≥ ⟨$⟩ Prod.map (helper i) (helper i) (Eq.Equivalence.to ≈⇔≤≥ ⟨$⟩ p₁≈p₂) where helper : ∀ {n₁ n₂} {p₁ : P n₁} {p₂ : P n₂} i → p₁ ≤ p₂ → p₁ ^ i ≤ p₂ ^ i helper zero p₁≤p₂ empty = empty helper {n₁} {n₂} (suc i) p₁≤p₂ ∈p₁⊙p₁ⁱ with ⊙.sound ⟨ n₁ ^ i ⟩-nullable ∈p₁⊙p₁ⁱ ... | ∈p₁ ⊙′ ∈p₁ⁱ = ⊙.complete (p₁≤p₂ ∈p₁) (helper i p₁≤p₂ ∈p₁ⁱ) ------------------------------------------------------------------------ -- A variant of _≤_ infix 4 _≲_ -- If _∣_ is viewed as the join operation of a join-semilattice, then -- the following definition of order is natural. _≲_ : ∀ {n₁ n₂} → P n₁ → P n₂ → Set p₁ ≲ p₂ = p₁ ∣ p₂ ≈ p₂ -- The order above coincides with _≤_. ≤⇔≲ : ∀ {n₁ n₂} (p₁ : P n₁) (p₂ : P n₂) → p₁ ≤ p₂ ⇔ p₁ ≲ p₂ ≤⇔≲ {n₁} p₁ p₂ = equivalence (λ (p₁≤p₂ : p₁ ≤ p₂) {_} → equivalence (helper p₁≤p₂) (∣-right {n₁ = n₁})) (λ (p₁≲p₂ : p₁ ≲ p₂) s∈p₁ → Eq.Equivalence.to p₁≲p₂ ⟨$⟩ ∣-left s∈p₁) where helper : p₁ ≤ p₂ → p₁ ∣ p₂ ≤ p₂ helper p₁≤p₂ (∣-left s∈p₁) = p₁≤p₂ s∈p₁ helper p₁≤p₂ (∣-right s∈p₂) = s∈p₂ ------------------------------------------------------------------------ -- Recognisers form a *-continuous Kleene algebra -- The definition of *-continuous Kleene algebras used here is the one -- given by Kozen in "On Kleene Algebras and Closed Semirings", except -- for the presence of the recogniser indices. Kozen used the order -- _≲_ in his definition, but as shown above this order is equivalent -- to _≤_. -- Additive idempotent commutative monoid. (One of the identity lemmas -- could be omitted.) ∣-commutative : ∀ {n₁ n₂} (p₁ : P n₁) (p₂ : P n₂) → p₁ ∣ p₂ ≈′ p₂ ∣ p₁ ∣-commutative {n₁} {n₂} p₁ p₂ = BoolCS.+-comm n₁ n₂ ∷ λ t → ♯ ∣-commutative (D t p₁) (D t p₂) fail-left-identity : ∀ {n} (p : P n) → fail ∣ p ≈′ p fail-left-identity p = refl ∷ λ t → ♯ fail-left-identity (D t p) fail-right-identity : ∀ {n} (p : P n) → p ∣ fail ≈′ p fail-right-identity {n} p = proj₂ BoolCS.+-identity n ∷ λ t → ♯ fail-right-identity (D t p) ∣-associative : ∀ {n₁ n₂ n₃} (p₁ : P n₁) (p₂ : P n₂) (p₃ : P n₃) → p₁ ∣ (p₂ ∣ p₃) ≈′ (p₁ ∣ p₂) ∣ p₃ ∣-associative {n₁} {n₂} {n₃} p₁ p₂ p₃ = P.sym (BoolCS.+-assoc n₁ n₂ n₃) ∷ λ t → ♯ ∣-associative (D t p₁) (D t p₂) (D t p₃) ∣-idempotent : ∀ {n} (p : P n) → p ∣ p ≈′ p ∣-idempotent {n} p = BoolBA.∨-idempotent n ∷ λ t → ♯ ∣-idempotent (D t p) -- Multiplicative monoid. empty-left-identity : ∀ {n} (p : P n) → empty ⊙ p ≈ p empty-left-identity {n} p = equivalence helper (λ s∈p → ⊙.complete empty s∈p) where helper : empty ⊙ p ≤ p helper ∈empty⊙p with ⊙.sound n ∈empty⊙p ... | empty ⊙′ s∈p = s∈p empty-right-identity : ∀ {n} (p : P n) → p ⊙ empty ≈ p empty-right-identity {n} p = equivalence helper (λ s∈p → cast∈ (proj₂ ListMonoid.identity _) refl (⊙.complete s∈p empty)) where helper : ∀ {s} → s ∈ p ⊙ empty → s ∈ p helper ∈p⊙empty with ⊙.sound true ∈p⊙empty helper ∈p⊙empty | ∈p ⊙′ empty = cast∈ (P.sym (proj₂ ListMonoid.identity _)) refl ∈p ·-associative : ∀ {n₁ n₂ n₃} (p₁ : P n₁) (p₂ : P n₂) (p₃ : P n₃) → p₁ ⊙ (p₂ ⊙ p₃) ≈ (p₁ ⊙ p₂) ⊙ p₃ ·-associative {n₁} {n₂} {n₃} p₁ p₂ p₃ = equivalence helper₁ helper₂ where helper₁ : p₁ ⊙ (p₂ ⊙ p₃) ≤ (p₁ ⊙ p₂) ⊙ p₃ helper₁ ∈⊙⊙ with ⊙.sound (n₂ ∧ n₃) ∈⊙⊙ ... | _⊙′_ {s₁ = s₁} ∈p₁ ∈⊙ with ⊙.sound n₃ ∈⊙ ... | ∈p₂ ⊙′ ∈p₃ = cast∈ (ListMonoid.assoc s₁ _ _) refl $ ⊙.complete (⊙.complete ∈p₁ ∈p₂) ∈p₃ helper₂ : (p₁ ⊙ p₂) ⊙ p₃ ≤ p₁ ⊙ (p₂ ⊙ p₃) helper₂ ∈⊙⊙ with ⊙.sound n₃ ∈⊙⊙ ... | ∈⊙ ⊙′ ∈p₃ with ⊙.sound n₂ ∈⊙ ... | _⊙′_ {s₁ = s₁} ∈p₁ ∈p₂ = cast∈ (P.sym $ ListMonoid.assoc s₁ _ _) refl $ ⊙.complete ∈p₁ (⊙.complete ∈p₂ ∈p₃) -- Distributivity. left-distributive : ∀ {n₁ n₂ n₃} (p₁ : P n₁) (p₂ : P n₂) (p₃ : P n₃) → p₁ ⊙ (p₂ ∣ p₃) ≈ p₁ ⊙ p₂ ∣ p₁ ⊙ p₃ left-distributive {n₁} {n₂} {n₃} p₁ p₂ p₃ = equivalence helper₁ helper₂ where helper₁ : p₁ ⊙ (p₂ ∣ p₃) ≤ p₁ ⊙ p₂ ∣ p₁ ⊙ p₃ helper₁ ∈⊙∣ with ⊙.sound (n₂ ∨ n₃) ∈⊙∣ ... | ∈p₁ ⊙′ ∣-left ∈p₂ = ∣-left $ ⊙.complete ∈p₁ ∈p₂ ... | ∈p₁ ⊙′ ∣-right ∈p₃ = ∣-right {n₁ = n₁ ∧ n₂} $ ⊙.complete ∈p₁ ∈p₃ helper₂ : p₁ ⊙ p₂ ∣ p₁ ⊙ p₃ ≤ p₁ ⊙ (p₂ ∣ p₃) helper₂ (∣-left ∈⊙) with ⊙.sound n₂ ∈⊙ ... | ∈p₁ ⊙′ ∈p₂ = ⊙.complete ∈p₁ (∣-left ∈p₂) helper₂ (∣-right ∈⊙) with ⊙.sound n₃ ∈⊙ ... | ∈p₁ ⊙′ ∈p₃ = ⊙.complete ∈p₁ (∣-right {n₁ = n₂} ∈p₃) right-distributive : ∀ {n₁ n₂ n₃} (p₁ : P n₁) (p₂ : P n₂) (p₃ : P n₃) → (p₁ ∣ p₂) ⊙ p₃ ≈ p₁ ⊙ p₃ ∣ p₂ ⊙ p₃ right-distributive {n₁} {n₂} {n₃} p₁ p₂ p₃ = equivalence helper₁ helper₂ where helper₁ : (p₁ ∣ p₂) ⊙ p₃ ≤ p₁ ⊙ p₃ ∣ p₂ ⊙ p₃ helper₁ ∈∣⊙ with ⊙.sound n₃ ∈∣⊙ ... | ∣-left ∈p₁ ⊙′ ∈p₃ = ∣-left $ ⊙.complete ∈p₁ ∈p₃ ... | ∣-right ∈p₂ ⊙′ ∈p₃ = ∣-right {n₁ = n₁ ∧ n₃} $ ⊙.complete ∈p₂ ∈p₃ helper₂ : p₁ ⊙ p₃ ∣ p₂ ⊙ p₃ ≤ (p₁ ∣ p₂) ⊙ p₃ helper₂ (∣-left ∈⊙) with ⊙.sound n₃ ∈⊙ ... | ∈p₁ ⊙′ ∈p₃ = ⊙.complete (∣-left ∈p₁) ∈p₃ helper₂ (∣-right ∈⊙) with ⊙.sound n₃ ∈⊙ ... | ∈p₂ ⊙′ ∈p₃ = ⊙.complete (∣-right {n₁ = n₁} ∈p₂) ∈p₃ -- Zero. left-zero : ∀ {n} (p : P n) → fail ⊙ p ≈ fail left-zero {n} p = equivalence helper (λ ()) where helper : fail ⊙ p ≤ fail helper ∈fail⊙ with ⊙.sound n ∈fail⊙ ... | () ⊙′ _ right-zero : ∀ {n} (p : P n) → p ⊙ fail ≈ fail right-zero {n} p = equivalence helper (λ ()) where helper : p ⊙ fail ≤ fail helper ∈⊙fail with ⊙.sound false ∈⊙fail ... | _ ⊙′ () -- *-continuity. *-continuity-upper-bound : ∀ {n₁ n₂ n₃} (p₁ : P n₁) (p₂ : P n₂) (p₃ : P n₃) → ∀ i → p₁ ⊙ p₂ ^ i ⊙ p₃ ≤ p₁ ⊙ p₂ ⋆ ⊙ p₃ *-continuity-upper-bound {n₁} {n₂} {n₃} _ _ _ i ∈⊙ⁱ⊙ with ⊙.sound n₃ ∈⊙ⁱ⊙ ... | ∈⊙ⁱ ⊙′ ∈p₃ with ⊙.sound ⟨ n₂ ^ i ⟩-nullable ∈⊙ⁱ ... | ∈p₁ ⊙′ ∈p₂ⁱ = ⊙.complete (⊙.complete ∈p₁ (^≤⋆ i ∈p₂ⁱ)) ∈p₃ *-continuity-least-upper-bound : ∀ {n₁ n₂ n₃ n} (p₁ : P n₁) (p₂ : P n₂) (p₃ : P n₃) (p : P n) → (∀ i → p₁ ⊙ p₂ ^ i ⊙ p₃ ≤ p) → p₁ ⊙ p₂ ⋆ ⊙ p₃ ≤ p *-continuity-least-upper-bound {n₁} {n₂} {n₃} {n} p₁ p₂ p₃ p ub = helper ∘ _⟨$⟩_ (Eq.Equivalence.from $ ·-associative p₁ (p₂ ⋆) p₃) where helper : p₁ ⊙ (p₂ ⋆ ⊙ p₃) ≤ p helper ∈⊙⋆⊙ with ⊙.sound (true ∧ n₃) ∈⊙⋆⊙ ... | _⊙′_ {s₁ = s₁} ∈p₁ ∈⋆⊙ with ⊙.sound n₃ ∈⋆⊙ ... | ∈p₂⋆ ⊙′ ∈p₃ with ⋆≤^ ∈p₂⋆ ... | (i , ∈p₂ⁱ) = cast∈ (ListMonoid.assoc s₁ _ _) refl $ ub i $ ⊙.complete (⊙.complete ∈p₁ ∈p₂ⁱ) ∈p₃
{ "alphanum_fraction": 0.5150004451, "avg_line_length": 35.2131661442, "ext": "agda", "hexsha": "636c01c5be47c980e18e695b07490e4d84e9d4c7", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "76774f54f466cfe943debf2da731074fe0c33644", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "nad/parser-combinators", "max_forks_repo_path": "TotalRecognisers/LeftRecursion/KleeneAlgebra.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "76774f54f466cfe943debf2da731074fe0c33644", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "nad/parser-combinators", "max_issues_repo_path": "TotalRecognisers/LeftRecursion/KleeneAlgebra.agda", "max_line_length": 72, "max_stars_count": 1, "max_stars_repo_head_hexsha": "76774f54f466cfe943debf2da731074fe0c33644", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "nad/parser-combinators", "max_stars_repo_path": "TotalRecognisers/LeftRecursion/KleeneAlgebra.agda", "max_stars_repo_stars_event_max_datetime": "2020-07-03T08:56:13.000Z", "max_stars_repo_stars_event_min_datetime": "2020-07-03T08:56:13.000Z", "num_tokens": 5587, "size": 11233 }
{- FP Lunch, Nottingham July 27, 2007 Conor McBride -} module Binary where data Bit : Set where O : Bit I : Bit infixl 80 _◃_ data Pos : Set where ◃I : Pos _◃_ : Pos -> Bit -> Pos bsuc : Pos -> Pos bsuc ◃I = ◃I ◃ O bsuc (n ◃ O) = n ◃ I bsuc (n ◃ I) = bsuc n ◃ O data Peano : Pos -> Set where pI : Peano ◃I psuc : {n : Pos} -> Peano n -> Peano (bsuc n) pdouble : {n : Pos} -> Peano n -> Peano (n ◃ O) pdouble pI = psuc pI pdouble (psuc p) = psuc (psuc (pdouble p)) peano : (n : Pos) -> Peano n peano ◃I = pI peano (n ◃ O) = pdouble (peano n) peano (n ◃ I) = psuc (pdouble (peano n)) -- Slow addition (yay!) _+_ : Pos -> Pos -> Pos _+_ n m = peano n ⊕ m where _⊕_ : {n : Pos} -> Peano n -> Pos -> Pos pI ⊕ m = bsuc m psuc p ⊕ m = bsuc (p ⊕ m) infixl 60 _+_ infix 40 _==_ data _==_ {A : Set}(x : A) : A -> Set where refl : x == x test : (◃I ◃ I ◃ O ◃ O ◃ O) == (◃I ◃ I ◃ O ◃ I) + (◃I ◃ O ◃ I ◃ I) test = refl
{ "alphanum_fraction": 0.5030612245, "avg_line_length": 18.1481481481, "ext": "agda", "hexsha": "f4b88fc4c9a8d10d1d4b7f581b736c762d92c7d3", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "231d6ad8e77b67ff8c4b1cb35a6c31ccd988c3e9", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "Agda-zh/agda", "max_forks_repo_path": "examples/Binary.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "shlevy/agda", "max_issues_repo_path": "examples/Binary.agda", "max_line_length": 66, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "shlevy/agda", "max_stars_repo_path": "examples/Binary.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 455, "size": 980 }
module Chain {A : Set}(_==_ : A -> A -> Set) (refl : (x : A) -> x == x) (trans : (x y z : A) -> x == y -> y == z -> x == z) where infix 2 chain>_ infixl 2 _===_by_ infix 1 _qed private data _≃_ (x y : A) : Set where prf : x == y -> x ≃ y chain>_ : (x : A) -> x ≃ x chain> x = prf (refl x) _===_by_ : {x y : A} -> x ≃ y -> (z : A) -> y == z -> x ≃ z prf p === z by q = prf (trans _ _ _ p q) _qed : {x y : A} -> x ≃ y -> x == y prf p qed = p
{ "alphanum_fraction": 0.4157782516, "avg_line_length": 18.76, "ext": "agda", "hexsha": "6fb2703510388b695b36e69b8d6e11856485dfb2", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "examples/outdated-and-incorrect/tait/Chain.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "examples/outdated-and-incorrect/tait/Chain.agda", "max_line_length": 59, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "examples/outdated-and-incorrect/tait/Chain.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 221, "size": 469 }
module Languages.FILL.Syntax where open import level open import bool open import nat open import unit open import empty open import list open import eq open import sum open import Utils.HaskellTypes open import Utils.HaskellFunctions open import Languages.FILL.TypeSyntax True : Set True = ⊤{lzero} False : Set False = ⊥{lzero} Name : Set Name = ℕ name-in : ∀{A : Set} → (A → A → 𝔹) → A → 𝕃 A → Set name-in eq x ctx with list-member eq x ctx name-in _ x ctx | tt = True name-in _ x ctx | ff = False -- Bound Variable Labels: data VLabel : Set where LPV : VLabel -- Let-Bound Left Pattern Variable RPV : VLabel -- Let-Bound Right Pattern Variable BV : VLabel -- λ-Bound Variable _vl-eq_ : VLabel → VLabel → 𝔹 LPV vl-eq LPV = tt RPV vl-eq RPV = tt BV vl-eq BV = tt _ vl-eq _ = ff data Pattern : Set where PTriv : Pattern PTensor : String → String → Pattern PPar : String → String → Pattern data Term : Set where Triv : Term Void : Term FVar : String → Term BVar : Name → String → VLabel → Term Let : Term → Type → Pattern → Term → Term Lam : String → Type → Term → Term App : Term → Term → Term Tensor : Term → Term → Term Par : Term → Term → Term open-t : Name → VLabel → Term → Term → Term open-t x l u (BVar y ys l') with x =ℕ y | l vl-eq l' ... | tt | tt = u ... | _ | _ = BVar y ys l' open-t x BV u (Let t₁ y z t₂) = Let (open-t x BV u t₁) y z (open-t x BV u t₂) open-t x l u (Let t₁ a p t₂) = Let (open-t (suc x) l u t₁) a p (open-t (suc x) l u t₂) open-t x BV u (Lam ys a t) = Lam ys a (open-t (suc x) BV u t) open-t x l u (Lam ys a t) = Lam ys a (open-t x l u t) open-t x l u (App t₁ t₂) = App (open-t x l u t₁) (open-t x l u t₂) open-t x l u (Tensor t₁ t₂) = Tensor (open-t x l u t₁) (open-t x l u t₂) open-t x l u (Par t₁ t₂) = Par (open-t x l u t₁) (open-t x l u t₂) open-t _ _ _ t = t close-t : Name → String → VLabel → String → Term → Term close-t x xs l y (FVar z) with y str-eq z ... | tt = BVar x xs l ... | ff = FVar z close-t x xs l y (Let t₁ ty p t₂) = Let (close-t x xs l y t₁) ty p (close-t x xs l y t₂) close-t x xs l y (Lam ys a t) = Lam ys a (close-t x xs l y t) close-t x xs l y (App t₁ t₂) = App (close-t x xs l y t₁) (close-t x xs l y t₂) close-t x xs l y (Tensor t₁ t₂) = Tensor (close-t x xs l y t₁) (close-t x xs l y t₂) close-t x xs l y (Par t₁ t₂) = Par (close-t x xs l y t₁) (close-t x xs l y t₂) close-t _ _ _ _ t = t data LC : Term → Set where Triv : LC Triv Void : LC Void FVar : ∀{x : String} → LC (FVar x) Lam : ∀{ns : 𝕃 String}{t : Term}{a : Type}{y : String} → LC t → (∀{x : String} → (name-in _str-eq_ x ns → False) → LC (open-t 0 BV (FVar x) t)) → LC (Lam y a t) LetTriv : ∀{t₁ : Term}{a : Type}{t₂ : Term} → LC t₁ → LC t₂ → LC (Let t₁ a PTriv t₂) LetTensor : ∀{ns : 𝕃 String}{t₁ : Term}{a : Type}{t₂ : Term}{s₁ s₂ : String} → LC t₁ → LC t₂ → (∀{x y : String} → (name-in _str-eq_ x ns → False) → (name-in _str-eq_ y ns → False) → LC (open-t 0 LPV (FVar x) (open-t 0 RPV (FVar y) t₂))) → LC (Let t₁ a (PTensor s₁ s₂) t₂) LetPar : ∀{ns : 𝕃 String}{t₁ : Term}{a : Type}{t₂ : Term}{s₁ s₂ : String} → LC t₁ → LC t₂ → (∀{x y : String} → (name-in _str-eq_ x ns → False) → (name-in _str-eq_ y ns → False) → LC (open-t 0 LPV (FVar x) (open-t 0 RPV (FVar y) t₂))) → LC (Let t₁ a (PPar s₁ s₂) t₂) App : ∀{t₁ t₂ : Term} → LC t₁ → LC t₂ → LC (App t₁ t₂) Tensor : ∀{t₁ t₂ : Term} → LC t₁ → LC t₂ → LC (Tensor t₁ t₂) Par : ∀{t₁ t₂ : Term} → LC t₁ → LC t₂ → LC (Par t₁ t₂)
{ "alphanum_fraction": 0.5546331012, "avg_line_length": 30.1129032258, "ext": "agda", "hexsha": "241631f2d9b6ba9619c5577d675af09e4dc9f87c", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "c83f5d8201362b26a749138f6dbff2dd509f85b1", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "heades/Agda-LLS", "max_forks_repo_path": "Source/ALL/Languages/FILL/Syntax.agda", "max_issues_count": 2, "max_issues_repo_head_hexsha": "c83f5d8201362b26a749138f6dbff2dd509f85b1", "max_issues_repo_issues_event_max_datetime": "2017-04-05T17:30:16.000Z", "max_issues_repo_issues_event_min_datetime": "2017-03-27T14:52:46.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "heades/Agda-LLS", "max_issues_repo_path": "Source/ALL/Languages/FILL/Syntax.agda", "max_line_length": 88, "max_stars_count": 3, "max_stars_repo_head_hexsha": "c83f5d8201362b26a749138f6dbff2dd509f85b1", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "heades/Agda-LLS", "max_stars_repo_path": "Source/ALL/Languages/FILL/Syntax.agda", "max_stars_repo_stars_event_max_datetime": "2019-08-02T23:41:23.000Z", "max_stars_repo_stars_event_min_datetime": "2017-04-09T20:53:53.000Z", "num_tokens": 1450, "size": 3734 }
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Introductions {{eqrel : EqRelSet}} where open import Definition.LogicalRelation.Substitution.Introductions.Application public open import Definition.LogicalRelation.Substitution.Introductions.Lambda public open import Definition.LogicalRelation.Substitution.Introductions.Nat public open import Definition.LogicalRelation.Substitution.Introductions.Natrec public open import Definition.LogicalRelation.Substitution.Introductions.Pi public open import Definition.LogicalRelation.Substitution.Introductions.SingleSubst public open import Definition.LogicalRelation.Substitution.Introductions.Universe public
{ "alphanum_fraction": 0.8724559023, "avg_line_length": 52.6428571429, "ext": "agda", "hexsha": "a78b8ff4c4f50f9e3fa3d5f392133b87ab0d7fb4", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "2251b8da423be0c6fb916f2675d7bd8537e4cd96", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "loic-p/logrel-mltt", "max_forks_repo_path": "Definition/LogicalRelation/Substitution/Introductions.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "2251b8da423be0c6fb916f2675d7bd8537e4cd96", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "loic-p/logrel-mltt", "max_issues_repo_path": "Definition/LogicalRelation/Substitution/Introductions.agda", "max_line_length": 87, "max_stars_count": null, "max_stars_repo_head_hexsha": "2251b8da423be0c6fb916f2675d7bd8537e4cd96", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "loic-p/logrel-mltt", "max_stars_repo_path": "Definition/LogicalRelation/Substitution/Introductions.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 142, "size": 737 }
open import Agda.Builtin.Equality cong : ∀{a b} {A : Set a} {B : Set b} (f : A → B) {x y : A} (eq : x ≡ y) → f x ≡ f y cong f refl = refl record Category : Set₂ where field Ob : Set₁ _⇒_ : Ob → Ob → Set _∘_ : ∀ {O P Q} → P ⇒ Q → O ⇒ P → O ⇒ Q -- Moving this out of the record fixes the problem. idem : {X : Ob} → X ⇒ X → Set₁ idem {X} f = f ∘ f ≡ f → Set Sets : Category Sets = record { Ob = Set ; _⇒_ = {!!} ; _∘_ = λ f g x → f (g x) } open Category Sets postulate Y : Ob f : Y ⇒ Y idem-f : idem {X = _} f -- Solving the _ fixes the problem idem-f ff≡f with ffx≡fx ← cong {!!} ff≡f = Y
{ "alphanum_fraction": 0.5039123631, "avg_line_length": 19.96875, "ext": "agda", "hexsha": "bb99a3cf1eb70a3cc94bcdb5f7f9dc9e9cbd969a", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "98c9382a59f707c2c97d75919e389fc2a783ac75", "max_forks_repo_licenses": [ "BSD-2-Clause" ], "max_forks_repo_name": "KDr2/agda", "max_forks_repo_path": "test/Fail/Issue5805.agda", "max_issues_count": 6, "max_issues_repo_head_hexsha": "98c9382a59f707c2c97d75919e389fc2a783ac75", "max_issues_repo_issues_event_max_datetime": "2021-11-24T08:31:10.000Z", "max_issues_repo_issues_event_min_datetime": "2021-10-18T08:12:24.000Z", "max_issues_repo_licenses": [ "BSD-2-Clause" ], "max_issues_repo_name": "KDr2/agda", "max_issues_repo_path": "test/Fail/Issue5805.agda", "max_line_length": 84, "max_stars_count": null, "max_stars_repo_head_hexsha": "98c9382a59f707c2c97d75919e389fc2a783ac75", "max_stars_repo_licenses": [ "BSD-2-Clause" ], "max_stars_repo_name": "KDr2/agda", "max_stars_repo_path": "test/Fail/Issue5805.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 279, "size": 639 }
-- Andreas, 2012-01-11, bug reported by Adam Gundry module Issue551 where data Bool : Set where true false : Bool data _≡_ {A : Set}(a : A) : A → Set where refl : a ≡ a cong : {A B : Set}(f : A → B){a a' : A} → a ≡ a' → f a ≡ f a' cong f refl = refl implicit : {A : Set}{{a : A}} -> A implicit {{a}} = a record PackBool : Set where constructor pack field unpack : Bool open PackBool data IrrBool : Set where irr : .(b : PackBool) -> IrrBool p : irr (pack true) ≡ irr (pack false) p = refl -- The following should fail: unirr : IrrBool -> PackBool unirr (irr x) = implicit -- unirr (irr x) = x gives an error message (as well it should) -- but using instance arguments circumvents the check. q : true ≡ false q = cong (λ x → unpack (unirr x)) p
{ "alphanum_fraction": 0.6253263708, "avg_line_length": 21.2777777778, "ext": "agda", "hexsha": "e55b39da386d02e7e0fedf9af95ae687e6c3a925", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "70c8a575c46f6a568c7518150a1a64fcd03aa437", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "masondesu/agda", "max_forks_repo_path": "test/fail/Issue551.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "70c8a575c46f6a568c7518150a1a64fcd03aa437", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "masondesu/agda", "max_issues_repo_path": "test/fail/Issue551.agda", "max_line_length": 63, "max_stars_count": 1, "max_stars_repo_head_hexsha": "aa10ae6a29dc79964fe9dec2de07b9df28b61ed5", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/agda-kanso", "max_stars_repo_path": "test/fail/Issue551.agda", "max_stars_repo_stars_event_max_datetime": "2019-11-27T04:41:05.000Z", "max_stars_repo_stars_event_min_datetime": "2019-11-27T04:41:05.000Z", "num_tokens": 269, "size": 766 }
module Issue936 where -- The highlighting generated for this file should not contain -- any references to Agda.Primitive.
{ "alphanum_fraction": 0.7967479675, "avg_line_length": 24.6, "ext": "agda", "hexsha": "57c8f0736bd1ffef1c5f9b7c6f9165a049135109", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/interaction/Issue936.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/interaction/Issue936.agda", "max_line_length": 62, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/interaction/Issue936.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 25, "size": 123 }
-- Andreas, 2017-01-18, issue #57 -- reported by Nisse 2008-03-26 data Unit : Set where unit : Unit foo : Unit → Unit foo m with m foo _ | x@unit with x foo _ | x@unit | _ = x test : Unit → Unit test m with m test _ | x@unit with x ... | _ = x
{ "alphanum_fraction": 0.6144578313, "avg_line_length": 15.5625, "ext": "agda", "hexsha": "3c60a64ce428b6cb1221f54f6b9582e0c8852391", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/Succeed/Issue57.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/Succeed/Issue57.agda", "max_line_length": 33, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/Succeed/Issue57.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 96, "size": 249 }
------------------------------------------------------------------------ -- Rational numbers ------------------------------------------------------------------------ module Data.Rational where open import Data.Bool.Properties open import Data.Function open import Data.Integer hiding (suc) renaming (_*_ to _ℤ*_) open import Data.Integer.Divisibility as ℤDiv using (Coprime) import Data.Integer.Properties as ℤ open import Data.Nat.Divisibility as ℕDiv using (_∣_) import Data.Nat.Coprimality as C open import Data.Nat as ℕ renaming (_*_ to _ℕ*_) open import Relation.Nullary.Decidable open import Relation.Binary open import Relation.Binary.PropositionalEquality as PropEq open ≡-Reasoning ------------------------------------------------------------------------ -- The definition -- Rational numbers in reduced form. record ℚ : Set where field numerator : ℤ denominator-1 : ℕ isCoprime : True (C.coprime? ∣ numerator ∣ (suc denominator-1)) denominator : ℤ denominator = + suc denominator-1 coprime : Coprime numerator denominator coprime = witnessToTruth isCoprime -- Constructs rational numbers. The arguments have to be in reduced -- form. infixl 7 _÷_ _÷_ : (numerator : ℤ) (denominator : ℕ) {coprime : True (C.coprime? ∣ numerator ∣ denominator)} {≢0 : False (ℕ._≟_ denominator 0)} → ℚ (n ÷ zero) {≢0 = ()} (n ÷ suc d) {c} = record { numerator = n; denominator-1 = d; isCoprime = c } private -- Note that the implicit arguments do not need to be given for -- concrete inputs: 0/1 : ℚ 0/1 = + 0 ÷ 1 -½ : ℚ -½ = - + 1 ÷ 2 ------------------------------------------------------------------------ -- Equality -- Equality of rational numbers. infix 4 _≃_ _≃_ : Rel ℚ p ≃ q = P.numerator ℤ* Q.denominator ≡ Q.numerator ℤ* P.denominator where module P = ℚ p; module Q = ℚ q -- _≃_ coincides with propositional equality. ≡⇒≃ : _≡_ ⇒ _≃_ ≡⇒≃ refl = refl ≃⇒≡ : _≃_ ⇒ _≡_ ≃⇒≡ {p} {q} = helper P.numerator P.denominator-1 P.isCoprime Q.numerator Q.denominator-1 Q.isCoprime where module P = ℚ p; module Q = ℚ q helper : ∀ n₁ d₁ c₁ n₂ d₂ c₂ → n₁ ℤ* + suc d₂ ≡ n₂ ℤ* + suc d₁ → (n₁ ÷ suc d₁) {c₁} ≡ (n₂ ÷ suc d₂) {c₂} helper n₁ d₁ c₁ n₂ d₂ c₂ eq with Poset.antisym ℕDiv.poset 1+d₁∣1+d₂ 1+d₂∣1+d₁ where 1+d₁∣1+d₂ : suc d₁ ∣ suc d₂ 1+d₁∣1+d₂ = ℤDiv.coprime-divisor (+ suc d₁) n₁ (+ suc d₂) (C.sym $ witnessToTruth c₁) $ ℕDiv.divides ∣ n₂ ∣ (begin ∣ n₁ ℤ* + suc d₂ ∣ ≡⟨ cong ∣_∣ eq ⟩ ∣ n₂ ℤ* + suc d₁ ∣ ≡⟨ ℤ.abs-*-commute n₂ (+ suc d₁) ⟩ ∣ n₂ ∣ ℕ* suc d₁ ∎) 1+d₂∣1+d₁ : suc d₂ ∣ suc d₁ 1+d₂∣1+d₁ = ℤDiv.coprime-divisor (+ suc d₂) n₂ (+ suc d₁) (C.sym $ witnessToTruth c₂) $ ℕDiv.divides ∣ n₁ ∣ (begin ∣ n₂ ℤ* + suc d₁ ∣ ≡⟨ cong ∣_∣ (PropEq.sym eq) ⟩ ∣ n₁ ℤ* + suc d₂ ∣ ≡⟨ ℤ.abs-*-commute n₁ (+ suc d₂) ⟩ ∣ n₁ ∣ ℕ* suc d₂ ∎) helper n₁ d c₁ n₂ .d c₂ eq | refl with ℤ.cancel-*-right n₁ n₂ (+ suc d) (λ ()) eq helper n d c₁ .n .d c₂ eq | refl | refl with proof-irrelevance c₁ c₂ helper n d c .n .d .c eq | refl | refl | refl = refl
{ "alphanum_fraction": 0.5245362059, "avg_line_length": 30.3818181818, "ext": "agda", "hexsha": "1042d936021b1bbbe59051aac054b78ace259a47", "lang": "Agda", "max_forks_count": 3, "max_forks_repo_forks_event_max_datetime": "2022-03-12T11:54:10.000Z", "max_forks_repo_forks_event_min_datetime": "2015-07-21T16:37:58.000Z", "max_forks_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "isabella232/Lemmachine", "max_forks_repo_path": "vendor/stdlib/src/Data/Rational.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_issues_repo_issues_event_max_datetime": "2022-03-12T12:17:51.000Z", "max_issues_repo_issues_event_min_datetime": "2022-03-12T12:17:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "larrytheliquid/Lemmachine", "max_issues_repo_path": "vendor/stdlib/src/Data/Rational.agda", "max_line_length": 74, "max_stars_count": 56, "max_stars_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "isabella232/Lemmachine", "max_stars_repo_path": "vendor/stdlib/src/Data/Rational.agda", "max_stars_repo_stars_event_max_datetime": "2021-12-21T17:02:19.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-20T02:11:42.000Z", "num_tokens": 1157, "size": 3342 }
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.types.Group open import lib.types.Unit open import lib.groups.SubgroupProp open import lib.groups.Homomorphism open import lib.groups.Isomorphism open import lib.groups.Lift module lib.groups.Unit where Unit-group-structure : GroupStructure Unit Unit-group-structure = record { ident = unit ; inv = λ _ → unit ; comp = λ _ _ → unit ; unit-l = λ _ → idp ; assoc = λ _ _ _ → idp ; inv-l = λ _ → idp } Unit-group : Group lzero Unit-group = group _ Unit-is-set Unit-group-structure 0ᴳ = Unit-group abstract Unit-group-is-trivial : is-trivialᴳ Unit-group Unit-group-is-trivial = λ _ → idp iso-Unit-is-trivial : ∀ {i} {G : Group i} → G ≃ᴳ Unit-group → is-trivialᴳ G iso-Unit-is-trivial G-iso-0 = iso-preserves'-trivial G-iso-0 Unit-group-is-trivial 0ᴳ-is-trivial = Unit-group-is-trivial iso-0ᴳ-is-trivial = iso-Unit-is-trivial trivial-iso-Unit : ∀ {i} {G : Group i} → is-trivialᴳ G → G ≃ᴳ Unit-group trivial-iso-Unit {G = G} G-triv = group-hom (λ _ → tt) (λ _ _ → idp) , is-eq _ (λ _ → Group.ident G) (λ _ → idp) (λ _ → ! (G-triv _)) trivial-iso-0ᴳ = trivial-iso-Unit {- the following should be replaced by [is-trivial] completely -} abstract contr-iso-Unit : ∀ {i} (G : Group i) → is-contr (Group.El G) → G ≃ᴳ Unit-group contr-iso-Unit G pA = ≃-to-≃ᴳ (contr-equiv-Unit pA) (λ _ _ → idp) contr-iso-0ᴳ = contr-iso-Unit Unit-group-is-abelian : is-abelian 0ᴳ Unit-group-is-abelian _ _ = idp 0ᴳ-is-abelian = Unit-group-is-abelian Unit-abgroup : AbGroup₀ Unit-abgroup = Unit-group , Unit-group-is-abelian 0ᴳ-abgroup = Unit-abgroup abstract hom₁-Unit-is-trivial : ∀ {i} (G : AbGroup i) → is-trivialᴳ (hom-group Unit-group G) hom₁-Unit-is-trivial G φ = group-hom= $ λ= λ _ → GroupHom.pres-ident φ hom₁-0ᴳ-is-trivial = hom₁-Unit-is-trivial
{ "alphanum_fraction": 0.6797843666, "avg_line_length": 28.1060606061, "ext": "agda", "hexsha": "411cf7569540e96b36c436296959e52205fd6b95", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2018-12-26T21:31:57.000Z", "max_forks_repo_forks_event_min_datetime": "2018-12-26T21:31:57.000Z", "max_forks_repo_head_hexsha": "e7d663b63d89f380ab772ecb8d51c38c26952dbb", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "mikeshulman/HoTT-Agda", "max_forks_repo_path": "core/lib/groups/Unit.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "e7d663b63d89f380ab772ecb8d51c38c26952dbb", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "mikeshulman/HoTT-Agda", "max_issues_repo_path": "core/lib/groups/Unit.agda", "max_line_length": 85, "max_stars_count": null, "max_stars_repo_head_hexsha": "e7d663b63d89f380ab772ecb8d51c38c26952dbb", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "mikeshulman/HoTT-Agda", "max_stars_repo_path": "core/lib/groups/Unit.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 678, "size": 1855 }
data Nat : Set where zero : Nat suc : Nat → Nat plus : Nat → Nat → Nat plus zero b = b plus (suc a) b = suc (plus a b) infixl 6 _+_ _+_ = plus {-# DISPLAY suc n = 1 + n #-} {-# DISPLAY plus a b = a + b #-} postulate T : {A : Set} → A → Set test₁ : ∀ a b → T (plus (suc a) b) test₁ a b = {!!} data Vec (A : Set) : Nat → Set where [] : Vec A zero _∷_ : ∀ {n} → A → Vec A n → Vec A (suc n) data List A : Set where [] : List A _∷_ : A → List A → List A infixr 4 _∷_ [_] : ∀ {A} → A → Vec A (suc zero) [ x ] = x ∷ [] {-# DISPLAY Vec._∷_ x Vec.[] = [ x ] #-} test₂ : (n : Nat) → T (n Vec.∷ []) test₂ n = {!!} append : ∀ {A : Set} {n m} → Vec A n → Vec A m → Vec A (n + m) append [] ys = ys append (x ∷ xs) ys = x ∷ append xs ys infixr 4 _++_ _++_ = append {-# DISPLAY append xs ys = xs ++ ys #-} {-# DISPLAY append xs (y Vec.∷ ys) = xs ++ [ y ] ++ ys #-} test₃ : ∀ {n} (xs ys : Vec Nat n) → T (append xs (n ∷ ys)) test₃ {n} xs ys = {!!}
{ "alphanum_fraction": 0.4783505155, "avg_line_length": 18.6538461538, "ext": "agda", "hexsha": "72ecc258d6f1945bb1f4b8225ef93f5b54e083d9", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2019-03-05T20:02:38.000Z", "max_forks_repo_forks_event_min_datetime": "2019-03-05T20:02:38.000Z", "max_forks_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "redfish64/autonomic-agda", "max_forks_repo_path": "test/interaction/DisplayForm.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "redfish64/autonomic-agda", "max_issues_repo_path": "test/interaction/DisplayForm.agda", "max_line_length": 62, "max_stars_count": 3, "max_stars_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "redfish64/autonomic-agda", "max_stars_repo_path": "test/interaction/DisplayForm.agda", "max_stars_repo_stars_event_max_datetime": "2015-12-07T20:14:00.000Z", "max_stars_repo_stars_event_min_datetime": "2015-03-28T14:51:03.000Z", "num_tokens": 401, "size": 970 }
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Reducibility {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped hiding (_∷_) open import Definition.Untyped.Properties open import Definition.Typed open import Definition.LogicalRelation open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.Substitution open import Definition.LogicalRelation.Substitution.Properties open import Tools.Nat open import Tools.Product private variable n : Nat Γ : Con Term n -- Valid types are reducible. reducibleᵛ : ∀ {A l} ([Γ] : ⊩ᵛ Γ) → Γ ⊩ᵛ⟨ l ⟩ A / [Γ] → Γ ⊩⟨ l ⟩ A reducibleᵛ [Γ] [A] = let ⊢Γ = soundContext [Γ] [id] = idSubstS [Γ] in irrelevance′ (subst-id _) (proj₁ ([A] ⊢Γ [id])) -- Valid type equality is reducible. reducibleEqᵛ : ∀ {A B l} ([Γ] : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) → Γ ⊩ᵛ⟨ l ⟩ A ≡ B / [Γ] / [A] → Γ ⊩⟨ l ⟩ A ≡ B / reducibleᵛ [Γ] [A] reducibleEqᵛ {A = A} [Γ] [A] [A≡B] = let [σA] = reducibleᵛ {A = A} [Γ] [A] ⊢Γ = soundContext [Γ] [id] = idSubstS [Γ] in irrelevanceEq″ (subst-id _) (subst-id _) (proj₁ ([A] ⊢Γ [id])) [σA] ([A≡B] ⊢Γ [id]) -- Valid terms are reducible. reducibleTermᵛ : ∀ {t A l} ([Γ] : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) → Γ ⊩ᵛ⟨ l ⟩ t ∷ A / [Γ] / [A] → Γ ⊩⟨ l ⟩ t ∷ A / reducibleᵛ [Γ] [A] reducibleTermᵛ {A = A} [Γ] [A] [t] = let [σA] = reducibleᵛ {A = A} [Γ] [A] ⊢Γ = soundContext [Γ] [id] = idSubstS [Γ] in irrelevanceTerm″ (subst-id _) (subst-id _) (proj₁ ([A] ⊢Γ [id])) [σA] (proj₁ ([t] ⊢Γ [id])) -- Valid term equality is reducible. reducibleEqTermᵛ : ∀ {t u A l} ([Γ] : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) → Γ ⊩ᵛ⟨ l ⟩ t ≡ u ∷ A / [Γ] / [A] → Γ ⊩⟨ l ⟩ t ≡ u ∷ A / reducibleᵛ [Γ] [A] reducibleEqTermᵛ {A = A} [Γ] [A] [t≡u] = let [σA] = reducibleᵛ {A = A} [Γ] [A] ⊢Γ = soundContext [Γ] [id] = idSubstS [Γ] in irrelevanceEqTerm″ (subst-id _) (subst-id _) (subst-id _) (proj₁ ([A] ⊢Γ [id])) [σA] ([t≡u] ⊢Γ [id])
{ "alphanum_fraction": 0.5055319149, "avg_line_length": 32.6388888889, "ext": "agda", "hexsha": "a55ca130f226f38fbe16e1bbc0f427e94b9d5b69", "lang": "Agda", "max_forks_count": 8, "max_forks_repo_forks_event_max_datetime": "2021-11-27T15:58:33.000Z", "max_forks_repo_forks_event_min_datetime": "2017-10-18T14:18:20.000Z", "max_forks_repo_head_hexsha": "ea83fc4f618d1527d64ecac82d7d17e2f18ac391", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "fhlkfy/logrel-mltt", "max_forks_repo_path": "Definition/LogicalRelation/Substitution/Reducibility.agda", "max_issues_count": 4, "max_issues_repo_head_hexsha": "ea83fc4f618d1527d64ecac82d7d17e2f18ac391", "max_issues_repo_issues_event_max_datetime": "2021-02-22T10:37:24.000Z", "max_issues_repo_issues_event_min_datetime": "2017-06-22T12:49:23.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "fhlkfy/logrel-mltt", "max_issues_repo_path": "Definition/LogicalRelation/Substitution/Reducibility.agda", "max_line_length": 86, "max_stars_count": 30, "max_stars_repo_head_hexsha": "ea83fc4f618d1527d64ecac82d7d17e2f18ac391", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "fhlkfy/logrel-mltt", "max_stars_repo_path": "Definition/LogicalRelation/Substitution/Reducibility.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:01:07.000Z", "max_stars_repo_stars_event_min_datetime": "2017-05-20T03:05:21.000Z", "num_tokens": 966, "size": 2350 }
{-# OPTIONS --without-K --safe #-} module Categories.Category.Construction.Properties.Comma where open import Level open import Data.Product using (Σ; _,_; proj₁; proj₂; zip; map; swap; <_,_>; -,_) open import Categories.Category open import Categories.Category.Instance.One open import Categories.Category.Equivalence using (StrongEquivalence) open import Categories.Functor renaming (id to idF) open import Categories.Functor.Construction.Constant using (const; constNat) open import Categories.NaturalTransformation using (module NaturalTransformation) open import Categories.Category.Construction.Comma open import Categories.Category.Product renaming (Product to _×_) open import Categories.Category.Construction.Functors renaming (Functors to [_⇒_]) open import Categories.NaturalTransformation renaming (id to idN) import Categories.Category.Slice as Sl import Categories.Morphism.Reasoning as Reas private variable o ℓ e o₁ ℓ₁ e₁ o₂ ℓ₂ e₂ o₃ ℓ₃ e₃ : Level C D E : Category o ℓ e -- There's a projection functor down onto the A and B Categories module _ {A : Category o₁ ℓ₁ e₁} {B : Category o₂ ℓ₂ e₂} {C : Category o₃ ℓ₃ e₃} where open CommaObj open Comma⇒ private module A = Category A module EA = A.Equiv module B = Category B module EB = B.Equiv module C = Category C module _ (S : Functor B C) (T : Functor A C) where private module S = Functor S module T = Functor T S↓T⇒A×B : Functor (S ↓ T) (A × B) S↓T⇒A×B = record { F₀ = < β , α > ; F₁ = < h , g > ; identity = EA.refl , EB.refl ; homomorphism = EA.refl , EB.refl ; F-resp-≈ = swap } induced-nat : NaturalTransformation (S ∘F Dom S T) (T ∘F Cod S T) induced-nat = record { η = f ; commute = λ i → C.Equiv.sym (commute i) ; sym-commute = commute } module _ (S′ : Functor D B) (T′ : Functor E A) where private module S′ = Functor S′ module T′ = Functor T′ compose-F : Functor (S ∘F S′ ↓ T ∘F T′) (S ↓ T) compose-F = record { F₀ = λ X → record { f = f X } ; F₁ = λ i → record { g = S′.F₁ (g i) ; h = T′.F₁ (h i) ; commute = commute i } ; identity = S′.identity , T′.identity ; homomorphism = S′.homomorphism , T′.homomorphism ; F-resp-≈ = map S′.F-resp-≈ T′.F-resp-≈ } module _ (S′ : Functor D B) where private module S′ = Functor S′ compose-Fˡ : Functor (S ∘F S′ ↓ T) (S ↓ T) compose-Fˡ = record { F₀ = λ X → record { f = f X } ; F₁ = λ i → record { g = S′.F₁ (g i) ; h = h i ; commute = commute i } ; identity = S′.identity , A.Equiv.refl ; homomorphism = S′.homomorphism , A.Equiv.refl ; F-resp-≈ = map S′.F-resp-≈ λ eq → eq } module _ (T′ : Functor E A) where private module T′ = Functor T′ compose-Fʳ : Functor (S ↓ T ∘F T′) (S ↓ T) compose-Fʳ = record { F₀ = λ X → record { f = f X } ; F₁ = λ i → record { g = g i ; h = T′.F₁ (h i) ; commute = commute i } ; identity = B.Equiv.refl , T′.identity ; homomorphism = B.Equiv.refl , T′.homomorphism ; F-resp-≈ = map (λ eq → eq) T′.F-resp-≈ } module _ {S S′ : Functor B C} {T T′ : Functor A C} (γ : NaturalTransformation S′ S) (δ : NaturalTransformation T T′) where private module S′ = Functor S′ module T′ = Functor T′ module γ = NaturalTransformation γ module δ = NaturalTransformation δ module S = Functor S module T = Functor T open C open HomReasoning open Reas C -- functors between Comma categories along natural transformations along-nat : Functor (S ↓ T) (S′ ↓ T′) along-nat = record { F₀ = λ X → record { f = δ.η (β X) ∘ f X ∘ γ.η (α X) } ; F₁ = λ {X Y} i → record { g = g i ; h = h i ; commute = begin T′.F₁ (h i) ∘ δ.η (β X) ∘ f X ∘ γ.η (α X) ≈⟨ sym-assoc ⟩ (T′.F₁ (h i) ∘ δ.η (β X)) ∘ f X ∘ γ.η (α X) ≈˘⟨ center⁻¹ (δ.commute (h i)) refl ⟩ δ.η (β Y) ∘ (T.F₁ (h i) ∘ f X) ∘ γ.η (α X) ≈⟨ refl⟩∘⟨ pushˡ (commute i) ⟩ δ.η (β Y) ∘ f Y ∘ S.F₁ (g i) ∘ γ.η (α X) ≈˘⟨ pull-last (γ.commute (g i)) ⟩ (δ.η (β Y) ∘ f Y ∘ γ.η (α Y)) ∘ S′.F₁ (g i) ∎ } ; identity = B.Equiv.refl , A.Equiv.refl ; homomorphism = B.Equiv.refl , A.Equiv.refl ; F-resp-≈ = λ eq → eq } along-natʳ : ∀ {T T′ : Functor A C} (S : Functor B C) (δ : NaturalTransformation T T′) → Functor (S ↓ T) (S ↓ T′) along-natʳ S = along-nat idN along-natˡ : ∀ {S S′ : Functor B C} (γ : NaturalTransformation S′ S) (T : Functor A C) → Functor (S ↓ T) (S′ ↓ T) along-natˡ γ T = along-nat γ idN -- There's an induced functor from Functors category to Functors over Comma categories module _ {A : Category o₁ ℓ₁ e₁} {B : Category o₂ ℓ₂ e₂} {C : Category o₃ ℓ₃ e₃} where open CommaObj open Comma⇒ open Category C open Functor open HomReasoning open Reas C induced : {s₁ d₁ : Functor A C} {s₂ d₂ : Functor B C} → ((Category.op [ A ⇒ C ] × [ B ⇒ C ]) [ (s₁ , s₂) , (d₁ , d₂) ]) → Functor (s₁ ↓ s₂) (d₁ ↓ d₂) induced {s₁ = s₁} {d₁ = d₁} {s₂} {d₂} (m₁ , m₂) = record { F₀ = λ o → record { α = α o ; β = β o ; f = m₂.η (β o) ∘ f o ∘ m₁.η (α o) } ; F₁ = λ {o₁} {o₂} a → record { g = g a ; h = h a ; commute = begin F₁ d₂ (h a) ∘ m₂.η (β o₁) ∘ f o₁ ∘ m₁.η (α o₁) ≈˘⟨ pushˡ (m₂.commute (h a)) ⟩ (m₂.η (β o₂) ∘ F₁ s₂ (h a)) ∘ f o₁ ∘ m₁.η (α o₁) ≈⟨ pullˡ (pullʳ (commute a)) ⟩ (m₂.η (β o₂) ∘ f o₂ ∘ F₁ s₁ (g a)) ∘ m₁.η (α o₁) ≈˘⟨ extendˡ (extendˡ (m₁.commute (g a))) ⟩ (m₂.η (β o₂) ∘ f o₂ ∘ m₁.η (α o₂)) ∘ F₁ d₁ (g a) ∎ } ; identity = A.Equiv.refl , B.Equiv.refl ; homomorphism = A.Equiv.refl , B.Equiv.refl ; F-resp-≈ = λ f≈g → f≈g } where module A = Category A module B = Category B module m₁ = NaturalTransformation m₁ module m₂ = NaturalTransformation m₂ module _ (F : Functor C D) where private module D = Category D along-natˡ′ : ∀ {A B} (f : A D.⇒ B) → Functor (B ↙ F) (A ↙ F) along-natˡ′ f = along-natˡ (constNat f) F along-natʳ′ : ∀ {A B} (f : A D.⇒ B) → Functor (F ↘ A) (F ↘ B) along-natʳ′ f = along-natʳ F (constNat f) module _ {C : Category o ℓ e} where open Category C open Sl C open SliceObj open Slice⇒ open HomReasoning open CommaObj open Comma⇒ open Reas C slice⇒comma : ∀ X → Functor (Slice X) (idF {C = C} ↓ const {C = One {o} {ℓ} {e}} X) slice⇒comma X = record { F₀ = λ X → record { f = arr X } ; F₁ = λ f → record { commute = identityˡ ○ ⟺ (△ f) } ; identity = refl , _ ; homomorphism = refl , _ ; F-resp-≈ = λ eq → eq , _ } comma⇒slice : ∀ X → Functor (idF {C = C} ↓ const {C = One {o} {ℓ} {e}} X) (Slice X) comma⇒slice X = record { F₀ = λ X → Sl.sliceobj (f X) ; F₁ = λ g → Sl.slicearr (⟺ (commute g) ○ identityˡ) ; identity = refl ; homomorphism = refl ; F-resp-≈ = proj₁ } comma-slice-equiv : ∀ X → StrongEquivalence (Slice X) (idF {C = C} ↓ const {C = One {o} {ℓ} {e}} X) comma-slice-equiv X = record { F = slice⇒comma X ; G = comma⇒slice X ; weak-inverse = record { F∘G≈id = record { F⇒G = record { η = λ _ → record { commute = id-comm-sym } ; commute = λ _ → id-comm-sym , _ ; sym-commute = λ _ → id-comm , _ } ; F⇐G = record { η = λ _ → record { commute = id-comm-sym } ; commute = λ _ → id-comm-sym , _ ; sym-commute = λ _ → id-comm , _ } ; iso = λ Y → record { isoˡ = identityˡ , _ ; isoʳ = identityˡ , _ } } ; G∘F≈id = record { F⇒G = record { η = λ _ → Sl.slicearr identityʳ ; commute = λ _ → id-comm-sym ; sym-commute = λ _ → id-comm } ; F⇐G = record { η = λ _ → Sl.slicearr identityʳ ; commute = λ _ → id-comm-sym ; sym-commute = λ _ → id-comm } ; iso = λ _ → record { isoˡ = identityˡ ; isoʳ = identityˡ } } } }
{ "alphanum_fraction": 0.4994328494, "avg_line_length": 32.8955223881, "ext": "agda", "hexsha": "2d4cd871ded8ca82fb16181344a08c1a84a04476", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "MirceaS/agda-categories", "max_forks_repo_path": "src/Categories/Category/Construction/Properties/Comma.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "MirceaS/agda-categories", "max_issues_repo_path": "src/Categories/Category/Construction/Properties/Comma.agda", "max_line_length": 124, "max_stars_count": null, "max_stars_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "MirceaS/agda-categories", "max_stars_repo_path": "src/Categories/Category/Construction/Properties/Comma.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 3212, "size": 8816 }
module FlatUnderscore where postulate A : Set f : (@♭ X : A → Set) → ∀ a → X a @♭ B : A → Set -- The undescore should be solved to B. g : ∀ a → B a g = f _
{ "alphanum_fraction": 0.5333333333, "avg_line_length": 13.75, "ext": "agda", "hexsha": "2b29c417b0cea7b2fbe584177c7b0a5ac6c3dae3", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/Succeed/FlatUnderscore.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/Succeed/FlatUnderscore.agda", "max_line_length": 39, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/Succeed/FlatUnderscore.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 66, "size": 165 }
{-# OPTIONS --safe --no-qualified-instances #-} module CF.Syntax where open import Level open import Data.Integer open import Data.Bool open import Data.String open import Data.Product open import Data.List hiding (null) open import Data.List.Relation.Unary.All open import Relation.Unary hiding (_⊢_) open import Relation.Unary.PredicateTransformer using (Pt) open import Relation.Binary.Structures using (IsPreorder) open import Relation.Binary.PropositionalEquality using (isEquivalence; refl) open import Relation.Ternary.Core open import Relation.Ternary.Structures open import Relation.Ternary.Structures.Syntax open import Relation.Ternary.Monad.Possibly open import Relation.Ternary.Monad.Weakening open import Relation.Ternary.Data.Bigstar hiding ([_]) open import CF.Types open import CF.Contexts.Lexical open import Relation.Ternary.Construct.Product using (fst; snd) open import Relation.Ternary.Data.Allstar Ty data BinOp : Ty → Ty → Ty → Set where add sub mul div xor : BinOp int int int eq ne lt ge gt le : BinOp int int bool data Exp : Ty → Pred Ctx 0ℓ where unit : ε[ Exp void ] num : ℤ → ε[ Exp int ] bool : Bool → ε[ Exp bool ] ifthenelse : ∀[ Exp bool ✴ Exp a ✴ Exp a ⇒ Exp a ] var' : ∀[ Var a ⇒ Exp a ] bop : BinOp a b c → ∀[ Exp a ✴ Exp b ⇒ Exp c ] pattern var = var' vars module Statements (Block : Ty → Pred Ctx 0ℓ) where data Statement (r : Ty) : Pred Ctx 0ℓ where asgn : ∀[ Var a ✴ Exp a ⇒ Statement r ] run : ∀[ Exp a ⇒ Statement r ] ifthenelse : ∀[ Exp bool ✴ Statement r ✴ Statement r ⇒ Statement r ] while : ∀[ Exp bool ✴ Statement r ⇒ Statement r ] block : ∀[ Block r ⇒ Statement r ] mutual Stmt = Statements.Statement Block data Block (r : Ty) : Pred Ctx 0ℓ where local : ∀[ Exp a ✴ [ a ] ⊢ (Block r) ⇒ Block r ] cons : ∀[ Stmt r ✴ Block r ⇒ Block r ] emp : ε[ Block r ] -- make constructors visible open Statements Block public infixr 5 _⍮⟨_⟩_ pattern _⍮⟨_⟩_ s σ b = cons (s ∙⟨ σ ⟩ b) pattern _≔⟨_⟩_ e σ b = local (e ∙⟨ σ ⟩ b)
{ "alphanum_fraction": 0.6660332542, "avg_line_length": 30.9558823529, "ext": "agda", "hexsha": "7c817ac0a9621140c14733fcc97efb7067347b38", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-12-28T17:37:15.000Z", "max_forks_repo_forks_event_min_datetime": "2021-12-28T17:37:15.000Z", "max_forks_repo_head_hexsha": "c84bc6b834295ac140ff30bfc8e55228efbf6d2a", "max_forks_repo_licenses": [ "Apache-2.0" ], "max_forks_repo_name": "ajrouvoet/jvm.agda", "max_forks_repo_path": "src/CF/Syntax.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "c84bc6b834295ac140ff30bfc8e55228efbf6d2a", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "Apache-2.0" ], "max_issues_repo_name": "ajrouvoet/jvm.agda", "max_issues_repo_path": "src/CF/Syntax.agda", "max_line_length": 77, "max_stars_count": 6, "max_stars_repo_head_hexsha": "c84bc6b834295ac140ff30bfc8e55228efbf6d2a", "max_stars_repo_licenses": [ "Apache-2.0" ], "max_stars_repo_name": "ajrouvoet/jvm.agda", "max_stars_repo_path": "src/CF/Syntax.agda", "max_stars_repo_stars_event_max_datetime": "2021-02-28T21:49:08.000Z", "max_stars_repo_stars_event_min_datetime": "2020-10-07T14:07:17.000Z", "num_tokens": 625, "size": 2105 }
-- Andreas, 2019-11-06, issue #4173, reported and testcase by nad. -- Allow pattern matching on erased arguments in erased context. -- {-# OPTIONS -v tc.cover.split:60 #-} open import Agda.Builtin.Bool @0 F : @0 Bool → Set₁ F true = Set F false = Set -- Should succeed. @0 G : @0 Bool → Set₁ G x = {! x !} -- splitting on x should also succeed
{ "alphanum_fraction": 0.6581196581, "avg_line_length": 21.9375, "ext": "agda", "hexsha": "f34624308a7f77b1145b4ab934591106d2c3a688", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "231d6ad8e77b67ff8c4b1cb35a6c31ccd988c3e9", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "Agda-zh/agda", "max_forks_repo_path": "test/interaction/Issue4173.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "shlevy/agda", "max_issues_repo_path": "test/interaction/Issue4173.agda", "max_line_length": 66, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "shlevy/agda", "max_stars_repo_path": "test/interaction/Issue4173.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 106, "size": 351 }
module Class.Monad where open import Class.Functor open import Data.Unit.Polymorphic open import Category.Monad renaming (RawMonad to Monad) public open Monad {{...}} using (return; _>>=_; _=<<_; _>>_) public module _ {a} {M : Set a → Set a} {{m : Monad M}} where instance _ = Monad.rawIApplicative m monadFunctor = Monad.rawFunctor m void : ∀ {A} → M A → M ⊤ void x = x >> return tt
{ "alphanum_fraction": 0.6575682382, "avg_line_length": 23.7058823529, "ext": "agda", "hexsha": "6d1caecd18f570dcade6b4e4fbdbb62b8e90636b", "lang": "Agda", "max_forks_count": 2, "max_forks_repo_forks_event_max_datetime": "2021-10-20T10:46:20.000Z", "max_forks_repo_forks_event_min_datetime": "2019-06-27T23:12:48.000Z", "max_forks_repo_head_hexsha": "62fa6f36e4555360d94041113749bbb6d291691c", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "WhatisRT/meta-cedille", "max_forks_repo_path": "stdlib-exts/Class/Monad.agda", "max_issues_count": 10, "max_issues_repo_head_hexsha": "62fa6f36e4555360d94041113749bbb6d291691c", "max_issues_repo_issues_event_max_datetime": "2020-04-25T15:29:17.000Z", "max_issues_repo_issues_event_min_datetime": "2019-06-13T17:44:43.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "WhatisRT/meta-cedille", "max_issues_repo_path": "stdlib-exts/Class/Monad.agda", "max_line_length": 62, "max_stars_count": 35, "max_stars_repo_head_hexsha": "62fa6f36e4555360d94041113749bbb6d291691c", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "WhatisRT/meta-cedille", "max_stars_repo_path": "stdlib-exts/Class/Monad.agda", "max_stars_repo_stars_event_max_datetime": "2021-10-12T22:59:10.000Z", "max_stars_repo_stars_event_min_datetime": "2019-06-13T07:44:50.000Z", "num_tokens": 127, "size": 403 }
{-# OPTIONS --rewriting --without-K #-} open import Agda.Primitive open import Prelude open import GSeTT.Syntax open import GSeTT.Rules {- Categorical structure of the type theory for globular sets -} module GSeTT.CwF-structure where {- cut-admissibility : action of substitutions preserves derivability -} []T : ∀ {Γ A Δ γ} → Γ ⊢T A → Δ ⊢S γ > Γ → Δ ⊢T (A [ γ ]Pre-Ty) []t : ∀ {Γ A t Δ γ} → Γ ⊢t t # A → Δ ⊢S γ > Γ → Δ ⊢t (t [ γ ]Pre-Tm) # (A [ γ ]Pre-Ty) []T (ob Γ⊢) Δ⊢γ:Γ = ob (Δ⊢γ:Γ→Δ⊢ Δ⊢γ:Γ) []T (ar Γ⊢t:A Γ⊢u:A) Δ⊢γ:Γ = ar ([]t Γ⊢t:A Δ⊢γ:Γ) ([]t Γ⊢u:A Δ⊢γ:Γ) []t {Γ = (Γ :: _)} {t = Var x} (var Γ+⊢@(cc Γ⊢ _ idp) (inl x∈Γ)) Δ⊢γ+:Γ+@(sc Δ⊢γ:Γ _ _ idp) with (eqdecℕ x (length Γ)) ... | inl idp = ⊥-elim (lΓ∉Γ Γ⊢ x∈Γ) ... | inr _ = trT (wk[]T (Γ⊢t:A→Γ⊢A (var Γ⊢ x∈Γ)) Δ⊢γ+:Γ+ ^) ([]t (var Γ⊢ x∈Γ) Δ⊢γ:Γ) []t {Γ = (Γ :: _)} {t = Var x} (var Γ+⊢@(cc Γ⊢ Γ⊢A idp) (inr (idp , idp))) Δ⊢γ+:Γ+@(sc Δ⊢γ:Γ x₁ Δ⊢t:A[γ] idp) with (eqdecℕ x (length Γ)) ... | inl _ = trT (wk[]T Γ⊢A Δ⊢γ+:Γ+ ^) Δ⊢t:A[γ] ... | inr x≠x = ⊥-elim (x≠x idp) {- action of identity on types and terms is trivial (true on syntax) -} [id]T : ∀ Γ A → (A [ Pre-id Γ ]Pre-Ty) == A [id]t : ∀ Γ t → (t [ Pre-id Γ ]Pre-Tm) == t [id]T Γ ∗ = idp [id]T Γ (⇒ A t u) = ⇒= ([id]T Γ A) ([id]t Γ t) ([id]t Γ u) [id]t nil (Var x) = idp [id]t (Γ :: (y , B)) (Var x) with (eqdecℕ x y) ... | inl x=y = Var= (x=y ^) ... | inr _ = [id]t Γ (Var x) {- identity is well-formed -} Γ⊢id:Γ : ∀ {Γ} → Γ ⊢C → Γ ⊢S Pre-id Γ > Γ Γ⊢id:Γ ec = es ec Γ⊢id:Γ Γ,x:A⊢@(cc Γ⊢ Γ⊢A idp) = sc (wkS (Γ⊢id:Γ Γ⊢) Γ,x:A⊢) Γ,x:A⊢ (var Γ,x:A⊢ (inr (idp , [id]T _ _))) idp {- action of substitutions on types and terms respects composition -} [∘]T : ∀ {Γ Δ Θ A γ δ} → Γ ⊢T A → Δ ⊢S γ > Γ → Θ ⊢S δ > Δ → ((A [ γ ]Pre-Ty) [ δ ]Pre-Ty) == (A [ γ ∘ δ ]Pre-Ty) [∘]t : ∀ {Γ Δ Θ A t γ δ} → Γ ⊢t t # A → Δ ⊢S γ > Γ → Θ ⊢S δ > Δ → ((t [ γ ]Pre-Tm) [ δ ]Pre-Tm) == (t [ γ ∘ δ ]Pre-Tm) [∘]T (ob _) _ _ = idp [∘]T (ar Γ⊢t:A Γ⊢u:A) Δ⊢γ:Γ Θ⊢δ:Δ = ⇒= ([∘]T (Γ⊢t:A→Γ⊢A Γ⊢t:A) Δ⊢γ:Γ Θ⊢δ:Δ) ([∘]t Γ⊢t:A Δ⊢γ:Γ Θ⊢δ:Δ) ([∘]t Γ⊢u:A Δ⊢γ:Γ Θ⊢δ:Δ) [∘]t (var {x = x} Γ⊢ x∈Γ) (sc {x = y} Δ⊢γ:Γ _ Δ⊢t:A[γ] idp) Θ⊢δ:Δ with (eqdecℕ x y ) ... | inl idp = idp [∘]t (var Γ,y:A⊢ (inr (idp , idp))) (sc Δ⊢γ:Γ _ Δ⊢t:A[γ] idp) Θ⊢δ:Δ | inr x≠x = ⊥-elim (x≠x idp) [∘]t (var (cc Γ⊢ _ _) (inl x∈Γ)) (sc Δ⊢γ:Γ _ Δ⊢t:A[γ] idp) Θ⊢δ:Δ | inr _ = [∘]t (var Γ⊢ x∈Γ) Δ⊢γ:Γ Θ⊢δ:Δ {- composition of well-formed substitutions is well-formed -} ∘-admissibility : ∀ {Γ Δ Θ γ δ} → Δ ⊢S γ > Γ → Θ ⊢S δ > Δ → Θ ⊢S (γ ∘ δ) > Γ ∘-admissibility (es Δ⊢) Θ⊢δ:Δ = es (Δ⊢γ:Γ→Δ⊢ Θ⊢δ:Δ) ∘-admissibility (sc Δ⊢γ:Γ Γ,x:A⊢@(cc _ Γ⊢A _) Δ⊢t:A[γ] idp) Θ⊢δ:Δ = sc (∘-admissibility Δ⊢γ:Γ Θ⊢δ:Δ) Γ,x:A⊢ (trT ([∘]T Γ⊢A Δ⊢γ:Γ Θ⊢δ:Δ) ([]t Δ⊢t:A[γ] Θ⊢δ:Δ)) idp {- composition is associative, this is true only for well-formed substitutions -} ∘-associativity : ∀ {Γ Δ Θ Ξ γ δ θ} → Δ ⊢S γ > Γ → Θ ⊢S δ > Δ → Ξ ⊢S θ > Θ → ((γ ∘ δ) ∘ θ) == (γ ∘ (δ ∘ θ)) ∘-associativity (es _) _ _ = idp ∘-associativity (sc Δ⊢γ:Γ _ Δ⊢t:A[γ] idp) Θ⊢δ:Δ Ξ⊢θ:Θ = ::= (∘-associativity Δ⊢γ:Γ Θ⊢δ:Δ Ξ⊢θ:Θ) (×= idp ([∘]t Δ⊢t:A[γ] Θ⊢δ:Δ Ξ⊢θ:Θ)) {- Left unitality of composition -} -- To prove right-unitality, we need a analoguous of wk[]T and wk[]t for substitutions -- Composing if θ is a subst without x, acting (γ :: (x , u)) on it is same as acting just γ on it wk[]S : ∀ {Γ Δ γ x u B Θ θ} → Γ ⊢S θ > Θ → Δ ⊢S (γ :: (x , u)) > (Γ :: (x , B)) → (θ ∘ (γ :: (x , u))) == (θ ∘ γ) wk[]S (es _) _ = idp wk[]S (sc Γ⊢θ:Θ _ Γ⊢t:A[θ] idp) Δ⊢γ+:Γ+ = ::= (wk[]S Γ⊢θ:Θ Δ⊢γ+:Γ+) (×= idp (wk[]t Γ⊢t:A[θ] Δ⊢γ+:Γ+)) ∘-left-unit : ∀{Γ Δ γ} → Δ ⊢S γ > Γ → (Pre-id Γ ∘ γ) == γ ∘-left-unit (es _) = idp ∘-left-unit Δ⊢γ+:Γ+@(sc {x = x} Δ⊢γ:Γ (cc Γ⊢ _ _) _ idp) with (eqdecℕ x x) ... | inl _ = ::= (wk[]S (Γ⊢id:Γ Γ⊢) Δ⊢γ+:Γ+ >> ∘-left-unit Δ⊢γ:Γ) idp ... | inr x≠x = ⊥-elim (x≠x idp) {- Right unitality of composition (true on syntax)-} ∘-right-unit : ∀ {Δ γ} → (γ ∘ Pre-id Δ) == γ ∘-right-unit {Δ} {nil} = idp ∘-right-unit {Δ} {γ :: (y , t)} = ::= ∘-right-unit (×= idp ([id]t Δ t)) {- Structure of CwF -} Γ,x:A⊢π:Γ : ∀ {Γ x A} → (Γ :: (x , A)) ⊢C → (Γ :: (x , A)) ⊢S Pre-π Γ x A > Γ Γ,x:A⊢π:Γ Γ,x:A⊢@(cc Γ⊢ _ _) = wkS (Γ⊢id:Γ Γ⊢) Γ,x:A⊢ -- TODO : complete the CwF structure
{ "alphanum_fraction": 0.4323817462, "avg_line_length": 53.3222222222, "ext": "agda", "hexsha": "5f80068ef46f78fed932162a2d45e81608ced06f", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "3a02010a869697f4833c9bc6047d66ca27b87cf2", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "thibautbenjamin/catt-formalization", "max_forks_repo_path": "GSeTT/CwF-structure.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "3a02010a869697f4833c9bc6047d66ca27b87cf2", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "thibautbenjamin/catt-formalization", "max_issues_repo_path": "GSeTT/CwF-structure.agda", "max_line_length": 171, "max_stars_count": null, "max_stars_repo_head_hexsha": "3a02010a869697f4833c9bc6047d66ca27b87cf2", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "thibautbenjamin/catt-formalization", "max_stars_repo_path": "GSeTT/CwF-structure.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 2631, "size": 4799 }
{- With Agda's current sized types, we have a size ∞ with ∞ < ∞. That's obviously troublesome if we want to interpret sizes as ordinals and < as the less-than relation, and indeed we can use this rule to prove false (in multiple different ways). This file is an experiment to see whether we could still work with a system that doesn't have this rule. -} {-# OPTIONS --postfix-projections #-} module irreflexive-lt where open import Size postulate 𝟘 : Size data Size≲ : (j : Size) → Set where ≲∞ : (i : Size) → Size≲ ∞ <→≲ : ∀ {j} (i : Size< j) → Size≲ j from≲ : ∀ {j} → Size≲ j → Size from≲ (≲∞ i) = i from≲ (<→≲ i) = i ∞′ : Size≲ ∞ ∞′ = ≲∞ ∞ -------------------------------------------------------------------------------- -- Natural numbers data ℕ (i : Size) : Set where zero : ℕ i suc : (j : Size< i) → ℕ j → ℕ i -- Using the successor at size ∞ becomes nontrivial. The following is NOT -- allowed since we use (∞ : Size< ∞). -- suc₀ : ℕ ∞ → ℕ ∞ -- suc₀ n = suc ∞ n -- Workaround: superfluous pattern matching. suc₁ : ℕ ∞ → ℕ ∞ suc₁ zero = suc 𝟘 zero suc₁ (suc j x) = suc (↑ j) (suc j x) -- Case analysis caseℕ : {T : Set} → (i : Size) → ℕ i → T → ((j : Size< i) → ℕ j → T) → T caseℕ i zero z s = z caseℕ i (suc j n) z s = s j n -- Dependent elimination (with size-based termination). indℕ : (P : (i : Size) → ℕ i → Set) → ((i : Size) → P i zero) → ((i : Size) (j : Size< i) (n : ℕ j) → P j n → P i (suc j n)) → (i : Size) (n : ℕ i) → P i n indℕ P Z S i zero = Z i indℕ P Z S i (suc j n) = S i j n (indℕ P Z S j n) -------------------------------------------------------------------------------- -- Streams record 𝕊 (A : Set) (i : Size) : Set where coinductive field head : A tail : (j : Size< i) → 𝕊 A j open 𝕊 variable A B : Set -- Again, we CANNOT use tail at ∞ directly since this uses (∞ : Size< ∞). -- tail₀ : 𝕊 ∞ → 𝕊 ∞ -- tail₀ xs = tail xs ∞ -- Workaround: The equivalent of the 'superfluous pattern matching' workaround -- for suc. tail₁ : 𝕊 A ∞ → 𝕊 A ∞ tail₁ xs .head = head {i = 𝟘} (tail xs 𝟘) -- [1] tail₁ xs .tail j = tail (tail xs (↑ j)) j -- [1] Without the implicit argument, this doesn't typecheck. Apparently the -- size argument to head gets eagerly instantiated to ∞ or something. replicate : (i : Size) → A → 𝕊 A i replicate i a .head = a replicate i a .tail j = replicate j a map𝕊 : (A → B) → (i : Size) → 𝕊 A i → 𝕊 B i map𝕊 f i xs .head = f (head xs) map𝕊 f i xs .tail j = map𝕊 f j (tail xs j) -------------------------------------------------------------------------------- -- Rose trees data List (A : Set) : Set where [] : List A _∷_ : A → List A → List A mapList : (A → B) → List A → List B mapList f [] = [] mapList f (x ∷ xs) = f x ∷ mapList f xs data Tree (A : Set) (i : Size) : Set where leaf : A → Tree A i node : (j : Size< i) → List (Tree A j) → Tree A i mapTree : (A → B) → (i : Size) → Tree A i → Tree B i mapTree f i (leaf x) = leaf (f x) mapTree f i (node j cs) = node j (mapList (mapTree f j) cs) -------------------------------------------------------------------------------- -- Potentially infinite lists mutual data CoList (A : Set) (i : Size) : Set where [] : CoList A i _∷_ : A → CoList′ A i → CoList A i record CoList′ (A : Set) (i : Size) : Set where coinductive field force : (j : Size< i) → CoList A j open CoList′ open import Data.Product using (∃-syntax) open import Relation.Binary.PropositionalEquality using (_≡_ ; refl ; inspect ; [_]) open import Relation.Binary.HeterogeneousEquality using (_≅_ ; refl) postulate force-parametric : ∀ {A i} (xs : CoList′ A i) (j j′ : Size< i) → xs .force j ≅ xs .force j′ size-parametric : ∀ {T : Size< ∞ → Set} (f : (i : Size< ∞) → T i) → (j j′ : Size< ∞) → f j ≅ f j′ mutual data _≈_ {A i j} : CoList A i → CoList A j → Set where [] : [] ≈ [] _∷_ : ∀ {x y xs ys} → x ≡ y → xs ≈′ ys → (x ∷ xs) ≈ (y ∷ ys) record _≈′_ {A i j} (xs : CoList′ A i) (ys : CoList′ A j) : Set where coinductive field force : (k : Size< i) (l : Size< j) → xs .force k ≈ ys .force l open _≈′_ force∞ : CoList′ A ∞ → CoList A ∞ force∞ {A} xs with xs .force 𝟘 ... | [] = [] ... | y ∷ ys = y ∷ ys′ where ys′ : CoList′ A ∞ ys′ .force i with xs .force (↑ i) ... | [] = [] ... | z ∷ zs = zs .force i 𝕊→CoList : (i : Size) → 𝕊 A i → CoList A i 𝕊→CoList i xs = head xs ∷ λ { .force j → 𝕊→CoList j (tail xs j) } -- Radical thought: Just kill ∞ altogether and work with (∀ i → CoList A i) and -- (∃ i → List A i) directly. How much less useful does that make the system? -- -- Perhaps we can auto-derive the iso (∃ i → List A i) ≅ List A. -- Radical thought: What if we only provide the Thunk type from the stdlib? Can -- we recover all other coinductive types from that?
{ "alphanum_fraction": 0.5286977988, "avg_line_length": 23.3701923077, "ext": "agda", "hexsha": "d72dd7cc328c1d8f0f4109bd5887bd9ab9a38edb", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "104cddc6b65386c7e121c13db417aebfd4b7a863", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "JLimperg/msc-thesis-code", "max_forks_repo_path": "src/irreflexive-lt.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "104cddc6b65386c7e121c13db417aebfd4b7a863", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "JLimperg/msc-thesis-code", "max_issues_repo_path": "src/irreflexive-lt.agda", "max_line_length": 84, "max_stars_count": 5, "max_stars_repo_head_hexsha": "104cddc6b65386c7e121c13db417aebfd4b7a863", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "JLimperg/msc-thesis-code", "max_stars_repo_path": "src/irreflexive-lt.agda", "max_stars_repo_stars_event_max_datetime": "2021-06-26T06:37:31.000Z", "max_stars_repo_stars_event_min_datetime": "2021-04-13T21:31:17.000Z", "num_tokens": 1763, "size": 4861 }
module Data.List.Functions where import Lvl open import Data.Boolean import Data.Boolean.Operators open Data.Boolean.Operators.Programming open import Data.List open import Data.Option as Option using (Option) import Data.Option.Functions as Option open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional open import Numeral.Finite open import Numeral.Natural open import Type private variable ℓ ℓ₁ ℓ₂ : Lvl.Level private variable T A A₁ A₂ B B₁ B₂ Result : Type{ℓ} infixl 1000 _++_ open import Data.List.Functions.Positional public -- The list of the successive application of `tail` on a list. -- For a list `l`, the range of `n ↦ (tail ^ n)(l)` as a list. -- Example: -- tails [] = [[]] -- tails [a] = [[a] , []] -- tails [a,b] = [[a,b] , [b] , []] -- tails [a,b,c] = [[a,b,c] , [b,c] , [c] , []] -- Note: `∀{l} → (tails l = accumulateIterate (length l) tail l)`. tails : List(T) → List(List(T)) tails ∅ = singleton(∅) tails (x ⊰ l) = (x ⊰ l) ⊰ tails l -- Applies a binary operator to each element in the list starting with the initial element. -- Example: -- foldₗ(▫)(init)[] = init -- foldₗ(▫)(init)[a] = init▫a -- foldₗ(▫)(init)[a,b] = (init▫a)▫b -- foldₗ(▫)(init)[a,b,c,d,e] = ((((init▫a)▫b)▫c)▫d)▫e foldₗ : (Result → T → Result) → Result → List(T) → Result foldₗ _ result ∅ = result foldₗ _▫_ result (elem ⊰ l) = foldₗ _▫_ (result ▫ elem) l -- Applies a binary operator to each element in the list starting with the initial element. -- Example: -- foldᵣ(▫)(init)[] = init -- foldᵣ(▫)(init)[a] = a▫init -- foldᵣ(▫)(init)[a,b] = a▫(b▫init) -- foldᵣ(▫)(init)[a,b,c,d,e] = a▫(b▫(c▫(d▫(e▫init)))) foldᵣ : (T → Result → Result) → Result → List(T) → Result foldᵣ _ init ∅ = init foldᵣ _▫_ init (elem ⊰ l) = elem ▫ (foldᵣ _▫_ init l) -- Applies a binary operator to each element in the list starting with the initial element. -- Example: -- foldᵣ-init(▫)(init)[] = init -- foldᵣ-init(▫)(init)[a] = init▫a -- foldᵣ-init(▫)(init)[a,b] = init▫(a▫b) -- foldᵣ-init(▫)(init)[a,b,c,d,e] = init▫(a▫(b▫(c▫(d▫e)))) -- Same as (reduceOrᵣ (_▫_) (a) (a⊰l)) except that -- this allows matching out one element when -- there is only a first element as the head -- and an _arbitrary_ list as the tail. -- Also, this dIffers from foldᵣ in the following way: -- foldᵣ (_▫_) (1) [2,3] = 2 ▫ (3 ▫ 1) -- foldᵣ-init (_▫_) (1) [2,3] = 1 ▫ (2 ▫ 3) -- Also: foldᵣ-init(▫)(init)(l++[last]) = foldᵣ(▫)(last)(init⊰l) foldᵣ-init : (T → T → T) → T → List(T) → T foldᵣ-init _ init ∅ = init foldᵣ-init _▫_ init (elem ⊰ l) = init ▫ (foldᵣ-init _▫_ elem l) -- If the list is empty, use the result, else like foldₗ -- Example: -- reduceOrₗ(▫)(result)[] = result -- reduceOrₗ(▫)(result)[a] = a -- reduceOrₗ(▫)(result)[a,b] = a▫b -- reduceOrₗ(▫)(result)[a,b,c] = (a▫b)▫c -- reduceOrₗ(▫)(result)[a,b,c,d,e] = (((a▫b)▫c)▫d)▫e reduceOrₗ : (T → T → T) → T → List(T) → T reduceOrₗ _ result ∅ = result reduceOrₗ _▫_ result (elem ⊰ l) = foldₗ _▫_ elem l -- If the list is empty, use the result, else like foldᵣ -- Example: -- reduceOrᵣ(▫)(result)[] = result -- reduceOrᵣ(▫)(result)[a] = a -- reduceOrᵣ(▫)(result)[a,b] = a▫b -- reduceOrᵣ(▫)(result)[a,b,c] = a▫(b▫c) -- reduceOrᵣ(▫)(result)[a,b,c,d,e] = a▫(b▫(c▫(d▫e))) reduceOrᵣ : (T → T → T) → T → List(T) → T reduceOrᵣ _ init ∅ = init reduceOrᵣ _▫_ init (elem ⊰ l) = foldᵣ-init _▫_ elem l -- Accumulates the results of every step in `foldₗ` into a list. -- Example: -- accumulateFoldₗ(_▫_) result [] = [result] -- accumulateFoldₗ(_▫_) result [a] = [result▫a] -- accumulateFoldₗ(_▫_) result [a,b] = [result▫a , (result▫a)▫b] -- accumulateFoldₗ(_▫_) result [a,b,c] = [result▫a , (result▫a)▫b , ((result▫a)▫b)▫c] -- accumulateFoldₗ(_▫_) result [a,b,c,d] = [result▫a , (result▫a)▫b , ((result▫a)▫b)▫c , (((result▫a)▫b)▫c)▫d] accumulateFoldₗ : (Result → T → Result) → Result → List(T) → List(Result) accumulateFoldₗ(_▫_) result ∅ = singleton(result) accumulateFoldₗ(_▫_) result (x ⊰ l) = result ⊰ accumulateFoldₗ(_▫_) (result ▫ x) l -- Accumulates the results of every step in `reduceₗ` into a list. -- Example: -- accumulateReduceₗ(_▫_) [] = [] -- accumulateReduceₗ(_▫_) [a] = [a] -- accumulateReduceₗ(_▫_) [a,b] = [a , a▫b] -- accumulateReduceₗ(_▫_) [a,b,c] = [a , a▫b , (a▫b)▫c] -- accumulateReduceₗ(_▫_) [a,b,c,d] = [a , a▫b , (a▫b)▫c , ((a▫b)▫c)▫d] accumulateReduceₗ : (T → T → T) → List(T) → List(T) accumulateReduceₗ(_▫_) ∅ = ∅ accumulateReduceₗ(_▫_) (x ⊰ l) = accumulateFoldₗ(_▫_) x l -- Accumulates the results of every step in `_^_` into a list. -- Example: -- accumulateIterate₀ 0 f(x) = [] -- accumulateIterate₀ 1 f(x) = [x] -- accumulateIterate₀ 2 f(x) = [x , f(x)] -- accumulateIterate₀ 3 f(x) = [x , f(x) , f(f(x))] -- accumulateIterate₀ 4 f(x) = [x , f(x) , f(f(x)) , f(f(f(x)))] accumulateIterate₀ : ℕ → (T → T) → (T → List(T)) accumulateIterate₀ 𝟎 f(x) = ∅ accumulateIterate₀ (𝐒(n)) f(x) = x ⊰ accumulateIterate₀ n f (f(x)) -- Accumulates the results of every step in `_^_` into a list. -- Example: -- accumulateIterate 0 f(x) = [x] -- accumulateIterate 1 f(x) = [x , f(x)] -- accumulateIterate 2 f(x) = [x , f(x) , f(f(x))] -- accumulateIterate 3 f(x) = [x , f(x) , f(f(x)) , f(f(f(x)))] -- accumulateIterate 4 f(x) = [x , f(x) , f(f(x)) , f(f(f(x))) , f(f(f(f(x))))] accumulateIterate : ℕ → (T → T) → (T → List(T)) accumulateIterate n = accumulateIterate₀(𝐒(n)) -- List concatenation. -- Concatenates (joins/glues) two lists together. -- Examples: -- [] ++ [] = [] -- [a] ++ [b] = [a,b] -- [a,b,c] ++ [d,e,f] = [a,b,c,d,e,f] _++_ : List(T) → List(T) → List(T) _++_ = swap(foldᵣ (_⊰_)) -- Concatenates multiple lists together. -- Examples: -- concat [[a,b,c] , [d,e] , [f] , [g,h]] -- = [a,b,c] ++ [d,e] ++ [f] ++ [g,h] = -- = [a,b,c,d,e,f,g,h] concat : List(List(T)) → List(T) concat = foldᵣ(_++_) ∅ -- Postpends an element to a list, inserting it to the end of the list. -- Examples: -- postpend a [] = [a] -- postpend b [a] = [a,b] -- postpend c [a,b] = [a,b,c] -- postpend d [a,b,c] = [a,b,c,d] postpend : T → List(T) → List(T) postpend a ∅ = a ⊰ ∅ postpend a (x ⊰ l) = x ⊰ postpend a l -- Inserts an element to a list, inserting it at the given position of the list. -- If the given position is out of range, then the element is postpended to the list. -- Examples: -- insert 2 x [] = [x] -- insert 2 x [a] = [a,x] -- insert 2 x [a,b] = [a,b,x] -- insert 2 x [a,b,c] = [a,b,x,c] -- insert 2 x [a,b,c,d] = [a,b,x,c,d] insert : ℕ → T → List(T) → List(T) insert 𝟎 = _⊰_ insert (𝐒(_)) a ∅ = singleton a insert (𝐒(i)) a (x ⊰ l) = x ⊰ insert i a l module LongOper where pattern empty = ∅ pattern prepend elem list = elem ⊰ list -- Applies a function on each element in the list -- Examples: -- map f[] = [] -- map f[a] = [f(a)] -- map f[a,b] = [f(a),f(b)] -- map f[a,b,c] = [f(a),f(b),f(c)] map : (A → B) → (List(A) → List(B)) map _ ∅ = ∅ map f (x ⊰ l) = f(x) ⊰ (map f l) -- Filters the list while mapping it mapFilter : (A → Option(B)) → (List(A) → List(B)) mapFilter _ ∅ = ∅ mapFilter f (x ⊰ l) with f(x) ... | Option.Some(y) = y ⊰ (mapFilter f l) ... | Option.None = mapFilter f l -- Maps every element to a list in the given list and then concatenates the resulting list. -- Note: Functionally equivalent to: `concat ∘₂ map`. -- Example: `concatMap(x ↦ [x , x + 1 , x + 2]) [10,20,30,40] = [10,11,12 , 20,21,22 , 30,31,32 , 40,41,42]` -- Alternative implementation: -- concatMap f ∅ = ∅ -- concatMap f (x ⊰ l) = f(x) ++ concatMap f l concatMap : (A → List(B)) → (List(A) → List(B)) concatMap f = foldᵣ((_++_) ∘ f) ∅ -- The nth element in the list -- Examples: -- • `index₀ 0 [a,b,c] = Some a` -- • `index₀ 1 [a,b,c] = Some b` -- • `index₀ 2 [a,b,c] = Some c` -- • `index₀ 3 [a,b,c] = None` -- • `index₀ 4 [a,b,c] = None` index₀ : ℕ → List(T) → Option(T) index₀ _ ∅ = Option.None index₀ 𝟎 (x ⊰ _) = Option.Some(x) index₀ (𝐒(n)) (_ ⊰ l) = index₀ n l -- The sublist with the first n elements in the list. -- Also called: "take" in the Haskell standard library. -- Example: -- • `initial 0 [1,2,3] = []` -- • `initial 1 [1,2,3] = [1]` -- • `initial 2 [1,2,3] = [1,2]` -- • `initial 3 [1,2,3] = [1,2,3]` -- • `initial 4 [1,2,3] = [1,2,3]` -- • `initial 5 [1,2,3] = [1,2,3]` initial : ℕ → List(T) → List(T) initial _ ∅ = ∅ initial 𝟎 (_ ⊰ _) = ∅ initial (𝐒(n)) (x ⊰ l) = x ⊰ (initial n l) -- The sublist without the first n elements in the list -- Example: -- • `skip 0 [1,2,3] = [1,2,3]` -- • `skip 1 [1,2,3] = [2,3]` -- • `skip 2 [1,2,3] = [3]` -- • `skip 3 [1,2,3] = []` -- • `skip 4 [1,2,3] = []` -- • `skip 5 [1,2,3] = []` skip : ℕ → List(T) → List(T) skip _ ∅ = ∅ skip 𝟎 l@(_ ⊰ _) = l skip (𝐒(n)) (x ⊰ l) = skip n l -- TODO: Maybe rename this to "extractFirst"? -- Extracts the first element from the list if there is one. -- Example: `splitFirst [1,2,3] = Some(1 , [2,3])` splitFirst : List(T) → Option(T ⨯ List(T)) splitFirst ∅ = Option.None splitFirst (x ⊰ l) = Option.Some(x , l) -- Extracts the last element from the list if there is one. -- Example: `splitLast [1,2,3] = Some([1,2] , 3)` splitLast : List(T) → Option(List(T) ⨯ T) splitLast ∅ = Option.None splitLast (x ⊰ ∅) = Option.Some(∅ , x) splitLast (x ⊰ y ⊰ l) = Option.map (Tuple.mapLeft (x ⊰_)) (splitLast (y ⊰ l)) -- Split a list into two sublist parts at the specified index. -- The first list's length is the specified index. -- The second list starts at the specified index. -- Example: -- splitAt 0 [a,b,c,d] = ([] , [a,b,c,d]) -- splitAt 1 [a,b,c,d] = ([a] , [b,c,d]) -- splitAt 2 [a,b,c,d] = ([a,b] , [c,d]) -- splitAt 3 [a,b,c,d] = ([a,b,c] , [d]) -- splitAt 4 [a,b,c,d] = ([a,b,c,d] , []) -- splitAt 5 [a,b,c,d] = ([a,b,c,d] , []) splitAt : ℕ → List(T) → (List(T) ⨯ List(T)) splitAt 𝟎 l = (∅ , l) splitAt (𝐒 n) ∅ = (∅ , ∅) splitAt (𝐒 n) (x ⊰ l) = Tuple.mapLeft (x ⊰_) (splitAt n l) -- All ordered sublist partitions of the specified list with only two parts. -- splits₂ : List(T) → List(List(T) ⨯ List(T)) splits₂ l = (∅ , l) ⊰ f ∅ l where f : List(T) → List(T) → List(List(T) ⨯ List(T)) f _ ∅ = ∅ f a (x ⊰ b) = (postpend x a , b) ⊰ f (postpend x a) b -- Length of the list (number of elements in the list). -- Examples: -- • `length [] = 0` -- • `length [a] = 1` -- • `length [a,b] = 2` -- • `length [a,b,c] = 3` -- • `length [b,c,a] = 3` -- • `length [c,a,b] = 3` -- • `length [b,a,c] = 3` -- • `length [a,c,b] = 3` -- • `length [b,a,c] = 3` length : List(T) → ℕ length = foldᵣ (const 𝐒) 0 -- The nth element in the list as a total function. index : (l : List(T)) → 𝕟(length(l)) → T index ∅ () index (x ⊰ l) 𝟎 = x index (x ⊰ l) (𝐒 n) = index l n -- The sublist with the last n elements in the list -- last : ℕ → List(T) → List(T) -- last n l = skip(length(l) −₀ ) l -- TODO: Generalize mapWindow2ₗ : (T → T → T) → List(T) → List(T) mapWindow2ₗ f (x₁ ⊰ x₂ ⊰ l) = (f x₁ x₂) ⊰ (mapWindow2ₗ f (x₂ ⊰ l)) {-# CATCHALL #-} mapWindow2ₗ _ _ = ∅ _orₗ_ : List(T) → List(T) → List(T) _orₗ_ ∅ default = default _orₗ_ (l @(_ ⊰ _)) _ = l -- Reverse the order of the elements in the list. -- Example: `reverse [a,b,c,d] = [d,c,b,a]`. reverse : List(T) → List(T) reverse ∅ = ∅ reverse (x ⊰ l) = postpend x (reverse l) import Function.Iteration as Function -- The list with a list concatenated (repeated) n times. -- Example: `[a,b,c] ++^ 4 = [a,b,c] ++ [a,b,c] ++ [a,b,c] ++ [a,b,c] = [a,b,c , a,b,c , a,b,c , a,b,c]`. _++^_ : List(T) → ℕ → List(T) _++^_ l n = Function.repeatᵣ n (_++_) l ∅ -- The list with an element repeated n times -- Example: `repeat a 4 = [a,a,a,a]`. repeat : T → ℕ → List(T) repeat = (_++^_) ∘ singleton -- Whether at least one element in the list satisfies the given boolean predicate function. -- Note: `∀{pred}{l} → (satisfiesAny pred l = foldᵣ((_||_) ∘ pred) 𝐹 l)`. They are functionally equivalent but the difference is that this exits early when something false is found which is good for performance. satisfiesAny : (T → Bool) → List(T) → Bool satisfiesAny pred ∅ = 𝐹 satisfiesAny pred (x ⊰ l) with pred(x) ... | 𝑇 = 𝑇 ... | 𝐹 = satisfiesAny(pred)(l) -- Whether all elements in the list satisfies the given boolean predicate function. -- Note: `∀{pred}{l} → (satisfiesAll pred l = foldᵣ((_&&_) ∘ pred) 𝑇 l)`. They are functionally equivalent but the difference is that this exits early when something false is found which is good for performance. satisfiesAll : (T → Bool) → List(T) → Bool satisfiesAll pred ∅ = 𝑇 satisfiesAll pred (x ⊰ l) with pred(x) ... | 𝑇 = satisfiesAll(pred)(l) ... | 𝐹 = 𝐹 satisfiesAll₂ : (T → T → Bool) → (T → Bool) → (T → Bool) → (List(T) → List(T) → Bool) satisfiesAll₂(_▫_) l r ∅ ∅ = 𝑇 satisfiesAll₂(_▫_) l r l₁@(_ ⊰ _) ∅ = satisfiesAll l l₁ satisfiesAll₂(_▫_) l r ∅ l₂@(_ ⊰ _) = satisfiesAll r l₂ satisfiesAll₂(_▫_) l r (x₁ ⊰ l₁) (x₂ ⊰ l₂) = (x₁ ▫ x₂) && satisfiesAll₂(_▫_) l r l₁ l₂ {-satisfiesAll₂(_▫_) l r (x₁ ⊰ l₁) (x₂ ⊰ l₂) with (x₁ ▫ x₂) ... | 𝑇 = satisfiesAll₂(_▫_) l r l₁ l₂ ... | 𝐹 = 𝐹-} -- TODO -- List-apply : ∀{L : List(Type{ℓ})} → (foldᵣ (_⨯_) (Out) (L)) → ∀{Out : Type{ℓ}} → (foldᵣ (_→ᶠ_) (Out) (L)) → Out -- List-apply(∅) (f) = f -- List-apply(head ⊰ rest) (f) = List-apply(rest) (f(head)) -- fn-to-list : ∀{L : List(Type{ℓ})}{Out : Type{ℓ}} → (foldᵣ (_→ᶠ_) (Out) (L)) → (List(Type{ℓ}) → Out) -- fn-to-list{∅} = -- Replacing the nth element in the list. -- Example: `modifyAt 2 f [a,b,c,d] = [a,b,f(c),d]`. modifyAt : ℕ → (T → T) → List(T) → List(T) modifyAt _ f ∅ = ∅ modifyAt 𝟎 f (x ⊰ l) = f(x) ⊰ l modifyAt (𝐒(n)) f (x ⊰ l) = x ⊰ modifyAt n f l -- Example: `replaceAt 2 x [a,b,c,d] = [a,b,x,d]`. replaceAt : ℕ → T → List(T) → List(T) replaceAt n = modifyAt n ∘ const -- The list without the nth element in the list -- Example: `withoutIndex 2 [a,b,c,d] = [a,b,d]`. withoutIndex : ℕ → List(T) → List(T) withoutIndex _ ∅ = ∅ withoutIndex 𝟎 (_ ⊰ l) = l withoutIndex (𝐒(n)) (x ⊰ l) = x ⊰ withoutIndex(n)(l) -- Example: `swapIndex 1 3 [a,b,c,d,e,f] = [a,d,c,b,e,f]`. swapIndex : ℕ → ℕ → List(T) → List(T) swapIndex _ _ ∅ = ∅ swapIndex 𝟎 𝟎 (x ⊰ l) = (x ⊰ l) swapIndex (𝐒(a)) 𝟎 (x ⊰ l) = Option.map(_⊰ replaceAt a x l) (index₀ a l) Option.or (x ⊰ l) swapIndex 𝟎 (𝐒(b)) (x ⊰ l) = Option.map(_⊰ replaceAt b x l) (index₀ b l) Option.or (x ⊰ l) swapIndex (𝐒(a)) (𝐒(b)) (x ⊰ l) = x ⊰ swapIndex a b l -- The given list with only the elements that satisfy the given predicate (without the elements that do not satisfy the given predicate). -- Example: `filter(_<? 10) [0,10,11,1,2,12,3,13,14,4,5] = [0,1,2,3,4,5]`. filter : (T → Bool) → List(T) → List(T) filter f(∅) = ∅ filter f(x ⊰ l) = (if f(x) then (x ⊰_) else id) (filter f(l)) -- Finds the first element that satisfies the given predicate in the given list. find : (T → Bool) → List(T) → Option(T) find f(∅) = Option.None find f(x ⊰ l) with f(x) ... | 𝑇 = Option.Some(x) ... | 𝐹 = find f(l) -- Finds and extracts the first element satisfying the given predicate. -- Example: `extractFirst(_> 2) [0,1,2,3,4,5] = Some(3 , [0,1,2,4,5])`. extractFirstBy : (T → Bool) → List(T) → Option(T ⨯ List(T)) extractFirstBy f(∅) = Option.None extractFirstBy f(x ⊰ l) with f(x) ... | 𝑇 = Option.Some(x , l) ... | 𝐹 = Option.map(Tuple.mapRight(x ⊰_)) (extractFirstBy f(l)) -- The number of elements satisfying the given predicate in the given list. count : (T → Bool) → List(T) → ℕ count f(∅) = 𝟎 count f(x ⊰ l) = (if f(x) then 𝐒 else id) (count f(l)) -- Whether the given list is the empty list. isEmpty : List(T) → Bool isEmpty(∅) = 𝑇 isEmpty(_ ⊰ _) = 𝐹 -- Separates a list into 2 lists of almost equal length putting every other element into different lists. -- Example: -- separate₂ [] = ([] , []) -- separate₂ [a] = ([a] , []) -- separate₂ [a,b] = ([a] , [b]) -- separate₂ [a,b,c] = ([a,c] , [b]) -- separate₂ [a,b,c,d] = ([a,c] , [b,d]) -- separate₂ [a,b,c,d,e] = ([a,c,e] , [b,d]) separate₂ : List(T) → (List(T) ⨯ List(T)) separate₂ ∅ = (∅ , ∅) separate₂ (x ⊰ ∅) = (singleton x , ∅) separate₂ (x ⊰ y ⊰ l) = Tuple.map (x ⊰_) (y ⊰_) (separate₂ l) -- Example: -- interleave [[0,1,2],[10,11,12,13,14],[100,101]] = [0,10,100 , 1,11,101 , 2,12 , 13 , 14] -- Termination: -- Terminates because the argument in the recursion `map tail ls` shrinks every list until they all become empty, and when all lists are empty, the function branches to the other trivially terminating case. {-# TERMINATING #-} interleave : List(List(T)) → List(T) interleave ls with satisfiesAll isEmpty ls ... | 𝑇 = ∅ ... | 𝐹 = foldᵣ (Option.partialMap id (_⊰_) ∘ first) (interleave(map tail ls)) ls -- Note: This is similiar to a function called `zipWith` in the Haskell standard library. -- TODO: Generalize like https://stackoverflow.com/questions/39991581/how-can-i-implement-generalized-zipn-and-unzipn-in-haskell map₂ : (A₁ → A₂ → B) → (List(A₁) → List(B)) → (List(A₂) → List(B)) → (List(A₁) → List(A₂) → List(B)) map₂ f g₁ g₂ ∅ ∅ = ∅ map₂ f g₁ g₂ ∅ l₂@(_ ⊰ _) = g₂ l₂ map₂ f g₁ g₂ l₁@(_ ⊰ _) ∅ = g₁ l₁ map₂ f g₁ g₂ (x₁ ⊰ l₁) (x₂ ⊰ l₂) = f x₁ x₂ ⊰ map₂ f g₁ g₂ l₁ l₂ -- Rotates to the left. -- Example: -- rotateₗ 3 [a,b,c,d,e] -- = rotateₗ 2 [b,c,d,e,a] -- = rotateₗ 1 [c,d,e,a,b] -- = rotateₗ 0 [d,e,a,b,c] -- = [d,e,a,b,c] rotateₗ : ℕ → List(T) → List(T) rotateₗ 𝟎 l = l rotateₗ (𝐒(n)) ∅ = ∅ rotateₗ (𝐒(n)) (x ⊰ l) = postpend x (rotateₗ n l) rotateᵣ : ℕ → List(T) → List(T) rotateᵣ n l with splitLast l ... | Option.None = ∅ ... | Option.Some(r , x) = x ⊰ r -- Examples: -- every n [] = [] -- every 0 [0,1,2,3,4,5,6,7,8] = [] -- every 1 [0,1,2,3,4,5,6,7,8] = [0,1,2,3,4,5,6,7,8] -- every 2 [0,1,2,3,4,5,6,7,8] = [0,2,4,6,8] -- every 3 [0,1,2,3,4,5,6,7,8] = [0,3,6] -- every 4 [0,1,2,3,4,5,6,7,8] = [0,4,8] -- every 5 [0,1,2,3,4,5,6,7,8] = [0,5] -- every 6 [0,1,2,3,4,5,6,7,8] = [0,6] -- every 7 [0,1,2,3,4,5,6,7,8] = [0,7] -- every 8 [0,1,2,3,4,5,6,7,8] = [0,8] -- every 9 [0,1,2,3,4,5,6,7,8] = [0] -- every 10 [0,1,2,3,4,5,6,7,8] = [0] -- Alternative implementations: -- • every n l = map head (accumulateIterate₀ (length(n) ⌈/₀⌉ n) (skip n) l) -- every 0 _ = ∅ -- every 1 l = l -- every (𝐒(𝐒(n))) ∅ = ∅ -- • every (𝐒(𝐒(n))) (x ⊰ l) = x ⊰ every (𝐒(𝐒(n))) (skip (𝐒(n)) l) every : ℕ → List(T) → List(T) every 𝟎 = const ∅ every (𝐒(n)) = impl 𝟎 where -- TODO: Is it possible to prove stuff about `every` when `impl` is hidden in a where clause? `impl` essentially contains a counter, so an alternative implementation would be having `every` having two arguments. impl : ℕ → List(T) → List(T) impl _ ∅ = ∅ impl 𝟎 (x ⊰ l) = x ⊰ impl n l impl (𝐒 k) (x ⊰ l) = impl k l -- Examples: -- separate 0 [0,1,2,3,4,5,6,7,8] = [] -- separate 1 [0,1,2,3,4,5,6,7,8] = [[0,1,2,3,4,5,6,7,8]] -- separate 2 [0,1,2,3,4,5,6,7,8] = [[0,2,4,6,8],[1,3,5,7]] -- separate 3 [0,1,2,3,4,5,6,7,8] = [[0,3,6],[1,4,7],[2,5,8]] -- separate 4 [0,1,2,3,4,5,6,7,8] = [[0,4,8],[1,5],[2,6],[3,7]] -- separate 5 [0,1,2,3,4,5,6,7,8] = [[0,5],[1,6],[2,7],[3,8],[4]] -- separate 6 [0,1,2,3,4,5,6,7,8] = [[0,6],[1,7],[2,8],[3],[4],[5]] -- separate 7 [0,1,2,3,4,5,6,7,8] = [[0,7],[1,8],[2],[3],[4],[5],[6]] -- separate 8 [0,1,2,3,4,5,6,7,8] = [[0,8],[1],[2],[3],[4],[5],[6],[7]] -- separate 9 [0,1,2,3,4,5,6,7,8] = [[0],[1],[2],[3],[4],[5],[6],[7],[8]] -- separate 10 [0,1,2,3,4,5,6,7,8] = [[0],[1],[2],[3],[4],[5],[6],[7],[8],[]] -- separate 11 [0,1,2,3,4,5,6,7,8] = [[0],[1],[2],[3],[4],[5],[6],[7],[8],[],[]] separate : ℕ → List(T) → List(List(T)) separate n l = map (every n) (accumulateIterate₀ n tail l) insertIn : T → (l : List(T)) → 𝕟₌(length l) → List(T) insertIn a l 𝟎 = a ⊰ l insertIn a ∅ (𝐒(_)) = singleton a insertIn a (x ⊰ l) (𝐒(i)) = x ⊰ insertIn a l i
{ "alphanum_fraction": 0.54620575, "avg_line_length": 39.1800766284, "ext": "agda", "hexsha": "2425d3491c200723936325bc4230c403f72a7d21", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Lolirofle/stuff-in-agda", "max_forks_repo_path": "Data/List/Functions.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Lolirofle/stuff-in-agda", "max_issues_repo_path": "Data/List/Functions.agda", "max_line_length": 213, "max_stars_count": 6, "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_path": "Data/List/Functions.agda", "max_stars_repo_stars_event_max_datetime": "2022-02-05T06:53:22.000Z", "max_stars_repo_stars_event_min_datetime": "2020-04-07T17:58:13.000Z", "num_tokens": 8556, "size": 20452 }
{-# OPTIONS --universe-polymorphism --no-positivity-check #-} module Alg-IIR where data Level : Set where zero : Level suc : Level -> Level {-# BUILTIN LEVEL Level #-} {-# BUILTIN LEVELZERO zero #-} {-# BUILTIN LEVELSUC suc #-} max : Level -> Level -> Level max zero m = m max (suc n) zero = suc n max (suc n) (suc m) = suc (max n m) {-# BUILTIN LEVELMAX max #-} _o_ : ∀ {a b c} {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} → (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) → ((x : A) → C (g x)) f o g = λ x → f (g x) infixl 50 _o_ record Sg {a b : Level}(S : Set a)(T : S -> Set b) : Set (max a b) where constructor _,_ field fst : S snd : T fst infixr 40 _,_ record Lifted {l : Level} (A : Set l) : Set (suc l) where constructor lif field fil : A open Lifted lift : {i : Level} -> Set i -> Set (suc i) lift x = Lifted x unl : {l r : Level}{A : Set l}{P : Lifted A -> Set r} -> ((a : A) -> P (lif a)) -> (a : Lifted A) -> P a unl p a = p (fil a) mutual data IRD (I : Set1)(J : I -> Set1) : Set1 where var : I -> IRD I J con : Set -> IRD I J _*_ : (S : IRD I J) -> (Deco S -> IRD I J) -> IRD I J _>_ : (S : Set) -> (S -> IRD I J) -> IRD I J Deco : forall {I J} -> IRD I J -> Set1 Deco {I}{J} (var i) = J i Deco (con A) = lift A -- grr Deco (S * T) = Sg (Deco S) \ s -> Deco (T s) Deco (S > T) = (s : S) -> Deco (T s) _-:>_ : forall {a b c}{I : Set a} -> (I -> Set b) -> (I -> Set c) -> Set (max a (max b c)) _-:>_ {I = I} S T = (i : I) -> S i -> T i mutual Func : forall {I J} -> IRD I J -> (X : I -> Set)(d : X -:> J) -> Set Func (var i) X d = X i Func (con A) X d = A Func (S * T) X d = Sg (Func S X d) \ s -> Func (T (deco S X d s)) X d Func (S > T) X d = (s : S) -> Func (T s) X d deco : forall {I J} -> (D : IRD I J) -> (X : I -> Set)(d : X -:> J) -> Func D X d -> Deco D deco (var i) X d x = d i x deco (con A) X d a = lif a deco (S * T) X d (s , t) = s' , t' where s' = deco S X d s t' = deco (T s') X d t deco (S > T) X d f = \ s -> deco (T s) X d (f s) mutual data DATA {I J}(F : I -> IRD I J)(d : (Deco o F) -:> J)(i : I) : Set where <_> : Func (F i) (DATA F d) decode -> DATA F d i decode : forall {I J}{F : I -> IRD I J}{d : (Deco o F) -:> J} -> DATA F d -:> J decode {I}{J}{F}{d} i < xs > = d i (deco (F i) (DATA F d) decode xs) data MyTags : Set where zz ss : MyTags [_/_] : forall {l}{P : MyTags -> Set l} -> P zz -> P ss -> (t : MyTags) -> P t [ z / s ] zz = z [ z / s ] ss = s record One {a} : Set a where constructor <> NAT : One {suc zero} -> IRD One \ _ -> One NAT _ = con MyTags * unl [ con One / var _ ] Nat : Set Nat = DATA NAT _ _ myze : Nat myze = < zz , _ > mysu : Nat -> Nat mysu n = < ss , n > data Two : Set where tt ff : Two not : Two -> Two not tt = ff not ff = tt _&&_ : Two -> Two -> Two tt && b = b ff && b = ff _=N=_ : Nat -> Nat -> Two < zz , _ > =N= < zz , _ > = tt < zz , _ > =N= < ss , _ > = ff < ss , _ > =N= < zz , _ > = ff < ss , m > =N= < ss , n > = m =N= n data Zero : Set where So : Two -> Set So tt = One So ff = Zero FREL : One {suc zero} -> IRD One \ _ -> Lifted (Nat -> Two) FREL _ = con MyTags * unl [ con One / (var _ * unl \ f -> con Nat * unl \ x -> con (So (f x))) ] frel : Deco o FREL -:> \ _ -> Lifted (Nat -> Two) frel _ (lif zz , _) = lif \ _ -> tt frel _ (lif ss , lif f , lif x , p) = lif \ y -> not (y =N= x) && f y Frel : Set Frel = DATA FREL frel _ good : Frel good = < ss , < ss , < ss , < zz , _ > , myze , _ > , mysu myze , _ > , mysu (mysu myze) , _ > {- bad : Frel bad = < ss , < ss , < ss , < zz , _ > , myze , _ > , mysu myze , _ > , myze , {!!} > -} UNI : One {suc zero} -> IRD One \ _ -> Set UNI _ = con MyTags * unl [ con One / (var _ * \ S -> S > \ _ -> var _) ] uni : Deco o UNI -:> \ _ -> Set uni i (lif zz , _) = Nat uni i (lif ss , S , T) = (s : S) -> T s
{ "alphanum_fraction": 0.4471702696, "avg_line_length": 23.9360465116, "ext": "agda", "hexsha": "a405ef3cfb626d1447fb8548debbadd6df289b44", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2022-03-12T11:51:42.000Z", "max_forks_repo_forks_event_min_datetime": "2022-03-12T11:51:42.000Z", "max_forks_repo_head_hexsha": "17b7858f51a35b3becb8433028c3f1ba25fbba9a", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "dataronio/epigram2", "max_forks_repo_path": "models/Alg-IIR.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "17b7858f51a35b3becb8433028c3f1ba25fbba9a", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "dataronio/epigram2", "max_issues_repo_path": "models/Alg-IIR.agda", "max_line_length": 78, "max_stars_count": 4, "max_stars_repo_head_hexsha": "17b7858f51a35b3becb8433028c3f1ba25fbba9a", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "dataronio/epigram2", "max_stars_repo_path": "models/Alg-IIR.agda", "max_stars_repo_stars_event_max_datetime": "2015-11-05T01:06:39.000Z", "max_stars_repo_stars_event_min_datetime": "2015-02-23T15:00:26.000Z", "num_tokens": 1698, "size": 4117 }
{-# OPTIONS --without-K --safe #-} open import Level open import Categories.Category using () renaming (Category to Setoid-Category) open import Categories.Category.Monoidal using (Monoidal) module Categories.Pseudofunctor.Instance.EnrichedUnderlying {o ℓ e} {V : Setoid-Category o ℓ e} (M : Monoidal V) (v : Level) where -- The "forgetful" functor from V-enriched categories to their -- underlying Setoid-categories. open import Data.Product as Prod using (_,_) open import Categories.Bicategory.Instance.Cats open import Categories.Bicategory.Instance.EnrichedCats M open import Categories.Enriched.Category M open import Categories.Enriched.Functor M open import Categories.Enriched.NaturalTransformation M import Categories.Morphism.Reasoning as MorphismReasoning open import Categories.NaturalTransformation using (ntHelper) open import Categories.NaturalTransformation.NaturalIsomorphism using (niHelper) open import Categories.Pseudofunctor using (Pseudofunctor) private module V = Setoid-Category V module UnderlyingReasoning {c} (C : Category c) where open Underlying C public hiding (id) open HomReasoning public open MorphismReasoning (Underlying C) public open NaturalTransformation using (_[_]) -- Aliases used to shorten some proof expressions module UF = UnderlyingFunctor infixr 14 _$₀_ _$₁_ _$₀_ = UF.F₀ _$₁_ = UF.F₁ -- The "forgetful" pseudofunctor mapping a V-enriched category to its -- underlying Setoid-category. -- -- Note that all the equational reasoning happens in the underlying -- (ordinary) categories! EnrichedUnderlying : Pseudofunctor (EnrichedCats v) (Cats v ℓ e) EnrichedUnderlying = record { P₀ = Underlying ; P₁ = record { F₀ = UnderlyingFunctor ; F₁ = UnderlyingNT ; identity = V.Equiv.refl ; homomorphism = V.Equiv.refl ; F-resp-≈ = λ eq → eq } ; P-identity = λ {C} → let module C = Underlying C open UnderlyingReasoning C in niHelper record { η = λ _ → ntHelper record { η = λ _ → C.id ; commute = λ f → begin C.id ∘ f ≈⟨ identityˡ ⟩ f ≈˘⟨ identityʳ ○ V.identityˡ ⟩ (V.id V.∘ f) ∘ C.id ∎ } ; η⁻¹ = λ _ → ntHelper record { η = λ _ → C.id ; commute = λ f → begin C.id ∘ (V.id V.∘ f) ≈⟨ identityˡ ○ V.identityˡ ⟩ f ≈˘⟨ identityʳ ⟩ f ∘ C.id ∎ } ; commute = λ _ → V.Equiv.refl ; iso = λ _ → record { isoˡ = C.identityˡ ; isoʳ = C.identityʳ } } ; P-homomorphism = λ {C D E} → let module C = Underlying C module D = Underlying D module E = Underlying E open UnderlyingReasoning E in niHelper record { η = λ{ (F , G) → ntHelper record { η = λ _ → E.id ; commute = λ f → begin E.id ∘ F $₁ G $₁ f ≈⟨ id-comm-sym ⟩ F $₁ G $₁ f ∘ E.id ≈˘⟨ V.assoc ⟩∘⟨refl ⟩ (F ∘F G) $₁ f ∘ E.id ∎ } } ; η⁻¹ = λ{ (F , G) → ntHelper record { η = λ _ → E.id ; commute = λ f → begin E.id ∘ (F ∘F G) $₁ f ≈⟨ id-comm-sym ⟩ (F ∘F G) $₁ f ∘ E.id ≈⟨ V.assoc ⟩∘⟨refl ⟩ F $₁ G $₁ f ∘ E.id ∎ } } ; commute = λ _ → id-comm-sym ; iso = λ _ → record { isoˡ = E.identityˡ ; isoʳ = E.identityʳ } } ; unitaryˡ = λ {_ D} → let module D = Underlying D open UnderlyingReasoning D in begin D.id ∘ D.id ∘ (V.id V.∘ D.id) ∘ D.id ≈⟨ identityˡ ○ identityˡ ⟩ (V.id V.∘ D.id) ∘ D.id ≈⟨ identityʳ ○ V.identityˡ ⟩ D.id ∎ ; unitaryʳ = λ {C D F X} → let module C = Underlying C module D = Underlying D open UnderlyingReasoning D in begin D.id ∘ D.id ∘ F $₁ C.id ∘ D.id ≈⟨ identityˡ ○ identityˡ ○ identityʳ ⟩ F $₁ C.id ≈⟨ UF.identity F ⟩ D.id ∎ ; assoc = λ {_ B C D F G H X} → let module B = Underlying B module C = Underlying C module D = Underlying D open UnderlyingReasoning D in ∘-resp-≈ʳ (begin D.id ∘ (H ∘F G) $₁ B.id ∘ D.id ≈⟨ refl⟩∘⟨ V.assoc ⟩∘⟨refl ⟩ D.id ∘ H $₁ G $₁ B.id ∘ D.id ≈⟨ refl⟩∘⟨ UF.F-resp-≈ H (UF.identity G) ⟩∘⟨refl ⟩ D.id ∘ H $₁ C.id ∘ D.id ≈⟨ id-comm-sym ⟩ (H $₁ C.id ∘ D.id) ∘ D.id ∎) }
{ "alphanum_fraction": 0.5511413521, "avg_line_length": 35.874015748, "ext": "agda", "hexsha": "02654b38e6ea3eb5af5826dec94e472f8b5a527a", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "MirceaS/agda-categories", "max_forks_repo_path": "src/Categories/Pseudofunctor/Instance/EnrichedUnderlying.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "MirceaS/agda-categories", "max_issues_repo_path": "src/Categories/Pseudofunctor/Instance/EnrichedUnderlying.agda", "max_line_length": 80, "max_stars_count": null, "max_stars_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "MirceaS/agda-categories", "max_stars_repo_path": "src/Categories/Pseudofunctor/Instance/EnrichedUnderlying.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 1527, "size": 4556 }
{- 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.Types import LibraBFT.Impl.Consensus.ConsensusTypes.Properties.VoteData as VoteDataProps import LibraBFT.Impl.Consensus.ConsensusTypes.VoteData as VoteData open import LibraBFT.Impl.Consensus.ConsensusTypes.QuorumCert as QuorumCert import LibraBFT.Impl.Types.LedgerInfoWithSignatures as LedgerInfoWithSignatures import LibraBFT.Impl.Types.Properties.LedgerInfoWithSignatures as LedgerInfoWithSignaturesProps open import LibraBFT.ImplShared.Base.Types open import LibraBFT.ImplShared.Consensus.Types open import Optics.All open import Util.Hash open import Util.KVMap as Map open import Util.Prelude module LibraBFT.Impl.Consensus.ConsensusTypes.Properties.QuorumCert (self : QuorumCert) (vv : ValidatorVerifier) where voteHash = hashVD (self ^∙ qcVoteData) record rnd≡0Props : Set where field par≡cert : self ^∙ qcParentBlock ≡ self ^∙ qcCertifiedBlock cert≡li : self ^∙ qcCertifiedBlock ≡ self ^∙ qcLedgerInfo ∙ liwsLedgerInfo ∙ liCommitInfo noSigs : Map.kvm-size (self ^∙ qcLedgerInfo ∙ liwsSignatures) ≡ 0 open rnd≡0Props record rnd≢0Props : Set where field sigProp : LedgerInfoWithSignatures.verifySignatures (self ^∙ qcLedgerInfo) vv ≡ Right unit vdProp : VoteDataProps.Contract (self ^∙ qcVoteData) open rnd≢0Props ParentProps : Dec (self ^∙ qcCertifiedBlock ∙ biRound ≡ 0) → Set ParentProps (yes _) = rnd≡0Props ParentProps (no _) = rnd≢0Props record Contract : Set where field lihash≡ : self ^∙ qcSignedLedgerInfo ∙ liwsLedgerInfo ∙ liConsensusDataHash ≡ voteHash rnd≟0 : Dec (self ^∙ qcCertifiedBlock ∙ biRound ≡ 0) parProp : ParentProps rnd≟0 open Contract contract : ∀ (r : Either ErrLog Unit) → r ≡ Right unit → QuorumCert.verify self vv ≡ r → Contract contract (Left fakeErr) with (self ^∙ qcSignedLedgerInfo ∙ liwsLedgerInfo ∙ liConsensusDataHash) ≟Hash (hashVD (self ^∙ qcVoteData)) ...| no neq = λ () ...| yes refl with self ^∙ qcCertifiedBlock ∙ biRound ≟ 0 ...| yes refl with (self ^∙ qcParentBlock) ≟-BlockInfo (self ^∙ qcCertifiedBlock) ...| no neq = λ () ...| yes refl with (self ^∙ qcCertifiedBlock) ≟-BlockInfo (self ^∙ qcLedgerInfo ∙ liwsLedgerInfo ∙ liCommitInfo) ...| no neq = λ () ...| yes refl with Map.kvm-size (self ^∙ qcLedgerInfo ∙ liwsSignatures) ≟ 0 ...| yes noSigs = λ () contract (Right unit) with (self ^∙ qcSignedLedgerInfo ∙ liwsLedgerInfo ∙ liConsensusDataHash) ≟Hash (hashVD (self ^∙ qcVoteData)) ...| no neq = λ _ () ...| yes refl with self ^∙ qcCertifiedBlock ∙ biRound ≟ 0 ...| yes refl with (self ^∙ qcParentBlock) ≟-BlockInfo (self ^∙ qcCertifiedBlock) ...| no neq = λ _ () ...| yes refl with (self ^∙ qcCertifiedBlock) ≟-BlockInfo (self ^∙ qcLedgerInfo ∙ liwsLedgerInfo ∙ liCommitInfo) ...| no neq = λ _ () ...| yes refl with Map.kvm-size (self ^∙ qcLedgerInfo ∙ liwsSignatures) ≟ 0 ...| yes noSigs = λ _ _ → record { lihash≡ = refl ; rnd≟0 = yes refl ; parProp = record { par≡cert = refl ; cert≡li = refl ; noSigs = noSigs } } contract (Right unit) | yes refl | no neq with LedgerInfoWithSignatures.verifySignatures (self ^∙ qcLedgerInfo) vv | inspect (LedgerInfoWithSignatures.verifySignatures (self ^∙ qcLedgerInfo)) vv ...| Left err | [ R ] = λ _ () ...| Right unit | [ R ] with VoteData.verify (self ^∙ qcVoteData) | inspect VoteData.verify (self ^∙ qcVoteData) ...| Left err | _ = λ _ () ...| Right unit | [ R' ] = λ _ _ → record { lihash≡ = refl ; rnd≟0 = no neq ; parProp = record { sigProp = R ; vdProp = VoteDataProps.contract (self ^∙ qcVoteData) R' } }
{ "alphanum_fraction": 0.6326434619, "avg_line_length": 42.52, "ext": "agda", "hexsha": "f797719fe4b243fde2bbc8cc2a558cea5ac11854", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_forks_repo_licenses": [ "UPL-1.0" ], "max_forks_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_forks_repo_path": "src/LibraBFT/Impl/Consensus/ConsensusTypes/Properties/QuorumCert.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "UPL-1.0" ], "max_issues_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_issues_repo_path": "src/LibraBFT/Impl/Consensus/ConsensusTypes/Properties/QuorumCert.agda", "max_line_length": 118, "max_stars_count": null, "max_stars_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_stars_repo_licenses": [ "UPL-1.0" ], "max_stars_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_stars_repo_path": "src/LibraBFT/Impl/Consensus/ConsensusTypes/Properties/QuorumCert.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 1347, "size": 4252 }
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Introductions.Application {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.LogicalRelation open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.Properties open import Definition.LogicalRelation.Application open import Definition.LogicalRelation.Substitution open import Definition.LogicalRelation.Substitution.Introductions.SingleSubst open import Definition.LogicalRelation.Substitution.Introductions.Pi open import Definition.LogicalRelation.Substitution.Weakening import Definition.LogicalRelation.Substitution.Irrelevance as S open import Tools.Product import Tools.PropositionalEquality as PE import Data.Nat as Nat -- Application of valid terms. appᵛ : ∀ {F G rF lF lG rΠ lΠ t u Γ l} ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) ([ΠFG] : Γ ⊩ᵛ⟨ l ⟩ Π F ^ rF ° lF ▹ G ° lG ° lΠ ^ [ rΠ , ι lΠ ] / [Γ]) ([t] : Γ ⊩ᵛ⟨ l ⟩ t ∷ Π F ^ rF ° lF ▹ G ° lG ° lΠ ^ [ rΠ , ι lΠ ] / [Γ] / [ΠFG]) ([u] : Γ ⊩ᵛ⟨ l ⟩ u ∷ F ^ [ rF , ι lF ] / [Γ] / [F]) → Γ ⊩ᵛ⟨ l ⟩ t ∘ u ^ lΠ ∷ G [ u ] ^ [ rΠ , ι lG ] / [Γ] / substSΠ {F} {G} {u} [Γ] [F] [ΠFG] [u] appᵛ {F} {G} {rF} {lF} {lG} {rΠ} {lΠ} {t} {u} [Γ] [F] [ΠFG] [t] [u] {σ = σ} ⊢Δ [σ] = let [G[u]] = substSΠ {F} {G} {u} [Γ] [F] [ΠFG] [u] [σF] = proj₁ ([F] ⊢Δ [σ]) [σΠFG] = proj₁ ([ΠFG] ⊢Δ [σ]) [σt] = proj₁ ([t] ⊢Δ [σ]) [σu] = proj₁ ([u] ⊢Δ [σ]) [σG[u]] = proj₁ ([G[u]] ⊢Δ [σ]) [σG[u]]′ = irrelevance′ (singleSubstLift G u) [σG[u]] in irrelevanceTerm′ (PE.sym (singleSubstLift G u)) PE.refl PE.refl [σG[u]]′ [σG[u]] (appTerm PE.refl [σF] [σG[u]]′ [σΠFG] [σt] [σu]) , (λ [σ′] [σ≡σ′] → let [σu′] = convTerm₂ [σF] (proj₁ ([F] ⊢Δ [σ′])) (proj₂ ([F] ⊢Δ [σ]) [σ′] [σ≡σ′]) (proj₁ ([u] ⊢Δ [σ′])) in irrelevanceEqTerm′ (PE.sym (singleSubstLift G u)) PE.refl PE.refl [σG[u]]′ [σG[u]] (app-congTerm [σF] [σG[u]]′ [σΠFG] (proj₂ ([t] ⊢Δ [σ]) [σ′] [σ≡σ′]) [σu] [σu′] (proj₂ ([u] ⊢Δ [σ]) [σ′] [σ≡σ′]))) -- Application congurence of valid terms. app-congᵛ : ∀ {F G rF lF lG rΠ lΠ t u a b Γ l} ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) ([ΠFG] : Γ ⊩ᵛ⟨ l ⟩ Π F ^ rF ° lF ▹ G ° lG ° lΠ ^ [ rΠ , ι lΠ ] / [Γ]) ([t≡u] : Γ ⊩ᵛ⟨ l ⟩ t ≡ u ∷ Π F ^ rF ° lF ▹ G ° lG ° lΠ ^ [ rΠ , ι lΠ ] / [Γ] / [ΠFG]) ([a] : Γ ⊩ᵛ⟨ l ⟩ a ∷ F ^ [ rF , ι lF ] / [Γ] / [F]) ([b] : Γ ⊩ᵛ⟨ l ⟩ b ∷ F ^ [ rF , ι lF ] / [Γ] / [F]) ([a≡b] : Γ ⊩ᵛ⟨ l ⟩ a ≡ b ∷ F ^ [ rF , ι lF ] / [Γ] / [F]) → Γ ⊩ᵛ⟨ l ⟩ t ∘ a ^ lΠ ≡ u ∘ b ^ lΠ ∷ G [ a ] ^ [ rΠ , ι lG ] / [Γ] / substSΠ {F} {G} {a} [Γ] [F] [ΠFG] [a] app-congᵛ {F} {G} {rF} {lF} {lG} {rΠ} {a = a} [Γ] [F] [ΠFG] [t≡u] [a] [b] [a≡b] ⊢Δ [σ] = let [σF] = proj₁ ([F] ⊢Δ [σ]) [G[a]] = proj₁ (substSΠ {F} {G} {a} [Γ] [F] [ΠFG] [a] ⊢Δ [σ]) [G[a]]′ = irrelevance′ (singleSubstLift G a) [G[a]] [σΠFG] = proj₁ ([ΠFG] ⊢Δ [σ]) [σa] = proj₁ ([a] ⊢Δ [σ]) [σb] = proj₁ ([b] ⊢Δ [σ]) in irrelevanceEqTerm′ (PE.sym (singleSubstLift G a)) PE.refl PE.refl [G[a]]′ [G[a]] (app-congTerm [σF] [G[a]]′ [σΠFG] ([t≡u] ⊢Δ [σ]) [σa] [σb] ([a≡b] ⊢Δ [σ])) appᵛ↑ : ∀ {F F' G rF rF' lF lF' lG rΠ lΠ t u Γ l} (lF≤ : lF ≤ lΠ) (lG≤ : lG ≤ lΠ) ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) ([F'] : Γ ⊩ᵛ⟨ l ⟩ F' ^ [ rF' , ι lF' ] / [Γ]) ([G] : Γ ∙ F ^ [ rF , ι lF ] ⊩ᵛ⟨ l ⟩ G ^ [ rΠ , ι lG ] / [Γ] ∙ [F]) ([ΠFG] : Γ ⊩ᵛ⟨ l ⟩ Π F ^ rF ° lF ▹ G ° lG ° lΠ ^ [ rΠ , ι lΠ ] / [Γ]) ([t] : Γ ∙ F' ^ [ rF' , ι lF' ] ⊩ᵛ⟨ l ⟩ t ∷ wk1 (Π F ^ rF ° lF ▹ G ° lG ° lΠ) ^ [ rΠ , ι lΠ ] / [Γ] ∙ [F'] / wk1ᵛ {A = Π F ^ rF ° lF ▹ G ° lG ° lΠ} {F = F'} [Γ] [F'] [ΠFG]) ([u] : Γ ∙ F' ^ [ rF' , ι lF' ] ⊩ᵛ⟨ l ⟩ u ∷ wk1 F ^ [ rF , ι lF ] / [Γ] ∙ [F'] / wk1ᵛ {A = F} {F = F'} [Γ] [F'] [F]) → Γ ∙ F' ^ [ rF' , ι lF' ] ⊩ᵛ⟨ l ⟩ t ∘ u ^ lΠ ∷ G [ u ]↑ ^ [ rΠ , ι lG ] / [Γ] ∙ [F'] / subst↑S {F'} {G} {u} {F' = F} [Γ] [F'] [F] [G] [u] appᵛ↑ {F} {F'} {G} {rF} {rF'} {lF} {lF'} {lG} {rΠ} {lΠ} {t} {u} lF≤ lG≤ [Γ] [F] [F'] [G] [ΠFG] [t] [u] = let [G[u]] = subst↑S {F'} {G} {u} {F' = F} [Γ] [F'] [F] [G] [u] [wF] = wk1ᵛ {A = F} {F = F'} [Γ] [F'] [F] [wΠFG] = wk1ᵛ {A = Π F ^ rF ° lF ▹ G ° lG ° lΠ} {F = F'} [Γ] [F'] [ΠFG] [app] = appᵛ {F = wk1 F} {G = wk1d G} {t = t} {u = u} (_∙_ {A = F'} [Γ] [F']) [wF] [wΠFG] [t] [u] in S.irrelevanceTerm′ {A = wk1d G [ u ]} {A′ = G [ u ]↑} {t = t ∘ u ^ lΠ} (PE.sym (wk1d[]-[]↑ G u)) PE.refl (_∙_ {A = F'} [Γ] [F']) (_∙_ {A = F'} [Γ] [F']) (substSΠ {wk1 F} {wk1d G} {u} (_∙_ {A = F'} [Γ] [F']) [wF] [wΠFG] [u]) [G[u]] [app]
{ "alphanum_fraction": 0.4144861585, "avg_line_length": 54.9375, "ext": "agda", "hexsha": "57ebb05caff2cbe4e4e5b51b41507368458f5d7b", "lang": "Agda", "max_forks_count": 2, "max_forks_repo_forks_event_max_datetime": "2022-02-15T19:42:19.000Z", "max_forks_repo_forks_event_min_datetime": "2022-01-26T14:55:51.000Z", "max_forks_repo_head_hexsha": "e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "CoqHott/logrel-mltt", "max_forks_repo_path": "Definition/LogicalRelation/Substitution/Introductions/Application.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "CoqHott/logrel-mltt", "max_issues_repo_path": "Definition/LogicalRelation/Substitution/Introductions/Application.agda", "max_line_length": 179, "max_stars_count": 2, "max_stars_repo_head_hexsha": "e0eeebc4aa5ed791ce3e7c0dc9531bd113dfcc04", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "CoqHott/logrel-mltt", "max_stars_repo_path": "Definition/LogicalRelation/Substitution/Introductions/Application.agda", "max_stars_repo_stars_event_max_datetime": "2022-01-17T16:13:53.000Z", "max_stars_repo_stars_event_min_datetime": "2018-06-21T08:39:01.000Z", "num_tokens": 2685, "size": 5274 }
{-# OPTIONS --omega-in-omega --no-termination-check --overlapping-instances #-} module Light.Literals.Definition.Negative where open import Light.Library.Data.Natural as ℕ using (ℕ ; zero ; successor) renaming (ℓ to nℓ) open import Light.Level using (++_ ; _⊔_) open import Light.Variable.Sets open import Light.Variable.Levels open import Light.Package using (Package) record FromNegative ⦃ package : Package record { ℕ } ⦄ (𝕒 : Set ℓ) : Set (++ (nℓ ⊔ ℓ)) where field convert : ℕ → 𝕒 open FromNegative ⦃ ... ⦄ using (convert) open import Agda.Builtin.Nat as Nat using (Nat) private change : ∀ ⦃ package : Package record { ℕ } ⦄ → Nat → ℕ change Nat.zero = zero change (Nat.suc n) = successor (change n) from‐literal : ∀ ⦃ package : Package record { ℕ } ⦄ ⦃ natural : FromNegative 𝕒 ⦄ (n : Nat) → 𝕒 from‐literal n = convert (change n) {-# BUILTIN FROMNEG from‐literal #-}
{ "alphanum_fraction": 0.677383592, "avg_line_length": 36.08, "ext": "agda", "hexsha": "fdd0a486cdbf6db78ef6eab4a9e0e1f2ab2e1f80", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "44b1c724f2de95d3a9effe87ca36ef9eca8b4756", "max_forks_repo_licenses": [ "0BSD" ], "max_forks_repo_name": "Zambonifofex/lightlib", "max_forks_repo_path": "Light/Literals/Definition/Negative.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "44b1c724f2de95d3a9effe87ca36ef9eca8b4756", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "0BSD" ], "max_issues_repo_name": "Zambonifofex/lightlib", "max_issues_repo_path": "Light/Literals/Definition/Negative.agda", "max_line_length": 94, "max_stars_count": 1, "max_stars_repo_head_hexsha": "44b1c724f2de95d3a9effe87ca36ef9eca8b4756", "max_stars_repo_licenses": [ "0BSD" ], "max_stars_repo_name": "zamfofex/lightlib", "max_stars_repo_path": "Light/Literals/Definition/Negative.agda", "max_stars_repo_stars_event_max_datetime": "2019-12-20T21:33:05.000Z", "max_stars_repo_stars_event_min_datetime": "2019-12-20T21:33:05.000Z", "num_tokens": 272, "size": 902 }
module Cats.Category.Setoids.Facts.Exponentials where open import Data.Product using (_,_) open import Relation.Binary using (Setoid) open import Cats.Category open import Cats.Category.Setoids as Setoids using (Setoids ; ≈-intro ; ≈-elim) open import Cats.Category.Setoids.Facts.Products as Products using (hasBinaryProducts) open import Cats.Util.Conv import Relation.Binary.PropositionalEquality as ≡ import Cats.Category.Base as Base import Cats.Util.SetoidReasoning as SetoidReasoning module Build l where infixr 1 _↝_ open Base.Category (Setoids l l) open Category (Setoids l l) using (∃!-intro ; Exp ; IsUniqueSuchThat) open HasBinaryProducts (hasBinaryProducts l l) open Setoids._⇒_ using (resp) _↝_ : Obj → Obj → Obj A ↝ B = record { Carrier = A ⇒ B ; _≈_ = _≈_ {A} {B} ; isEquivalence = equiv } eval : ∀ {B C} → (B ↝ C) × B ⇒ C eval = record { arr = λ { (f , x) → (f ⃗) x } ; resp = λ { (eq₁ , eq₂) → ≈-elim eq₁ eq₂ } } curry : ∀ {A B C} → A × B ⇒ C → A ⇒ B ↝ C curry {A} f = record { arr = λ a → record { arr = λ b → (f ⃗) (a , b) ; resp = λ eqb → resp f (refl , eqb) } ; resp = λ eqa → ≈-intro λ eqb → resp f (eqa , eqb) } where open Setoid A using (refl) curry-correct : ∀ {A B C} (f : A × B ⇒ C) → eval ∘ ⟨ curry f × id ⟩ ≈ f curry-correct f = ≈-intro (resp f) curry-unique : ∀ {A B C} (f : A × B ⇒ C) → IsUniqueSuchThat (λ f̃ → eval ∘ ⟨ f̃ × id ⟩ ≈ f) (curry f) curry-unique {A} {B} {C} f {g} eval∘g≈f = ≈-intro λ {a} {a′} a≈a′ → ≈-intro λ {b} {b′} b≈b′ → begin⟨ C ⟩ ((((curry f) ⃗) a) ⃗) b ≡⟨⟩ (f ⃗) (a , b) ≈⟨ sym C (≈-elim eval∘g≈f (sym A a≈a′ , sym B b≈b′)) ⟩ (((g ⃗) a′) ⃗) b′ ∎ where open SetoidReasoning open Setoid using (sym) _↝′_ : ∀ B C → Exp B C B ↝′ C = record { Cᴮ = B ↝ C ; eval = eval ; curry′ = λ f → ∃!-intro (curry f) (curry-correct f) (λ {g} eval∘g≈f → curry-unique f {g} eval∘g≈f) } instance hasExponentials : ∀ l → HasExponentials (Setoids l l) hasExponentials l = record { _↝′_ = Build._↝′_ l }
{ "alphanum_fraction": 0.5298573975, "avg_line_length": 24.9333333333, "ext": "agda", "hexsha": "2329beccf05ef9a8334ff75e2fbddf85f3c97dd1", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "a3b69911c4c6ec380ddf6a0f4510d3a755734b86", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "alessio-b-zak/cats", "max_forks_repo_path": "Cats/Category/Setoids/Facts/Exponentials.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "a3b69911c4c6ec380ddf6a0f4510d3a755734b86", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "alessio-b-zak/cats", "max_issues_repo_path": "Cats/Category/Setoids/Facts/Exponentials.agda", "max_line_length": 79, "max_stars_count": null, "max_stars_repo_head_hexsha": "a3b69911c4c6ec380ddf6a0f4510d3a755734b86", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "alessio-b-zak/cats", "max_stars_repo_path": "Cats/Category/Setoids/Facts/Exponentials.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 864, "size": 2244 }
------------------------------------------------------------------------------ -- Testing the function FOL.Translation.Terms.termToFOLTerm: Con term ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module TermToFOLTerm.ConTerm where -- We add 3 to the fixities of the standard library. infixl 9 _+_ infix 7 _≡_ ------------------------------------------------------------------------------ data ℕ : Set where zero : ℕ succ : ℕ → ℕ data _≡_ (m : ℕ) : ℕ → Set where refl : m ≡ m sym : ∀ {x y} → x ≡ y → y ≡ x sym refl = refl _+_ : ℕ → ℕ → ℕ zero + n = n succ m + n = succ (m + n) +-Sx : ∀ m n → succ m + n ≡ succ (m + n) +-Sx m n = refl {-# ATP hint +-Sx #-} postulate +-rightIdentity : ∀ n → n + zero ≡ n x+Sy≡S[x+y] : ∀ m n → m + succ n ≡ succ (m + n) +-comm : ∀ m n → m + n ≡ n + m +-comm zero n = sym (+-rightIdentity n) +-comm (succ m) n = prf (+-comm m n) where postulate prf : m + n ≡ n + m → succ m + n ≡ n + succ m {-# ATP prove prf x+Sy≡S[x+y] #-}
{ "alphanum_fraction": 0.4126853377, "avg_line_length": 25.829787234, "ext": "agda", "hexsha": "45006281c7f4135e951d2f36f58dc7d44abaa657", "lang": "Agda", "max_forks_count": 4, "max_forks_repo_forks_event_max_datetime": "2016-08-03T03:54:55.000Z", "max_forks_repo_forks_event_min_datetime": "2016-05-10T23:06:19.000Z", "max_forks_repo_head_hexsha": "a66c5ddca2ab470539fd68c42c4fbd45f720d682", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "asr/apia", "max_forks_repo_path": "issues/Issue16/sharing/TermToFOLTerm/ConTerm.agda", "max_issues_count": 121, "max_issues_repo_head_hexsha": "a66c5ddca2ab470539fd68c42c4fbd45f720d682", "max_issues_repo_issues_event_max_datetime": "2018-04-22T06:01:44.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-25T13:22:12.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "asr/apia", "max_issues_repo_path": "issues/Issue16/sharing/TermToFOLTerm/ConTerm.agda", "max_line_length": 78, "max_stars_count": 10, "max_stars_repo_head_hexsha": "a66c5ddca2ab470539fd68c42c4fbd45f720d682", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/apia", "max_stars_repo_path": "issues/Issue16/sharing/TermToFOLTerm/ConTerm.agda", "max_stars_repo_stars_event_max_datetime": "2019-12-03T13:44:25.000Z", "max_stars_repo_stars_event_min_datetime": "2015-09-03T20:54:16.000Z", "num_tokens": 363, "size": 1214 }
module Numeral.Matrix.Relations where open import Data.Tuple as Tuple using (_,_) open import Logic.Predicate open import Logic open import Numeral.Matrix hiding (module SquareMatrix) open import Numeral.Matrix.OverField import Relator.Equals as Eq open import Structure.Operator.Field open import Structure.Operator.Monoid open import Structure.Operator.Properties open import Structure.Setoid open import Syntax.Function open import Type module SquareMatrix {ℓ ℓₑ} {d} {T : Type{ℓ}} ⦃ equiv : Equiv{ℓₑ}(T) ⦄ where record Symmetric(M : SquareMatrix(d)(T)) : Stmt{ℓₑ} where constructor intro field proof : ∀{x y} → Matrix.proj M(x , y) ≡ Matrix.proj M(y , x) module _ {_▫_ : T → T → T} ⦃ monoid : Monoid(_▫_) ⦄ where record Diagonal(M : SquareMatrix(d)(T)) : Stmt{ℓₑ} where constructor intro field proof : ∀{x y} → (x Eq.≢ y) → (Matrix.proj M(x , y) ≡ Monoid.id monoid) record Scalar (s : T) (M : SquareMatrix(d)(T)) : Stmt{ℓₑ} where constructor intro field ⦃ diagonal ⦄ : Diagonal(M) proof : ∀{x} → (Matrix.proj M(x , x) ≡ s) module _ {_+ₛ_ _⋅ₛ_ : T → T → T} ⦃ field-structure : Field(_+ₛ_)(_⋅ₛ_) ⦄ where record Similar(A B : SquareMatrix(d)(T)) : Stmt{ℓₑ} where constructor intro field proof : ∃(P ↦ ∃{Obj = Invertible(P)}(inver ↦ B ≡ inv(P) ⨯ A ⨯ P)) record Diagonalizable(M : SquareMatrix(d)(T)) : Stmt{ℓₑ} where constructor intro field proof : ∃(P ↦ ∃{Obj = Invertible(P)}(inver ↦ Diagonal(inv(P) ⨯ M ⨯ P)))
{ "alphanum_fraction": 0.6486842105, "avg_line_length": 38, "ext": "agda", "hexsha": "91d7cb32e4b991d6829100d4a16215af259b5f49", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Lolirofle/stuff-in-agda", "max_forks_repo_path": "Numeral/Matrix/Relations.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Lolirofle/stuff-in-agda", "max_issues_repo_path": "Numeral/Matrix/Relations.agda", "max_line_length": 83, "max_stars_count": 6, "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_path": "Numeral/Matrix/Relations.agda", "max_stars_repo_stars_event_max_datetime": "2022-02-05T06:53:22.000Z", "max_stars_repo_stars_event_min_datetime": "2020-04-07T17:58:13.000Z", "num_tokens": 522, "size": 1520 }
module Text.Parse (Tok : Set) where open import Prelude private data P′ (A : Set) : Set where symbolBind : (Tok → P′ A) → P′ A fail′ : P′ A returnPlus : A → P′ A → P′ A _+++′_ : ∀ {A} → P′ A → P′ A → P′ A symbolBind f +++′ symbolBind g = symbolBind λ x → f x +++′ g x fail′ +++′ q = q p +++′ fail′ = p returnPlus x p +++′ q = returnPlus x (p +++′ q) p +++′ returnPlus x q = returnPlus x (p +++′ q) parse′ : ∀ {A} → P′ A → List Tok → List (A × List Tok) parse′ (symbolBind _) [] = [] parse′ (symbolBind f) (c ∷ s) = parse′ (f c) s parse′ (returnPlus x p) s = (x , s) ∷ parse′ p s parse′ fail′ xs = [] record P (A : Set) : Set₁ where constructor mkP field unP : ∀ {B} → (A → P′ B) → P′ B open P symbol : P Tok symbol = mkP symbolBind fail : ∀ {A} → P A fail = mkP λ _ → fail′ infixr 2 _+++_ _+++_ : ∀ {A} → P A → P A → P A p +++ q = mkP λ k → unP p k +++′ unP q k private ret : ∀ {A} → A → P A ret x = mkP λ k → k x bind : ∀ {A B} → P A → (A → P B) → P B bind p f = mkP λ k → unP p (λ x → unP (f x) k) parse : ∀ {A} → P A → List Tok → List (A × List Tok) parse p = parse′ (unP p (λ x → returnPlus x fail′)) parse! : ∀ {A} → P A → List Tok → Maybe A parse! p s with filter (null ∘ snd) (parse p s) ... | [] = nothing ... | (x , _) ∷ _ = just x --- Instances --- instance FunctorP : Functor P fmap {{FunctorP}} f m = bind m λ x → ret (f x) ApplicativeP : Applicative P pure {{ApplicativeP}} = ret _<*>_ {{ApplicativeP}} = monadAp bind MonadP : Monad P _>>=_ {{MonadP}} = bind MonoidP : ∀ {A} → Monoid (P A) mempty {{MonoidP}} = fail _<>_ {{MonoidP}} = _+++_ --- Derived combinators --- sat : (p : Tok → Bool) → P (Σ Tok (IsTrue ∘ p)) sat p = symbol >>= match where -- Inlining 'match' gives internal error! match : Tok → P (Σ Tok (IsTrue ∘ p)) match t = if′ p t then return (t , it) else fail sat! : (Tok → Bool) → P Tok sat! p = fst <$> sat p token : {{EqTok : Eq Tok}} → Tok → P ⊤ token t = _ <$ sat (isYes ∘ _==_ t) {-# NON_TERMINATING #-} many many₁ : ∀ {A} → P A → P (List A) many p = return [] +++ many₁ p many₁ p = _∷_ <$> p <*> many p
{ "alphanum_fraction": 0.5141138362, "avg_line_length": 23.2365591398, "ext": "agda", "hexsha": "87ff0e392070dfaa7e0fb26970f662fcb5c5f8f9", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "75016b4151ed601e28f4462cd7b6b1aaf5d0d1a6", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "lclem/agda-prelude", "max_forks_repo_path": "src/Text/Parse.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "75016b4151ed601e28f4462cd7b6b1aaf5d0d1a6", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "lclem/agda-prelude", "max_issues_repo_path": "src/Text/Parse.agda", "max_line_length": 64, "max_stars_count": null, "max_stars_repo_head_hexsha": "75016b4151ed601e28f4462cd7b6b1aaf5d0d1a6", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "lclem/agda-prelude", "max_stars_repo_path": "src/Text/Parse.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 854, "size": 2161 }
module json where open import general-util data json : Set where json-null : json json-raw : rope → json json-string : string → json json-nat : nat → json json-array : 𝕃 json → json json-object : 𝕃 (string × json) → json json-escape-string : string → string json-escape-string str = 𝕃char-to-string $ rec $ string-to-𝕃char str where rec : 𝕃 char → 𝕃 char rec [] = [] rec ('\b' :: chars) = '\\' :: 'b' :: rec chars rec ('\f' :: chars) = '\\' :: 'f' :: rec chars rec ('\n' :: chars) = '\\' :: 'n' :: rec chars rec ('\r' :: chars) = '\\' :: 'r' :: rec chars rec ('\t' :: chars) = '\\' :: 't' :: rec chars rec ('"' :: chars) = '\\' :: '"' :: rec chars rec ('\\' :: chars) = '\\' :: '\\' :: rec chars rec (char :: chars) = char :: rec chars {-# TERMINATING #-} json-to-rope : json → rope json-to-rope json-null = [[ "null" ]] json-to-rope (json-raw rope) = rope json-to-rope (json-string string) = [[ "\"" ]] ⊹⊹ [[ json-escape-string string ]] ⊹⊹ [[ "\"" ]] json-to-rope (json-nat nat) = [[ ℕ-to-string nat ]] json-to-rope (json-array array) = [[ "[" ]] ⊹⊹ 𝕃-to-rope json-to-rope "," array ⊹⊹ [[ "]" ]] json-to-rope (json-object t) = [[ "{" ]] ⊹⊹ 𝕃-to-rope (uncurry λ k v → [[ "\"" ]] ⊹⊹ [[ json-escape-string k ]] ⊹⊹ [[ "\":" ]] ⊹⊹ json-to-rope v) "," t ⊹⊹ [[ "}" ]] json-rope : rope → json json-rope rope = json-raw ([[ "\"" ]] ⊹⊹ rope ⊹⊹ [[ "\"" ]]) json-raw-string : string → json json-raw-string str = json-raw [[ str ]] putJson : json → IO ⊤ putJson = putRopeLn ∘ json-to-rope
{ "alphanum_fraction": 0.5253456221, "avg_line_length": 35.3255813953, "ext": "agda", "hexsha": "63eab2ab3773712c5b96baefb28d6cc5cf0d1d9c", "lang": "Agda", "max_forks_count": 34, "max_forks_repo_forks_event_max_datetime": "2022-02-20T18:33:16.000Z", "max_forks_repo_forks_event_min_datetime": "2018-09-17T11:51:36.000Z", "max_forks_repo_head_hexsha": "75f72bf2e41ac4042efc3128fa9958d4cd69b947", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "mudathirmahgoub/cedille", "max_forks_repo_path": "src/json.agda", "max_issues_count": 123, "max_issues_repo_head_hexsha": "75f72bf2e41ac4042efc3128fa9958d4cd69b947", "max_issues_repo_issues_event_max_datetime": "2022-01-12T03:51:28.000Z", "max_issues_repo_issues_event_min_datetime": "2018-09-17T10:53:20.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "mudathirmahgoub/cedille", "max_issues_repo_path": "src/json.agda", "max_line_length": 165, "max_stars_count": 328, "max_stars_repo_head_hexsha": "75f72bf2e41ac4042efc3128fa9958d4cd69b947", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "mudathirmahgoub/cedille", "max_stars_repo_path": "src/json.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-26T10:33:07.000Z", "max_stars_repo_stars_event_min_datetime": "2018-09-14T20:06:09.000Z", "num_tokens": 544, "size": 1519 }
{- 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 -} module Dijkstra.EitherD.Syntax where open import Dijkstra.EitherD open import Dijkstra.EitherLike open import Dijkstra.Syntax open import Haskell.Prelude private variable E : Set A B C : Set -- From this instance declaration, we get _<$>_, pure, and _<*>_ also. instance Monad-EitherD : ∀ {E : Set} → Monad (EitherD E) Monad.return Monad-EitherD = EitherD-return Monad._>>=_ Monad-EitherD = EitherD-bind -- These instance declarations give us variant conditional operations that we -- can define to play nice with `EitherD-weakestPre` instance EitherD-MonadIfD : MonadIfD{ℓ₃ = ℓ0} (EitherD E) MonadIfD.monad EitherD-MonadIfD = Monad-EitherD MonadIfD.ifD‖ EitherD-MonadIfD = EitherD-if EitherD-MonadMaybeD : MonadMaybeD (EitherD E) MonadMaybeD.monad EitherD-MonadMaybeD = Monad-EitherD MonadMaybeD.maybeD EitherD-MonadMaybeD = EitherD-maybe EitherD-MonadEitherD : MonadEitherD (EitherD E) MonadEitherD.monad EitherD-MonadEitherD = Monad-EitherD MonadEitherD.eitherD EitherD-MonadEitherD = EitherD-either -- `EitherD` is Either-like instance EitherD-EitherLike : EitherLike EitherD EitherLike.fromEither EitherD-EitherLike (Left a) = EitherD-bail a EitherLike.fromEither EitherD-EitherLike (Right b) = EitherD-return b EitherLike.toEither EitherD-EitherLike = EitherD-run
{ "alphanum_fraction": 0.7610899873, "avg_line_length": 32.875, "ext": "agda", "hexsha": "436b8fa94678150f64818c4d72f7e13e1fb1bce0", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_forks_repo_licenses": [ "UPL-1.0" ], "max_forks_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_forks_repo_path": "src/Dijkstra/EitherD/Syntax.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "UPL-1.0" ], "max_issues_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_issues_repo_path": "src/Dijkstra/EitherD/Syntax.agda", "max_line_length": 111, "max_stars_count": null, "max_stars_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_stars_repo_licenses": [ "UPL-1.0" ], "max_stars_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_stars_repo_path": "src/Dijkstra/EitherD/Syntax.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 477, "size": 1578 }
_ : @ω Set → Set₁ _ = λ (@0 _) → Set
{ "alphanum_fraction": 0.4324324324, "avg_line_length": 12.3333333333, "ext": "agda", "hexsha": "aa711f212d79db98e26d0e00f8e8513cfaa6a9ad", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "cc026a6a97a3e517bb94bafa9d49233b067c7559", "max_forks_repo_licenses": [ "BSD-2-Clause" ], "max_forks_repo_name": "cagix/agda", "max_forks_repo_path": "test/Fail/Issue5251-1.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "cc026a6a97a3e517bb94bafa9d49233b067c7559", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-2-Clause" ], "max_issues_repo_name": "cagix/agda", "max_issues_repo_path": "test/Fail/Issue5251-1.agda", "max_line_length": 18, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "cc026a6a97a3e517bb94bafa9d49233b067c7559", "max_stars_repo_licenses": [ "BSD-2-Clause" ], "max_stars_repo_name": "cagix/agda", "max_stars_repo_path": "test/Fail/Issue5251-1.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 18, "size": 37 }
------------------------------------------------------------------------ -- The Eilenberg-MacLane space K(G, 1) ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe #-} -- The module is parametrised by a notion of equality. The higher -- constructors of the HIT defining K(G, 1) use path equality, but the -- supplied notion of equality is used for many other things. import Equality.Path as P module Eilenberg-MacLane-space {e⁺} (eq : ∀ {a p} → P.Equality-with-paths a p e⁺) where open P.Derived-definitions-and-properties eq hiding (elim) open import Logical-equivalence using (_⇔_) open import Prelude as P hiding (id) renaming (_∘_ to _⊚_) open import Bijection equality-with-J as B using (_↔_) open import Embedding equality-with-J using (Embedding; Is-embedding) import Equality.Groupoid equality-with-J as EG open import Equality.Path.Isomorphisms eq open import Equivalence equality-with-J as Eq using (_≃_; Is-equivalence) import Equivalence P.equality-with-J as PEq open import Function-universe equality-with-J hiding (id; _∘_) open import Group equality-with-J open import H-level equality-with-J as H-level import H-level P.equality-with-J as PH open import H-level.Closure equality-with-J open import H-level.Truncation eq as T using (∥_∥[1+_]; ∣_∣) open import H-level.Truncation.Propositional eq as TP using (Surjective) open import Pointed-type equality-with-J open import Pointed-type.Connected eq open import Pointed-type.Homotopy-group eq open import Univalence-axiom equality-with-J private variable a p : Level A : Type a P : A → Type p e g x y : A G G₁ G₂ : Group g ------------------------------------------------------------------------ -- The type -- The Eilenberg-MacLane space K(G, 1). -- -- This definition is taken from "Eilenberg-MacLane Spaces in Homotopy -- Type Theory" by Licata and Finster. data K[_]1 (G : Group g) : Type g where base : K[ G ]1 loopᴾ : Group.Carrier G → base P.≡ base loop-idᴾ : loopᴾ (Group.id G) P.≡ P.refl loop-∘ᴾ : loopᴾ (Group._∘_ G x y) P.≡ P.trans (loopᴾ x) (loopᴾ y) is-groupoidᴾ : PH.H-level 3 K[ G ]1 -- Variants of the higher constructors. loop : Group.Carrier G → base ≡ base loop {G = G} = _↔_.from ≡↔≡ ⊚ loopᴾ {G = G} loop-id : loop {G = G} (Group.id G) ≡ refl base loop-id {G = G} = loop id ≡⟨ _≃_.from (Eq.≃-≡ (Eq.↔⇒≃ (inverse ≡↔≡))) (_↔_.from ≡↔≡ loop-idᴾ) ⟩ _↔_.from ≡↔≡ P.refl ≡⟨ from-≡↔≡-refl ⟩∎ refl base ∎ where open Group G loop-∘ : loop {G = G} (Group._∘_ G x y) ≡ trans (loop x) (loop y) loop-∘ {G = G} {x = x} {y = y} = loop (Group._∘_ G x y) ≡⟨ _≃_.from (Eq.≃-≡ (Eq.↔⇒≃ (inverse ≡↔≡))) (_↔_.from ≡↔≡ loop-∘ᴾ) ⟩ _↔_.from ≡↔≡ (P.trans (loopᴾ x) (loopᴾ y)) ≡⟨ sym trans≡trans ⟩∎ trans (loop x) (loop y) ∎ is-groupoid : H-level 3 K[ G ]1 is-groupoid = _↔_.from (H-level↔H-level 3) is-groupoidᴾ ------------------------------------------------------------------------ -- Eliminators -- A dependent eliminator, expressed using paths. -- -- This eliminator is based on one from "Eilenberg-MacLane Spaces in -- Homotopy Type Theory" by Licata and Finster. record Elimᴾ {G : Group g} (P : K[ G ]1 → Type p) : Type (g ⊔ p) where no-eta-equality open Group G field baseʳ : P base loopʳ : ∀ g → P.[ (λ i → P (loopᴾ g i)) ] baseʳ ≡ baseʳ loop-idʳ : P.[ (λ i → P.[ (λ j → P (loop-idᴾ i j)) ] baseʳ ≡ baseʳ) ] loopʳ id ≡ P.refl {x = baseʳ} loop-∘ʳ : P.[ (λ i → P.[ (λ j → P (loop-∘ᴾ {x = x} {y = y} i j)) ] baseʳ ≡ baseʳ) ] loopʳ (x ∘ y) ≡ P.htrans P (loopʳ x) (loopʳ y) is-groupoidʳ : ∀ x → PH.H-level 3 (P x) open Elimᴾ public elimᴾ : Elimᴾ P → (x : K[ G ]1) → P x elimᴾ {G = G} {P = P} e = helper where module E = Elimᴾ e helper : (x : K[ G ]1) → P x helper base = E.baseʳ helper (loopᴾ x i) = E.loopʳ x i helper (loop-idᴾ i j) = E.loop-idʳ i j helper (loop-∘ᴾ i j) = E.loop-∘ʳ i j helper (is-groupoidᴾ p q i j k) = P.heterogeneous-UIP₃ E.is-groupoidʳ (is-groupoidᴾ p q) (λ j k → helper (p j k)) (λ j k → helper (q j k)) i j k -- A non-dependent eliminator, expressed using paths. -- -- This eliminator is based on one from "Eilenberg-MacLane Spaces in -- Homotopy Type Theory" by Licata and Finster. record Recᴾ (G : Group g) (A : Type a) : Type (g ⊔ a) where no-eta-equality open Group G field baseʳ : A loopʳ : Carrier → baseʳ P.≡ baseʳ loop-idʳ : loopʳ id P.≡ P.refl loop-∘ʳ : loopʳ (x ∘ y) P.≡ P.trans (loopʳ x) (loopʳ y) is-groupoidʳ : PH.H-level 3 A open Recᴾ public recᴾ : Recᴾ G A → K[ G ]1 → A recᴾ {G = G} {A = A} r = elimᴾ λ where .is-groupoidʳ _ → R.is-groupoidʳ .baseʳ → R.baseʳ .loopʳ → R.loopʳ .loop-idʳ → R.loop-idʳ .loop-∘ʳ {x = x} {y = y} → R.loopʳ (x ∘ y) P.≡⟨ R.loop-∘ʳ ⟩ P.trans (R.loopʳ x) (R.loopʳ y) P.≡⟨ P.sym $ P.htrans-const (loopᴾ {G = G} x) (loopᴾ y) (R.loopʳ x) ⟩∎ P.htrans {x≡y = loopᴾ {G = G} x} {y≡z = loopᴾ y} (const A) (R.loopʳ x) (R.loopʳ y) ∎ where open Group G module R = Recᴾ r -- A non-dependent eliminator. -- -- This eliminator is based on one from "Eilenberg-MacLane Spaces in -- Homotopy Type Theory" by Licata and Finster. record Rec (G : Group g) (A : Type a) : Type (g ⊔ a) where no-eta-equality open Group G field baseʳ : A loopʳ : Carrier → baseʳ ≡ baseʳ loop-idʳ : loopʳ id ≡ refl baseʳ loop-∘ʳ : loopʳ (x ∘ y) ≡ trans (loopʳ x) (loopʳ y) is-groupoidʳ : H-level 3 A open Rec public rec : Rec G A → K[ G ]1 → A rec {G = G} {A = A} r = recᴾ λ where .is-groupoidʳ → _↔_.to (H-level↔H-level 3) R.is-groupoidʳ .baseʳ → R.baseʳ .loopʳ → _↔_.to ≡↔≡ ⊚ R.loopʳ .loop-idʳ → _↔_.to ≡↔≡ (R.loopʳ id) P.≡⟨ P.cong (_↔_.to ≡↔≡) $ _↔_.to ≡↔≡ R.loop-idʳ ⟩ _↔_.to ≡↔≡ (refl R.baseʳ) P.≡⟨ _↔_.to ≡↔≡ to-≡↔≡-refl ⟩∎ P.refl ∎ .loop-∘ʳ {x = x} {y = y} → _↔_.to ≡↔≡ (R.loopʳ (x ∘ y)) P.≡⟨ P.cong (_↔_.to ≡↔≡) $ _↔_.to ≡↔≡ R.loop-∘ʳ ⟩ _↔_.to ≡↔≡ (trans (R.loopʳ x) (R.loopʳ y)) P.≡⟨ _↔_.to ≡↔≡ $ sym $ cong₂ (λ p q → _↔_.to ≡↔≡ (trans p q)) (_↔_.left-inverse-of ≡↔≡ _) (_↔_.left-inverse-of ≡↔≡ _) ⟩ _↔_.to ≡↔≡ (trans (_↔_.from ≡↔≡ (_↔_.to ≡↔≡ (R.loopʳ x))) (_↔_.from ≡↔≡ (_↔_.to ≡↔≡ (R.loopʳ y)))) P.≡⟨ P.cong (_↔_.to ≡↔≡) $ _↔_.to ≡↔≡ trans≡trans ⟩ (_↔_.to ≡↔≡ $ _↔_.from ≡↔≡ $ P.trans (_↔_.to ≡↔≡ (R.loopʳ x)) (_↔_.to ≡↔≡ (R.loopʳ y))) P.≡⟨ _↔_.to ≡↔≡ $ _↔_.right-inverse-of ≡↔≡ _ ⟩∎ P.trans (_↔_.to ≡↔≡ (R.loopʳ x)) (_↔_.to ≡↔≡ (R.loopʳ y)) ∎ where open Group G module R = Rec r -- A "computation" rule. rec-loop : cong (rec e) (loop g) ≡ e .loopʳ g rec-loop = cong-≡↔≡ (refl _) -- A dependent eliminator that can be used when eliminating into sets, -- expressed using paths. record Elim-setᴾ {G : Group g} (P : K[ G ]1 → Type p) : Type (g ⊔ p) where no-eta-equality open Group G field baseʳ : P base loopʳ : ∀ g → P.[ (λ i → P (loopᴾ g i)) ] baseʳ ≡ baseʳ is-setʳ : ∀ x → P.Is-set (P x) open Elim-setᴾ public elim-setᴾ : Elim-setᴾ P → (x : K[ G ]1) → P x elim-setᴾ e = elimᴾ λ where .baseʳ → E.baseʳ .loopʳ → E.loopʳ .loop-idʳ → P.heterogeneous-UIP E.is-setʳ _ _ _ .loop-∘ʳ → P.heterogeneous-UIP E.is-setʳ _ _ _ .is-groupoidʳ → PH.mono₁ 2 ⊚ E.is-setʳ where module E = Elim-setᴾ e -- A dependent eliminator that can be used when eliminating into sets. record Elim-set {G : Group g} (P : K[ G ]1 → Type p) : Type (g ⊔ p) where no-eta-equality open Group G field baseʳ : P base loopʳ : ∀ g → subst P (loop g) baseʳ ≡ baseʳ is-setʳ : ∀ x → Is-set (P x) open Elim-set public elim-set : Elim-set P → (x : K[ G ]1) → P x elim-set e = elim-setᴾ λ where .baseʳ → E.baseʳ .loopʳ → subst≡→[]≡ ⊚ E.loopʳ .is-setʳ → _↔_.to (H-level↔H-level 2) ⊚ E.is-setʳ where module E = Elim-set e -- A "computation" rule. elim-set-loop : dcong (elim-set e) (loop g) ≡ e .loopʳ g elim-set-loop = dcong-subst≡→[]≡ (refl _) -- A non-dependent eliminator that can be used when eliminating into -- sets, expressed using paths. record Rec-setᴾ (G : Group g) (A : Type a) : Type (g ⊔ a) where no-eta-equality open Group G field baseʳ : A loopʳ : Carrier → baseʳ P.≡ baseʳ is-setʳ : P.Is-set A open Rec-setᴾ public rec-setᴾ : Rec-setᴾ G A → K[ G ]1 → A rec-setᴾ r = elim-setᴾ λ where .baseʳ → R.baseʳ .loopʳ → R.loopʳ .is-setʳ _ → R.is-setʳ where module R = Rec-setᴾ r -- A non-dependent eliminator that can be used when eliminating into -- sets. record Rec-set (G : Group g) (A : Type a) : Type (g ⊔ a) where no-eta-equality open Group G field baseʳ : A loopʳ : Carrier → baseʳ ≡ baseʳ is-setʳ : Is-set A open Rec-set public rec-set : Rec-set G A → K[ G ]1 → A rec-set r = rec-setᴾ λ where .baseʳ → R.baseʳ .loopʳ → _↔_.to ≡↔≡ ⊚ R.loopʳ .is-setʳ → _↔_.to (H-level↔H-level 2) R.is-setʳ where module R = Rec-set r -- A "computation" rule. rec-set-loop : cong (rec-set e) (loop g) ≡ e .loopʳ g rec-set-loop = cong-≡↔≡ (refl _) -- A dependent eliminator that can be used when eliminating into -- propositions. record Elim-prop {G : Group g} (P : K[ G ]1 → Type p) : Type (g ⊔ p) where no-eta-equality field baseʳ : P base is-propositionʳ : ∀ x → Is-proposition (P x) open Elim-prop public elim-prop : Elim-prop P → (x : K[ G ]1) → P x elim-prop e = elim-set λ where .baseʳ → E.baseʳ .loopʳ _ → E.is-propositionʳ _ _ _ .is-setʳ → mono₁ 1 ⊚ E.is-propositionʳ where module E = Elim-prop e ------------------------------------------------------------------------ -- Universal properties -- A dependent universal property, restricted to families of sets. -- -- This property is expressed using P.[_]_≡_. universal-property-Π-setᴾ : (∀ x → P.Is-set (P x)) → ((x : K[ G ]1) → P x) ≃ (∃ λ (x : P base) → ∀ g → P.[ (λ i → P (loopᴾ g i)) ] x ≡ x) universal-property-Π-setᴾ {G = G} {P = P} P-set = _↔_.from ≃↔≃ $ PEq.↔→≃ (λ f → f base , P.hcong f ⊚ loopᴾ) (λ (x , f) → elim-setᴾ λ where .baseʳ → x .loopʳ → f .is-setʳ → P-set) (λ _ → P.refl) (λ f → P.⟨ext⟩ $ elim-setᴾ λ where .baseʳ → P.refl .loopʳ _ _ → P.refl .is-setʳ _ → PH.mono₁ 2 (P-set _)) -- A variant of the dependent universal property, restricted to -- families of sets. -- -- This property is expressed using subst. universal-property-Π-set : (∀ x → Is-set (P x)) → ((x : K[ G ]1) → P x) ≃ (∃ λ (x : P base) → ∀ g → subst P (loop g) x ≡ x) universal-property-Π-set {G = G} {P = P} P-set = ((x : K[ G ]1) → P x) ↝⟨ universal-property-Π-setᴾ (_↔_.to (H-level↔H-level 2) ⊚ P-set) ⟩ (∃ λ (x : P base) → ∀ g → P.[ (λ i → P (loopᴾ g i)) ] x ≡ x) ↔⟨ (∃-cong λ _ → ∀-cong ext λ _ → inverse subst≡↔[]≡) ⟩□ (∃ λ (x : P base) → ∀ g → subst P (loop g) x ≡ x) □ -- A non-dependent universal property, restricted to sets. universal-property-set : Is-set A → (K[ G ]1 → A) ≃ (∃ λ (x : A) → Group.Carrier G → x ≡ x) universal-property-set {A = A} {G = G} A-set = (K[ G ]1 → A) ↝⟨ universal-property-Π-setᴾ (λ _ → _↔_.to (H-level↔H-level 2) A-set) ⟩ (∃ λ (x : A) → Carrier → x P.≡ x) ↔⟨ (∃-cong λ _ → ∀-cong ext λ _ → inverse ≡↔≡) ⟩□ (∃ λ (x : A) → Carrier → x ≡ x) □ where open Group G ------------------------------------------------------------------------ -- Some conversion functions -- A map function. -- -- The existence of such a function was suggested to me by Christian -- Sattler. map : G₁ →ᴳ G₂ → K[ G₁ ]1 → K[ G₂ ]1 map {G₁ = G₁} {G₂ = G₂} h = rec λ where .is-groupoidʳ → is-groupoid .baseʳ → base .loopʳ x → loop (to x) .loop-idʳ → loop (to G₁.id) ≡⟨ cong loop (→ᴳ-id h) ⟩ loop G₂.id ≡⟨ loop-id ⟩∎ refl _ ∎ .loop-∘ʳ {x = x} {y = y} → loop (to (x G₁.∘ y)) ≡⟨ cong loop (h .homomorphic x y) ⟩ loop (to x G₂.∘ to y) ≡⟨ loop-∘ ⟩∎ trans (loop (to x)) (loop (to y)) ∎ where module G₁ = Group G₁ module G₂ = Group G₂ open Homomorphic h using (to) -- If G₁ and G₂ are isomorphic groups, then K[ G₁ ]1 and K[ G₂ ]1 are -- equivalent. cong-≃ : G₁ ≃ᴳ G₂ → K[ G₁ ]1 ≃ K[ G₂ ]1 cong-≃ G₁≃G₂ = Eq.↔→≃ (map (↝ᴳ→→ᴳ G₁≃G₂)) (map (↝ᴳ→→ᴳ (≃ᴳ-sym G₁≃G₂))) (lemma (↝ᴳ→→ᴳ G₁≃G₂) (↝ᴳ→→ᴳ (≃ᴳ-sym G₁≃G₂)) (_≃_.right-inverse-of (related G₁≃G₂))) (lemma (↝ᴳ→→ᴳ (≃ᴳ-sym G₁≃G₂)) (↝ᴳ→→ᴳ G₁≃G₂) (_≃_.left-inverse-of (related G₁≃G₂))) where open Homomorphic using (to) lemma : (f₁ : G₁ →ᴳ G₂) (f₂ : G₂ →ᴳ G₁) → (∀ x → to f₁ (to f₂ x) ≡ x) → ∀ x → map f₁ (map f₂ x) ≡ x lemma f₁ f₂ hyp = elim-set λ where .is-setʳ _ → is-groupoid .baseʳ → refl _ .loopʳ g → subst (λ x → map f₁ (map f₂ x) ≡ x) (loop g) (refl _) ≡⟨ subst-in-terms-of-trans-and-cong ⟩ trans (sym $ cong (map f₁ ⊚ map f₂) (loop g)) (trans (refl _) (cong P.id (loop g))) ≡⟨ cong₂ (trans ⊚ sym) (sym $ cong-∘ _ _ _) (trans (trans-reflˡ _) $ sym $ cong-id _) ⟩ trans (sym $ cong (map f₁) $ cong (map f₂) (loop g)) (loop g) ≡⟨ cong (flip trans (loop g) ⊚ sym) $ trans (cong (cong _) rec-loop) rec-loop ⟩ trans (sym $ loop (to f₁ (to f₂ g))) (loop g) ≡⟨ cong (flip trans _ ⊚ sym ⊚ loop) $ hyp _ ⟩ trans (sym $ loop g) (loop g) ≡⟨ trans-symˡ _ ⟩∎ refl _ ∎ ------------------------------------------------------------------------ -- A lemma -- The pointed type (K[ G ]1 , base) is connected. -- -- This result was pointed out to me by Christian Sattler. connected : Connected (K[ G ]1 , base) connected = elim-prop λ where .is-propositionʳ _ → TP.truncation-is-proposition .baseʳ → TP.∣ refl _ ∣ ------------------------------------------------------------------------ -- Some lemmas related to the fundamental group of (K[ G ]1 , base) -- A variant of the fundamental group of (K[ G ]1 , base) is -- isomorphic to G (assuming univalence). -- -- The proof is based on the one given in "Eilenberg-MacLane Spaces in -- Homotopy Type Theory" by Licata and Finster. Fundamental-group′[K1]≃ᴳ : {G : Group g} → Univalence g → (s : Is-set (proj₁ (Ω (K[ G ]1 , base)))) → Fundamental-group′ (K[ G ]1 , base) s ≃ᴳ G Fundamental-group′[K1]≃ᴳ {g = g} {G = G} univ _ = λ where .related → equiv .homomorphic → hom where module FG = Group (Fundamental-group′ (K[ G ]1 , base) is-groupoid) open Group G -- Postcomposition is an equivalence. to-≃ : Carrier → Carrier ≃ Carrier to-≃ x = Eq.↔→≃ (_∘ x) (_∘ x ⁻¹) (λ y → (y ∘ x ⁻¹) ∘ x ≡⟨ sym $ assoc _ _ _ ⟩ y ∘ (x ⁻¹ ∘ x) ≡⟨ cong (y ∘_) $ left-inverse _ ⟩ y ∘ id ≡⟨ right-identity _ ⟩∎ y ∎) (λ y → (y ∘ x) ∘ x ⁻¹ ≡⟨ sym $ assoc _ _ _ ⟩ y ∘ (x ∘ x ⁻¹) ≡⟨ cong (y ∘_) $ right-inverse _ ⟩ y ∘ id ≡⟨ right-identity _ ⟩∎ y ∎) -- A family of codes. Code : K[ G ]1 → Set g Code = rec λ where .is-groupoidʳ → ∃-H-level-H-level-1+ ext univ 2 .baseʳ → Carrier , Carrier-is-set .loopʳ x → Σ-≡,≡→≡ (≃⇒≡ univ (to-≃ x)) (H-level-propositional ext 2 _ _) .loop-idʳ → Σ-≡,≡→≡ (≃⇒≡ univ (to-≃ id)) _ ≡⟨ _≃_.from (Eq.≃-≡ $ Eq.↔⇒≃ B.Σ-≡,≡↔≡) $ Σ-≡,≡→≡ ( ≃⇒≡ univ (to-≃ id) ≡⟨ cong (≃⇒≡ univ) $ Eq.lift-equality ext $ ⟨ext⟩ right-identity ⟩ ≃⇒≡ univ Eq.id ≡⟨ ≃⇒≡-id univ ⟩∎ refl _ ∎) (H-level.⇒≡ 1 (H-level-propositional ext 2) _ _) ⟩ Σ-≡,≡→≡ (refl _) (subst-refl _ _) ≡⟨ Σ-≡,≡→≡-refl-subst-refl ⟩∎ refl _ ∎ .loop-∘ʳ {x = x} {y = y} → Σ-≡,≡→≡ (≃⇒≡ univ (to-≃ (x ∘ y))) _ ≡⟨ _≃_.from (Eq.≃-≡ $ Eq.↔⇒≃ B.Σ-≡,≡↔≡) $ Σ-≡,≡→≡ ( ≃⇒≡ univ (to-≃ (x ∘ y)) ≡⟨ (cong (≃⇒≡ univ) $ Eq.lift-equality ext $ ⟨ext⟩ λ _ → assoc _ _ _) ⟩ ≃⇒≡ univ (to-≃ y Eq.∘ to-≃ x) ≡⟨ ≃⇒≡-∘ univ ext _ _ ⟩∎ trans (≃⇒≡ univ (to-≃ x)) (≃⇒≡ univ (to-≃ y)) ∎) (H-level.⇒≡ 1 (H-level-propositional ext 2) _ _) ⟩ Σ-≡,≡→≡ (trans (≃⇒≡ univ (to-≃ x)) (≃⇒≡ univ (to-≃ y))) _ ≡⟨ sym $ trans-Σ-≡,≡→≡ _ _ _ _ ⟩∎ trans (Σ-≡,≡→≡ (≃⇒≡ univ (to-≃ x)) _) (Σ-≡,≡→≡ (≃⇒≡ univ (to-≃ y)) _) ∎ -- Some "computation" rules. ≡⇒≃-cong-Code-loop : ≡⇒≃ (cong (proj₁ ⊚ Code) (loop x)) ≡ to-≃ x ≡⇒≃-cong-Code-loop {x = x} = ≡⇒≃ (cong (proj₁ ⊚ Code) (loop x)) ≡⟨ cong ≡⇒≃ $ sym $ cong-∘ proj₁ Code (loop x) ⟩ ≡⇒≃ (cong proj₁ (cong Code (loop x))) ≡⟨ cong (≡⇒≃ ⊚ cong proj₁) rec-loop ⟩ ≡⇒≃ (cong proj₁ $ Σ-≡,≡→≡ (≃⇒≡ univ (to-≃ x)) (H-level-propositional ext 2 _ _)) ≡⟨ cong ≡⇒≃ $ proj₁-Σ-≡,≡→≡ _ _ ⟩ ≡⇒≃ (≃⇒≡ univ (to-≃ x)) ≡⟨ _≃_.right-inverse-of (≡≃≃ univ) _ ⟩∎ to-≃ x ∎ subst-Code-loop : subst (proj₁ ⊚ Code) (loop x) ≡ _∘ x subst-Code-loop {x = x} = ⟨ext⟩ λ y → subst (proj₁ ⊚ Code) (loop x) y ≡⟨ subst-in-terms-of-≡⇒↝ equivalence _ _ _ ⟩ _≃_.to (≡⇒≃ (cong (proj₁ ⊚ Code) (loop x))) y ≡⟨ cong (λ eq → _≃_.to eq y) ≡⇒≃-cong-Code-loop ⟩∎ _≃_.to (to-≃ x) y ∎ subst-Code-sym-loop : subst (proj₁ ⊚ Code) (sym (loop x)) ≡ _∘ x ⁻¹ subst-Code-sym-loop {x = x} = ⟨ext⟩ λ y → subst (proj₁ ⊚ Code) (sym (loop x)) y ≡⟨ subst-in-terms-of-inverse∘≡⇒↝ equivalence _ _ _ ⟩ _≃_.from (≡⇒≃ (cong (proj₁ ⊚ Code) (loop x))) y ≡⟨ cong (λ eq → _≃_.from eq y) ≡⇒≃-cong-Code-loop ⟩∎ _≃_.from (to-≃ x) y ∎ -- An equivalence. to : base ≡ x → proj₁ (Code x) to eq = subst (proj₁ ⊚ Code) eq id from : ∀ x → proj₁ (Code x) → base ≡ x from = elim-set λ where .is-setʳ _ → Π-closure ext 2 λ _ → is-groupoid .baseʳ → loop .loopʳ x → ⟨ext⟩ λ y → subst (λ x → proj₁ (Code x) → base ≡ x) (loop x) loop y ≡⟨ subst-→ ⟩ subst (base ≡_) (loop x) (loop (subst (proj₁ ⊚ Code) (sym (loop x)) y)) ≡⟨ sym trans-subst ⟩ trans (loop (subst (proj₁ ⊚ Code) (sym (loop x)) y)) (loop x) ≡⟨ cong (flip trans (loop x) ⊚ loop ⊚ (_$ y)) subst-Code-sym-loop ⟩ trans (loop (y ∘ x ⁻¹)) (loop x) ≡⟨ cong (flip trans _) loop-∘ ⟩ trans (trans (loop y) (loop (x ⁻¹))) (loop x) ≡⟨ trans-assoc _ _ _ ⟩ trans (loop y) (trans (loop (x ⁻¹)) (loop x)) ≡⟨ cong (trans _) $ sym loop-∘ ⟩ trans (loop y) (loop (x ⁻¹ ∘ x)) ≡⟨ cong (trans (loop y) ⊚ loop) $ left-inverse _ ⟩ trans (loop y) (loop id) ≡⟨ cong (trans _) loop-id ⟩ trans (loop y) (refl base) ≡⟨ trans-reflʳ _ ⟩∎ loop y ∎ to-loop : ∀ x → to (loop x) ≡ x to-loop x = subst (proj₁ ⊚ Code) (loop x) id ≡⟨ cong (_$ id) subst-Code-loop ⟩ id ∘ x ≡⟨ left-identity _ ⟩∎ x ∎ from-to : ∀ eq → from x (to eq) ≡ eq from-to = elim¹ (λ {x} eq → from x (to eq) ≡ eq) (loop (subst (proj₁ ⊚ Code) (refl base) id) ≡⟨ cong loop $ subst-refl _ _ ⟩ loop id ≡⟨ loop-id ⟩∎ refl base ∎) equiv : proj₁ (Ω (K[ G ]1 , base)) ≃ Carrier equiv = base ≡ base ↝⟨ Eq.↔→≃ to loop to-loop from-to ⟩□ Carrier □ -- The equivalence is homomorphic. hom′ : ∀ x y → _≃_.from equiv (x ∘ y) ≡ _≃_.from equiv x FG.∘ _≃_.from equiv y hom′ x y = loop (x ∘ y) ≡⟨ loop-∘ ⟩∎ trans (loop x) (loop y) ∎ hom : ∀ p q → _≃_.to equiv (p FG.∘ q) ≡ _≃_.to equiv p ∘ _≃_.to equiv q hom p q = _≃_.from-to equiv (_≃_.from equiv (_≃_.to equiv p ∘ _≃_.to equiv q) ≡⟨ hom′ _ _ ⟩ _≃_.from equiv (_≃_.to equiv p) FG.∘ _≃_.from equiv (_≃_.to equiv q) ≡⟨ cong₂ FG._∘_ (_≃_.left-inverse-of equiv p) (_≃_.left-inverse-of equiv q) ⟩∎ p FG.∘ q ∎) -- The right-to-left direction of Fundamental-group′[K1]≃ᴳ is loop. _ : {G : Group g} {univ : Univalence g} {s : Is-set _} → _≃_.from (Fundamental-group′[K1]≃ᴳ {G = G} univ s .related) ≡ loop _ = refl _ -- The fundamental group of (K[ G ]1 , base) is isomorphic to G -- (assuming univalence). -- -- The proof is based on the one given in "Eilenberg-MacLane Spaces in -- Homotopy Type Theory" by Licata and Finster. Fundamental-group[K1]≃ᴳ : {G : Group g} → Univalence g → Fundamental-group (K[ G ]1 , base) ≃ᴳ G Fundamental-group[K1]≃ᴳ univ = ↝ᴳ-trans (≃ᴳ-sym Homotopy-group-[1+]′≃ᴳHomotopy-group-[1+]) (Fundamental-group′[K1]≃ᴳ univ is-groupoid) -- If G is abelian, then the fundamental group of (K[ G ]1 , base) is -- abelian. Abelian→Abelian-Fundamental-group′ : Abelian G → Abelian (Fundamental-group′ (K[ G ]1 , base) is-groupoid) Abelian→Abelian-Fundamental-group′ {G = G} abelian = flip $ EG.Transitivity-commutative.commutative base _∙_ ∙-base base-∙ where open Group G lemma : Carrier → (x : K[ G ]1) → x ≡ x lemma g₁ = elim-set λ where .is-setʳ → λ _ → is-groupoid .baseʳ → loop g₁ .loopʳ g₂ → ≡⇒↝ _ (sym [subst≡]≡[trans≡trans]) (trans (loop g₁) (loop g₂) ≡⟨ sym loop-∘ ⟩ loop (g₁ ∘ g₂) ≡⟨ cong loop (abelian g₁ g₂) ⟩ loop (g₂ ∘ g₁) ≡⟨ loop-∘ ⟩∎ trans (loop g₂) (loop g₁) ∎) lemma-id : ∀ x → lemma id x ≡ refl x lemma-id = elim-prop λ where .is-propositionʳ _ → is-groupoid .baseʳ → loop id ≡⟨ loop-id ⟩∎ refl base ∎ lemma-∘ : ∀ g₁ g₂ x → lemma (g₁ ∘ g₂) x ≡ trans (lemma g₁ x) (lemma g₂ x) lemma-∘ g₁ g₂ = elim-prop λ where .is-propositionʳ _ → is-groupoid .baseʳ → loop (g₁ ∘ g₂) ≡⟨ loop-∘ ⟩∎ trans (loop g₁) (loop g₂) ∎ _∙_ : K[ G ]1 → K[ G ]1 → K[ G ]1 _∙_ x = rec λ where .is-groupoidʳ → is-groupoid .baseʳ → x .loopʳ g → lemma g x .loop-idʳ → lemma-id x .loop-∘ʳ → lemma-∘ _ _ x base-∙ : ∀ x → x ∙ base ≡ x base-∙ _ = refl _ ∙-base : ∀ y → base ∙ y ≡ y ∙-base = elim-set λ where .is-setʳ _ → is-groupoid .baseʳ → refl _ .loopʳ y → subst (λ y → base ∙ y ≡ y) (loop y) (refl _) ≡⟨ subst-in-terms-of-trans-and-cong ⟩ trans (sym (cong (base ∙_) (loop y))) (trans (refl _) (cong P.id (loop y))) ≡⟨ cong (trans _) $ trans (trans-reflˡ _) $ sym $ cong-id _ ⟩ trans (sym (cong (base ∙_) (loop y))) (loop y) ≡⟨ cong (flip trans (loop y) ⊚ sym) $ rec-loop ⟩ trans (sym (loop y)) (loop y) ≡⟨ trans-symˡ _ ⟩∎ refl _ ∎ -- If P is a groupoid, then there is a based embedding from -- (K[ Fundamental-group′ P s ]1 , base) to P (assuming univalence). -- -- Christian Sattler showed me a similar proof of this result. K[Fundamental-group′]1↣ᴮ : {P : Pointed-type p} {s : Is-set (proj₁ (Ω P))} → Univalence p → H-level 3 (proj₁ P) → (K[ Fundamental-group′ P s ]1 , base) ↝[ embedding ]ᴮ P K[Fundamental-group′]1↣ᴮ {P = P@(A , a)} {s = s} univ g = record { to = to; is-embedding = emb } , refl _ where to : K[ Fundamental-group′ P s ]1 → A to = rec λ where .baseʳ → a .loopʳ → P.id .loop-idʳ → refl _ .loop-∘ʳ → refl _ .is-groupoidʳ → g iso : Fundamental-group′ P s ≃ᴳ Fundamental-group′ (K[ Fundamental-group′ P s ]1 , base) is-groupoid iso = ≃ᴳ-sym $ Fundamental-group′[K1]≃ᴳ univ is-groupoid cong-to-iso : cong to ⊚ Homomorphic.to iso ≡ P.id cong-to-iso = ⟨ext⟩ λ eq → cong to (loop eq) ≡⟨ rec-loop ⟩∎ eq ∎ cong-to-equivalence : Eq.Is-equivalence (cong {x = base} {y = base} to) cong-to-equivalence = Eq.Two-out-of-three.g∘f-f (Eq.two-out-of-three _ _) (Is-equivalence-cong _ (ext⁻¹ (sym cong-to-iso)) (_≃_.is-equivalence Eq.id)) (_≃_.is-equivalence (iso .related)) emb : Is-embedding to emb = elim-prop λ where .is-propositionʳ _ → Π-closure ext 1 λ _ → Eq.propositional ext _ .baseʳ → elim-prop λ where .is-propositionʳ _ → Eq.propositional ext _ .baseʳ → cong-to-equivalence -- If P is a connected groupoid, then there is a based equivalence -- from (K[ Fundamental-group′ P s ]1 , base) to P (assuming -- univalence). -- -- Christian Sattler showed me a similar proof of this result. K[Fundamental-group′]1≃ᴮ : {P : Pointed-type p} {s : Is-set (proj₁ (Ω P))} → Univalence p → H-level 3 (proj₁ P) → Connected P → (K[ Fundamental-group′ P s ]1 , base) ≃ᴮ P K[Fundamental-group′]1≃ᴮ {P = P@(A , a)} {s = s} univ g conn = Eq.⟨ Embedding.to (proj₁ f) , _≃_.to TP.surjective×embedding≃equivalence (surj , Embedding.is-embedding (proj₁ f)) ⟩ , proj₂ f where f = K[Fundamental-group′]1↣ᴮ univ g surj : Surjective (Embedding.to (proj₁ f)) surj x = flip TP.∥∥-map (conn x) λ a≡x → base , (Embedding.to (proj₁ f) base ≡⟨⟩ a ≡⟨ a≡x ⟩∎ x ∎) ------------------------------------------------------------------------ -- Another result related to a fundamental group -- If G is abelian, then the fundamental group of -- (K[ G ]1 ≃ K[ G ]1 , Eq.id) is isomorphic to G (assuming -- univalence). -- -- I was informed of a related result by Christian Sattler. Fundamental-group′[K1≃K1]≃ᴳ : {G : Group g} {s : Is-set _} → Univalence g → Abelian G → Fundamental-group′ ((K[ G ]1 ≃ K[ G ]1) , Eq.id) s ≃ᴳ G Fundamental-group′[K1≃K1]≃ᴳ {G = G} univ abelian = λ where .related → _≡_ {A = K[ G ]1 ≃ K[ G ]1} Eq.id Eq.id ↝⟨ inverse $ ≃-to-≡≃≡ ext ext ⟩ ((x : K[ G ]1) → x ≡ x) ↝⟨ Eq.↔→≃ to from to-from from-to ⟩□ Carrier □ .homomorphic p q → Homomorphic.to iso (cong (λ eq → _≃_.to eq base) (trans p q)) ≡⟨ cong (Homomorphic.to iso) $ cong-trans _ _ _ ⟩ Homomorphic.to iso (trans (cong (λ eq → _≃_.to eq base) p) (cong (λ eq → _≃_.to eq base) q)) ≡⟨ Homomorphic.homomorphic iso _ _ ⟩∎ Homomorphic.to iso (cong (λ eq → _≃_.to eq base) p) ∘ Homomorphic.to iso (cong (λ eq → _≃_.to eq base) q) ∎ where open Group G iso = Fundamental-group′[K1]≃ᴳ {G = G} univ is-groupoid to : ((x : K[ G ]1) → x ≡ x) → Carrier to f = Homomorphic.to iso (f base) from : Carrier → (x : K[ G ]1) → x ≡ x from x = elim-set λ where .is-setʳ _ → is-groupoid .baseʳ → loop x .loopʳ y → ≡⇒↝ _ (sym [subst≡]≡[trans≡trans]) (trans (loop x) (loop y) ≡⟨ sym loop-∘ ⟩ loop (x ∘ y) ≡⟨ cong loop $ abelian x y ⟩ loop (y ∘ x) ≡⟨ loop-∘ ⟩∎ trans (loop y) (loop x) ∎) to-from : ∀ p → to (from p) ≡ p to-from x = Homomorphic.to iso (loop x) ≡⟨ _≃_.right-inverse-of (Homomorphic.related iso) _ ⟩∎ x ∎ from-to : ∀ f → from (to f) ≡ f from-to f = ⟨ext⟩ $ elim-prop λ where .is-propositionʳ _ → is-groupoid .baseʳ → loop (Homomorphic.to iso (f base)) ≡⟨ _≃_.left-inverse-of (Homomorphic.related iso) _ ⟩∎ f base ∎
{ "alphanum_fraction": 0.475862069, "avg_line_length": 35.3533568905, "ext": "agda", "hexsha": "f3dbcf41df92e6a7a705522dff6bd20c4315894c", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "402b20615cfe9ca944662380d7b2d69b0f175200", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "nad/equality", "max_forks_repo_path": "src/Eilenberg-MacLane-space.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "402b20615cfe9ca944662380d7b2d69b0f175200", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "nad/equality", "max_issues_repo_path": "src/Eilenberg-MacLane-space.agda", "max_line_length": 136, "max_stars_count": 3, "max_stars_repo_head_hexsha": "402b20615cfe9ca944662380d7b2d69b0f175200", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "nad/equality", "max_stars_repo_path": "src/Eilenberg-MacLane-space.agda", "max_stars_repo_stars_event_max_datetime": "2021-09-02T17:18:15.000Z", "max_stars_repo_stars_event_min_datetime": "2020-05-21T22:58:50.000Z", "num_tokens": 11682, "size": 30015 }
------------------------------------------------------------------------ -- The equality can be turned into a groupoid which is sometimes -- commutative ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Equality module Equality.Groupoid {reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where open import Bijection eq using (_↔_) open Derived-definitions-and-properties eq open import Equality.Tactic eq open import Groupoid eq open import Pointed-type eq open import Prelude hiding (id; _∘_) ------------------------------------------------------------------------ -- _≡_ comes with a groupoid structure groupoid : ∀ {a} (A : Type a) → Groupoid a a groupoid A = record { Object = A ; _∼_ = _≡_ ; id = refl _ ; _∘_ = flip trans ; _⁻¹ = sym ; left-identity = trans-reflʳ ; right-identity = trans-reflˡ ; assoc = λ z≡u y≡z x≡y → trans-assoc x≡y y≡z z≡u ; left-inverse = trans-symʳ ; right-inverse = trans-symˡ } ------------------------------------------------------------------------ -- In some cases transitivity is commutative -- This proof is based on an informal proof due to Thierry Coquand, -- based on a result from homotopy theory. module Transitivity-commutative {a} {A : Type a} (e : A) (_∙_ : A → A → A) (left-identity : ∀ x → (e ∙ x) ≡ x) (right-identity : ∀ x → (x ∙ e) ≡ x) where open Groupoid (groupoid A) hiding (left-identity; right-identity) abstract commutative : (p q : e ≡ e) → p ∘ q ≡ q ∘ p commutative p q = p ∘ q ≡⟨ cong (_∘_ p) (lem₁ _) ⟩ p ∘ (ri ∘ li ⁻¹ ∘ q′ ∘ li ∘ ri ⁻¹) ≡⟨ prove (Trans (Trans (Trans (Trans (Trans (Sym (Lift ri)) (Lift li)) (Lift q′)) (Sym (Lift li))) (Lift ri)) (Lift p)) (Trans (Trans (Sym (Lift ri)) (Trans (Trans (Lift li) (Lift q′)) (Sym (Lift li)))) (Trans (Lift ri) (Lift p))) (refl _) ⟩ (p ∘ ri) ∘ (li ⁻¹ ∘ q′ ∘ li) ∘ ri ⁻¹ ≡⟨ cong₂ (λ p q → p ∘ q ∘ ri ⁻¹) (lem₂ _) (lem₃ _) ⟩ (ri ∘ lc p) ∘ rc q′ ∘ ri ⁻¹ ≡⟨ prove (Trans (Trans (Sym (Lift ri)) (Lift (rc q′))) (Trans (Lift (lc p)) (Lift ri))) (Trans (Trans (Sym (Lift ri)) (Trans (Lift (rc q′)) (Lift (lc p)))) (Lift ri)) (refl _) ⟩ ri ∘ (lc p ∘ rc q′) ∘ ri ⁻¹ ≡⟨ cong (λ p → ri ∘ p ∘ ri ⁻¹) (lem₄ _ _) ⟩ ri ∘ (rc q′ ∘ lc p) ∘ ri ⁻¹ ≡⟨ prove (Trans (Trans (Sym (Lift ri)) (Trans (Lift (lc p)) (Lift (rc q′)))) (Lift ri)) (Trans (Trans (Trans (Sym (Lift ri)) (Lift (lc p))) (Lift (rc q′))) (Lift ri)) (refl _) ⟩ ri ∘ rc q′ ∘ (lc p ∘ ri ⁻¹) ≡⟨ cong₂ (λ p q → ri ∘ p ∘ q) (sym (lem₃ _)) (lem₅ _) ⟩ ri ∘ (li ⁻¹ ∘ q′ ∘ li) ∘ (ri ⁻¹ ∘ p) ≡⟨ prove (Trans (Trans (Trans (Lift p) (Sym (Lift ri))) (Trans (Trans (Lift li) (Lift q′)) (Sym (Lift li)))) (Lift ri)) (Trans (Lift p) (Trans (Trans (Trans (Trans (Sym (Lift ri)) (Lift li)) (Lift q′)) (Sym (Lift li))) (Lift ri))) (refl _) ⟩ (ri ∘ li ⁻¹ ∘ q′ ∘ li ∘ ri ⁻¹) ∘ p ≡⟨ cong (λ q → q ∘ p) (sym (lem₁ _)) ⟩∎ q ∘ p ∎ where -- Abbreviations. li : ∀ {x} → (e ∙ x) ≡ x li = left-identity _ ri : ∀ {x} → (x ∙ e) ≡ x ri = right-identity _ q′ : e ≡ e q′ = li ∘ ri ⁻¹ ∘ q ∘ ri ∘ li ⁻¹ lc : ∀ {x y} → x ≡ y → (x ∙ e) ≡ (y ∙ e) lc = cong (λ x → (x ∙ e)) rc : ∀ {x y} → x ≡ y → (e ∙ x) ≡ (e ∙ y) rc = cong (λ y → (e ∙ y)) -- Lemmas. lem₁ : (p : e ≡ e) → p ≡ ri ∘ li ⁻¹ ∘ (li ∘ ri ⁻¹ ∘ p ∘ ri ∘ li ⁻¹) ∘ li ∘ ri ⁻¹ lem₁ p = p ≡⟨ prove (Lift p) (Trans (Trans Refl (Lift p)) Refl) (refl _) ⟩ refl _ ∘ p ∘ refl _ ≡⟨ sym (cong₂ (λ q r → q ∘ p ∘ r) (right-inverse _) (right-inverse _)) ⟩ (ri ∘ ri ⁻¹) ∘ p ∘ (ri ∘ ri ⁻¹) ≡⟨ prove (Trans (Trans (Trans (Sym (Lift ri)) (Lift ri)) (Lift p)) (Trans (Sym (Lift ri)) (Lift ri))) (Trans (Trans (Trans (Trans (Trans (Trans (Sym (Lift ri)) Refl) (Lift ri)) (Lift p)) (Sym (Lift ri))) Refl) (Lift ri)) (refl _) ⟩ ri ∘ refl _ ∘ ri ⁻¹ ∘ p ∘ ri ∘ refl _ ∘ ri ⁻¹ ≡⟨ sym (cong₂ (λ q r → ri ∘ q ∘ ri ⁻¹ ∘ p ∘ ri ∘ r ∘ ri ⁻¹) (left-inverse _) (left-inverse _)) ⟩ ri ∘ (li ⁻¹ ∘ li) ∘ ri ⁻¹ ∘ p ∘ ri ∘ (li ⁻¹ ∘ li) ∘ ri ⁻¹ ≡⟨ prove (Trans (Trans (Trans (Trans (Trans (Trans (Sym (Lift ri)) (Trans (Lift li) (Sym (Lift li)))) (Lift ri)) (Lift p)) (Sym (Lift ri))) (Trans (Lift li) (Sym (Lift li)))) (Lift ri)) (Trans (Trans (Trans (Trans (Sym (Lift ri)) (Lift li)) (Trans (Trans (Trans (Trans (Sym (Lift li)) (Lift ri)) (Lift p)) (Sym (Lift ri))) (Lift li))) (Sym (Lift li))) (Lift ri)) (refl _) ⟩∎ ri ∘ li ⁻¹ ∘ (li ∘ ri ⁻¹ ∘ p ∘ ri ∘ li ⁻¹) ∘ li ∘ ri ⁻¹ ∎ lem₂ : ∀ {x y} (p : x ≡ y) → p ∘ ri ≡ ri ∘ lc p lem₂ = elim (λ p → p ∘ ri ≡ ri ∘ lc p) λ _ → prove (Trans (Lift ri) Refl) (Trans (Cong (λ x → (x ∙ e)) Refl) (Lift ri)) (refl _) lem₃ : ∀ {x y} (p : x ≡ y) → li ⁻¹ ∘ p ∘ li ≡ rc p lem₃ = elim (λ p → li ⁻¹ ∘ p ∘ li ≡ rc p) λ x → li ⁻¹ ∘ refl x ∘ li ≡⟨ prove (Trans (Trans (Lift li) Refl) (Sym (Lift li))) (Trans (Lift li) (Sym (Lift li))) (refl _) ⟩ li ⁻¹ ∘ li ≡⟨ left-inverse _ ⟩ refl (e ∙ x) ≡⟨ prove Refl (Cong (λ y → (e ∙ y)) Refl) (refl _) ⟩∎ rc (refl x) ∎ lem₄ : (p q : e ≡ e) → lc p ∘ rc q ≡ rc q ∘ lc p lem₄ p q = elim (λ {x y} x≡y → lc x≡y ∘ cong (λ z → (x ∙ z)) q ≡ cong (λ z → (y ∙ z)) q ∘ lc x≡y) (λ x → prove (Trans (Cong (λ z → x ∙ z) (Lift q)) (Cong (λ x → x ∙ e) Refl)) (Trans (Cong (λ x → x ∙ e) Refl) (Cong (λ z → x ∙ z) (Lift q))) (refl _)) p lem₅ : ∀ {x y} (p : x ≡ y) → lc p ∘ ri ⁻¹ ≡ ri ⁻¹ ∘ p lem₅ = elim (λ p → lc p ∘ ri ⁻¹ ≡ ri ⁻¹ ∘ p) λ _ → prove (Trans (Sym (Lift ri)) (Cong (λ x → (x ∙ e)) Refl)) (Trans Refl (Sym (Lift ri))) (refl _) -- In particular, transitivity is commutative for proofs in -- proj₁ (Ω[ 2 + n ] X). Ω[2+n]-commutative : ∀ {x} {X : Pointed-type x} n → (p q : proj₁ (Ω[ 2 + n ] X)) → trans p q ≡ trans q p Ω[2+n]-commutative {X = X} n p q = Transitivity-commutative.commutative id _∘_ left-identity right-identity q p where open Groupoid (groupoid (proj₁ (Ω[ n ] X)))
{ "alphanum_fraction": 0.3328036322, "avg_line_length": 51.2209302326, "ext": "agda", "hexsha": "19487340df17ceacb6700c8808a3e7ab2be3d724", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "402b20615cfe9ca944662380d7b2d69b0f175200", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "nad/equality", "max_forks_repo_path": "src/Equality/Groupoid.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "402b20615cfe9ca944662380d7b2d69b0f175200", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "nad/equality", "max_issues_repo_path": "src/Equality/Groupoid.agda", "max_line_length": 135, "max_stars_count": 3, "max_stars_repo_head_hexsha": "402b20615cfe9ca944662380d7b2d69b0f175200", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "nad/equality", "max_stars_repo_path": "src/Equality/Groupoid.agda", "max_stars_repo_stars_event_max_datetime": "2021-09-02T17:18:15.000Z", "max_stars_repo_stars_event_min_datetime": "2020-05-21T22:58:50.000Z", "num_tokens": 2694, "size": 8810 }
module Implicits.Syntax.Type.Unification.Lemmas where open import Prelude open import Data.Nat.Properties.Simple open import Data.Maybe as Maybe open import Data.Vec open import Extensions.Vec open import Implicits.Syntax open import Implicits.Syntax.Type.Unification hiding (open-meta) open import Implicits.Substitutions open import Implicits.Substitutions.Lemmas.MetaType open MetaTypeMetaSubst open MetaTypeMetaLemmas open import Relation.Binary.HeterogeneousEquality as H using () -- the following properties of mgu are assumed to hold here but have been proven by -- Conor McBride (and verified using the LEGO dependently typed language) postulate sound : ∀ {m ν} (a : MetaType m ν) (b : SimpleType ν) → Maybe.All (Unifier a b) (mgu a b) postulate complete : ∀ {m ν} (a : MetaType m ν) (b : SimpleType ν) u → Unifier a b u → Is-just (mgu a b) to-meta-zero-vanishes : ∀ {ν} {a : Type ν} → from-meta (to-meta a) ≡ a to-meta-zero-vanishes {a = simpl (tc x)} = refl to-meta-zero-vanishes {a = simpl (tvar n)} = refl to-meta-zero-vanishes {a = simpl (a →' b)} = cong₂ (λ u v → simpl (u →' v)) to-meta-zero-vanishes to-meta-zero-vanishes to-meta-zero-vanishes {a = a ⇒ b} = cong₂ _⇒_ to-meta-zero-vanishes to-meta-zero-vanishes to-meta-zero-vanishes {a = ∀' a} = cong ∀' to-meta-zero-vanishes mutual from-to-smeta : ∀ {ν} (a : SimpleType ν) → from-smeta (to-smeta a) ≡ a from-to-smeta (tc x) = refl from-to-smeta (tvar n) = refl from-to-smeta (a →' b) = cong₂ _→'_ (from-to-meta a) (from-to-meta b) from-to-meta : ∀ {ν} (a : Type ν) → from-meta (to-meta a) ≡ a from-to-meta (simpl x) = cong simpl (from-to-smeta x) from-to-meta (a ⇒ b) = cong₂ _⇒_ (from-to-meta a) (from-to-meta b) from-to-meta (∀' a) = cong ∀' (from-to-meta a) from-to-meta-/-vanishes : ∀ {ν} {a : Type ν} {s} → from-meta (to-meta {zero} a MetaTypeMetaSubst./ s) ≡ a from-to-meta-/-vanishes {a = a} {s = []} = begin from-meta (MetaTypeMetaSubst._/_ (to-meta {zero} a) []) ≡⟨ cong (λ q → from-meta q) (MetaTypeMetaLemmas.id-vanishes (to-meta {zero} a)) ⟩ from-meta (to-meta {zero} a) ≡⟨ to-meta-zero-vanishes ⟩ a ∎ mgu-id : ∀ {ν} → (a : SimpleType ν) → Unifiable {m = zero} (simpl (to-smeta a)) a mgu-id a = [] , (begin from-meta (MetaTypeMetaSubst._/_ (simpl (to-smeta a)) []) ≡⟨ from-to-meta-/-vanishes ⟩ simpl a ∎) mvar-unifiable : ∀ {ν m} (n : Fin m) (τ : SimpleType ν) → Unifiable (simpl (mvar n)) τ mvar-unifiable n τ = u , p where u = replicate (simpl (tc zero)) [ n ]≔ simpl (to-smeta τ) p : from-meta (lookup n u) ≡ simpl τ p = begin from-meta (lookup n u) ≡⟨ cong from-meta (lookup-≔ (replicate (simpl (tc zero))) n _) ⟩ simpl (from-smeta (to-smeta τ)) ≡⟨ cong simpl (from-to-smeta τ) ⟩ simpl τ ∎
{ "alphanum_fraction": 0.6297589941, "avg_line_length": 38.1733333333, "ext": "agda", "hexsha": "35fb1513cf030fa25dfbb636404244b7125c5d6c", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "7fe638b87de26df47b6437f5ab0a8b955384958d", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "metaborg/ts.agda", "max_forks_repo_path": "src/Implicits/Syntax/Type/Unification/Lemmas.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "7fe638b87de26df47b6437f5ab0a8b955384958d", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "metaborg/ts.agda", "max_issues_repo_path": "src/Implicits/Syntax/Type/Unification/Lemmas.agda", "max_line_length": 89, "max_stars_count": 4, "max_stars_repo_head_hexsha": "7fe638b87de26df47b6437f5ab0a8b955384958d", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "metaborg/ts.agda", "max_stars_repo_path": "src/Implicits/Syntax/Type/Unification/Lemmas.agda", "max_stars_repo_stars_event_max_datetime": "2021-05-07T04:08:41.000Z", "max_stars_repo_stars_event_min_datetime": "2019-04-05T17:57:11.000Z", "num_tokens": 983, "size": 2863 }
-- Andreas, 2017-01-13, issue #2402 -- Error message: incomplete pattern matching open import Common.Bool module _ (A B C D E F G H I J K L M O P Q R S T U V W X Y Z : Set) where test2 : Bool → Bool test2 x with true test2 true | x = ? -- WAS: Reports: -- Incomplete pattern matching for .IncompletePattern.with-56. -- Missing cases: -- .IncompletePattern.with-56 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ false -- when checking the definition of with-56 -- That's total bogus! -- Expected: -- Incomplete pattern matching for .Issue2402-2.with-56. -- Missing cases: -- test2 false | w -- when checking the definition of with-56
{ "alphanum_fraction": 0.6805555556, "avg_line_length": 25.92, "ext": "agda", "hexsha": "da2737f5b8eb731b289b63ae071835d8f3cec18e", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "231d6ad8e77b67ff8c4b1cb35a6c31ccd988c3e9", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "Agda-zh/agda", "max_forks_repo_path": "test/Fail/Issue2402-2.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "shlevy/agda", "max_issues_repo_path": "test/Fail/Issue2402-2.agda", "max_line_length": 89, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "shlevy/agda", "max_stars_repo_path": "test/Fail/Issue2402-2.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 197, "size": 648 }
{-# OPTIONS --safe #-} module Cubical.Algebra.Ring.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Equiv.HalfAdjoint open import Cubical.Foundations.Function open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import Cubical.Foundations.Transport open import Cubical.Foundations.SIP open import Cubical.Data.Sigma open import Cubical.Algebra.Semigroup open import Cubical.Algebra.Monoid open import Cubical.Algebra.Group open import Cubical.Algebra.AbGroup open import Cubical.Displayed.Base open import Cubical.Displayed.Auto open import Cubical.Displayed.Record open import Cubical.Displayed.Universe open import Cubical.Reflection.RecordEquiv open Iso private variable ℓ ℓ' : Level record IsRing {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) : Type ℓ where constructor isring field +IsAbGroup : IsAbGroup 0r _+_ -_ ·IsMonoid : IsMonoid 1r _·_ dist : (x y z : R) → (x · (y + z) ≡ (x · y) + (x · z)) × ((x + y) · z ≡ (x · z) + (y · z)) -- This is in the Agda stdlib, but it's redundant -- zero : (x : R) → (x · 0r ≡ 0r) × (0r · x ≡ 0r) open IsAbGroup +IsAbGroup public renaming ( assoc to +Assoc ; identity to +Identity ; lid to +Lid ; rid to +Rid ; inverse to +Inv ; invl to +Linv ; invr to +Rinv ; comm to +Comm ; isSemigroup to +IsSemigroup ; isMonoid to +IsMonoid ; isGroup to +IsGroup ) open IsMonoid ·IsMonoid public renaming ( assoc to ·Assoc ; identity to ·Identity ; lid to ·Lid ; rid to ·Rid ; isSemigroup to ·IsSemigroup ) hiding ( is-set ) -- We only want to export one proof of this ·Rdist+ : (x y z : R) → x · (y + z) ≡ (x · y) + (x · z) ·Rdist+ x y z = dist x y z .fst ·Ldist+ : (x y z : R) → (x + y) · z ≡ (x · z) + (y · z) ·Ldist+ x y z = dist x y z .snd record RingStr (A : Type ℓ) : Type (ℓ-suc ℓ) where constructor ringstr field 0r : A 1r : A _+_ : A → A → A _·_ : A → A → A -_ : A → A isRing : IsRing 0r 1r _+_ _·_ -_ infix 8 -_ infixl 7 _·_ infixl 6 _+_ open IsRing isRing public Ring : ∀ ℓ → Type (ℓ-suc ℓ) Ring ℓ = TypeWithStr ℓ RingStr isSetRing : (R : Ring ℓ) → isSet ⟨ R ⟩ isSetRing R = R .snd .RingStr.isRing .IsRing.·IsMonoid .IsMonoid.isSemigroup .IsSemigroup.is-set makeIsRing : {R : Type ℓ} {0r 1r : R} {_+_ _·_ : R → R → R} { -_ : R → R} (is-setR : isSet R) (+-assoc : (x y z : R) → x + (y + z) ≡ (x + y) + z) (+-rid : (x : R) → x + 0r ≡ x) (+-rinv : (x : R) → x + (- x) ≡ 0r) (+-comm : (x y : R) → x + y ≡ y + x) (r+-assoc : (x y z : R) → x · (y · z) ≡ (x · y) · z) (·-rid : (x : R) → x · 1r ≡ x) (·-lid : (x : R) → 1r · x ≡ x) (·-rdist-+ : (x y z : R) → x · (y + z) ≡ (x · y) + (x · z)) (·-ldist-+ : (x y z : R) → (x + y) · z ≡ (x · z) + (y · z)) → IsRing 0r 1r _+_ _·_ -_ makeIsRing is-setR assoc +-rid +-rinv +-comm ·-assoc ·-rid ·-lid ·-rdist-+ ·-ldist-+ = isring (makeIsAbGroup is-setR assoc +-rid +-rinv +-comm) (makeIsMonoid is-setR ·-assoc ·-rid ·-lid) λ x y z → ·-rdist-+ x y z , ·-ldist-+ x y z makeRing : {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) (is-setR : isSet R) (+-assoc : (x y z : R) → x + (y + z) ≡ (x + y) + z) (+-rid : (x : R) → x + 0r ≡ x) (+-rinv : (x : R) → x + (- x) ≡ 0r) (+-comm : (x y : R) → x + y ≡ y + x) (+-assoc : (x y z : R) → x · (y · z) ≡ (x · y) · z) (·-rid : (x : R) → x · 1r ≡ x) (·-lid : (x : R) → 1r · x ≡ x) (·-rdist-+ : (x y z : R) → x · (y + z) ≡ (x · y) + (x · z)) (·-ldist-+ : (x y z : R) → (x + y) · z ≡ (x · z) + (y · z)) → Ring ℓ makeRing 0r 1r _+_ _·_ -_ is-setR assoc +-rid +-rinv +-comm ·-assoc ·-rid ·-lid ·-rdist-+ ·-ldist-+ = _ , ringstr 0r 1r _+_ _·_ -_ (makeIsRing is-setR assoc +-rid +-rinv +-comm ·-assoc ·-rid ·-lid ·-rdist-+ ·-ldist-+ ) record IsRingHom {A : Type ℓ} {B : Type ℓ'} (R : RingStr A) (f : A → B) (S : RingStr B) : Type (ℓ-max ℓ ℓ') where -- Shorter qualified names private module R = RingStr R module S = RingStr S field pres0 : f R.0r ≡ S.0r pres1 : f R.1r ≡ S.1r pres+ : (x y : A) → f (x R.+ y) ≡ f x S.+ f y pres· : (x y : A) → f (x R.· y) ≡ f x S.· f y pres- : (x : A) → f (R.- x) ≡ S.- (f x) unquoteDecl IsRingHomIsoΣ = declareRecordIsoΣ IsRingHomIsoΣ (quote IsRingHom) RingHom : (R : Ring ℓ) (S : Ring ℓ') → Type (ℓ-max ℓ ℓ') RingHom R S = Σ[ f ∈ (⟨ R ⟩ → ⟨ S ⟩) ] IsRingHom (R .snd) f (S .snd) IsRingEquiv : {A : Type ℓ} {B : Type ℓ'} (M : RingStr A) (e : A ≃ B) (N : RingStr B) → Type (ℓ-max ℓ ℓ') IsRingEquiv M e N = IsRingHom M (e .fst) N RingEquiv : (R : Ring ℓ) (S : Ring ℓ') → Type (ℓ-max ℓ ℓ') RingEquiv R S = Σ[ e ∈ (⟨ R ⟩ ≃ ⟨ S ⟩) ] IsRingEquiv (R .snd) e (S .snd) _$_ : {R S : Ring ℓ} → (φ : RingHom R S) → (x : ⟨ R ⟩) → ⟨ S ⟩ φ $ x = φ .fst x RingEquiv→RingHom : {A B : Ring ℓ} → RingEquiv A B → RingHom A B RingEquiv→RingHom (e , eIsHom) = e .fst , eIsHom isPropIsRing : {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) → isProp (IsRing 0r 1r _+_ _·_ -_) isPropIsRing 0r 1r _+_ _·_ -_ (isring RG RM RD) (isring SG SM SD) = λ i → isring (isPropIsAbGroup _ _ _ RG SG i) (isPropIsMonoid _ _ RM SM i) (isPropDistr RD SD i) where isSetR : isSet _ isSetR = RM .IsMonoid.isSemigroup .IsSemigroup.is-set isPropDistr : isProp ((x y z : _) → ((x · (y + z)) ≡ ((x · y) + (x · z))) × (((x + y) · z) ≡ ((x · z) + (y · z)))) isPropDistr = isPropΠ3 λ _ _ _ → isProp× (isSetR _ _) (isSetR _ _) isPropIsRingHom : {A : Type ℓ} {B : Type ℓ'} (R : RingStr A) (f : A → B) (S : RingStr B) → isProp (IsRingHom R f S) isPropIsRingHom R f S = isOfHLevelRetractFromIso 1 IsRingHomIsoΣ (isProp×4 (isSetRing (_ , S) _ _) (isSetRing (_ , S) _ _) (isPropΠ2 λ _ _ → isSetRing (_ , S) _ _) (isPropΠ2 λ _ _ → isSetRing (_ , S) _ _) (isPropΠ λ _ → isSetRing (_ , S) _ _)) isSetRingHom : (R : Ring ℓ) (S : Ring ℓ') → isSet (RingHom R S) isSetRingHom R S = isSetΣSndProp (isSetΠ (λ _ → isSetRing S)) (λ f → isPropIsRingHom (snd R) f (snd S)) RingHomPathP : (R S T : Ring ℓ) (p : S ≡ T) (φ : RingHom R S) (ψ : RingHom R T) → PathP (λ i → R .fst → p i .fst) (φ .fst) (ψ .fst) → PathP (λ i → RingHom R (p i)) φ ψ RingHomPathP R S T p φ ψ q = ΣPathP (q , isProp→PathP (λ _ → isPropIsRingHom _ _ _) _ _) RingHom≡ : {R S : Ring ℓ} {φ ψ : RingHom R S} → fst φ ≡ fst ψ → φ ≡ ψ RingHom≡ = Σ≡Prop λ f → isPropIsRingHom _ f _ 𝒮ᴰ-Ring : DUARel (𝒮-Univ ℓ) RingStr ℓ 𝒮ᴰ-Ring = 𝒮ᴰ-Record (𝒮-Univ _) IsRingEquiv (fields: data[ 0r ∣ null ∣ pres0 ] data[ 1r ∣ null ∣ pres1 ] data[ _+_ ∣ bin ∣ pres+ ] data[ _·_ ∣ bin ∣ pres· ] data[ -_ ∣ un ∣ pres- ] prop[ isRing ∣ (λ _ _ → isPropIsRing _ _ _ _ _) ]) where open RingStr open IsRingHom -- faster with some sharing null = autoDUARel (𝒮-Univ _) (λ A → A) un = autoDUARel (𝒮-Univ _) (λ A → A → A) bin = autoDUARel (𝒮-Univ _) (λ A → A → A → A) RingPath : (R S : Ring ℓ) → RingEquiv R S ≃ (R ≡ S) RingPath = ∫ 𝒮ᴰ-Ring .UARel.ua -- Rings have an abelian group and a monoid Ring→AbGroup : Ring ℓ → AbGroup ℓ Ring→AbGroup (A , ringstr _ _ _ _ _ R) = A , abgroupstr _ _ _ (IsRing.+IsAbGroup R) Ring→Group : Ring ℓ → Group ℓ Ring→Group = AbGroup→Group ∘ Ring→AbGroup Ring→AddMonoid : Ring ℓ → Monoid ℓ Ring→AddMonoid = Group→Monoid ∘ Ring→Group Ring→MultMonoid : Ring ℓ → Monoid ℓ Ring→MultMonoid (A , ringstr _ _ _ _ _ R) = monoid _ _ _ (IsRing.·IsMonoid R) -- Smart constructor for ring homomorphisms -- that infers the other equations from pres1, pres+, and pres· module _ {R : Ring ℓ} {S : Ring ℓ'} {f : ⟨ R ⟩ → ⟨ S ⟩} where private module R = RingStr (R .snd) module S = RingStr (S .snd) module _ (p1 : f R.1r ≡ S.1r) (p+ : (x y : ⟨ R ⟩) → f (x R.+ y) ≡ f x S.+ f y) (p· : (x y : ⟨ R ⟩) → f (x R.· y) ≡ f x S.· f y) where open IsRingHom private isGHom : IsGroupHom (Ring→Group R .snd) f (Ring→Group S .snd) isGHom = makeIsGroupHom p+ makeIsRingHom : IsRingHom (R .snd) f (S .snd) makeIsRingHom .pres0 = isGHom .IsGroupHom.pres1 makeIsRingHom .pres1 = p1 makeIsRingHom .pres+ = p+ makeIsRingHom .pres· = p· makeIsRingHom .pres- = isGHom .IsGroupHom.presinv
{ "alphanum_fraction": 0.5173710998, "avg_line_length": 34.1056603774, "ext": "agda", "hexsha": "d12f9dddeb31b8e32e21e3a25eef80b2dd6a068d", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "9f9ad9dad7404c75cf457f81ba5ac269afe1b1a7", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "lpw25/cubical", "max_forks_repo_path": "Cubical/Algebra/Ring/Base.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "9f9ad9dad7404c75cf457f81ba5ac269afe1b1a7", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "lpw25/cubical", "max_issues_repo_path": "Cubical/Algebra/Ring/Base.agda", "max_line_length": 103, "max_stars_count": null, "max_stars_repo_head_hexsha": "9f9ad9dad7404c75cf457f81ba5ac269afe1b1a7", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "lpw25/cubical", "max_stars_repo_path": "Cubical/Algebra/Ring/Base.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 3675, "size": 9038 }
------------------------------------------------------------------------ -- The Agda standard library -- -- Operations on and properties of decidable relations -- -- This file contains some core definitions which are re-exported by -- Relation.Nullary.Decidable ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Relation.Nullary.Decidable.Core where open import Level using (Level; Lift) open import Data.Bool.Base using (Bool; false; true; not; T) open import Data.Unit.Base using (⊤) open import Data.Empty open import Data.Product open import Function.Base open import Agda.Builtin.Equality open import Relation.Nullary.Reflects open import Relation.Nullary private variable p q : Level P : Set p Q : Set q -- `isYes` is a stricter version of `does`. The lack of computation means that -- we can recover the proposition `P` from `isYes P?` by unification. This is -- useful when we are using the decision procedure for proof automation. isYes : Dec P → Bool isYes ( true because _) = true isYes (false because _) = false isYes≗does : (P? : Dec P) → isYes P? ≡ does P? isYes≗does ( true because _) = refl isYes≗does (false because _) = refl -- The traditional name for isYes is ⌊_⌋, indicating the stripping of evidence. ⌊_⌋ = isYes isNo : Dec P → Bool isNo = not ∘ isYes True : Dec P → Set True Q = T (isYes Q) False : Dec P → Set False Q = T (isNo Q) -- Gives a witness to the "truth". toWitness : {Q : Dec P} → True Q → P toWitness {Q = true because [p]} _ = invert [p] toWitness {Q = false because _ } () -- Establishes a "truth", given a witness. fromWitness : {Q : Dec P} → P → True Q fromWitness {Q = true because _ } = const _ fromWitness {Q = false because [¬p]} = invert [¬p] -- Variants for False. toWitnessFalse : {Q : Dec P} → False Q → ¬ P toWitnessFalse {Q = true because _ } () toWitnessFalse {Q = false because [¬p]} _ = invert [¬p] fromWitnessFalse : {Q : Dec P} → ¬ P → False Q fromWitnessFalse {Q = true because [p]} = flip _$_ (invert [p]) fromWitnessFalse {Q = false because _ } = const _ -- If a decision procedure returns "yes", then we can extract the -- proof using from-yes. module _ {p} {P : Set p} where From-yes : Dec P → Set p From-yes (true because _) = P From-yes (false because _) = Lift p ⊤ from-yes : (p : Dec P) → From-yes p from-yes (true because [p]) = invert [p] from-yes (false because _ ) = _ -- If a decision procedure returns "no", then we can extract the proof -- using from-no. From-no : Dec P → Set p From-no (false because _) = ¬ P From-no (true because _) = Lift p ⊤ from-no : (p : Dec P) → From-no p from-no (false because [¬p]) = invert [¬p] from-no (true because _ ) = _ ------------------------------------------------------------------------ -- Result of decidability dec-true : (p? : Dec P) → P → does p? ≡ true dec-true (true because _ ) p = refl dec-true (false because [¬p]) p = ⊥-elim (invert [¬p] p) dec-false : (p? : Dec P) → ¬ P → does p? ≡ false dec-false (false because _ ) ¬p = refl dec-false (true because [p]) ¬p = ⊥-elim (¬p (invert [p])) dec-yes : (p? : Dec P) → P → ∃ λ p′ → p? ≡ yes p′ dec-yes p? p with dec-true p? p dec-yes (yes p′) p | refl = p′ , refl dec-no : (p? : Dec P) → ¬ P → ∃ λ ¬p′ → p? ≡ no ¬p′ dec-no p? ¬p with dec-false p? ¬p dec-no (no ¬p′) ¬p | refl = ¬p′ , refl dec-yes-irr : (p? : Dec P) → Irrelevant P → (p : P) → p? ≡ yes p dec-yes-irr p? irr p with dec-yes p? p ... | p′ , eq rewrite irr p p′ = eq ------------------------------------------------------------------------ -- Maps map′ : (P → Q) → (Q → P) → Dec P → Dec Q does (map′ P→Q Q→P p?) = does p? proof (map′ P→Q Q→P (true because [p])) = ofʸ (P→Q (invert [p])) proof (map′ P→Q Q→P (false because [¬p])) = ofⁿ (invert [¬p] ∘ Q→P)
{ "alphanum_fraction": 0.5762360859, "avg_line_length": 29.4885496183, "ext": "agda", "hexsha": "11734ac9c79b41c60ccbcd50b2f0069bdcda6122", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "DreamLinuxer/popl21-artifact", "max_forks_repo_path": "agda-stdlib/src/Relation/Nullary/Decidable/Core.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "DreamLinuxer/popl21-artifact", "max_issues_repo_path": "agda-stdlib/src/Relation/Nullary/Decidable/Core.agda", "max_line_length": 79, "max_stars_count": 5, "max_stars_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "DreamLinuxer/popl21-artifact", "max_stars_repo_path": "agda-stdlib/src/Relation/Nullary/Decidable/Core.agda", "max_stars_repo_stars_event_max_datetime": "2020-10-10T21:41:32.000Z", "max_stars_repo_stars_event_min_datetime": "2020-10-07T12:07:53.000Z", "num_tokens": 1227, "size": 3863 }
------------------------------------------------------------------------ -- Digits and digit expansions ------------------------------------------------------------------------ module Data.Digit where open import Data.Nat open import Data.Nat.Properties open SemiringSolver open import Data.Fin as Fin using (Fin; zero; suc; toℕ) open import Relation.Nullary.Decidable open import Data.Char using (Char) open import Data.List open import Data.Vec as Vec using (Vec; _∷_; []) open import Induction.Nat open import Data.Nat.DivMod open ≤-Reasoning open import Relation.Binary.PropositionalEquality open import Data.Function ------------------------------------------------------------------------ -- A boring lemma private lem : ∀ x k r → 2 + x ≤′ r + (1 + x) * (2 + k) lem x k r = ≤⇒≤′ $ begin 2 + x ≤⟨ m≤m+n _ _ ⟩ 2 + x + (x + (1 + x) * k + r) ≡⟨ solve 3 (λ x r k → con 2 :+ x :+ (x :+ (con 1 :+ x) :* k :+ r) := r :+ (con 1 :+ x) :* (con 2 :+ k)) refl x r k ⟩ r + (1 + x) * (2 + k) ∎ ------------------------------------------------------------------------ -- Digits -- Digit b is the type of digits in base b. Digit : ℕ → Set Digit b = Fin b -- Some specific digit kinds. Decimal = Digit 10 Bit = Digit 2 -- Some named digits. 0b : Bit 0b = zero 1b : Bit 1b = suc zero ------------------------------------------------------------------------ -- Showing digits -- The characters used to show the first 16 digits. digitChars : Vec Char 16 digitChars = '0' ∷ '1' ∷ '2' ∷ '3' ∷ '4' ∷ '5' ∷ '6' ∷ '7' ∷ '8' ∷ '9' ∷ 'a' ∷ 'b' ∷ 'c' ∷ 'd' ∷ 'e' ∷ 'f' ∷ [] -- showDigit shows digits in base ≤ 16. showDigit : ∀ {base} {base≤16 : True (base ≤? 16)} → Digit base → Char showDigit {base≤16 = base≤16} d = Vec.lookup (Fin.inject≤ d (witnessToTruth base≤16)) digitChars ------------------------------------------------------------------------ -- Digit expansions -- fromDigits takes a digit expansion of a natural number, starting -- with the _least_ significant digit, and returns the corresponding -- natural number. fromDigits : ∀ {base} → List (Fin base) → ℕ fromDigits [] = 0 fromDigits {base} (d ∷ ds) = toℕ d + fromDigits ds * base -- toDigits b n yields the digits of n, in base b, starting with the -- _least_ significant digit. -- -- Note that the list of digits is always non-empty. -- -- This function should be linear in n, if optimised properly (see -- Data.Nat.DivMod). data Digits (base : ℕ) : ℕ → Set where digits : (ds : List (Fin base)) → Digits base (fromDigits ds) toDigits : (base : ℕ) {base≥2 : True (2 ≤? base)} (n : ℕ) → Digits base n toDigits zero {base≥2 = ()} _ toDigits (suc zero) {base≥2 = ()} _ toDigits (suc (suc k)) n = <-rec Pred helper n where base = suc (suc k) Pred = Digits base cons : ∀ {n} (r : Fin base) → Pred n → Pred (toℕ r + n * base) cons r (digits ds) = digits (r ∷ ds) helper : ∀ n → <-Rec Pred n → Pred n helper n rec with n divMod base helper .(toℕ r + 0 * base) rec | result zero r = digits (r ∷ []) helper .(toℕ r + suc x * base) rec | result (suc x) r = cons r (rec (suc x) (lem (pred (suc x)) k (toℕ r))) theDigits : (base : ℕ) {base≥2 : True (2 ≤? base)} (n : ℕ) → List (Fin base) theDigits base {base≥2} n with toDigits base {base≥2} n theDigits base .(fromDigits ds) | digits ds = ds
{ "alphanum_fraction": 0.5093740986, "avg_line_length": 28.8916666667, "ext": "agda", "hexsha": "dab111428285e30247b8e9f9d7a70e14c518e50e", "lang": "Agda", "max_forks_count": 3, "max_forks_repo_forks_event_max_datetime": "2022-03-12T11:54:10.000Z", "max_forks_repo_forks_event_min_datetime": "2015-07-21T16:37:58.000Z", "max_forks_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "isabella232/Lemmachine", "max_forks_repo_path": "vendor/stdlib/src/Data/Digit.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_issues_repo_issues_event_max_datetime": "2022-03-12T12:17:51.000Z", "max_issues_repo_issues_event_min_datetime": "2022-03-12T12:17:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "larrytheliquid/Lemmachine", "max_issues_repo_path": "vendor/stdlib/src/Data/Digit.agda", "max_line_length": 73, "max_stars_count": 56, "max_stars_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "isabella232/Lemmachine", "max_stars_repo_path": "vendor/stdlib/src/Data/Digit.agda", "max_stars_repo_stars_event_max_datetime": "2021-12-21T17:02:19.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-20T02:11:42.000Z", "num_tokens": 1073, "size": 3467 }
-- Adding forcing to functions (f in this case) leaves -- an unsolved meta of type I (for the argument to f). module Issue330 where postulate I : Set i : I data D (n : I) : Set where d : D n f : ∀ n → D n → D n f n d = d data P : D i → Set where c : ∀ v → P (f i v) p : P d p = c _
{ "alphanum_fraction": 0.5773195876, "avg_line_length": 14.55, "ext": "agda", "hexsha": "d9bd74f808e3b9a9471c6b79d1414b4a64a0d6c7", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "231d6ad8e77b67ff8c4b1cb35a6c31ccd988c3e9", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "Agda-zh/agda", "max_forks_repo_path": "test/Succeed/Issue330.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "shlevy/agda", "max_issues_repo_path": "test/Succeed/Issue330.agda", "max_line_length": 54, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "shlevy/agda", "max_stars_repo_path": "test/Succeed/Issue330.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 106, "size": 291 }
module Language.Greek where data Maybe A : Set where none : Maybe A just : A → Maybe A data Unicode : Set where Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ′ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω : Unicode grave acute diaeresis smooth rough circumflex iotaSubscript : Unicode postulate Char : Set {-# BUILTIN CHAR Char #-} {-# COMPILED_TYPE Char Char #-} charToUnicode : Char -> Maybe Unicode charToUnicode 'Α' = just Α charToUnicode 'Β' = just Β charToUnicode 'Γ' = just Γ charToUnicode 'Δ' = just Δ charToUnicode 'Ε' = just Ε charToUnicode 'Ζ' = just Ζ charToUnicode 'Η' = just Η charToUnicode 'Θ' = just Θ charToUnicode 'Ι' = just Ι charToUnicode 'Κ' = just Κ charToUnicode 'Λ' = just Λ charToUnicode 'Μ' = just Μ charToUnicode 'Ν' = just Ν charToUnicode 'Ξ' = just Ξ charToUnicode 'Ο' = just Ο charToUnicode 'Π' = just Π charToUnicode 'Ρ' = just Ρ charToUnicode 'Σ' = just Σ charToUnicode 'Τ' = just Τ charToUnicode 'Υ' = just Υ charToUnicode 'Φ' = just Φ charToUnicode 'Χ' = just Χ charToUnicode 'Ψ' = just Ψ charToUnicode 'Ω' = just Ω charToUnicode 'α' = just α charToUnicode 'β' = just β charToUnicode 'γ' = just γ charToUnicode 'δ' = just δ charToUnicode 'ε' = just ε charToUnicode 'ζ' = just ζ charToUnicode 'η' = just η charToUnicode 'θ' = just θ charToUnicode 'ι' = just ι charToUnicode 'κ' = just κ charToUnicode 'λ' = just λ′ charToUnicode 'μ' = just μ charToUnicode 'ν' = just ν charToUnicode 'ξ' = just ξ charToUnicode 'ο' = just ο charToUnicode 'π' = just π charToUnicode 'ρ' = just ρ charToUnicode 'ς' = just ς charToUnicode 'σ' = just σ charToUnicode 'τ' = just τ charToUnicode 'υ' = just υ charToUnicode 'φ' = just φ charToUnicode 'χ' = just χ charToUnicode 'ψ' = just ψ charToUnicode 'ω' = just ω charToUnicode '\x0300' = just grave -- COMBINING GRAVE ACCENT charToUnicode '\x0301' = just acute -- COMBINING ACUTE ACCENT charToUnicode '\x0308' = just diaeresis -- COMBINING DIAERESIS charToUnicode '\x0313' = just smooth -- COMBINING COMMA ABOVE charToUnicode '\x0314' = just rough -- COMBINING REVERSED COMMA ABOVE charToUnicode '\x0342' = just circumflex -- COMBINING GREEK PERISPOMENI charToUnicode '\x0345' = just iotaSubscript -- COMBINING GREEK YPOGEGRAMMENI charToUnicode _ = none data UnicodeCategory : Set where letter mark : UnicodeCategory unicodeToCategory : Unicode → UnicodeCategory unicodeToCategory Α = letter unicodeToCategory Β = letter unicodeToCategory Γ = letter unicodeToCategory Δ = letter unicodeToCategory Ε = letter unicodeToCategory Ζ = letter unicodeToCategory Η = letter unicodeToCategory Θ = letter unicodeToCategory Ι = letter unicodeToCategory Κ = letter unicodeToCategory Λ = letter unicodeToCategory Μ = letter unicodeToCategory Ν = letter unicodeToCategory Ξ = letter unicodeToCategory Ο = letter unicodeToCategory Π = letter unicodeToCategory Ρ = letter unicodeToCategory Σ = letter unicodeToCategory Τ = letter unicodeToCategory Υ = letter unicodeToCategory Φ = letter unicodeToCategory Χ = letter unicodeToCategory Ψ = letter unicodeToCategory Ω = letter unicodeToCategory α = letter unicodeToCategory β = letter unicodeToCategory γ = letter unicodeToCategory δ = letter unicodeToCategory ε = letter unicodeToCategory ζ = letter unicodeToCategory η = letter unicodeToCategory θ = letter unicodeToCategory ι = letter unicodeToCategory κ = letter unicodeToCategory λ′ = letter unicodeToCategory μ = letter unicodeToCategory ν = letter unicodeToCategory ξ = letter unicodeToCategory ο = letter unicodeToCategory π = letter unicodeToCategory ρ = letter unicodeToCategory σ = letter unicodeToCategory ς = letter unicodeToCategory τ = letter unicodeToCategory υ = letter unicodeToCategory φ = letter unicodeToCategory χ = letter unicodeToCategory ψ = letter unicodeToCategory ω = letter unicodeToCategory grave = mark unicodeToCategory acute = mark unicodeToCategory diaeresis = mark unicodeToCategory smooth = mark unicodeToCategory rough = mark unicodeToCategory circumflex = mark unicodeToCategory iotaSubscript = mark data List A : Set where [] : List A _∷_ : A → List A -> List A infixr 6 _∷_ foldr : {A B : Set} → (A → B → B) → B → List A → B foldr f y [] = y foldr f y (x ∷ xs) = f x (foldr f y xs) data _And_ : (A : Set) → (B : Set) → Set₁ where _and_ : {A B : Set} → A → B → A And B data ConcreteLetter : Set where Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω α β γ δ ε ζ η θ ι κ λ′ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω : ConcreteLetter data ConcreteMark : Set where grave acute diaeresis smooth rough circumflex iotaSubscript : ConcreteMark
{ "alphanum_fraction": 0.7340008707, "avg_line_length": 29.4487179487, "ext": "agda", "hexsha": "003a2c8e6e2edc7e09e4cead0452ad0665688535", "lang": "Agda", "max_forks_count": 5, "max_forks_repo_forks_event_max_datetime": "2017-06-11T11:25:09.000Z", "max_forks_repo_forks_event_min_datetime": "2015-02-27T22:34:13.000Z", "max_forks_repo_head_hexsha": "915c46c27c7f8aad5907474d8484f2685a4cd6a7", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "scott-fleischman/GreekGrammar", "max_forks_repo_path": "agda/Language/Greek.agda", "max_issues_count": 13, "max_issues_repo_head_hexsha": "915c46c27c7f8aad5907474d8484f2685a4cd6a7", "max_issues_repo_issues_event_max_datetime": "2020-09-07T11:58:38.000Z", "max_issues_repo_issues_event_min_datetime": "2015-05-28T20:04:08.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "scott-fleischman/GreekGrammar", "max_issues_repo_path": "agda/Language/Greek.agda", "max_line_length": 117, "max_stars_count": 44, "max_stars_repo_head_hexsha": "915c46c27c7f8aad5907474d8484f2685a4cd6a7", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "scott-fleischman/GreekGrammar", "max_stars_repo_path": "agda/Language/Greek.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-06T15:41:57.000Z", "max_stars_repo_stars_event_min_datetime": "2015-05-29T14:48:51.000Z", "num_tokens": 1595, "size": 4594 }
module Issue481Record where record Issue481Record : Set where
{ "alphanum_fraction": 0.8412698413, "avg_line_length": 15.75, "ext": "agda", "hexsha": "dacbcbf8fc9ccececdc0c440bc02ee2ef9b17237", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "231d6ad8e77b67ff8c4b1cb35a6c31ccd988c3e9", "max_forks_repo_licenses": [ "BSD-3-Clause" ], "max_forks_repo_name": "Agda-zh/agda", "max_forks_repo_path": "test/Succeed/Issue481Record.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "BSD-3-Clause" ], "max_issues_repo_name": "shlevy/agda", "max_issues_repo_path": "test/Succeed/Issue481Record.agda", "max_line_length": 33, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_stars_repo_licenses": [ "BSD-3-Clause" ], "max_stars_repo_name": "shlevy/agda", "max_stars_repo_path": "test/Succeed/Issue481Record.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 14, "size": 63 }
{-# OPTIONS --without-K --safe #-} open import Level open import Categories.Category using (Category) module Categories.NaturalTransformation.Hom {o ℓ e : Level} (C : Category o ℓ e) where open import Categories.Category.Instance.Setoids open import Categories.Functor.Hom using (module Hom; Hom[_][-,_]; Hom[_][_,-]; Hom[_][-,-]) open import Categories.NaturalTransformation using (NaturalTransformation; ntHelper) renaming (id to idN) import Categories.Morphism.Reasoning as MR open Category C open HomReasoning open MR C open NaturalTransformation private module CE = Category.Equiv C module C = Category C Hom[A,C]⇒Hom[B,C] : {A B : Obj} → (A ⇒ B) → NaturalTransformation Hom[ C ][-, A ] Hom[ C ][-, B ] Hom[A,C]⇒Hom[B,C] {A} A⇒B = ntHelper record { η = λ X → record { _⟨$⟩_ = λ X⇒A → A⇒B ∘ X⇒A ; cong = ∘-resp-≈ʳ } ; commute = λ f {g} {h} g≈h → begin A⇒B ∘ id ∘ g ∘ f ≈⟨ sym-assoc ⟩ (A⇒B ∘ id) ∘ g ∘ f ≈⟨ id-comm ⟩∘⟨ g≈h ⟩∘⟨refl ⟩ (id ∘ A⇒B) ∘ h ∘ f ≈⟨ pullʳ sym-assoc ⟩ id ∘ (A⇒B ∘ h) ∘ f ∎ } Hom[C,A]⇒Hom[C,B] : {A B : Obj} → (B ⇒ A) → NaturalTransformation Hom[ C ][ A ,-] Hom[ C ][ B ,-] Hom[C,A]⇒Hom[C,B] {A} B⇒A = ntHelper record { η = λ X → record { _⟨$⟩_ = λ A⇒X → A⇒X ∘ B⇒A ; cong = ∘-resp-≈ˡ } ; commute = λ f {g} {h} g≈h → begin (f ∘ g ∘ id) ∘ B⇒A ≈⟨ pullʳ assoc ⟩ f ∘ g ∘ id ∘ B⇒A ≈⟨ (refl⟩∘⟨ g≈h ⟩∘⟨ id-comm-sym) ⟩ f ∘ h ∘ B⇒A ∘ id ≈⟨ (refl⟩∘⟨ sym-assoc) ⟩ f ∘ (h ∘ B⇒A) ∘ id ∎ }
{ "alphanum_fraction": 0.5621621622, "avg_line_length": 37, "ext": "agda", "hexsha": "0a5111fe09222a15b15a9eee48ca6766ba608438", "lang": "Agda", "max_forks_count": 64, "max_forks_repo_forks_event_max_datetime": "2022-03-14T02:00:59.000Z", "max_forks_repo_forks_event_min_datetime": "2019-06-02T16:58:15.000Z", "max_forks_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Code-distancing/agda-categories", "max_forks_repo_path": "src/Categories/NaturalTransformation/Hom.agda", "max_issues_count": 236, "max_issues_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_issues_repo_issues_event_max_datetime": "2022-03-28T14:31:43.000Z", "max_issues_repo_issues_event_min_datetime": "2019-06-01T14:53:54.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Code-distancing/agda-categories", "max_issues_repo_path": "src/Categories/NaturalTransformation/Hom.agda", "max_line_length": 105, "max_stars_count": 279, "max_stars_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Trebor-Huang/agda-categories", "max_stars_repo_path": "src/Categories/NaturalTransformation/Hom.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-22T00:40:14.000Z", "max_stars_repo_stars_event_min_datetime": "2019-06-01T14:36:40.000Z", "num_tokens": 668, "size": 1480 }
module Comments where {- Single-line comments cannot be started inside multi-line ones: -- -} postulate foo-- : Set -- Note that -- does not start a comment when -- located inside or at the end of an identifier. -- The following comment marker is followed by an alphabetic -- character: --This is a {- non-nested comment. {-This is a comment.-} {- -- The final comment marker {- is followed by -} the end of the file -- without any intervening newline. -} --
{ "alphanum_fraction": 0.662601626, "avg_line_length": 24.6, "ext": "agda", "hexsha": "5d67b3da8fa25d5bc8b9f2d008e13b79b31b3661", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "70c8a575c46f6a568c7518150a1a64fcd03aa437", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "masondesu/agda", "max_forks_repo_path": "test/succeed/Comments.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "70c8a575c46f6a568c7518150a1a64fcd03aa437", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "masondesu/agda", "max_issues_repo_path": "test/succeed/Comments.agda", "max_line_length": 69, "max_stars_count": 1, "max_stars_repo_head_hexsha": "aa10ae6a29dc79964fe9dec2de07b9df28b61ed5", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/agda-kanso", "max_stars_repo_path": "test/succeed/Comments.agda", "max_stars_repo_stars_event_max_datetime": "2019-11-27T04:41:05.000Z", "max_stars_repo_stars_event_min_datetime": "2019-11-27T04:41:05.000Z", "num_tokens": 110, "size": 492 }
------------------------------------------------------------------------ -- The Agda standard library -- -- Pairs of lists that share no common elements (propositional equality) ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary module Data.List.Relation.Binary.Disjoint.Propositional {a} {A : Set a} where open import Relation.Binary.PropositionalEquality using (setoid) open import Data.List.Relation.Binary.Disjoint.Setoid as DisjointUnique ------------------------------------------------------------------------ -- Re-export the contents of setoid uniqueness open DisjointUnique (setoid A) public
{ "alphanum_fraction": 0.5309352518, "avg_line_length": 33.0952380952, "ext": "agda", "hexsha": "b7f5d1185003c8085b01c8ecf9c9835d907fdd6e", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-04T06:54:45.000Z", "max_forks_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "DreamLinuxer/popl21-artifact", "max_forks_repo_path": "agda-stdlib/src/Data/List/Relation/Binary/Disjoint/Propositional.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "DreamLinuxer/popl21-artifact", "max_issues_repo_path": "agda-stdlib/src/Data/List/Relation/Binary/Disjoint/Propositional.agda", "max_line_length": 72, "max_stars_count": 5, "max_stars_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "DreamLinuxer/popl21-artifact", "max_stars_repo_path": "agda-stdlib/src/Data/List/Relation/Binary/Disjoint/Propositional.agda", "max_stars_repo_stars_event_max_datetime": "2020-10-10T21:41:32.000Z", "max_stars_repo_stars_event_min_datetime": "2020-10-07T12:07:53.000Z", "num_tokens": 117, "size": 695 }
{- 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 -} import LibraBFT.Impl.OBM.Crypto as Crypto open import LibraBFT.Impl.OBM.Logging.Logging open import LibraBFT.Impl.Types.ValidatorVerifier as ValidatorVerifier open import LibraBFT.ImplShared.Consensus.Types open import Optics.All import Util.KVMap as Map open import Util.PKCS open import Util.Prelude module LibraBFT.Impl.Types.LedgerInfoWithSignatures where obmNewNoSigs : LedgerInfo → LedgerInfoWithSignatures obmNewNoSigs li = LedgerInfoWithSignatures∙new li Map.empty -- HC-TODO : refactor this and TimeoutCertificate addSignature : AccountAddress → Signature → LedgerInfoWithSignatures → LedgerInfoWithSignatures addSignature validator sig liws = case Map.lookup validator (liws ^∙ liwsSignatures) of λ where (just _) → liws nothing → liws & liwsSignatures ∙~ Map.kvm-insert-Haskell validator sig (liws ^∙ liwsSignatures) verifySignatures : LedgerInfoWithSignatures → ValidatorVerifier → Either ErrLog Unit verifySignatures self validator = withErrCtx' ("LedgerInfoWithSignatures" ∷ "verify" ∷ []) (ValidatorVerifier.batchVerifyAggregatedSignatures validator (self ^∙ liwsLedgerInfo) (self ^∙ liwsSignatures))
{ "alphanum_fraction": 0.7735849057, "avg_line_length": 40.8857142857, "ext": "agda", "hexsha": "4deb622afcf0c357ffe691640063e401705c18d8", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_forks_repo_licenses": [ "UPL-1.0" ], "max_forks_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_forks_repo_path": "src/LibraBFT/Impl/Types/LedgerInfoWithSignatures.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "UPL-1.0" ], "max_issues_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_issues_repo_path": "src/LibraBFT/Impl/Types/LedgerInfoWithSignatures.agda", "max_line_length": 111, "max_stars_count": null, "max_stars_repo_head_hexsha": "a4674fc473f2457fd3fe5123af48253cfb2404ef", "max_stars_repo_licenses": [ "UPL-1.0" ], "max_stars_repo_name": "LaudateCorpus1/bft-consensus-agda", "max_stars_repo_path": "src/LibraBFT/Impl/Types/LedgerInfoWithSignatures.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 382, "size": 1431 }
------------------------------------------------------------------------ -- The Agda standard library -- -- A bunch of properties about natural number operations ------------------------------------------------------------------------ -- See README.Nat for some examples showing how this module can be -- used. {-# OPTIONS --without-K --safe #-} module Data.Nat.Properties where open import Axiom.UniquenessOfIdentityProofs open import Algebra open import Algebra.Morphism open import Function open import Function.Injection using (_↣_) open import Data.Nat.Base open import Data.Product open import Data.Sum open import Data.Empty open import Data.Bool.Base using (Bool; false; true; T) open import Data.Bool.Properties using (T?) open import Level using (0ℓ) open import Relation.Binary open import Relation.Binary.PropositionalEquality open import Relation.Nullary open import Relation.Nullary.Decidable using (True; via-injection; map′) open import Relation.Nullary.Negation using (contradiction) open import Algebra.FunctionProperties (_≡_ {A = ℕ}) hiding (LeftCancellative; RightCancellative; Cancellative) open import Algebra.FunctionProperties using (LeftCancellative; RightCancellative; Cancellative) open import Algebra.FunctionProperties.Consequences.Propositional open import Algebra.Structures (_≡_ {A = ℕ}) open ≡-Reasoning ------------------------------------------------------------------------ -- Properties of _≡_ suc-injective : ∀ {m n} → suc m ≡ suc n → m ≡ n suc-injective refl = refl ≡ᵇ⇒≡ : ∀ m n → T (m ≡ᵇ n) → m ≡ n ≡ᵇ⇒≡ zero zero _ = refl ≡ᵇ⇒≡ (suc m) (suc n) eq = cong suc (≡ᵇ⇒≡ m n eq) ≡ᵇ⇒≡ zero (suc n) () ≡ᵇ⇒≡ (suc m) zero () ≡⇒≡ᵇ : ∀ m n → m ≡ n → T (m ≡ᵇ n) ≡⇒≡ᵇ zero zero eq = _ ≡⇒≡ᵇ (suc m) (suc n) eq = ≡⇒≡ᵇ m n (suc-injective eq) ≡⇒≡ᵇ zero (suc n) () ≡⇒≡ᵇ (suc m) zero () -- NB: we use the builtin function `_≡ᵇ_ : (m n : ℕ) → Bool` here so -- that the function quickly decides whether to return `yes` or `no`. -- It sill takes a linear amount of time to generate the proof if it -- is inspected. We expect the main benefit to be visible in compiled -- code: the backend erases proofs. infix 4 _≟_ _≟_ : Decidable {A = ℕ} _≡_ m ≟ n = map′ (≡ᵇ⇒≡ m n) (≡⇒≡ᵇ m n) (T? (m ≡ᵇ n)) ≡-irrelevant : Irrelevant {A = ℕ} _≡_ ≡-irrelevant = Decidable⇒UIP.≡-irrelevant _≟_ ≟-diag : ∀ {m n} (eq : m ≡ n) → (m ≟ n) ≡ yes eq ≟-diag = ≡-≟-identity _≟_ ≡-isDecEquivalence : IsDecEquivalence (_≡_ {A = ℕ}) ≡-isDecEquivalence = record { isEquivalence = isEquivalence ; _≟_ = _≟_ } ≡-decSetoid : DecSetoid 0ℓ 0ℓ ≡-decSetoid = record { Carrier = ℕ ; _≈_ = _≡_ ; isDecEquivalence = ≡-isDecEquivalence } ------------------------------------------------------------------------ -- Properties of _≤_ ≤-pred : ∀ {m n} → suc m ≤ suc n → m ≤ n ≤-pred (s≤s m≤n) = m≤n -- Relation-theoretic properties of _≤_ ≤-reflexive : _≡_ ⇒ _≤_ ≤-reflexive {zero} refl = z≤n ≤-reflexive {suc m} refl = s≤s (≤-reflexive refl) ≤-refl : Reflexive _≤_ ≤-refl = ≤-reflexive refl ≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym z≤n z≤n = refl ≤-antisym (s≤s m≤n) (s≤s n≤m) = cong suc (≤-antisym m≤n n≤m) ≤-trans : Transitive _≤_ ≤-trans z≤n _ = z≤n ≤-trans (s≤s m≤n) (s≤s n≤o) = s≤s (≤-trans m≤n n≤o) ≤-total : Total _≤_ ≤-total zero _ = inj₁ z≤n ≤-total _ zero = inj₂ z≤n ≤-total (suc m) (suc n) with ≤-total m n ... | inj₁ m≤n = inj₁ (s≤s m≤n) ... | inj₂ n≤m = inj₂ (s≤s n≤m) infix 4 _≤?_ _≥?_ _≤?_ : Decidable _≤_ zero ≤? _ = yes z≤n suc m ≤? zero = no λ() suc m ≤? suc n with m ≤? n ... | yes m≤n = yes (s≤s m≤n) ... | no m≰n = no (m≰n ∘ ≤-pred) _≥?_ : Decidable _≥_ _≥?_ = flip _≤?_ ≤-isPreorder : IsPreorder _≡_ _≤_ ≤-isPreorder = record { isEquivalence = isEquivalence ; reflexive = ≤-reflexive ; trans = ≤-trans } ≤-preorder : Preorder 0ℓ 0ℓ 0ℓ ≤-preorder = record { isPreorder = ≤-isPreorder } ≤-isPartialOrder : IsPartialOrder _≡_ _≤_ ≤-isPartialOrder = record { isPreorder = ≤-isPreorder ; antisym = ≤-antisym } ≤-poset : Poset 0ℓ 0ℓ 0ℓ ≤-poset = record { isPartialOrder = ≤-isPartialOrder } ≤-isTotalOrder : IsTotalOrder _≡_ _≤_ ≤-isTotalOrder = record { isPartialOrder = ≤-isPartialOrder ; total = ≤-total } ≤-totalOrder : TotalOrder 0ℓ 0ℓ 0ℓ ≤-totalOrder = record { isTotalOrder = ≤-isTotalOrder } ≤-isDecTotalOrder : IsDecTotalOrder _≡_ _≤_ ≤-isDecTotalOrder = record { isTotalOrder = ≤-isTotalOrder ; _≟_ = _≟_ ; _≤?_ = _≤?_ } ≤-decTotalOrder : DecTotalOrder 0ℓ 0ℓ 0ℓ ≤-decTotalOrder = record { isDecTotalOrder = ≤-isDecTotalOrder } -- Other properties of _≤_ s≤s-injective : ∀ {m n} {p q : m ≤ n} → s≤s p ≡ s≤s q → p ≡ q s≤s-injective refl = refl ≤-irrelevant : Irrelevant _≤_ ≤-irrelevant z≤n z≤n = refl ≤-irrelevant (s≤s m≤n₁) (s≤s m≤n₂) = cong s≤s (≤-irrelevant m≤n₁ m≤n₂) ≤-step : ∀ {m n} → m ≤ n → m ≤ 1 + n ≤-step z≤n = z≤n ≤-step (s≤s m≤n) = s≤s (≤-step m≤n) n≤1+n : ∀ n → n ≤ 1 + n n≤1+n _ = ≤-step ≤-refl 1+n≰n : ∀ {n} → 1 + n ≰ n 1+n≰n (s≤s le) = 1+n≰n le n≤0⇒n≡0 : ∀ {n} → n ≤ 0 → n ≡ 0 n≤0⇒n≡0 z≤n = refl ------------------------------------------------------------------------ -- Properties of _<_ -- Relation theoretic properties of _<_ <-irrefl : Irreflexive _≡_ _<_ <-irrefl refl (s≤s n<n) = <-irrefl refl n<n <-asym : Asymmetric _<_ <-asym (s≤s n<m) (s≤s m<n) = <-asym n<m m<n <-trans : Transitive _<_ <-trans (s≤s i≤j) (s≤s j<k) = s≤s (≤-trans i≤j (≤-trans (n≤1+n _) j<k)) <-transʳ : Trans _≤_ _<_ _<_ <-transʳ m≤n (s≤s n≤o) = s≤s (≤-trans m≤n n≤o) <-transˡ : Trans _<_ _≤_ _<_ <-transˡ (s≤s m≤n) (s≤s n≤o) = s≤s (≤-trans m≤n n≤o) <-cmp : Trichotomous _≡_ _<_ <-cmp zero zero = tri≈ (λ()) refl (λ()) <-cmp zero (suc n) = tri< (s≤s z≤n) (λ()) (λ()) <-cmp (suc m) zero = tri> (λ()) (λ()) (s≤s z≤n) <-cmp (suc m) (suc n) with <-cmp m n ... | tri< ≤ ≢ ≱ = tri< (s≤s ≤) (≢ ∘ suc-injective) (≱ ∘ ≤-pred) ... | tri≈ ≰ ≡ ≱ = tri≈ (≰ ∘ ≤-pred) (cong suc ≡) (≱ ∘ ≤-pred) ... | tri> ≰ ≢ ≥ = tri> (≰ ∘ ≤-pred) (≢ ∘ suc-injective) (s≤s ≥) infix 4 _<?_ _>?_ _<?_ : Decidable _<_ x <? y = suc x ≤? y _>?_ : Decidable _>_ _>?_ = flip _<?_ <-resp₂-≡ : _<_ Respects₂ _≡_ <-resp₂-≡ = subst (_ <_) , subst (_< _) <-isStrictPartialOrder : IsStrictPartialOrder _≡_ _<_ <-isStrictPartialOrder = record { isEquivalence = isEquivalence ; irrefl = <-irrefl ; trans = <-trans ; <-resp-≈ = <-resp₂-≡ } <-strictPartialOrder : StrictPartialOrder 0ℓ 0ℓ 0ℓ <-strictPartialOrder = record { isStrictPartialOrder = <-isStrictPartialOrder } <-isStrictTotalOrder : IsStrictTotalOrder _≡_ _<_ <-isStrictTotalOrder = record { isEquivalence = isEquivalence ; trans = <-trans ; compare = <-cmp } <-strictTotalOrder : StrictTotalOrder 0ℓ 0ℓ 0ℓ <-strictTotalOrder = record { isStrictTotalOrder = <-isStrictTotalOrder } -- Other properties of _<_ <-irrelevant : Irrelevant _<_ <-irrelevant = ≤-irrelevant <⇒≤pred : ∀ {m n} → m < n → m ≤ pred n <⇒≤pred (s≤s le) = le <⇒≤ : _<_ ⇒ _≤_ <⇒≤ (s≤s m≤n) = ≤-trans m≤n (≤-step ≤-refl) <⇒≢ : _<_ ⇒ _≢_ <⇒≢ m<n refl = 1+n≰n m<n ≤⇒≯ : _≤_ ⇒ _≯_ ≤⇒≯ z≤n () ≤⇒≯ (s≤s m≤n) (s≤s n≤m) = ≤⇒≯ m≤n n≤m <⇒≱ : _<_ ⇒ _≱_ <⇒≱ (s≤s m+1≤n) (s≤s n≤m) = <⇒≱ m+1≤n n≤m <⇒≯ : _<_ ⇒ _≯_ <⇒≯ (s≤s m<n) (s≤s n<m) = <⇒≯ m<n n<m ≰⇒≮ : _≰_ ⇒ _≮_ ≰⇒≮ m≰n 1+m≤n = m≰n (<⇒≤ 1+m≤n) ≰⇒> : _≰_ ⇒ _>_ ≰⇒> {zero} z≰n = contradiction z≤n z≰n ≰⇒> {suc m} {zero} _ = s≤s z≤n ≰⇒> {suc m} {suc n} m≰n = s≤s (≰⇒> (m≰n ∘ s≤s)) ≰⇒≥ : _≰_ ⇒ _≥_ ≰⇒≥ = <⇒≤ ∘ ≰⇒> ≮⇒≥ : _≮_ ⇒ _≥_ ≮⇒≥ {_} {zero} _ = z≤n ≮⇒≥ {zero} {suc j} 1≮j+1 = contradiction (s≤s z≤n) 1≮j+1 ≮⇒≥ {suc i} {suc j} i+1≮j+1 = s≤s (≮⇒≥ (i+1≮j+1 ∘ s≤s)) ≤∧≢⇒< : ∀ {m n} → m ≤ n → m ≢ n → m < n ≤∧≢⇒< {_} {zero} z≤n m≢n = contradiction refl m≢n ≤∧≢⇒< {_} {suc n} z≤n m≢n = s≤s z≤n ≤∧≢⇒< {_} {suc n} (s≤s m≤n) 1+m≢1+n = s≤s (≤∧≢⇒< m≤n (1+m≢1+n ∘ cong suc)) n≮n : ∀ n → n ≮ n n≮n n = <-irrefl (refl {x = n}) m<n⇒n≢0 : ∀ {m n} → m < n → n ≢ 0 m<n⇒n≢0 (s≤s m≤n) () ------------------------------------------------------------------------ -- Properties of _≤′_ ≤′-trans : Transitive _≤′_ ≤′-trans m≤n ≤′-refl = m≤n ≤′-trans m≤n (≤′-step n≤o) = ≤′-step (≤′-trans m≤n n≤o) z≤′n : ∀ {n} → zero ≤′ n z≤′n {zero} = ≤′-refl z≤′n {suc n} = ≤′-step z≤′n s≤′s : ∀ {m n} → m ≤′ n → suc m ≤′ suc n s≤′s ≤′-refl = ≤′-refl s≤′s (≤′-step m≤′n) = ≤′-step (s≤′s m≤′n) ≤′⇒≤ : _≤′_ ⇒ _≤_ ≤′⇒≤ ≤′-refl = ≤-refl ≤′⇒≤ (≤′-step m≤′n) = ≤-step (≤′⇒≤ m≤′n) ≤⇒≤′ : _≤_ ⇒ _≤′_ ≤⇒≤′ z≤n = z≤′n ≤⇒≤′ (s≤s m≤n) = s≤′s (≤⇒≤′ m≤n) ≤′-step-injective : ∀ {m n} {p q : m ≤′ n} → ≤′-step p ≡ ≤′-step q → p ≡ q ≤′-step-injective refl = refl -- Decidablity for _≤'_ infix 4 _≤′?_ _<′?_ _≥′?_ _>′?_ _≤′?_ : Decidable _≤′_ x ≤′? y = map′ ≤⇒≤′ ≤′⇒≤ (x ≤? y) _<′?_ : Decidable _<′_ x <′? y = suc x ≤′? y _≥′?_ : Decidable _≥′_ _≥′?_ = flip _≤′?_ _>′?_ : Decidable _>′_ _>′?_ = flip _<′?_ ------------------------------------------------------------------------ -- Properties of pred pred-mono : pred Preserves _≤_ ⟶ _≤_ pred-mono z≤n = z≤n pred-mono (s≤s le) = le ≤pred⇒≤ : ∀ {m n} → m ≤ pred n → m ≤ n ≤pred⇒≤ {m} {zero} le = le ≤pred⇒≤ {m} {suc n} le = ≤-step le ≤⇒pred≤ : ∀ {m n} → m ≤ n → pred m ≤ n ≤⇒pred≤ {zero} le = le ≤⇒pred≤ {suc m} le = ≤-trans (n≤1+n m) le m≢0⇒suc[pred[m]]≡m : ∀ {m} → m ≢ 0 → suc (pred m) ≡ m m≢0⇒suc[pred[m]]≡m {zero} m≢0 = ⊥-elim (m≢0 refl) m≢0⇒suc[pred[m]]≡m {suc m} m≢0 = refl ------------------------------------------------------------------------ -- Properties of _+_ -- Algebraic properties of _+_ +-suc : ∀ m n → m + suc n ≡ suc (m + n) +-suc zero n = refl +-suc (suc m) n = cong suc (+-suc m n) +-assoc : Associative _+_ +-assoc zero _ _ = refl +-assoc (suc m) n o = cong suc (+-assoc m n o) +-identityˡ : LeftIdentity 0 _+_ +-identityˡ _ = refl +-identityʳ : RightIdentity 0 _+_ +-identityʳ zero = refl +-identityʳ (suc n) = cong suc (+-identityʳ n) +-identity : Identity 0 _+_ +-identity = +-identityˡ , +-identityʳ +-comm : Commutative _+_ +-comm zero n = sym (+-identityʳ n) +-comm (suc m) n = begin suc m + n ≡⟨⟩ suc (m + n) ≡⟨ cong suc (+-comm m n) ⟩ suc (n + m) ≡⟨ sym (+-suc n m) ⟩ n + suc m ∎ +-isMagma : IsMagma _+_ +-isMagma = record { isEquivalence = isEquivalence ; ∙-cong = cong₂ _+_ } +-magma : Magma 0ℓ 0ℓ +-magma = record { isMagma = +-isMagma } +-isSemigroup : IsSemigroup _+_ +-isSemigroup = record { isMagma = +-isMagma ; assoc = +-assoc } +-semigroup : Semigroup 0ℓ 0ℓ +-semigroup = record { isSemigroup = +-isSemigroup } +-0-isMonoid : IsMonoid _+_ 0 +-0-isMonoid = record { isSemigroup = +-isSemigroup ; identity = +-identity } +-0-monoid : Monoid 0ℓ 0ℓ +-0-monoid = record { isMonoid = +-0-isMonoid } +-0-isCommutativeMonoid : IsCommutativeMonoid _+_ 0 +-0-isCommutativeMonoid = record { isSemigroup = +-isSemigroup ; identityˡ = +-identityˡ ; comm = +-comm } +-0-commutativeMonoid : CommutativeMonoid 0ℓ 0ℓ +-0-commutativeMonoid = record { isCommutativeMonoid = +-0-isCommutativeMonoid } -- Other properties of _+_ and _≡_ +-cancelˡ-≡ : LeftCancellative _≡_ _+_ +-cancelˡ-≡ zero eq = eq +-cancelˡ-≡ (suc m) eq = +-cancelˡ-≡ m (cong pred eq) +-cancelʳ-≡ : RightCancellative _≡_ _+_ +-cancelʳ-≡ = comm+cancelˡ⇒cancelʳ +-comm +-cancelˡ-≡ +-cancel-≡ : Cancellative _≡_ _+_ +-cancel-≡ = +-cancelˡ-≡ , +-cancelʳ-≡ m≢1+m+n : ∀ m {n} → m ≢ suc (m + n) m≢1+m+n zero () m≢1+m+n (suc m) eq = m≢1+m+n m (cong pred eq) m≢1+n+m : ∀ m {n} → m ≢ suc (n + m) m≢1+n+m m m≡1+n+m = m≢1+m+n m (trans m≡1+n+m (cong suc (+-comm _ m))) i+1+j≢i : ∀ i {j} → i + suc j ≢ i i+1+j≢i zero () i+1+j≢i (suc i) = (i+1+j≢i i) ∘ suc-injective i+j≡0⇒i≡0 : ∀ i {j} → i + j ≡ 0 → i ≡ 0 i+j≡0⇒i≡0 zero eq = refl i+j≡0⇒i≡0 (suc i) () i+j≡0⇒j≡0 : ∀ i {j} → i + j ≡ 0 → j ≡ 0 i+j≡0⇒j≡0 i {j} i+j≡0 = i+j≡0⇒i≡0 j (trans (+-comm j i) (i+j≡0)) -- Properties of _+_ and orderings +-cancelˡ-≤ : LeftCancellative _≤_ _+_ +-cancelˡ-≤ zero le = le +-cancelˡ-≤ (suc m) (s≤s le) = +-cancelˡ-≤ m le +-cancelʳ-≤ : RightCancellative _≤_ _+_ +-cancelʳ-≤ {m} n o le = +-cancelˡ-≤ m (subst₂ _≤_ (+-comm n m) (+-comm o m) le) +-cancel-≤ : Cancellative _≤_ _+_ +-cancel-≤ = +-cancelˡ-≤ , +-cancelʳ-≤ +-cancelˡ-< : LeftCancellative _<_ _+_ +-cancelˡ-< x {y} {z} = +-cancelˡ-≤ x ∘ subst (_≤ x + z) (sym (+-suc x y)) +-cancelʳ-< : RightCancellative _<_ _+_ +-cancelʳ-< y z y+x<z+x = +-cancelʳ-≤ (suc y) z y+x<z+x +-cancel-< : Cancellative _<_ _+_ +-cancel-< = +-cancelˡ-< , +-cancelʳ-< ≤-stepsˡ : ∀ {m n} o → m ≤ n → m ≤ o + n ≤-stepsˡ zero m≤n = m≤n ≤-stepsˡ (suc o) m≤n = ≤-step (≤-stepsˡ o m≤n) ≤-stepsʳ : ∀ {m n} o → m ≤ n → m ≤ n + o ≤-stepsʳ {m} o m≤n = subst (m ≤_) (+-comm o _) (≤-stepsˡ o m≤n) m≤m+n : ∀ m n → m ≤ m + n m≤m+n zero n = z≤n m≤m+n (suc m) n = s≤s (m≤m+n m n) n≤m+n : ∀ m n → n ≤ m + n n≤m+n m zero = z≤n n≤m+n m (suc n) = subst (suc n ≤_) (sym (+-suc m n)) (s≤s (n≤m+n m n)) m+n≤o⇒m≤o : ∀ m {n o} → m + n ≤ o → m ≤ o m+n≤o⇒m≤o zero m+n≤o = z≤n m+n≤o⇒m≤o (suc m) (s≤s m+n≤o) = s≤s (m+n≤o⇒m≤o m m+n≤o) m+n≤o⇒n≤o : ∀ m {n o} → m + n ≤ o → n ≤ o m+n≤o⇒n≤o zero n≤o = n≤o m+n≤o⇒n≤o (suc m) m+n<o = m+n≤o⇒n≤o m (<⇒≤ m+n<o) +-mono-≤ : _+_ Preserves₂ _≤_ ⟶ _≤_ ⟶ _≤_ +-mono-≤ {_} {m} z≤n o≤p = ≤-trans o≤p (n≤m+n m _) +-mono-≤ {_} {_} (s≤s m≤n) o≤p = s≤s (+-mono-≤ m≤n o≤p) +-monoˡ-≤ : ∀ n → (_+ n) Preserves _≤_ ⟶ _≤_ +-monoˡ-≤ n m≤o = +-mono-≤ m≤o (≤-refl {n}) +-monoʳ-≤ : ∀ n → (n +_) Preserves _≤_ ⟶ _≤_ +-monoʳ-≤ n m≤o = +-mono-≤ (≤-refl {n}) m≤o +-mono-<-≤ : _+_ Preserves₂ _<_ ⟶ _≤_ ⟶ _<_ +-mono-<-≤ {_} {suc y} (s≤s z≤n) u≤v = s≤s (≤-stepsˡ y u≤v) +-mono-<-≤ {_} {_} (s≤s (s≤s x<y)) u≤v = s≤s (+-mono-<-≤ (s≤s x<y) u≤v) +-mono-≤-< : _+_ Preserves₂ _≤_ ⟶ _<_ ⟶ _<_ +-mono-≤-< {_} {y} z≤n u<v = ≤-trans u<v (n≤m+n y _) +-mono-≤-< {_} {_} (s≤s x≤y) u<v = s≤s (+-mono-≤-< x≤y u<v) +-mono-< : _+_ Preserves₂ _<_ ⟶ _<_ ⟶ _<_ +-mono-< x≤y = +-mono-≤-< (<⇒≤ x≤y) +-monoˡ-< : ∀ n → (_+ n) Preserves _<_ ⟶ _<_ +-monoˡ-< n = +-monoˡ-≤ n +-monoʳ-< : ∀ n → (n +_) Preserves _<_ ⟶ _<_ +-monoʳ-< zero m≤o = m≤o +-monoʳ-< (suc n) m≤o = s≤s (+-monoʳ-< n m≤o) i+1+j≰i : ∀ i {j} → i + suc j ≰ i i+1+j≰i zero () i+1+j≰i (suc i) le = i+1+j≰i i (≤-pred le) m+n≮n : ∀ m n → m + n ≮ n m+n≮n zero n = n≮n n m+n≮n (suc m) (suc n) (s≤s m+n<n) = m+n≮n m (suc n) (≤-step m+n<n) m+n≮m : ∀ m n → m + n ≮ m m+n≮m m n = subst (_≮ m) (+-comm n m) (m+n≮n n m) m≤′m+n : ∀ m n → m ≤′ m + n m≤′m+n m n = ≤⇒≤′ (m≤m+n m n) n≤′m+n : ∀ m n → n ≤′ m + n n≤′m+n zero n = ≤′-refl n≤′m+n (suc m) n = ≤′-step (n≤′m+n m n) ------------------------------------------------------------------------ -- Properties of _*_ +-*-suc : ∀ m n → m * suc n ≡ m + m * n +-*-suc zero n = refl +-*-suc (suc m) n = begin suc m * suc n ≡⟨⟩ suc n + m * suc n ≡⟨ cong (suc n +_) (+-*-suc m n) ⟩ suc n + (m + m * n) ≡⟨⟩ suc (n + (m + m * n)) ≡⟨ cong suc (sym (+-assoc n m (m * n))) ⟩ suc (n + m + m * n) ≡⟨ cong (λ x → suc (x + m * n)) (+-comm n m) ⟩ suc (m + n + m * n) ≡⟨ cong suc (+-assoc m n (m * n)) ⟩ suc (m + (n + m * n)) ≡⟨⟩ suc m + suc m * n ∎ *-identityˡ : LeftIdentity 1 _*_ *-identityˡ x = +-identityʳ x *-identityʳ : RightIdentity 1 _*_ *-identityʳ zero = refl *-identityʳ (suc x) = cong suc (*-identityʳ x) *-identity : Identity 1 _*_ *-identity = *-identityˡ , *-identityʳ *-zeroˡ : LeftZero 0 _*_ *-zeroˡ _ = refl *-zeroʳ : RightZero 0 _*_ *-zeroʳ zero = refl *-zeroʳ (suc n) = *-zeroʳ n *-zero : Zero 0 _*_ *-zero = *-zeroˡ , *-zeroʳ *-comm : Commutative _*_ *-comm zero n = sym (*-zeroʳ n) *-comm (suc m) n = begin suc m * n ≡⟨⟩ n + m * n ≡⟨ cong (n +_) (*-comm m n) ⟩ n + n * m ≡⟨ sym (+-*-suc n m) ⟩ n * suc m ∎ *-distribʳ-+ : _*_ DistributesOverʳ _+_ *-distribʳ-+ m zero o = refl *-distribʳ-+ m (suc n) o = begin (suc n + o) * m ≡⟨⟩ m + (n + o) * m ≡⟨ cong (m +_) (*-distribʳ-+ m n o) ⟩ m + (n * m + o * m) ≡⟨ sym (+-assoc m (n * m) (o * m)) ⟩ m + n * m + o * m ≡⟨⟩ suc n * m + o * m ∎ *-distribˡ-+ : _*_ DistributesOverˡ _+_ *-distribˡ-+ = comm+distrʳ⇒distrˡ *-comm *-distribʳ-+ *-distrib-+ : _*_ DistributesOver _+_ *-distrib-+ = *-distribˡ-+ , *-distribʳ-+ *-assoc : Associative _*_ *-assoc zero n o = refl *-assoc (suc m) n o = begin (suc m * n) * o ≡⟨⟩ (n + m * n) * o ≡⟨ *-distribʳ-+ o n (m * n) ⟩ n * o + (m * n) * o ≡⟨ cong (n * o +_) (*-assoc m n o) ⟩ n * o + m * (n * o) ≡⟨⟩ suc m * (n * o) ∎ *-isMagma : IsMagma _*_ *-isMagma = record { isEquivalence = isEquivalence ; ∙-cong = cong₂ _*_ } *-magma : Magma 0ℓ 0ℓ *-magma = record { isMagma = *-isMagma } *-isSemigroup : IsSemigroup _*_ *-isSemigroup = record { isMagma = *-isMagma ; assoc = *-assoc } *-semigroup : Semigroup 0ℓ 0ℓ *-semigroup = record { isSemigroup = *-isSemigroup } *-1-isMonoid : IsMonoid _*_ 1 *-1-isMonoid = record { isSemigroup = *-isSemigroup ; identity = *-identity } *-1-monoid : Monoid 0ℓ 0ℓ *-1-monoid = record { isMonoid = *-1-isMonoid } *-1-isCommutativeMonoid : IsCommutativeMonoid _*_ 1 *-1-isCommutativeMonoid = record { isSemigroup = *-isSemigroup ; identityˡ = *-identityˡ ; comm = *-comm } *-1-commutativeMonoid : CommutativeMonoid 0ℓ 0ℓ *-1-commutativeMonoid = record { isCommutativeMonoid = *-1-isCommutativeMonoid } *-+-isSemiring : IsSemiring _+_ _*_ 0 1 *-+-isSemiring = record { isSemiringWithoutAnnihilatingZero = record { +-isCommutativeMonoid = +-0-isCommutativeMonoid ; *-isMonoid = *-1-isMonoid ; distrib = *-distrib-+ } ; zero = *-zero } *-+-semiring : Semiring 0ℓ 0ℓ *-+-semiring = record { isSemiring = *-+-isSemiring } *-+-isCommutativeSemiring : IsCommutativeSemiring _+_ _*_ 0 1 *-+-isCommutativeSemiring = record { +-isCommutativeMonoid = +-0-isCommutativeMonoid ; *-isCommutativeMonoid = *-1-isCommutativeMonoid ; distribʳ = *-distribʳ-+ ; zeroˡ = *-zeroˡ } *-+-commutativeSemiring : CommutativeSemiring 0ℓ 0ℓ *-+-commutativeSemiring = record { isCommutativeSemiring = *-+-isCommutativeSemiring } -- Other properties of _*_ *-cancelʳ-≡ : ∀ i j {k} → i * suc k ≡ j * suc k → i ≡ j *-cancelʳ-≡ zero zero eq = refl *-cancelʳ-≡ zero (suc j) () *-cancelʳ-≡ (suc i) zero () *-cancelʳ-≡ (suc i) (suc j) {k} eq = cong suc (*-cancelʳ-≡ i j (+-cancelˡ-≡ (suc k) eq)) *-cancelˡ-≡ : ∀ {i j} k → suc k * i ≡ suc k * j → i ≡ j *-cancelˡ-≡ {i} {j} k eq = *-cancelʳ-≡ i j (subst₂ _≡_ (*-comm (suc k) i) (*-comm (suc k) j) eq) i*j≡0⇒i≡0∨j≡0 : ∀ i {j} → i * j ≡ 0 → i ≡ 0 ⊎ j ≡ 0 i*j≡0⇒i≡0∨j≡0 zero {j} eq = inj₁ refl i*j≡0⇒i≡0∨j≡0 (suc i) {zero} eq = inj₂ refl i*j≡0⇒i≡0∨j≡0 (suc i) {suc j} () i*j≡1⇒i≡1 : ∀ i j → i * j ≡ 1 → i ≡ 1 i*j≡1⇒i≡1 (suc zero) j _ = refl i*j≡1⇒i≡1 zero j () i*j≡1⇒i≡1 (suc (suc i)) (suc (suc j)) () i*j≡1⇒i≡1 (suc (suc i)) (suc zero) () i*j≡1⇒i≡1 (suc (suc i)) zero eq = contradiction (trans (sym $ *-zeroʳ i) eq) λ() i*j≡1⇒j≡1 : ∀ i j → i * j ≡ 1 → j ≡ 1 i*j≡1⇒j≡1 i j eq = i*j≡1⇒i≡1 j i (trans (*-comm j i) eq) *-cancelʳ-≤ : ∀ i j k → i * suc k ≤ j * suc k → i ≤ j *-cancelʳ-≤ zero _ _ _ = z≤n *-cancelʳ-≤ (suc i) zero _ () *-cancelʳ-≤ (suc i) (suc j) k le = s≤s (*-cancelʳ-≤ i j k (+-cancelˡ-≤ (suc k) le)) *-mono-≤ : _*_ Preserves₂ _≤_ ⟶ _≤_ ⟶ _≤_ *-mono-≤ z≤n _ = z≤n *-mono-≤ (s≤s m≤n) u≤v = +-mono-≤ u≤v (*-mono-≤ m≤n u≤v) *-monoˡ-≤ : ∀ n → (_* n) Preserves _≤_ ⟶ _≤_ *-monoˡ-≤ n m≤o = *-mono-≤ m≤o (≤-refl {n}) *-monoʳ-≤ : ∀ n → (n *_) Preserves _≤_ ⟶ _≤_ *-monoʳ-≤ n m≤o = *-mono-≤ (≤-refl {n}) m≤o *-mono-< : _*_ Preserves₂ _<_ ⟶ _<_ ⟶ _<_ *-mono-< (s≤s z≤n) (s≤s u≤v) = s≤s z≤n *-mono-< (s≤s (s≤s m≤n)) (s≤s u≤v) = +-mono-< (s≤s u≤v) (*-mono-< (s≤s m≤n) (s≤s u≤v)) *-monoˡ-< : ∀ n → (_* suc n) Preserves _<_ ⟶ _<_ *-monoˡ-< n (s≤s z≤n) = s≤s z≤n *-monoˡ-< n (s≤s (s≤s m≤o)) = +-mono-≤-< (≤-refl {suc n}) (*-monoˡ-< n (s≤s m≤o)) *-monoʳ-< : ∀ n → (suc n *_) Preserves _<_ ⟶ _<_ *-monoʳ-< zero (s≤s m≤o) = +-mono-≤ (s≤s m≤o) z≤n *-monoʳ-< (suc n) (s≤s m≤o) = +-mono-≤ (s≤s m≤o) (<⇒≤ (*-monoʳ-< n (s≤s m≤o))) ------------------------------------------------------------------------ -- Properties of _^_ ^-identityʳ : RightIdentity 1 _^_ ^-identityʳ zero = refl ^-identityʳ (suc x) = cong suc (^-identityʳ x) ^-zeroˡ : LeftZero 1 _^_ ^-zeroˡ zero = refl ^-zeroˡ (suc e) = begin 1 ^ suc e ≡⟨⟩ 1 * (1 ^ e) ≡⟨ *-identityˡ (1 ^ e) ⟩ 1 ^ e ≡⟨ ^-zeroˡ e ⟩ 1 ∎ ^-distribˡ-+-* : ∀ m n p → m ^ (n + p) ≡ m ^ n * m ^ p ^-distribˡ-+-* m zero p = sym (+-identityʳ (m ^ p)) ^-distribˡ-+-* m (suc n) p = begin m * (m ^ (n + p)) ≡⟨ cong (m *_) (^-distribˡ-+-* m n p) ⟩ m * ((m ^ n) * (m ^ p)) ≡⟨ sym (*-assoc m _ _) ⟩ (m * (m ^ n)) * (m ^ p) ∎ ^-semigroup-morphism : ∀ {n} → (n ^_) Is +-semigroup -Semigroup⟶ *-semigroup ^-semigroup-morphism = record { ⟦⟧-cong = cong (_ ^_) ; ∙-homo = ^-distribˡ-+-* _ } ^-monoid-morphism : ∀ {n} → (n ^_) Is +-0-monoid -Monoid⟶ *-1-monoid ^-monoid-morphism = record { sm-homo = ^-semigroup-morphism ; ε-homo = refl } ^-*-assoc : ∀ m n p → (m ^ n) ^ p ≡ m ^ (n * p) ^-*-assoc m n zero = begin 1 ≡⟨⟩ m ^ 0 ≡⟨ cong (m ^_) (sym $ *-zeroʳ n) ⟩ m ^ (n * 0) ∎ ^-*-assoc m n (suc p) = begin (m ^ n) * ((m ^ n) ^ p) ≡⟨ cong ((m ^ n) *_) (^-*-assoc m n p) ⟩ (m ^ n) * (m ^ (n * p)) ≡⟨ sym (^-distribˡ-+-* m n (n * p)) ⟩ m ^ (n + n * p) ≡⟨ cong (m ^_) (sym (+-*-suc n p)) ⟩ m ^ (n * (suc p)) ∎ i^j≡0⇒i≡0 : ∀ i j → i ^ j ≡ 0 → i ≡ 0 i^j≡0⇒i≡0 i zero () i^j≡0⇒i≡0 i (suc j) eq = [ id , i^j≡0⇒i≡0 i j ]′ (i*j≡0⇒i≡0∨j≡0 i eq) i^j≡1⇒j≡0∨i≡1 : ∀ i j → i ^ j ≡ 1 → j ≡ 0 ⊎ i ≡ 1 i^j≡1⇒j≡0∨i≡1 i zero _ = inj₁ refl i^j≡1⇒j≡0∨i≡1 i (suc j) eq = inj₂ (i*j≡1⇒i≡1 i (i ^ j) eq) ------------------------------------------------------------------------ -- Properties of _≤‴_ ≤‴⇒≤″ : ∀{m n} → m ≤‴ n → m ≤″ n ≤‴⇒≤″ {m = m} ≤‴-refl = less-than-or-equal {k = 0} (+-identityʳ m) ≤‴⇒≤″ {m = m} (≤‴-step x) = less-than-or-equal (trans (+-suc m _) (_≤″_.proof ind)) where ind = ≤‴⇒≤″ x m≤‴m+k : ∀{m n k} → m + k ≡ n → m ≤‴ n m≤‴m+k {m} {k = zero} refl = subst (λ z → m ≤‴ z) (sym (+-identityʳ m)) (≤‴-refl {m}) m≤‴m+k {m} {k = suc k} proof = ≤‴-step (m≤‴m+k {k = k} (trans (sym (+-suc m _)) proof)) ≤″⇒≤‴ : ∀{m n} → m ≤″ n → m ≤‴ n ≤″⇒≤‴ (less-than-or-equal {k} proof) = m≤‴m+k proof ------------------------------------------------------------------------ -- Properties of _⊔_ and _⊓_ ⊔-assoc : Associative _⊔_ ⊔-assoc zero _ _ = refl ⊔-assoc (suc m) zero o = refl ⊔-assoc (suc m) (suc n) zero = refl ⊔-assoc (suc m) (suc n) (suc o) = cong suc $ ⊔-assoc m n o ⊔-identityˡ : LeftIdentity 0 _⊔_ ⊔-identityˡ _ = refl ⊔-identityʳ : RightIdentity 0 _⊔_ ⊔-identityʳ zero = refl ⊔-identityʳ (suc n) = refl ⊔-identity : Identity 0 _⊔_ ⊔-identity = ⊔-identityˡ , ⊔-identityʳ ⊔-comm : Commutative _⊔_ ⊔-comm zero n = sym $ ⊔-identityʳ n ⊔-comm (suc m) zero = refl ⊔-comm (suc m) (suc n) = cong suc (⊔-comm m n) ⊔-sel : Selective _⊔_ ⊔-sel zero _ = inj₂ refl ⊔-sel (suc m) zero = inj₁ refl ⊔-sel (suc m) (suc n) with ⊔-sel m n ... | inj₁ m⊔n≡m = inj₁ (cong suc m⊔n≡m) ... | inj₂ m⊔n≡n = inj₂ (cong suc m⊔n≡n) ⊔-idem : Idempotent _⊔_ ⊔-idem = sel⇒idem ⊔-sel ⊓-assoc : Associative _⊓_ ⊓-assoc zero _ _ = refl ⊓-assoc (suc m) zero o = refl ⊓-assoc (suc m) (suc n) zero = refl ⊓-assoc (suc m) (suc n) (suc o) = cong suc $ ⊓-assoc m n o ⊓-zeroˡ : LeftZero 0 _⊓_ ⊓-zeroˡ _ = refl ⊓-zeroʳ : RightZero 0 _⊓_ ⊓-zeroʳ zero = refl ⊓-zeroʳ (suc n) = refl ⊓-zero : Zero 0 _⊓_ ⊓-zero = ⊓-zeroˡ , ⊓-zeroʳ ⊓-comm : Commutative _⊓_ ⊓-comm zero n = sym $ ⊓-zeroʳ n ⊓-comm (suc m) zero = refl ⊓-comm (suc m) (suc n) = cong suc (⊓-comm m n) ⊓-sel : Selective _⊓_ ⊓-sel zero _ = inj₁ refl ⊓-sel (suc m) zero = inj₂ refl ⊓-sel (suc m) (suc n) with ⊓-sel m n ... | inj₁ m⊓n≡m = inj₁ (cong suc m⊓n≡m) ... | inj₂ m⊓n≡n = inj₂ (cong suc m⊓n≡n) ⊓-idem : Idempotent _⊓_ ⊓-idem = sel⇒idem ⊓-sel ⊓-distribʳ-⊔ : _⊓_ DistributesOverʳ _⊔_ ⊓-distribʳ-⊔ (suc m) (suc n) (suc o) = cong suc $ ⊓-distribʳ-⊔ m n o ⊓-distribʳ-⊔ (suc m) (suc n) zero = cong suc $ refl ⊓-distribʳ-⊔ (suc m) zero o = refl ⊓-distribʳ-⊔ zero n o = begin (n ⊔ o) ⊓ 0 ≡⟨ ⊓-comm (n ⊔ o) 0 ⟩ 0 ⊓ (n ⊔ o) ≡⟨⟩ 0 ⊓ n ⊔ 0 ⊓ o ≡⟨ ⊓-comm 0 n ⟨ cong₂ _⊔_ ⟩ ⊓-comm 0 o ⟩ n ⊓ 0 ⊔ o ⊓ 0 ∎ ⊓-distribˡ-⊔ : _⊓_ DistributesOverˡ _⊔_ ⊓-distribˡ-⊔ = comm+distrʳ⇒distrˡ ⊓-comm ⊓-distribʳ-⊔ ⊓-distrib-⊔ : _⊓_ DistributesOver _⊔_ ⊓-distrib-⊔ = ⊓-distribˡ-⊔ , ⊓-distribʳ-⊔ ⊔-abs-⊓ : _⊔_ Absorbs _⊓_ ⊔-abs-⊓ zero n = refl ⊔-abs-⊓ (suc m) zero = refl ⊔-abs-⊓ (suc m) (suc n) = cong suc $ ⊔-abs-⊓ m n ⊓-abs-⊔ : _⊓_ Absorbs _⊔_ ⊓-abs-⊔ zero n = refl ⊓-abs-⊔ (suc m) (suc n) = cong suc $ ⊓-abs-⊔ m n ⊓-abs-⊔ (suc m) zero = cong suc $ begin m ⊓ m ≡⟨ cong (m ⊓_) $ sym $ ⊔-identityʳ m ⟩ m ⊓ (m ⊔ 0) ≡⟨ ⊓-abs-⊔ m zero ⟩ m ∎ ⊓-⊔-absorptive : Absorptive _⊓_ _⊔_ ⊓-⊔-absorptive = ⊓-abs-⊔ , ⊔-abs-⊓ ⊔-isMagma : IsMagma _⊔_ ⊔-isMagma = record { isEquivalence = isEquivalence ; ∙-cong = cong₂ _⊔_ } ⊔-magma : Magma 0ℓ 0ℓ ⊔-magma = record { isMagma = ⊔-isMagma } ⊔-isSemigroup : IsSemigroup _⊔_ ⊔-isSemigroup = record { isMagma = ⊔-isMagma ; assoc = ⊔-assoc } ⊔-semigroup : Semigroup 0ℓ 0ℓ ⊔-semigroup = record { isSemigroup = ⊔-isSemigroup } ⊔-isBand : IsBand _⊔_ ⊔-isBand = record { isSemigroup = ⊔-isSemigroup ; idem = ⊔-idem } ⊔-band : Band 0ℓ 0ℓ ⊔-band = record { isBand = ⊔-isBand } ⊔-isSemilattice : IsSemilattice _⊔_ ⊔-isSemilattice = record { isBand = ⊔-isBand ; comm = ⊔-comm } ⊔-semilattice : Semilattice 0ℓ 0ℓ ⊔-semilattice = record { isSemilattice = ⊔-isSemilattice } ⊔-0-isCommutativeMonoid : IsCommutativeMonoid _⊔_ 0 ⊔-0-isCommutativeMonoid = record { isSemigroup = ⊔-isSemigroup ; identityˡ = ⊔-identityˡ ; comm = ⊔-comm } ⊔-0-commutativeMonoid : CommutativeMonoid 0ℓ 0ℓ ⊔-0-commutativeMonoid = record { isCommutativeMonoid = ⊔-0-isCommutativeMonoid } ⊓-isMagma : IsMagma _⊓_ ⊓-isMagma = record { isEquivalence = isEquivalence ; ∙-cong = cong₂ _⊓_ } ⊓-magma : Magma 0ℓ 0ℓ ⊓-magma = record { isMagma = ⊓-isMagma } ⊓-isSemigroup : IsSemigroup _⊓_ ⊓-isSemigroup = record { isMagma = ⊓-isMagma ; assoc = ⊓-assoc } ⊓-semigroup : Semigroup 0ℓ 0ℓ ⊓-semigroup = record { isSemigroup = ⊔-isSemigroup } ⊓-isBand : IsBand _⊓_ ⊓-isBand = record { isSemigroup = ⊓-isSemigroup ; idem = ⊓-idem } ⊓-band : Band 0ℓ 0ℓ ⊓-band = record { isBand = ⊓-isBand } ⊓-isSemilattice : IsSemilattice _⊓_ ⊓-isSemilattice = record { isBand = ⊓-isBand ; comm = ⊓-comm } ⊓-semilattice : Semilattice 0ℓ 0ℓ ⊓-semilattice = record { isSemilattice = ⊓-isSemilattice } ⊔-⊓-isSemiringWithoutOne : IsSemiringWithoutOne _⊔_ _⊓_ 0 ⊔-⊓-isSemiringWithoutOne = record { +-isCommutativeMonoid = ⊔-0-isCommutativeMonoid ; *-isSemigroup = ⊓-isSemigroup ; distrib = ⊓-distrib-⊔ ; zero = ⊓-zero } ⊔-⊓-isCommutativeSemiringWithoutOne : IsCommutativeSemiringWithoutOne _⊔_ _⊓_ 0 ⊔-⊓-isCommutativeSemiringWithoutOne = record { isSemiringWithoutOne = ⊔-⊓-isSemiringWithoutOne ; *-comm = ⊓-comm } ⊔-⊓-commutativeSemiringWithoutOne : CommutativeSemiringWithoutOne 0ℓ 0ℓ ⊔-⊓-commutativeSemiringWithoutOne = record { isCommutativeSemiringWithoutOne = ⊔-⊓-isCommutativeSemiringWithoutOne } ⊓-⊔-isLattice : IsLattice _⊓_ _⊔_ ⊓-⊔-isLattice = record { isEquivalence = isEquivalence ; ∨-comm = ⊓-comm ; ∨-assoc = ⊓-assoc ; ∨-cong = cong₂ _⊓_ ; ∧-comm = ⊔-comm ; ∧-assoc = ⊔-assoc ; ∧-cong = cong₂ _⊔_ ; absorptive = ⊓-⊔-absorptive } ⊓-⊔-lattice : Lattice 0ℓ 0ℓ ⊓-⊔-lattice = record { isLattice = ⊓-⊔-isLattice } ⊓-⊔-isDistributiveLattice : IsDistributiveLattice _⊓_ _⊔_ ⊓-⊔-isDistributiveLattice = record { isLattice = ⊓-⊔-isLattice ; ∨-∧-distribʳ = ⊓-distribʳ-⊔ } ⊓-⊔-distributiveLattice : DistributiveLattice 0ℓ 0ℓ ⊓-⊔-distributiveLattice = record { isDistributiveLattice = ⊓-⊔-isDistributiveLattice } -- Ordering properties of _⊔_ and _⊓_ m⊓n≤m : ∀ m n → m ⊓ n ≤ m m⊓n≤m zero _ = z≤n m⊓n≤m (suc m) zero = z≤n m⊓n≤m (suc m) (suc n) = s≤s $ m⊓n≤m m n m⊓n≤n : ∀ m n → m ⊓ n ≤ n m⊓n≤n m n = subst (_≤ n) (⊓-comm n m) (m⊓n≤m n m) m≤m⊔n : ∀ m n → m ≤ m ⊔ n m≤m⊔n zero _ = z≤n m≤m⊔n (suc m) zero = ≤-refl m≤m⊔n (suc m) (suc n) = s≤s $ m≤m⊔n m n n≤m⊔n : ∀ m n → n ≤ m ⊔ n n≤m⊔n m n = subst (n ≤_) (⊔-comm n m) (m≤m⊔n n m) m≤n⇒m⊓n≡m : ∀ {m n} → m ≤ n → m ⊓ n ≡ m m≤n⇒m⊓n≡m z≤n = refl m≤n⇒m⊓n≡m (s≤s m≤n) = cong suc (m≤n⇒m⊓n≡m m≤n) m≤n⇒n⊓m≡m : ∀ {m n} → m ≤ n → n ⊓ m ≡ m m≤n⇒n⊓m≡m {m} m≤n = trans (⊓-comm _ m) (m≤n⇒m⊓n≡m m≤n) m⊓n≡m⇒m≤n : ∀ {m n} → m ⊓ n ≡ m → m ≤ n m⊓n≡m⇒m≤n m⊓n≡m = subst (_≤ _) m⊓n≡m (m⊓n≤n _ _) m⊓n≡n⇒n≤m : ∀ {m n} → m ⊓ n ≡ n → n ≤ m m⊓n≡n⇒n≤m m⊓n≡n = subst (_≤ _) m⊓n≡n (m⊓n≤m _ _) m≤n⇒n⊔m≡n : ∀ {m n} → m ≤ n → n ⊔ m ≡ n m≤n⇒n⊔m≡n z≤n = ⊔-identityʳ _ m≤n⇒n⊔m≡n (s≤s m≤n) = cong suc (m≤n⇒n⊔m≡n m≤n) m≤n⇒m⊔n≡n : ∀ {m n} → m ≤ n → m ⊔ n ≡ n m≤n⇒m⊔n≡n {m} m≤n = trans (⊔-comm m _) (m≤n⇒n⊔m≡n m≤n) n⊔m≡m⇒n≤m : ∀ {m n} → n ⊔ m ≡ m → n ≤ m n⊔m≡m⇒n≤m n⊔m≡m = subst (_ ≤_) n⊔m≡m (m≤m⊔n _ _) n⊔m≡n⇒m≤n : ∀ {m n} → n ⊔ m ≡ n → m ≤ n n⊔m≡n⇒m≤n n⊔m≡n = subst (_ ≤_) n⊔m≡n (n≤m⊔n _ _) m⊓n≤m⊔n : ∀ m n → m ⊓ n ≤ m ⊔ n m⊓n≤m⊔n zero n = z≤n m⊓n≤m⊔n (suc m) zero = z≤n m⊓n≤m⊔n (suc m) (suc n) = s≤s (m⊓n≤m⊔n m n) m≤n⇒m⊓o≤n : ∀ {m n} o → m ≤ n → m ⊓ o ≤ n m≤n⇒m⊓o≤n o m≤n = ≤-trans (m⊓n≤m _ o) m≤n m≤n⇒o⊓m≤n : ∀ {m n} o → m ≤ n → o ⊓ m ≤ n m≤n⇒o⊓m≤n n m≤n = ≤-trans (m⊓n≤n n _) m≤n m≤n⊓o⇒m≤n : ∀ {m} n o → m ≤ n ⊓ o → m ≤ n m≤n⊓o⇒m≤n n o m≤n⊓o = ≤-trans m≤n⊓o (m⊓n≤m n o) m≤n⊓o⇒m≤o : ∀ {m} n o → m ≤ n ⊓ o → m ≤ o m≤n⊓o⇒m≤o n o m≤n⊓o = ≤-trans m≤n⊓o (m⊓n≤n n o) m≤n⇒m≤n⊔o : ∀ {m n} o → m ≤ n → m ≤ n ⊔ o m≤n⇒m≤n⊔o o m≤n = ≤-trans m≤n (m≤m⊔n _ o) m≤n⇒m≤o⊔n : ∀ {m n} o → m ≤ n → m ≤ o ⊔ n m≤n⇒m≤o⊔n n m≤n = ≤-trans m≤n (n≤m⊔n n _) m⊔n≤o⇒m≤o : ∀ m n {o} → m ⊔ n ≤ o → m ≤ o m⊔n≤o⇒m≤o m n m⊔n≤o = ≤-trans (m≤m⊔n m n) m⊔n≤o m⊔n≤o⇒n≤o : ∀ m n {o} → m ⊔ n ≤ o → n ≤ o m⊔n≤o⇒n≤o m n m⊔n≤o = ≤-trans (n≤m⊔n m n) m⊔n≤o m<n⇒m⊓o<n : ∀ {m n} o → m < n → m ⊓ o < n m<n⇒m⊓o<n o m<n = <-transʳ (m⊓n≤m _ o) m<n m<n⇒o⊓m<n : ∀ {m n} o → m < n → o ⊓ m < n m<n⇒o⊓m<n o m<n = <-transʳ (m⊓n≤n o _) m<n m<n⊓o⇒m<n : ∀ {m} n o → m < n ⊓ o → m < n m<n⊓o⇒m<n = m≤n⊓o⇒m≤n m<n⊓o⇒m<o : ∀ {m} n o → m < n ⊓ o → m < o m<n⊓o⇒m<o = m≤n⊓o⇒m≤o m<n⇒m<n⊔o : ∀ {m n} o → m < n → m < n ⊔ o m<n⇒m<n⊔o = m≤n⇒m≤n⊔o m<n⇒m<o⊔n : ∀ {m n} o → m < n → m < o ⊔ n m<n⇒m<o⊔n = m≤n⇒m≤o⊔n m⊔n<o⇒m<o : ∀ m n {o} → m ⊔ n < o → m < o m⊔n<o⇒m<o m n m⊔n<o = <-transʳ (m≤m⊔n m n) m⊔n<o m⊔n<o⇒n<o : ∀ m n {o} → m ⊔ n < o → n < o m⊔n<o⇒n<o m n m⊔n<o = <-transʳ (n≤m⊔n m n) m⊔n<o ⊔-mono-≤ : _⊔_ Preserves₂ _≤_ ⟶ _≤_ ⟶ _≤_ ⊔-mono-≤ {x} {y} {u} {v} x≤y u≤v with ⊔-sel x u ... | inj₁ x⊔u≡x rewrite x⊔u≡x = ≤-trans x≤y (m≤m⊔n y v) ... | inj₂ x⊔u≡u rewrite x⊔u≡u = ≤-trans u≤v (n≤m⊔n y v) ⊔-monoˡ-≤ : ∀ n → (_⊔ n) Preserves _≤_ ⟶ _≤_ ⊔-monoˡ-≤ n m≤o = ⊔-mono-≤ m≤o (≤-refl {n}) ⊔-monoʳ-≤ : ∀ n → (n ⊔_) Preserves _≤_ ⟶ _≤_ ⊔-monoʳ-≤ n m≤o = ⊔-mono-≤ (≤-refl {n}) m≤o ⊔-mono-< : _⊔_ Preserves₂ _<_ ⟶ _<_ ⟶ _<_ ⊔-mono-< = ⊔-mono-≤ ⊓-mono-≤ : _⊓_ Preserves₂ _≤_ ⟶ _≤_ ⟶ _≤_ ⊓-mono-≤ {x} {y} {u} {v} x≤y u≤v with ⊓-sel y v ... | inj₁ y⊓v≡y rewrite y⊓v≡y = ≤-trans (m⊓n≤m x u) x≤y ... | inj₂ y⊓v≡v rewrite y⊓v≡v = ≤-trans (m⊓n≤n x u) u≤v ⊓-monoˡ-≤ : ∀ n → (_⊓ n) Preserves _≤_ ⟶ _≤_ ⊓-monoˡ-≤ n m≤o = ⊓-mono-≤ m≤o (≤-refl {n}) ⊓-monoʳ-≤ : ∀ n → (n ⊓_) Preserves _≤_ ⟶ _≤_ ⊓-monoʳ-≤ n m≤o = ⊓-mono-≤ (≤-refl {n}) m≤o ⊓-mono-< : _⊓_ Preserves₂ _<_ ⟶ _<_ ⟶ _<_ ⊓-mono-< = ⊓-mono-≤ -- Properties of _⊔_ and _⊓_ and _+_ m⊔n≤m+n : ∀ m n → m ⊔ n ≤ m + n m⊔n≤m+n m n with ⊔-sel m n ... | inj₁ m⊔n≡m rewrite m⊔n≡m = m≤m+n m n ... | inj₂ m⊔n≡n rewrite m⊔n≡n = n≤m+n m n m⊓n≤m+n : ∀ m n → m ⊓ n ≤ m + n m⊓n≤m+n m n with ⊓-sel m n ... | inj₁ m⊓n≡m rewrite m⊓n≡m = m≤m+n m n ... | inj₂ m⊓n≡n rewrite m⊓n≡n = n≤m+n m n +-distribˡ-⊔ : _+_ DistributesOverˡ _⊔_ +-distribˡ-⊔ zero y z = refl +-distribˡ-⊔ (suc x) y z = cong suc (+-distribˡ-⊔ x y z) +-distribʳ-⊔ : _+_ DistributesOverʳ _⊔_ +-distribʳ-⊔ = comm+distrˡ⇒distrʳ +-comm +-distribˡ-⊔ +-distrib-⊔ : _+_ DistributesOver _⊔_ +-distrib-⊔ = +-distribˡ-⊔ , +-distribʳ-⊔ +-distribˡ-⊓ : _+_ DistributesOverˡ _⊓_ +-distribˡ-⊓ zero y z = refl +-distribˡ-⊓ (suc x) y z = cong suc (+-distribˡ-⊓ x y z) +-distribʳ-⊓ : _+_ DistributesOverʳ _⊓_ +-distribʳ-⊓ = comm+distrˡ⇒distrʳ +-comm +-distribˡ-⊓ +-distrib-⊓ : _+_ DistributesOver _⊓_ +-distrib-⊓ = +-distribˡ-⊓ , +-distribʳ-⊓ -- Other properties ⊓-triangulate : ∀ x y z → x ⊓ y ⊓ z ≡ (x ⊓ y) ⊓ (y ⊓ z) ⊓-triangulate x y z = begin x ⊓ y ⊓ z ≡⟨ cong (λ v → x ⊓ v ⊓ z) (sym (⊓-idem y)) ⟩ x ⊓ (y ⊓ y) ⊓ z ≡⟨ ⊓-assoc x _ _ ⟩ x ⊓ ((y ⊓ y) ⊓ z) ≡⟨ cong (x ⊓_) (⊓-assoc y _ _) ⟩ x ⊓ (y ⊓ (y ⊓ z)) ≡⟨ sym (⊓-assoc x _ _) ⟩ (x ⊓ y) ⊓ (y ⊓ z) ∎ ⊔-triangulate : ∀ x y z → x ⊔ y ⊔ z ≡ (x ⊔ y) ⊔ (y ⊔ z) ⊔-triangulate x y z = begin x ⊔ y ⊔ z ≡⟨ cong (λ v → x ⊔ v ⊔ z) (sym (⊔-idem y)) ⟩ x ⊔ (y ⊔ y) ⊔ z ≡⟨ ⊔-assoc x _ _ ⟩ x ⊔ ((y ⊔ y) ⊔ z) ≡⟨ cong (x ⊔_) (⊔-assoc y _ _) ⟩ x ⊔ (y ⊔ (y ⊔ z)) ≡⟨ sym (⊔-assoc x _ _) ⟩ (x ⊔ y) ⊔ (y ⊔ z) ∎ ------------------------------------------------------------------------ -- Properties of _∸_ 0∸n≡0 : LeftZero zero _∸_ 0∸n≡0 zero = refl 0∸n≡0 (suc _) = refl n∸n≡0 : ∀ n → n ∸ n ≡ 0 n∸n≡0 zero = refl n∸n≡0 (suc n) = n∸n≡0 n -- Ordering properties of _∸_ n∸m≤n : ∀ m n → n ∸ m ≤ n n∸m≤n zero n = ≤-refl n∸m≤n (suc m) zero = ≤-refl n∸m≤n (suc m) (suc n) = ≤-trans (n∸m≤n m n) (n≤1+n n) m≮m∸n : ∀ m n → m ≮ m ∸ n m≮m∸n zero (suc n) () m≮m∸n m zero = n≮n m m≮m∸n (suc m) (suc n) = m≮m∸n m n ∘ ≤-trans (n≤1+n (suc m)) ∸-mono : _∸_ Preserves₂ _≤_ ⟶ _≥_ ⟶ _≤_ ∸-mono z≤n (s≤s n₁≥n₂) = z≤n ∸-mono (s≤s m₁≤m₂) (s≤s n₁≥n₂) = ∸-mono m₁≤m₂ n₁≥n₂ ∸-mono m₁≤m₂ (z≤n {n = n₁}) = ≤-trans (n∸m≤n n₁ _) m₁≤m₂ ∸-monoˡ-≤ : ∀ {m n} o → m ≤ n → m ∸ o ≤ n ∸ o ∸-monoˡ-≤ o m≤n = ∸-mono {u = o} m≤n ≤-refl ∸-monoʳ-≤ : ∀ {m n} o → m ≤ n → o ∸ m ≥ o ∸ n ∸-monoʳ-≤ _ m≤n = ∸-mono ≤-refl m≤n m∸n≡0⇒m≤n : ∀ {m n} → m ∸ n ≡ 0 → m ≤ n m∸n≡0⇒m≤n {zero} {_} _ = z≤n m∸n≡0⇒m≤n {suc m} {zero} () m∸n≡0⇒m≤n {suc m} {suc n} eq = s≤s (m∸n≡0⇒m≤n eq) m≤n⇒m∸n≡0 : ∀ {m n} → m ≤ n → m ∸ n ≡ 0 m≤n⇒m∸n≡0 {n = n} z≤n = 0∸n≡0 n m≤n⇒m∸n≡0 {_} (s≤s m≤n) = m≤n⇒m∸n≡0 m≤n -- Properties of _∸_ and _+_ +-∸-comm : ∀ {m} n {o} → o ≤ m → (m + n) ∸ o ≡ (m ∸ o) + n +-∸-comm {zero} _ {suc o} () +-∸-comm {zero} _ {zero} _ = refl +-∸-comm {suc m} _ {zero} _ = refl +-∸-comm {suc m} n {suc o} (s≤s o≤m) = +-∸-comm n o≤m ∸-+-assoc : ∀ m n o → (m ∸ n) ∸ o ≡ m ∸ (n + o) ∸-+-assoc m n zero = cong (m ∸_) (sym $ +-identityʳ n) ∸-+-assoc zero zero (suc o) = refl ∸-+-assoc zero (suc n) (suc o) = refl ∸-+-assoc (suc m) zero (suc o) = refl ∸-+-assoc (suc m) (suc n) (suc o) = ∸-+-assoc m n (suc o) +-∸-assoc : ∀ m {n o} → o ≤ n → (m + n) ∸ o ≡ m + (n ∸ o) +-∸-assoc m (z≤n {n = n}) = begin m + n ∎ +-∸-assoc m (s≤s {m = o} {n = n} o≤n) = begin (m + suc n) ∸ suc o ≡⟨ cong (_∸ suc o) (+-suc m n) ⟩ suc (m + n) ∸ suc o ≡⟨⟩ (m + n) ∸ o ≡⟨ +-∸-assoc m o≤n ⟩ m + (n ∸ o) ∎ n≤m+n∸m : ∀ m n → n ≤ m + (n ∸ m) n≤m+n∸m m zero = z≤n n≤m+n∸m zero (suc n) = ≤-refl n≤m+n∸m (suc m) (suc n) = s≤s (n≤m+n∸m m n) m+n∸n≡m : ∀ m n → (m + n) ∸ n ≡ m m+n∸n≡m m n = begin (m + n) ∸ n ≡⟨ +-∸-assoc m (≤-refl {x = n}) ⟩ m + (n ∸ n) ≡⟨ cong (m +_) (n∸n≡0 n) ⟩ m + 0 ≡⟨ +-identityʳ m ⟩ m ∎ m+n∸m≡n : ∀ {m n} → m ≤ n → m + (n ∸ m) ≡ n m+n∸m≡n {m} {n} m≤n = begin m + (n ∸ m) ≡⟨ sym $ +-∸-assoc m m≤n ⟩ (m + n) ∸ m ≡⟨ cong (_∸ m) (+-comm m n) ⟩ (n + m) ∸ m ≡⟨ m+n∸n≡m n m ⟩ n ∎ m∸n+n≡m : ∀ {m n} → n ≤ m → (m ∸ n) + n ≡ m m∸n+n≡m {m} {n} n≤m = begin (m ∸ n) + n ≡⟨ sym (+-∸-comm n n≤m) ⟩ (m + n) ∸ n ≡⟨ m+n∸n≡m m n ⟩ m ∎ m∸[m∸n]≡n : ∀ {m n} → n ≤ m → m ∸ (m ∸ n) ≡ n m∸[m∸n]≡n {m} {_} z≤n = n∸n≡0 m m∸[m∸n]≡n {suc m} {suc n} (s≤s n≤m) = begin suc m ∸ (m ∸ n) ≡⟨ +-∸-assoc 1 (n∸m≤n n m) ⟩ suc (m ∸ (m ∸ n)) ≡⟨ cong suc (m∸[m∸n]≡n n≤m) ⟩ suc n ∎ [i+j]∸[i+k]≡j∸k : ∀ i j k → (i + j) ∸ (i + k) ≡ j ∸ k [i+j]∸[i+k]≡j∸k zero j k = refl [i+j]∸[i+k]≡j∸k (suc i) j k = [i+j]∸[i+k]≡j∸k i j k -- Properties of _∸_ and _*_ *-distribʳ-∸ : _*_ DistributesOverʳ _∸_ *-distribʳ-∸ i zero zero = refl *-distribʳ-∸ zero zero (suc k) = sym (0∸n≡0 (k * zero)) *-distribʳ-∸ (suc i) zero (suc k) = refl *-distribʳ-∸ i (suc j) zero = refl *-distribʳ-∸ i (suc j) (suc k) = begin (j ∸ k) * i ≡⟨ *-distribʳ-∸ i j k ⟩ j * i ∸ k * i ≡⟨ sym $ [i+j]∸[i+k]≡j∸k i _ _ ⟩ i + j * i ∸ (i + k * i) ∎ *-distribˡ-∸ : _*_ DistributesOverˡ _∸_ *-distribˡ-∸ = comm+distrʳ⇒distrˡ *-comm *-distribʳ-∸ *-distrib-∸ : _*_ DistributesOver _∸_ *-distrib-∸ = *-distribˡ-∸ , *-distribʳ-∸ -- Properties of _∸_ and _⊓_ and _⊔_ m⊓n+n∸m≡n : ∀ m n → (m ⊓ n) + (n ∸ m) ≡ n m⊓n+n∸m≡n zero n = refl m⊓n+n∸m≡n (suc m) zero = refl m⊓n+n∸m≡n (suc m) (suc n) = cong suc $ m⊓n+n∸m≡n m n [m∸n]⊓[n∸m]≡0 : ∀ m n → (m ∸ n) ⊓ (n ∸ m) ≡ 0 [m∸n]⊓[n∸m]≡0 zero zero = refl [m∸n]⊓[n∸m]≡0 zero (suc n) = refl [m∸n]⊓[n∸m]≡0 (suc m) zero = refl [m∸n]⊓[n∸m]≡0 (suc m) (suc n) = [m∸n]⊓[n∸m]≡0 m n ∸-distribˡ-⊓-⊔ : ∀ x y z → x ∸ (y ⊓ z) ≡ (x ∸ y) ⊔ (x ∸ z) ∸-distribˡ-⊓-⊔ x zero zero = sym (⊔-idem x) ∸-distribˡ-⊓-⊔ zero zero (suc z) = refl ∸-distribˡ-⊓-⊔ zero (suc y) zero = refl ∸-distribˡ-⊓-⊔ zero (suc y) (suc z) = refl ∸-distribˡ-⊓-⊔ (suc x) (suc y) zero = sym (m≤n⇒m⊔n≡n (≤-step (n∸m≤n y x))) ∸-distribˡ-⊓-⊔ (suc x) zero (suc z) = sym (m≤n⇒n⊔m≡n (≤-step (n∸m≤n z x))) ∸-distribˡ-⊓-⊔ (suc x) (suc y) (suc z) = ∸-distribˡ-⊓-⊔ x y z ∸-distribʳ-⊓ : _∸_ DistributesOverʳ _⊓_ ∸-distribʳ-⊓ zero y z = refl ∸-distribʳ-⊓ (suc x) zero z = refl ∸-distribʳ-⊓ (suc x) (suc y) zero = sym (⊓-zeroʳ (y ∸ x)) ∸-distribʳ-⊓ (suc x) (suc y) (suc z) = ∸-distribʳ-⊓ x y z ∸-distribˡ-⊔-⊓ : ∀ x y z → x ∸ (y ⊔ z) ≡ (x ∸ y) ⊓ (x ∸ z) ∸-distribˡ-⊔-⊓ x zero zero = sym (⊓-idem x) ∸-distribˡ-⊔-⊓ zero zero z = 0∸n≡0 z ∸-distribˡ-⊔-⊓ zero (suc y) z = 0∸n≡0 (suc y ⊔ z) ∸-distribˡ-⊔-⊓ (suc x) (suc y) zero = sym (m≤n⇒m⊓n≡m (≤-step (n∸m≤n y x))) ∸-distribˡ-⊔-⊓ (suc x) zero (suc z) = sym (m≤n⇒n⊓m≡m (≤-step (n∸m≤n z x))) ∸-distribˡ-⊔-⊓ (suc x) (suc y) (suc z) = ∸-distribˡ-⊔-⊓ x y z ∸-distribʳ-⊔ : _∸_ DistributesOverʳ _⊔_ ∸-distribʳ-⊔ zero y z = refl ∸-distribʳ-⊔ (suc x) zero z = refl ∸-distribʳ-⊔ (suc x) (suc y) zero = sym (⊔-identityʳ (y ∸ x)) ∸-distribʳ-⊔ (suc x) (suc y) (suc z) = ∸-distribʳ-⊔ x y z ------------------------------------------------------------------------ -- Properties of ∣_-_∣ n≡m⇒∣n-m∣≡0 : ∀ {n m} → n ≡ m → ∣ n - m ∣ ≡ 0 n≡m⇒∣n-m∣≡0 {zero} refl = refl n≡m⇒∣n-m∣≡0 {suc n} refl = n≡m⇒∣n-m∣≡0 {n} refl m≤n⇒∣n-m∣≡n∸m : ∀ {n m} → m ≤ n → ∣ n - m ∣ ≡ n ∸ m m≤n⇒∣n-m∣≡n∸m {zero} z≤n = refl m≤n⇒∣n-m∣≡n∸m {suc n} z≤n = refl m≤n⇒∣n-m∣≡n∸m (s≤s m≤n) = m≤n⇒∣n-m∣≡n∸m m≤n ∣n-m∣≡0⇒n≡m : ∀ {n m} → ∣ n - m ∣ ≡ 0 → n ≡ m ∣n-m∣≡0⇒n≡m {zero} {zero} eq = refl ∣n-m∣≡0⇒n≡m {zero} {suc m} () ∣n-m∣≡0⇒n≡m {suc n} {zero} () ∣n-m∣≡0⇒n≡m {suc n} {suc m} eq = cong suc (∣n-m∣≡0⇒n≡m eq) ∣n-m∣≡n∸m⇒m≤n : ∀ {n m} → ∣ n - m ∣ ≡ n ∸ m → m ≤ n ∣n-m∣≡n∸m⇒m≤n {zero} {zero} eq = z≤n ∣n-m∣≡n∸m⇒m≤n {zero} {suc m} () ∣n-m∣≡n∸m⇒m≤n {suc n} {zero} eq = z≤n ∣n-m∣≡n∸m⇒m≤n {suc n} {suc m} eq = s≤s (∣n-m∣≡n∸m⇒m≤n eq) ∣n-n∣≡0 : ∀ n → ∣ n - n ∣ ≡ 0 ∣n-n∣≡0 n = n≡m⇒∣n-m∣≡0 {n} refl ∣n-n+m∣≡m : ∀ n m → ∣ n - n + m ∣ ≡ m ∣n-n+m∣≡m zero m = refl ∣n-n+m∣≡m (suc n) m = ∣n-n+m∣≡m n m ∣n+m-n+o∣≡∣m-o| : ∀ n m o → ∣ n + m - n + o ∣ ≡ ∣ m - o ∣ ∣n+m-n+o∣≡∣m-o| zero m o = refl ∣n+m-n+o∣≡∣m-o| (suc n) m o = ∣n+m-n+o∣≡∣m-o| n m o n∸m≤∣n-m∣ : ∀ n m → n ∸ m ≤ ∣ n - m ∣ n∸m≤∣n-m∣ n m with ≤-total m n ... | inj₁ m≤n = subst (n ∸ m ≤_) (sym (m≤n⇒∣n-m∣≡n∸m m≤n)) ≤-refl ... | inj₂ n≤m = subst (_≤ ∣ n - m ∣) (sym (m≤n⇒m∸n≡0 n≤m)) z≤n ∣n-m∣≤n⊔m : ∀ n m → ∣ n - m ∣ ≤ n ⊔ m ∣n-m∣≤n⊔m zero m = ≤-refl ∣n-m∣≤n⊔m (suc n) zero = ≤-refl ∣n-m∣≤n⊔m (suc n) (suc m) = ≤-step (∣n-m∣≤n⊔m n m) ∣-∣-comm : Commutative ∣_-_∣ ∣-∣-comm zero zero = refl ∣-∣-comm zero (suc m) = refl ∣-∣-comm (suc n) zero = refl ∣-∣-comm (suc n) (suc m) = ∣-∣-comm n m ∣n-m∣≡[n∸m]∨[m∸n] : ∀ m n → (∣ n - m ∣ ≡ n ∸ m) ⊎ (∣ n - m ∣ ≡ m ∸ n) ∣n-m∣≡[n∸m]∨[m∸n] m n with ≤-total m n ... | inj₁ m≤n = inj₁ $ m≤n⇒∣n-m∣≡n∸m m≤n ... | inj₂ n≤m = inj₂ $ begin ∣ n - m ∣ ≡⟨ ∣-∣-comm n m ⟩ ∣ m - n ∣ ≡⟨ m≤n⇒∣n-m∣≡n∸m n≤m ⟩ m ∸ n ∎ private *-distribˡ-∣-∣-aux : ∀ a m n → m ≤ n → a * ∣ n - m ∣ ≡ ∣ a * n - a * m ∣ *-distribˡ-∣-∣-aux a m n m≤n = begin a * ∣ n - m ∣ ≡⟨ cong (a *_) (m≤n⇒∣n-m∣≡n∸m m≤n) ⟩ a * (n ∸ m) ≡⟨ *-distribˡ-∸ a n m ⟩ a * n ∸ a * m ≡⟨ sym $′ m≤n⇒∣n-m∣≡n∸m (*-monoʳ-≤ a m≤n) ⟩ ∣ a * n - a * m ∣ ∎ *-distribˡ-∣-∣ : _*_ DistributesOverˡ ∣_-_∣ *-distribˡ-∣-∣ a m n with ≤-total m n ... | inj₁ m≤n = begin a * ∣ m - n ∣ ≡⟨ cong (a *_) (∣-∣-comm m n) ⟩ a * ∣ n - m ∣ ≡⟨ *-distribˡ-∣-∣-aux a m n m≤n ⟩ ∣ a * n - a * m ∣ ≡⟨ ∣-∣-comm (a * n) (a * m) ⟩ ∣ a * m - a * n ∣ ∎ ... | inj₂ n≤m = *-distribˡ-∣-∣-aux a n m n≤m *-distribʳ-∣-∣ : _*_ DistributesOverʳ ∣_-_∣ *-distribʳ-∣-∣ = comm+distrˡ⇒distrʳ *-comm *-distribˡ-∣-∣ *-distrib-∣-∣ : _*_ DistributesOver ∣_-_∣ *-distrib-∣-∣ = *-distribˡ-∣-∣ , *-distribʳ-∣-∣ ------------------------------------------------------------------------ -- Properties of ⌊_/2⌋ ⌊n/2⌋-mono : ⌊_/2⌋ Preserves _≤_ ⟶ _≤_ ⌊n/2⌋-mono z≤n = z≤n ⌊n/2⌋-mono (s≤s z≤n) = z≤n ⌊n/2⌋-mono (s≤s (s≤s m≤n)) = s≤s (⌊n/2⌋-mono m≤n) ⌈n/2⌉-mono : ⌈_/2⌉ Preserves _≤_ ⟶ _≤_ ⌈n/2⌉-mono m≤n = ⌊n/2⌋-mono (s≤s m≤n) ⌈n/2⌉≤′n : ∀ n → ⌈ n /2⌉ ≤′ n ⌈n/2⌉≤′n zero = ≤′-refl ⌈n/2⌉≤′n (suc zero) = ≤′-refl ⌈n/2⌉≤′n (suc (suc n)) = s≤′s (≤′-step (⌈n/2⌉≤′n n)) ⌊n/2⌋≤′n : ∀ n → ⌊ n /2⌋ ≤′ n ⌊n/2⌋≤′n zero = ≤′-refl ⌊n/2⌋≤′n (suc n) = ≤′-step (⌈n/2⌉≤′n n) ------------------------------------------------------------------------ -- Properties of _<″_, and _≤″_ -- equivalence to _<ᵇ_ m<ᵇn⇒1+m+[n-1+m]≡n : ∀ m n → T (m <ᵇ n) → suc m + (n ∸ suc m) ≡ n m<ᵇn⇒1+m+[n-1+m]≡n m zero () m<ᵇn⇒1+m+[n-1+m]≡n zero (suc n) lt = refl m<ᵇn⇒1+m+[n-1+m]≡n (suc m) (suc n) lt = cong suc (m<ᵇn⇒1+m+[n-1+m]≡n m n lt) <ᵇ⇒<″ : ∀ {m n} → T (m <ᵇ n) → m <″ n <ᵇ⇒<″ {m} {n} eq = less-than-or-equal {k = n ∸ suc m} (m<ᵇn⇒1+m+[n-1+m]≡n m n eq) m<ᵇ1+m+n : ∀ m {n} → T (m <ᵇ suc (m + n)) m<ᵇ1+m+n zero = _ m<ᵇ1+m+n (suc m) = m<ᵇ1+m+n m <″⇒<ᵇ : ∀ {m n} → m <″ n → T (m <ᵇ n) <″⇒<ᵇ {m} (less-than-or-equal refl) = m<ᵇ1+m+n m -- equivalence to _≤_ ≤″⇒≤ : _≤″_ ⇒ _≤_ ≤″⇒≤ {zero} (less-than-or-equal refl) = z≤n ≤″⇒≤ {suc m} (less-than-or-equal refl) = s≤s (≤″⇒≤ (less-than-or-equal refl)) ≤⇒≤″ : _≤_ ⇒ _≤″_ ≤⇒≤″ m≤n = less-than-or-equal (proof m≤n) where k : ∀ m n → m ≤ n → ℕ k zero n _ = n k (suc m) zero () k (suc m) (suc n) m≤n = k m n (≤-pred m≤n) proof : ∀ {m n} (m≤n : m ≤ n) → m + k m n m≤n ≡ n proof z≤n = refl proof (s≤s m≤n) = cong suc (proof m≤n) -- decidability -- NB: we use the builtin function `_<ᵇ_ : (m n : ℕ) → Bool` here so -- that the function quickly decides whether to return `yes` or `no`. -- It sill takes a linear amount of time to generate the proof if it -- is inspected. We expect the main benefit to be visible for compiled -- code: the backend erases proofs. infix 4 _<″?_ _≤″?_ _≥″?_ _>″?_ _<″?_ : Decidable _<″_ m <″? n = map′ <ᵇ⇒<″ <″⇒<ᵇ (T? (m <ᵇ n)) _≤″?_ : Decidable _≤″_ zero ≤″? n = yes (less-than-or-equal refl) suc m ≤″? n = m <″? n _≥″?_ : Decidable _≥″_ _≥″?_ = flip _≤″?_ _>″?_ : Decidable _>″_ _>″?_ = flip _<″?_ -- irrelevance ≤″-irrelevant : Irrelevant _≤″_ ≤″-irrelevant {m} (less-than-or-equal {k₁} eq₁) (less-than-or-equal {k₂} eq₂) with +-cancelˡ-≡ m (trans eq₁ (sym eq₂)) ... | refl = cong less-than-or-equal (≡-irrelevant eq₁ eq₂) <″-irrelevant : Irrelevant _<″_ <″-irrelevant = ≤″-irrelevant >″-irrelevant : Irrelevant _>″_ >″-irrelevant = ≤″-irrelevant ≥″-irrelevant : Irrelevant _≥″_ ≥″-irrelevant = ≤″-irrelevant ------------------------------------------------------------------------ -- Other properties -- If there is an injection from a type to ℕ, then the type has -- decidable equality. eq? : ∀ {a} {A : Set a} → A ↣ ℕ → Decidable {A = A} _≡_ eq? inj = via-injection inj _≟_ ------------------------------------------------------------------------ -- A module for reasoning about the _≤_ and _<_ relations module ≤-Reasoning where open import Relation.Binary.Reasoning.Base.Triple ≤-isPreorder <-trans (resp₂ _<_) <⇒≤ <-transˡ <-transʳ public hiding (_≈⟨_⟩_) ------------------------------------------------------------------------ -- DEPRECATED NAMES ------------------------------------------------------------------------ -- Please use the new names as continuing support for the old names is -- not guaranteed. -- Version 0.14 _*-mono_ = *-mono-≤ {-# WARNING_ON_USAGE _*-mono_ "Warning: _*-mono_ was deprecated in v0.14. Please use *-mono-≤ instead." #-} _+-mono_ = +-mono-≤ {-# WARNING_ON_USAGE _+-mono_ "Warning: _+-mono_ was deprecated in v0.14. Please use +-mono-≤ instead." #-} +-right-identity = +-identityʳ {-# WARNING_ON_USAGE +-right-identity "Warning: +-right-identity was deprecated in v0.14. Please use +-identityʳ instead." #-} *-right-zero = *-zeroʳ {-# WARNING_ON_USAGE *-right-zero "Warning: *-right-zero was deprecated in v0.14. Please use *-zeroʳ instead." #-} distribʳ-*-+ = *-distribʳ-+ {-# WARNING_ON_USAGE distribʳ-*-+ "Warning: distribʳ-*-+ was deprecated in v0.14. Please use *-distribʳ-+ instead." #-} *-distrib-∸ʳ = *-distribʳ-∸ {-# WARNING_ON_USAGE *-distrib-∸ʳ "Warning: *-distrib-∸ʳ was deprecated in v0.14. Please use *-distribʳ-∸ instead." #-} cancel-+-left = +-cancelˡ-≡ {-# WARNING_ON_USAGE cancel-+-left "Warning: cancel-+-left was deprecated in v0.14. Please use +-cancelˡ-≡ instead." #-} cancel-+-left-≤ = +-cancelˡ-≤ {-# WARNING_ON_USAGE cancel-+-left-≤ "Warning: cancel-+-left-≤ was deprecated in v0.14. Please use +-cancelˡ-≤ instead." #-} cancel-*-right = *-cancelʳ-≡ {-# WARNING_ON_USAGE cancel-*-right "Warning: cancel-*-right was deprecated in v0.14. Please use *-cancelʳ-≡ instead." #-} cancel-*-right-≤ = *-cancelʳ-≤ {-# WARNING_ON_USAGE cancel-*-right-≤ "Warning: cancel-*-right-≤ was deprecated in v0.14. Please use *-cancelʳ-≤ instead." #-} strictTotalOrder = <-strictTotalOrder {-# WARNING_ON_USAGE strictTotalOrder "Warning: strictTotalOrder was deprecated in v0.14. Please use <-strictTotalOrder instead." #-} isCommutativeSemiring = *-+-isCommutativeSemiring {-# WARNING_ON_USAGE isCommutativeSemiring "Warning: isCommutativeSemiring was deprecated in v0.14. Please use *-+-isCommutativeSemiring instead." #-} commutativeSemiring = *-+-commutativeSemiring {-# WARNING_ON_USAGE commutativeSemiring "Warning: commutativeSemiring was deprecated in v0.14. Please use *-+-commutativeSemiring instead." #-} isDistributiveLattice = ⊓-⊔-isDistributiveLattice {-# WARNING_ON_USAGE isDistributiveLattice "Warning: isDistributiveLattice was deprecated in v0.14. Please use ⊓-⊔-isDistributiveLattice instead." #-} distributiveLattice = ⊓-⊔-distributiveLattice {-# WARNING_ON_USAGE distributiveLattice "Warning: distributiveLattice was deprecated in v0.14. Please use ⊓-⊔-distributiveLattice instead." #-} ⊔-⊓-0-isSemiringWithoutOne = ⊔-⊓-isSemiringWithoutOne {-# WARNING_ON_USAGE ⊔-⊓-0-isSemiringWithoutOne "Warning: ⊔-⊓-0-isSemiringWithoutOne was deprecated in v0.14. Please use ⊔-⊓-isSemiringWithoutOne instead." #-} ⊔-⊓-0-isCommutativeSemiringWithoutOne = ⊔-⊓-isCommutativeSemiringWithoutOne {-# WARNING_ON_USAGE ⊔-⊓-0-isCommutativeSemiringWithoutOne "Warning: ⊔-⊓-0-isCommutativeSemiringWithoutOne was deprecated in v0.14. Please use ⊔-⊓-isCommutativeSemiringWithoutOne instead." #-} ⊔-⊓-0-commutativeSemiringWithoutOne = ⊔-⊓-commutativeSemiringWithoutOne {-# WARNING_ON_USAGE ⊔-⊓-0-commutativeSemiringWithoutOne "Warning: ⊔-⊓-0-commutativeSemiringWithoutOne was deprecated in v0.14. Please use ⊔-⊓-commutativeSemiringWithoutOne instead." #-} -- Version 0.15 ¬i+1+j≤i = i+1+j≰i {-# WARNING_ON_USAGE ¬i+1+j≤i "Warning: ¬i+1+j≤i was deprecated in v0.15. Please use i+1+j≰i instead." #-} ≤-steps = ≤-stepsˡ {-# WARNING_ON_USAGE ≤-steps "Warning: ≤-steps was deprecated in v0.15. Please use ≤-stepsˡ instead." #-} -- Version 0.17 i∸k∸j+j∸k≡i+j∸k : ∀ i j k → i ∸ (k ∸ j) + (j ∸ k) ≡ i + j ∸ k i∸k∸j+j∸k≡i+j∸k zero j k = cong (_+ (j ∸ k)) (0∸n≡0 (k ∸ j)) i∸k∸j+j∸k≡i+j∸k (suc i) j zero = cong (λ x → suc i ∸ x + j) (0∸n≡0 j) i∸k∸j+j∸k≡i+j∸k (suc i) zero (suc k) = begin i ∸ k + 0 ≡⟨ +-identityʳ _ ⟩ i ∸ k ≡⟨ cong (_∸ k) (sym (+-identityʳ _)) ⟩ i + 0 ∸ k ∎ i∸k∸j+j∸k≡i+j∸k (suc i) (suc j) (suc k) = begin suc i ∸ (k ∸ j) + (j ∸ k) ≡⟨ i∸k∸j+j∸k≡i+j∸k (suc i) j k ⟩ suc i + j ∸ k ≡⟨ cong (_∸ k) (sym (+-suc i j)) ⟩ i + suc j ∸ k ∎ {-# WARNING_ON_USAGE i∸k∸j+j∸k≡i+j∸k "Warning: i∸k∸j+j∸k≡i+j∸k was deprecated in v0.17." #-} im≡jm+n⇒[i∸j]m≡n : ∀ i j m n → i * m ≡ j * m + n → (i ∸ j) * m ≡ n im≡jm+n⇒[i∸j]m≡n i j m n eq = begin (i ∸ j) * m ≡⟨ *-distribʳ-∸ m i j ⟩ (i * m) ∸ (j * m) ≡⟨ cong (_∸ j * m) eq ⟩ (j * m + n) ∸ (j * m) ≡⟨ cong (_∸ j * m) (+-comm (j * m) n) ⟩ (n + j * m) ∸ (j * m) ≡⟨ m+n∸n≡m n (j * m) ⟩ n ∎ {-# WARNING_ON_USAGE im≡jm+n⇒[i∸j]m≡n "Warning: im≡jm+n⇒[i∸j]m≡n was deprecated in v0.17." #-} ≤+≢⇒< = ≤∧≢⇒< {-# WARNING_ON_USAGE ≤+≢⇒< "Warning: ≤+≢⇒< was deprecated in v0.17. Please use ≤∧≢⇒< instead." #-} -- Version 1.0 ≤-irrelevance = ≤-irrelevant {-# WARNING_ON_USAGE ≤-irrelevance "Warning: ≤-irrelevance was deprecated in v1.0. Please use ≤-irrelevant instead." #-} <-irrelevance = <-irrelevant {-# WARNING_ON_USAGE <-irrelevance "Warning: <-irrelevance was deprecated in v1.0. Please use <-irrelevant instead." #-}
{ "alphanum_fraction": 0.4983211263, "avg_line_length": 28.6751126126, "ext": "agda", "hexsha": "c878d4993f2b53ac3b12dfee9ff279c846085f61", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "omega12345/agda-mode", "max_forks_repo_path": "test/asset/agda-stdlib-1.0/Data/Nat/Properties.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "omega12345/agda-mode", "max_issues_repo_path": "test/asset/agda-stdlib-1.0/Data/Nat/Properties.agda", "max_line_length": 89, "max_stars_count": null, "max_stars_repo_head_hexsha": "0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "omega12345/agda-mode", "max_stars_repo_path": "test/asset/agda-stdlib-1.0/Data/Nat/Properties.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 28165, "size": 50927 }
{-# OPTIONS --cubical #-} open import 17-number-theory public {- streams -} record stream (A : Set) : Set where coinductive field hd : A tl : stream A open stream public from : ℕ → stream ℕ hd (from n) = n tl (from n) = from (succ-ℕ n) map-stream : {A B : Set} → (A → B) → stream A → stream B hd (map-stream f xs) = f (hd xs) tl (map-stream f xs) = map-stream f (tl xs) list-stream : {A : Set} → stream A → ℕ → list A list-stream xs zero-ℕ = nil list-stream xs (succ-ℕ n) = cons (hd xs) (list-stream xs n) record ℕ∞ : Set where coinductive field pred∞ : coprod ℕ∞ unit zero-ℕ∞ : ℕ∞ pred∞ zero-ℕ∞ = {!inr star!}
{ "alphanum_fraction": 0.6028037383, "avg_line_length": 18.3428571429, "ext": "agda", "hexsha": "9b74c24413a85baf8994e0fbe152cbb17545af51", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "22023fd35023cb6804424ce12cd10d252b80fd29", "max_forks_repo_licenses": [ "CC-BY-4.0" ], "max_forks_repo_name": "tmoux/HoTT-Intro", "max_forks_repo_path": "Agda/coinductive-types.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "22023fd35023cb6804424ce12cd10d252b80fd29", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "CC-BY-4.0" ], "max_issues_repo_name": "tmoux/HoTT-Intro", "max_issues_repo_path": "Agda/coinductive-types.agda", "max_line_length": 59, "max_stars_count": null, "max_stars_repo_head_hexsha": "22023fd35023cb6804424ce12cd10d252b80fd29", "max_stars_repo_licenses": [ "CC-BY-4.0" ], "max_stars_repo_name": "tmoux/HoTT-Intro", "max_stars_repo_path": "Agda/coinductive-types.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 238, "size": 642 }
module BasicIS4.Metatheory.DyadicGentzen-TarskiGluedDyadicImplicit where open import BasicIS4.Syntax.DyadicGentzen public open import BasicIS4.Semantics.TarskiGluedDyadicImplicit public open ImplicitSyntax (_⊢_) public -- Soundness with respect to all models, or evaluation. -- FIXME postulate reify⋆ : ∀ {{_ : Model}} {Ξ Γ Δ} → Γ ⁏ Δ ⊩⋆ Ξ → Γ ⁏ Δ ⊢⋆ Ξ eval : ∀ {A Γ Δ} → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊨ A eval (var i) γ δ = lookup i γ eval (lam t) γ δ = λ ψ a → eval t (mono²⊩⋆ ψ γ , a) (mono²⊩⋆ ψ δ) eval (app {A} {B} t u) γ δ = _⟪$⟫_ {A} {B} (eval t γ δ) (eval u γ δ) eval (mvar i) γ δ = mlookup i δ eval (box t) γ δ = λ ψ → let δ′ = mono²⊩⋆ ψ δ in mmulticut (reify⋆ δ′) (box t) ⅋ eval t ∙ δ′ eval (unbox t u) γ δ = eval u γ (δ , λ ψ → let γ′ = mono²⊩⋆ ψ γ δ′ = mono²⊩⋆ ψ δ in multicut² (reify⋆ γ′) (reify⋆ δ′) t ⅋ ⟪↓⟫ (eval t γ′ δ′)) eval (pair t u) γ δ = eval t γ δ , eval u γ δ eval (fst t) γ δ = π₁ (eval t γ δ) eval (snd t) γ δ = π₂ (eval t γ δ) eval unit γ δ = ∙ -- TODO: Correctness of evaluation with respect to conversion. -- The canonical model. private instance canon : Model canon = record { _⊩ᵅ_ = λ Π P → Π ⊢ α P ; mono²⊩ᵅ = mono²⊢ } -- Soundness and completeness with respect to the canonical model. mutual reflectᶜ : ∀ {A Γ Δ} → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊩ A reflectᶜ {α P} t = t reflectᶜ {A ▻ B} t = λ ψ → let t′ = mono²⊢ ψ t in λ a → reflectᶜ (app t′ (reifyᶜ a)) reflectᶜ {□ A} t = λ ψ → let t′ = mono²⊢ ψ t in t′ ⅋ reflectᶜ (down t′) reflectᶜ {A ∧ B} t = reflectᶜ (fst t) , reflectᶜ (snd t) reflectᶜ {⊤} t = ∙ reifyᶜ : ∀ {A Γ Δ} → Γ ⁏ Δ ⊩ A → Γ ⁏ Δ ⊢ A reifyᶜ {α P} s = s reifyᶜ {A ▻ B} s = lam (reifyᶜ (s (weak⊆²₁) (reflectᶜ {A} v₀))) reifyᶜ {□ A} s = syn (s refl⊆²) reifyᶜ {A ∧ B} s = pair (reifyᶜ (π₁ s)) (reifyᶜ (π₂ s)) reifyᶜ {⊤} s = unit reflectᶜ⋆ : ∀ {Ξ Γ Δ} → Γ ⁏ Δ ⊢⋆ Ξ → Γ ⁏ Δ ⊩⋆ Ξ reflectᶜ⋆ {∅} ∙ = ∙ reflectᶜ⋆ {Ξ , A} (ts , t) = reflectᶜ⋆ ts , reflectᶜ t reifyᶜ⋆ : ∀ {Ξ Γ Δ} → Γ ⁏ Δ ⊩⋆ Ξ → Γ ⁏ Δ ⊢⋆ Ξ reifyᶜ⋆ {∅} ∙ = ∙ reifyᶜ⋆ {Ξ , A} (ts , t) = reifyᶜ⋆ ts , reifyᶜ t -- Reflexivity and transitivity. refl⊩⋆ : ∀ {Γ Δ} → Γ ⁏ Δ ⊩⋆ Γ refl⊩⋆ = reflectᶜ⋆ refl⊢⋆ mrefl⊩⋆ : ∀ {Γ Δ} → Γ ⁏ Δ ⊩⋆ □⋆ Δ mrefl⊩⋆ = reflectᶜ⋆ mrefl⊢⋆ trans⊩⋆ : ∀ {Γ Γ′ Δ Δ′ Ξ} → Γ ⁏ Δ ⊩⋆ Γ′ ⧺ (□⋆ Δ′) → Γ′ ⁏ Δ′ ⊩⋆ Ξ → Γ ⁏ Δ ⊩⋆ Ξ trans⊩⋆ ts us = reflectᶜ⋆ (trans⊢⋆ (reifyᶜ⋆ ts) (reifyᶜ⋆ us)) -- Completeness with respect to all models, or quotation. quot : ∀ {A Γ Δ} → Γ ⁏ Δ ⊨ A → Γ ⁏ Δ ⊢ A quot s = reifyᶜ (s refl⊩⋆ mrefl⊩⋆) -- Normalisation by evaluation. norm : ∀ {A Γ Δ} → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ A norm = quot ∘ eval -- TODO: Correctness of normalisation with respect to conversion.
{ "alphanum_fraction": 0.4811413578, "avg_line_length": 30.1881188119, "ext": "agda", "hexsha": "1a3a6b01e159cb89dfc9c01f08d696c48533c814", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "fcd187db70f0a39b894fe44fad0107f61849405c", "max_forks_repo_licenses": [ "X11" ], "max_forks_repo_name": "mietek/hilbert-gentzen", "max_forks_repo_path": "BasicIS4/Metatheory/DyadicGentzen-TarskiGluedDyadicImplicit.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "fcd187db70f0a39b894fe44fad0107f61849405c", "max_issues_repo_issues_event_max_datetime": "2018-06-10T09:11:22.000Z", "max_issues_repo_issues_event_min_datetime": "2018-06-10T09:11:22.000Z", "max_issues_repo_licenses": [ "X11" ], "max_issues_repo_name": "mietek/hilbert-gentzen", "max_issues_repo_path": "BasicIS4/Metatheory/DyadicGentzen-TarskiGluedDyadicImplicit.agda", "max_line_length": 77, "max_stars_count": 29, "max_stars_repo_head_hexsha": "fcd187db70f0a39b894fe44fad0107f61849405c", "max_stars_repo_licenses": [ "X11" ], "max_stars_repo_name": "mietek/hilbert-gentzen", "max_stars_repo_path": "BasicIS4/Metatheory/DyadicGentzen-TarskiGluedDyadicImplicit.agda", "max_stars_repo_stars_event_max_datetime": "2022-01-01T10:29:18.000Z", "max_stars_repo_stars_event_min_datetime": "2016-07-03T18:51:56.000Z", "num_tokens": 1469, "size": 3049 }
module Adjunctions.Adj2Mon where open import Library open import Categories open import Functors open import Monads open import Adjunctions open Cat open Fun Adj2Mon : ∀{a b}{C D : Cat {a}{b}} → Adj C D → Monad C Adj2Mon {C = C}{D} A = record{ T = OMap R ∘ OMap L; η = left (iden D); bind = HMap R ∘ right; law1 = proof HMap R (right (left (iden D))) ≅⟨ cong (HMap R) (lawa (iden D)) ⟩ HMap R (iden D) ≅⟨ fid R ⟩ iden C ∎; law2 = λ{_}{_}{f} → proof comp C (HMap R (right f)) (left (iden D)) ≅⟨ cong (comp C (HMap R (right f))) (sym (idr C)) ⟩ comp C (HMap R (right f)) (comp C (left (iden D)) (iden C)) ≅⟨ natleft (iden C) (right f) (iden D) ⟩ left (comp D (right f) (comp D (iden D) (HMap L (iden C)))) ≅⟨ cong (left ∘ comp D (right f)) (idl D) ⟩ left (comp D (right f) (HMap L (iden C))) ≅⟨ cong (left ∘ comp D (right f)) (fid L) ⟩ left (comp D (right f) (iden D)) ≅⟨ cong (left) (idr D) ⟩ left (right f) ≅⟨ lawb f ⟩ f ∎; law3 = λ{_}{_}{_}{f}{g} → proof HMap R (right (comp C (HMap R (right g)) f)) ≅⟨ cong (HMap R ∘ right ∘ comp C (HMap R (right g))) (sym (idr C)) ⟩ HMap R (right (comp C (HMap R (right g)) (comp C f (iden C)))) ≅⟨ cong (HMap R) (natright (iden C) (right g) f) ⟩ HMap R (comp D (right g) (comp D (right f) (HMap L (iden C)))) ≅⟨ cong (HMap R ∘ comp D (right g) ∘ comp D (right f)) (fid L)⟩ HMap R (comp D (right g) (comp D (right f) (iden D))) ≅⟨ cong (HMap R ∘ comp D (right g)) (idr D) ⟩ HMap R (comp D (right g) (right f)) ≅⟨ fcomp R ⟩ comp C (HMap R (right g)) (HMap R (right f)) ∎} where open Adj A
{ "alphanum_fraction": 0.5279576221, "avg_line_length": 30.8909090909, "ext": "agda", "hexsha": "e59fa01bc2efbe6e2dadfa68d85b52c83be941e3", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2019-11-04T21:33:13.000Z", "max_forks_repo_forks_event_min_datetime": "2019-11-04T21:33:13.000Z", "max_forks_repo_head_hexsha": "74707d3538bf494f4bd30263d2f5515a84733865", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "jmchapman/Relative-Monads", "max_forks_repo_path": "Adjunctions/Adj2Mon.agda", "max_issues_count": 3, "max_issues_repo_head_hexsha": "74707d3538bf494f4bd30263d2f5515a84733865", "max_issues_repo_issues_event_max_datetime": "2019-05-29T09:50:26.000Z", "max_issues_repo_issues_event_min_datetime": "2019-01-13T13:12:33.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "jmchapman/Relative-Monads", "max_issues_repo_path": "Adjunctions/Adj2Mon.agda", "max_line_length": 67, "max_stars_count": 21, "max_stars_repo_head_hexsha": "74707d3538bf494f4bd30263d2f5515a84733865", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "jmchapman/Relative-Monads", "max_stars_repo_path": "Adjunctions/Adj2Mon.agda", "max_stars_repo_stars_event_max_datetime": "2021-02-13T18:02:18.000Z", "max_stars_repo_stars_event_min_datetime": "2015-07-30T01:25:12.000Z", "num_tokens": 716, "size": 1699 }
{- Definition of subfinite sets A set is subfinite if it is merely a subset of `Fin n` for some `n`. This definition is weaker than `isFinSet` if we don't assume LEM, but they are equivalent if we do. Every subfinite set is guaranteed to be a set and discrete. -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.SubFinSet where open import Cubical.Data.Nat open import Cubical.Data.Fin open import Cubical.Data.Sigma open import Cubical.Data.FinSet open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Functions.Embedding open import Cubical.HITs.PropositionalTruncation as PT open import Cubical.Relation.Nullary private variable ℓ : Level A B : Type ℓ isSubFinSet : Type ℓ → Type ℓ isSubFinSet A = ∃[ n ∈ ℕ ] A ↪ Fin n isFinSet→isSubFinSet : isFinSet A → isSubFinSet A isFinSet→isSubFinSet = PT.map λ (n , f , isEquiv-f) → n , f , isEquiv→isEmbedding isEquiv-f isSubFinSet→isSet : isSubFinSet A → isSet A isSubFinSet→isSet = PT.rec isPropIsSet λ (n , emb) → Embedding-into-isSet→isSet emb isSetFin isSubFinSet→Discrete : isSubFinSet A → Discrete A isSubFinSet→Discrete isSubFinSet-A x y = PT.rec (isPropDec (isSubFinSet→isSet isSubFinSet-A x y)) (λ (n , emb) → Embedding-into-Discrete→Discrete emb discreteFin x y) isSubFinSet-A
{ "alphanum_fraction": 0.7475728155, "avg_line_length": 26.78, "ext": "agda", "hexsha": "ef0dc2af86eb28bc78e56a7953b5c51dc9a307f5", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "dan-iel-lee/cubical", "max_forks_repo_path": "Cubical/Data/SubFinSet.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_issues_repo_issues_event_max_datetime": "2022-01-27T02:07:48.000Z", "max_issues_repo_issues_event_min_datetime": "2022-01-27T02:07:48.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "dan-iel-lee/cubical", "max_issues_repo_path": "Cubical/Data/SubFinSet.agda", "max_line_length": 73, "max_stars_count": null, "max_stars_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "dan-iel-lee/cubical", "max_stars_repo_path": "Cubical/Data/SubFinSet.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 442, "size": 1339 }
module Haskell.Prim.Maybe where -------------------------------------------------- -- Maybe data Maybe {ℓ} (a : Set ℓ) : Set ℓ where Nothing : Maybe a Just : a -> Maybe a maybe : ∀ {ℓ₁ ℓ₂} {a : Set ℓ₁} {b : Set ℓ₂} → b → (a → b) → Maybe a → b maybe n j Nothing = n maybe n j (Just x) = j x
{ "alphanum_fraction": 0.4635761589, "avg_line_length": 21.5714285714, "ext": "agda", "hexsha": "e3e7c665e16c138907eb64e55ed7f82157ee0ad6", "lang": "Agda", "max_forks_count": 18, "max_forks_repo_forks_event_max_datetime": "2022-03-12T11:42:52.000Z", "max_forks_repo_forks_event_min_datetime": "2020-10-21T22:19:09.000Z", "max_forks_repo_head_hexsha": "160478a51bc78b0fdab07b968464420439f9fed6", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "seanpm2001/agda2hs", "max_forks_repo_path": "lib/Haskell/Prim/Maybe.agda", "max_issues_count": 63, "max_issues_repo_head_hexsha": "160478a51bc78b0fdab07b968464420439f9fed6", "max_issues_repo_issues_event_max_datetime": "2022-02-25T15:47:30.000Z", "max_issues_repo_issues_event_min_datetime": "2020-10-22T05:19:27.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "seanpm2001/agda2hs", "max_issues_repo_path": "lib/Haskell/Prim/Maybe.agda", "max_line_length": 71, "max_stars_count": 55, "max_stars_repo_head_hexsha": "8c8f24a079ed9677dbe6893cf786e7ed52dfe8b6", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "dxts/agda2hs", "max_stars_repo_path": "lib/Haskell/Prim/Maybe.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-26T21:57:56.000Z", "max_stars_repo_stars_event_min_datetime": "2020-10-20T13:36:25.000Z", "num_tokens": 107, "size": 302 }
module _ where open import Agda.Builtin.Nat open import Agda.Builtin.String open import Common.IO open import Common.Unit data ⊥ : Set where record Pair : Set where constructor _,_ field fst snd : String open Pair record ERing : Set where constructor ering field divRem : (⊥ → ⊥) → Pair open ERing eRing : ERing eRing = ering λ _ → "fst" , "snd" test : String test = snd (divRem eRing (λ ())) main : IO Unit main = putStrLn test
{ "alphanum_fraction": 0.697309417, "avg_line_length": 14.8666666667, "ext": "agda", "hexsha": "582f1c0e39a01ddaf2ce3c66e514b82945826eae", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/Compiler/simple/Issue2123.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/Compiler/simple/Issue2123.agda", "max_line_length": 33, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/Compiler/simple/Issue2123.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 137, "size": 446 }
{-# OPTIONS --without-K --safe #-} module Categories.Category.Construction.Properties.Presheaves.CartesianClosed where open import Level open import Data.Unit open import Data.Product using (_,_) open import Data.Product.Relation.Binary.Pointwise.NonDependent open import Function.Equality using (Π) renaming (_∘_ to _∙_) open import Relation.Binary open import Categories.Category open import Categories.Category.Cartesian 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.Object.Product as Prod import Categories.Object.Exponential as Exp import Categories.Morphism.Reasoning as MR import Relation.Binary.Reasoning.Setoid as SetoidR open Π using (_⟨$⟩_) module HasClosedStructure o′ ℓ′ {o ℓ e} {C : Category o ℓ e} (Car : Cartesian C) where private module C = Category C open Preₚ C open C P = Presheaves′ o′ ℓ′ C module P = Category P S = Setoids o′ ℓ′ module S = Category S open Prod C open Cartesian Car Pres-exp : (F : Presheaf C (Setoids o′ ℓ′)) (X : Obj) → Presheaf C (Setoids o′ ℓ′) Pres-exp F X = record { F₀ = λ Y → F.₀ (X × Y) ; F₁ = λ f → F.₁ (second f) ; identity = λ {A} {x y} eq → let open Setoid (F.₀ (X × A)) open SetoidR (F.₀ (X × A)) in begin F.₁ (second C.id) ⟨$⟩ x ≈⟨ F.F-resp-≈ (id×id (product {X} {A})) refl ⟩ F.F₁ C.id ⟨$⟩ x ≈⟨ F.identity eq ⟩ y ∎ ; homomorphism = λ {Y Z W} {f} {g} {x y} eq → let open Setoid (F.₀ (X × Y)) open SetoidR (F.₀ (X × W)) in begin F.₁ (second (f ∘ g)) ⟨$⟩ x ≈˘⟨ [ F ]-resp-∘ second∘second (sym eq) ⟩ F.₁ (second g) ⟨$⟩ (F.₁ (second f) ⟨$⟩ y) ∎ ; F-resp-≈ = λ {Y Z} {f g} eq → F.F-resp-≈ (⁂-cong₂ Equiv.refl eq) } where module F = Functor F ExpF : (F : Presheaf C (Setoids o′ ℓ′)) → Functor C.op P ExpF F = record { F₀ = Pres-exp F ; F₁ = λ {A B} f → ntHelper record { η = λ X → F₁ (first f) ; commute = λ {X Y} g {x y} eq → [ F ]-resp-square (Equiv.sym first↔second) eq } ; identity = λ {A B} {x y} eq → let open Setoid (F₀ (A × B)) open SetoidR (F₀ (A × B)) in begin F₁ (first C.id) ⟨$⟩ x ≈⟨ F-resp-≈ (id×id product) eq ⟩ F₁ C.id ⟨$⟩ y ≈⟨ identity refl ⟩ y ∎ ; homomorphism = λ {X Y Z} {f g} {W} {x y} eq → let open Setoid (F₀ (X × W)) open SetoidR (F₀ (Z × W)) in begin F₁ (first (f ∘ g)) ⟨$⟩ x ≈˘⟨ [ F ]-resp-∘ first∘first (sym eq) ⟩ F₁ (first g) ⟨$⟩ (F₁ (first f) ⟨$⟩ y) ∎ ; F-resp-≈ = λ {A B} {f g} eq → F-resp-≈ (⁂-cong₂ eq Equiv.refl) } where open Functor F module _ (F G : Presheaf C (Setoids o′ ℓ′)) where private module F = Functor F module G = Functor G Presheaf^ : Presheaf C (Setoids (o′ ⊔ ℓ′ ⊔ o ⊔ ℓ) (o′ ⊔ ℓ′ ⊔ o)) Presheaf^ = record { F₀ = λ X → Hom[ Presheaves C ][ G , Pres-exp F X ] ; F₁ = λ {A B} f → record { _⟨$⟩_ = λ α → let module α = NaturalTransformation α in ntHelper record { η = λ X → F.₁ (first f) ∙ α.η X ; commute = λ {X Y} g {x y} eq → let open SetoidR (F.₀ (B × Y)) in begin F.₁ (first f) ⟨$⟩ (α.η Y ⟨$⟩ (G.₁ g ⟨$⟩ x)) ≈⟨ Π.cong (F.₁ (first f)) (α.commute g eq) ⟩ F.₁ (first f) ⟨$⟩ (F.₁ (second g) ⟨$⟩ (α.η X ⟨$⟩ y)) ≈˘⟨ [ F ]-resp-square first↔second (Setoid.refl (F.₀ (A × X))) ⟩ F.₁ (second g) ⟨$⟩ (F.₁ (first f) ⟨$⟩ (α.η X ⟨$⟩ y)) ∎ } ; cong = λ eq eq′ → Π.cong (F.₁ (first f)) (eq eq′) } ; identity = λ {X} {α β} eq {Y} {x y} eq′ → let module α = NaturalTransformation α module β = NaturalTransformation β open SetoidR (F.₀ (X × Y)) in begin F.₁ (first C.id) ⟨$⟩ (α.η Y ⟨$⟩ x) ≈⟨ F.F-resp-≈ (id×id product) (eq eq′) ⟩ F.₁ C.id ⟨$⟩ (β.η Y ⟨$⟩ y) ≈⟨ F.identity (Setoid.refl (F.₀ (X × Y))) ⟩ β.η Y ⟨$⟩ y ∎ ; homomorphism = λ {X Y Z} eq {W} eq′ → let open Setoid (F.₀ (X × W)) in Setoid.sym (F.₀ (Z × W)) ([ F ]-resp-∘ first∘first (sym (eq eq′))) ; F-resp-≈ = λ eq eq′ eq″ → F.F-resp-≈ (⁂-cong₂ eq Equiv.refl) (eq′ eq″) } module IsCCC {o} {C : Category o o o} (Car : Cartesian C) where private module C = Category C module CH = C.HomReasoning open Preₚ C open C open Prod C P = Presheaves′ o o C module P = Category P open Cartesian Car open IsCartesian o o open HasClosedStructure o o Car 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 F.₁ Δ ⟨$⟩ (α.η X ⟨$⟩ x) } ; cong = λ { (eq , eq′) → Π.cong (F.₁ Δ) (eq eq′) } } ; commute = λ {X Y} f → λ { {α , x} {β , y} (eq , eq′) → let module α = NaturalTransformation α module β = NaturalTransformation β open Setoid (F.₀ (X × X)) open SetoidR (F.₀ Y) in begin F.₁ Δ ⟨$⟩ (F.₁ (first f) ⟨$⟩ (α.η Y ⟨$⟩ (G.₁ f ⟨$⟩ x))) ≈⟨ Π.cong (F.₁ Δ ∙ F.₁ (first f)) (α.commute f eq′) ⟩ F.₁ Δ ∙ F.₁ (first f) ∙ F.₁ (second f) ⟨$⟩ (α.η X ⟨$⟩ y) ≈⟨ Π.cong (F.₁ Δ) ([ F ]-resp-∘ second∘first refl) ⟩ F.₁ Δ ⟨$⟩ (F.F₁ (f ⁂ f) ⟨$⟩ (α.η X ⟨$⟩ y)) ≈⟨ [ F ]-resp-∘ ⁂∘Δ refl ⟩ F.F₁ ⟨ f , f ⟩ ⟨$⟩ (α.η X ⟨$⟩ y) ≈˘⟨ [ F ]-resp-∘ Δ∘ (sym (eq (Setoid.refl (G.₀ X)))) ⟩ F.₁ f ⟨$⟩ (F.₁ Δ ⟨$⟩ (β.η X ⟨$⟩ 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 { _⟨$⟩_ = λ y → α.η (X × Y) ⟨$⟩ (F.₁ π₁ ⟨$⟩ x , G.₁ π₂ ⟨$⟩ y) ; cong = λ eq → Π.cong (α.η (X × Y)) (Setoid.refl (F.₀ (X × Y)) , Π.cong (G.₁ π₂) eq) } ; commute = λ {Y Z} f {y z} eq → let open SetoidR (H.₀ (X × Z)) in begin α.η (X × Z) ⟨$⟩ (F.₁ π₁ ⟨$⟩ x , G.₁ π₂ ⟨$⟩ (G.₁ f ⟨$⟩ y)) ≈˘⟨ Π.cong (α.η (X × Z)) ( [ F ]-resp-∘ (π₁∘⁂ CH.○ identityˡ) (Setoid.refl (F.₀ X)) , [ G ]-resp-square π₂∘⁂ (Setoid.refl (G.₀ Y))) ⟩ α.η (X × Z) ⟨$⟩ (F.₁ (second f) ∙ F.₁ π₁ ⟨$⟩ x , G.₁ (second f) ⟨$⟩ (G.₁ π₂ ⟨$⟩ y)) ≈⟨ α.commute (second f) (Setoid.refl (F.₀ (X × Y)) , Π.cong (G.₁ π₂) eq) ⟩ H.₁ (second f) ⟨$⟩ (α.η (X × Y) ⟨$⟩ (F.₁ π₁ ⟨$⟩ x , G.₁ π₂ ⟨$⟩ z)) ∎ } ; cong = λ eq₁ eq₂ → Π.cong (α.η _) (Π.cong (F.F₁ π₁) eq₁ , Π.cong (G.₁ π₂) eq₂) } ; commute = λ {X Y} f {x y} eq₁ {Z} {z w} eq₂ → let open SetoidR (H.₀ (Y × Z)) in begin α.η (Y × Z) ⟨$⟩ (F.₁ π₁ ⟨$⟩ (F.₁ f ⟨$⟩ x) , G.₁ π₂ ⟨$⟩ z) ≈˘⟨ Π.cong (α.η _) ( [ F ]-resp-square π₁∘⁂ (Setoid.refl (F.₀ X)) , [ G ]-resp-∘ (π₂∘⁂ CH.○ identityˡ) (Setoid.refl (G.₀ Z))) ⟩ α.η (Y × Z) ⟨$⟩ (F.₁ (first f) ⟨$⟩ (F.₁ π₁ ⟨$⟩ x) , G.₁ (first f) ⟨$⟩ (G.₁ π₂ ⟨$⟩ z)) ≈⟨ α.commute (first f) (Π.cong (F.₁ π₁) eq₁ , Π.cong (G.₁ π₂) eq₂) ⟩ H.₁ (first f) ⟨$⟩ (α.η (X × Z) ⟨$⟩ (F.₁ π₁ ⟨$⟩ y , G.₁ π₂ ⟨$⟩ w)) ∎ } ; eval-comp = λ {F G H} {α} → λ { {X} {x , y} {z , w} (eq₁ , eq₂) → let module F = Functor F module G = Functor G module H = Functor H module α = NaturalTransformation α module HX = Setoid (H.₀ X) module GX = Setoid (G.₀ X) open SetoidR (F.₀ X) in begin F.₁ Δ ⟨$⟩ (α.η (X × X) ⟨$⟩ (H.₁ π₁ ⟨$⟩ x , G.₁ π₂ ⟨$⟩ y)) ≈⟨ α.sym-commute Δ (Π.cong (H.₁ π₁) eq₁ , Π.cong (G.₁ π₂) eq₂) ⟩ α.η X ⟨$⟩ (H.₁ Δ ⟨$⟩ (H.F₁ π₁ ⟨$⟩ z) , G.₁ Δ ⟨$⟩ (G.₁ π₂ ⟨$⟩ w)) ≈⟨ Π.cong (α.η X) ([ H ]-resp-∘ project₁ HX.refl , [ G ]-resp-∘ project₂ GX.refl) ⟩ α.η X ⟨$⟩ (H.F₁ C.id ⟨$⟩ z , G.F₁ C.id ⟨$⟩ w) ≈⟨ Π.cong (α.η X) (H.identity HX.refl , G.identity GX.refl) ⟩ α.η X ⟨$⟩ (z , w) ∎ } ; curry-resp-≈ = λ {F G H} eq eq₁ eq₂ → let module G = Functor G module H = Functor H in eq (Π.cong (G.₁ π₁) eq₁ , Π.cong (H.₁ π₂) eq₂) ; curry-unique = λ {F G H} {α β} eq {X} {x y} eq₁ {Y} {z w} eq₂ → let module F = Functor F module G = Functor G module H = Functor H module α = NaturalTransformation α module β = NaturalTransformation β module GXY = Setoid (G.₀ (X × Y)) module αXx = NaturalTransformation (α.η X ⟨$⟩ x) open SetoidR (G.₀ (X × Y)) in begin αXx.η Y ⟨$⟩ z ≈˘⟨ G.identity GXY.refl ⟩ G.₁ C.id ⟨$⟩ (αXx.η Y ⟨$⟩ z) ≈˘⟨ [ G ]-resp-∘ (⁂∘Δ CH.○ η) GXY.refl ⟩ G.₁ Δ ⟨$⟩ (G.F₁ (π₁ ⁂ π₂) ⟨$⟩ (αXx.η Y ⟨$⟩ z)) ≈˘⟨ Π.cong (G.₁ Δ) ([ G ]-resp-∘ second∘first GXY.refl) ⟩ G.₁ Δ ⟨$⟩ (G.₁ (first π₁) ⟨$⟩ (G.₁ (second π₂) ⟨$⟩ (αXx.η Y ⟨$⟩ z))) ≈⟨ Π.cong (G.₁ Δ ∙ G.₁ (first π₁)) (αXx.sym-commute π₂ (Setoid.refl (H.₀ Y))) ⟩ G.₁ Δ ⟨$⟩ (G.₁ (first π₁) ⟨$⟩ (αXx.η (X × Y) ⟨$⟩ (H.₁ π₂ ⟨$⟩ z))) ≈⟨ Π.cong (G.₁ Δ) (α.sym-commute π₁ (Setoid.refl (F.₀ X)) (Setoid.refl (H.₀ (X × Y)))) ⟩ G.₁ Δ ⟨$⟩ (NaturalTransformation.η (α.η (X × Y) ⟨$⟩ (F.₁ π₁ ⟨$⟩ x)) (X × Y) ⟨$⟩ (H.₁ π₂ ⟨$⟩ z)) ≈⟨ eq (Π.cong (F.₁ π₁) eq₁ , Π.cong (H.₁ π₂) eq₂) ⟩ β.η (X × Y) ⟨$⟩ (F.₁ π₁ ⟨$⟩ y , H.₁ π₂ ⟨$⟩ w) ∎ } where module PC = Presheaves-Cartesian Presheaves-CartesianClosed : CartesianClosed P Presheaves-CartesianClosed = Equivalence.fromCanonical P CanonicalCCC module Presheaves-CartesianClosed = CartesianClosed Presheaves-CartesianClosed
{ "alphanum_fraction": 0.4612399683, "avg_line_length": 42.468164794, "ext": "agda", "hexsha": "b7dc9f6bd6ad154c90c68e46333583606baff502", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "MirceaS/agda-categories", "max_forks_repo_path": "src/Categories/Category/Construction/Properties/Presheaves/CartesianClosed.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "MirceaS/agda-categories", "max_issues_repo_path": "src/Categories/Category/Construction/Properties/Presheaves/CartesianClosed.agda", "max_line_length": 131, "max_stars_count": null, "max_stars_repo_head_hexsha": "58e5ec015781be5413bdf968f7ec4fdae0ab4b21", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "MirceaS/agda-categories", "max_stars_repo_path": "src/Categories/Category/Construction/Properties/Presheaves/CartesianClosed.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 4528, "size": 11339 }
{-# OPTIONS --universe-polymorphism #-} module SetOmega where open import Imports.Level postulate IsType : ∀ {a} → Set a → Set Bad : IsType ((a : Level) → Set a)
{ "alphanum_fraction": 0.650887574, "avg_line_length": 16.9, "ext": "agda", "hexsha": "1e18c913c0eda5b33c9048f2c607167b15769a1f", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "20596e9dd9867166a64470dd24ea68925ff380ce", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "np/agda-git-experiment", "max_forks_repo_path": "test/fail/SetOmega.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "20596e9dd9867166a64470dd24ea68925ff380ce", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "np/agda-git-experiment", "max_issues_repo_path": "test/fail/SetOmega.agda", "max_line_length": 39, "max_stars_count": 1, "max_stars_repo_head_hexsha": "aa10ae6a29dc79964fe9dec2de07b9df28b61ed5", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/agda-kanso", "max_stars_repo_path": "test/fail/SetOmega.agda", "max_stars_repo_stars_event_max_datetime": "2019-11-27T04:41:05.000Z", "max_stars_repo_stars_event_min_datetime": "2019-11-27T04:41:05.000Z", "num_tokens": 50, "size": 169 }
------------------------------------------------------------------------ -- Higher lenses, defined using the requirement that the remainder -- function should be surjective ------------------------------------------------------------------------ {-# OPTIONS --cubical #-} import Equality.Path as P module Lens.Non-dependent.Higher.Surjective-remainder {e⁺} (eq : ∀ {a p} → P.Equality-with-paths a p e⁺) where open P.Derived-definitions-and-properties eq open import Prelude open import Equality.Path.Isomorphisms eq open import Equivalence equality-with-J as Eq using (_≃_) open import Function-universe equality-with-J hiding (_∘_) open import H-level.Truncation.Propositional eq open import Lens.Non-dependent eq import Lens.Non-dependent.Higher eq as Higher private variable a b : Level A B : Type a -- A variant of the lenses defined in Lens.Non-dependent.Higher. In -- this definition the function called inhabited is replaced by a -- requirement that the remainder function should be surjective. record Lens (A : Type a) (B : Type b) : Type (lsuc (a ⊔ b)) where field -- Remainder type. R : Type (a ⊔ b) -- Equivalence. equiv : A ≃ (R × B) -- Remainder. remainder : A → R remainder a = proj₁ (_≃_.to equiv a) field -- The remainder function is surjective. remainder-surjective : Surjective remainder -- Getter. get : A → B get a = proj₂ (_≃_.to equiv a) -- Setter. set : A → B → A set a b = _≃_.from equiv (remainder a , b) instance -- The lenses defined above have getters and setters. has-getter-and-setter : Has-getter-and-setter (Lens {a = a} {b = b}) has-getter-and-setter = record { get = Lens.get ; set = Lens.set } -- Lens can be expressed as a nested Σ-type. Lens-as-Σ : {A : Type a} {B : Type b} → Lens A B ≃ ∃ λ (R : Type (a ⊔ b)) → ∃ λ (equiv : A ≃ (R × B)) → Surjective (proj₁ ∘ _≃_.to equiv) Lens-as-Σ = Eq.↔→≃ (λ l → R l , equiv l , remainder-surjective l) (λ (R , equiv , remainder-surjective) → record { R = R ; equiv = equiv ; remainder-surjective = remainder-surjective }) refl refl where open Lens -- Higher.Lens A B is equivalent to Lens A B. Higher-lens≃Lens : Higher.Lens A B ≃ Lens A B Higher-lens≃Lens {A = A} {B = B} = Higher.Lens A B ↔⟨ Higher.Lens-as-Σ ⟩ (∃ λ (R : Type _) → (A ≃ (R × B)) × (R → ∥ B ∥)) ↝⟨ (∃-cong λ _ → ∃-cong Higher.inhabited≃remainder-surjective) ⟩ (∃ λ (R : Type _) → ∃ λ (equiv : A ≃ (R × B)) → Surjective (proj₁ ∘ _≃_.to equiv)) ↝⟨ inverse Lens-as-Σ ⟩□ Lens A B □ -- The equivalence preserves getters and setters. Higher-lens≃Lens-preserves-getters-and-setters : Preserves-getters-and-setters-⇔ A B (_≃_.logical-equivalence Higher-lens≃Lens) Higher-lens≃Lens-preserves-getters-and-setters = (λ _ → refl _ , refl _) , (λ _ → refl _ , refl _)
{ "alphanum_fraction": 0.5777116402, "avg_line_length": 26.2956521739, "ext": "agda", "hexsha": "2e790bed89d5ca0e327751d86cb42758181b2af1", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2020-07-01T14:33:26.000Z", "max_forks_repo_forks_event_min_datetime": "2020-07-01T14:33:26.000Z", "max_forks_repo_head_hexsha": "f2da6f7e95b87ca525e8ea43929c6d6163a74811", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "nad/dependent-lenses", "max_forks_repo_path": "src/Lens/Non-dependent/Higher/Surjective-remainder.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "f2da6f7e95b87ca525e8ea43929c6d6163a74811", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "nad/dependent-lenses", "max_issues_repo_path": "src/Lens/Non-dependent/Higher/Surjective-remainder.agda", "max_line_length": 111, "max_stars_count": 3, "max_stars_repo_head_hexsha": "f2da6f7e95b87ca525e8ea43929c6d6163a74811", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "nad/dependent-lenses", "max_stars_repo_path": "src/Lens/Non-dependent/Higher/Surjective-remainder.agda", "max_stars_repo_stars_event_max_datetime": "2020-07-03T08:55:52.000Z", "max_stars_repo_stars_event_min_datetime": "2020-04-16T12:10:46.000Z", "num_tokens": 909, "size": 3024 }
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.types.Bool open import lib.types.Empty open import lib.types.Lift open import lib.types.Sigma open import lib.types.Pi module lib.types.Coproduct where module _ {i j} {A : Type i} {B : Type j} where Coprod= : Coprod A B → Coprod A B → Type (lmax i j) Coprod= (inl a₁) (inl a₂) = Lift {j = (lmax i j)} $ a₁ == a₂ Coprod= (inl a₁) (inr b₂) = Lift Empty Coprod= (inr b₁) (inl a₂) = Lift Empty Coprod= (inr b₁) (inr b₂) = Lift {j = (lmax i j)} $ b₁ == b₂ Coprod=-in : {x y : Coprod A B} → (x == y) → Coprod= x y Coprod=-in {inl _} idp = lift idp Coprod=-in {inr _} idp = lift idp Coprod=-out : {x y : Coprod A B} → Coprod= x y → (x == y) Coprod=-out {inl _} {inl _} c = ap inl $ lower c Coprod=-out {inl _} {inr _} c = Empty-rec $ lower c Coprod=-out {inr _} {inl _} c = Empty-rec $ lower c Coprod=-out {inr _} {inr _} c = ap inr (lower c) Coprod=-in-equiv : (x y : Coprod A B) → (x == y) ≃ Coprod= x y Coprod=-in-equiv x y = equiv Coprod=-in Coprod=-out (f-g x y) (g-f x y) where f-g : ∀ x' y' → ∀ c → Coprod=-in (Coprod=-out {x'} {y'} c) == c f-g (inl a₁) (inl .a₁) (lift idp) = idp f-g (inl a₁) (inr b₂) b = Empty-rec $ lower b f-g (inr b₁) (inl a₂) b = Empty-rec $ lower b f-g (inr b₁) (inr .b₁) (lift idp) = idp g-f : ∀ x' y' → ∀ p → Coprod=-out (Coprod=-in {x'} {y'} p) == p g-f (inl _) .(inl _) idp = idp g-f (inr _) .(inr _) idp = idp inl=inl-equiv : (a₁ a₂ : A) → (inl a₁ == inl a₂) ≃ (a₁ == a₂) inl=inl-equiv a₁ a₂ = lower-equiv ∘e Coprod=-in-equiv (inl a₁) (inl a₂) inr=inr-equiv : (b₁ b₂ : B) → (inr b₁ == inr b₂) ≃ (b₁ == b₂) inr=inr-equiv b₁ b₂ = lower-equiv ∘e Coprod=-in-equiv (inr b₁) (inr b₂) inl≠inr : (a₁ : A) (b₂ : B) → (inl a₁ ≠ inr b₂) inl≠inr a₁ b₂ p = lower $ Coprod=-in p inr≠inl : (b₁ : B) (a₂ : A) → (inr b₁ ≠ inl a₂) inr≠inl a₁ b₂ p = lower $ Coprod=-in p ⊔-level : ∀ {n} → has-level (S (S n)) A → has-level (S (S n)) B → has-level (S (S n)) (Coprod A B) ⊔-level pA _ (inl a₁) (inl a₂) = equiv-preserves-level (inl=inl-equiv a₁ a₂ ⁻¹) (pA a₁ a₂) ⊔-level _ _ (inl a₁) (inr b₂) = λ p → Empty-rec (inl≠inr a₁ b₂ p) ⊔-level _ _ (inr b₁) (inl a₂) = λ p → Empty-rec (inr≠inl b₁ a₂ p) ⊔-level _ pB (inr b₁) (inr b₂) = equiv-preserves-level ((inr=inr-equiv b₁ b₂)⁻¹) (pB b₁ b₂) Coprod-level = ⊔-level infix 80 _⊙⊔_ _⊙⊔_ : ∀ {i j} → Ptd i → Ptd j → Ptd (lmax i j) X ⊙⊔ Y = ⊙[ Coprod (de⊙ X) (de⊙ Y) , inl (pt X) ] _⊔⊙_ : ∀ {i j} → Ptd i → Ptd j → Ptd (lmax i j) X ⊔⊙ Y = ⊙[ Coprod (de⊙ X) (de⊙ Y) , inr (pt Y) ] codiag : ∀ {i} {A : Type i} → A ⊔ A → A codiag (inl a) = a codiag (inr a) = a ⊙codiag : ∀ {i} {X : Ptd i} → X ⊙⊔ X ⊙→ X ⊙codiag = (codiag , idp) -- A binary sigma is a coproduct ΣBool-equiv-⊔ : ∀ {i} (Pick : Bool → Type i) → Σ Bool Pick ≃ Pick true ⊔ Pick false ΣBool-equiv-⊔ Pick = equiv into out into-out out-into where into : Σ _ Pick → Pick true ⊔ Pick false into (true , a) = inl a into (false , b) = inr b out : (Pick true ⊔ Pick false) → Σ _ Pick out (inl a) = (true , a) out (inr b) = (false , b) abstract into-out : ∀ c → into (out c) == c into-out (inl a) = idp into-out (inr b) = idp out-into : ∀ s → out (into s) == s out-into (true , a) = idp out-into (false , b) = idp module _ {i j k} {A : Type i} {B : Type j} (P : A ⊔ B → Type k) where Π₁-⊔-equiv-× : Π (A ⊔ B) P ≃ Π A (P ∘ inl) × Π B (P ∘ inr) Π₁-⊔-equiv-× = equiv to from to-from from-to where to : Π (A ⊔ B) P → Π A (P ∘ inl) × Π B (P ∘ inr) to f = (λ a → f (inl a)) , (λ b → f (inr b)) from : Π A (P ∘ inl) × Π B (P ∘ inr) → Π (A ⊔ B) P from (f , g) (inl a) = f a from (f , g) (inr b) = g b abstract to-from : ∀ fg → to (from fg) == fg to-from _ = idp from-to : ∀ fg → from (to fg) == fg from-to fg = λ= λ where (inl _) → idp (inr _) → idp
{ "alphanum_fraction": 0.5191351889, "avg_line_length": 33.8151260504, "ext": "agda", "hexsha": "2e7b00323d3284c4500ca607f3e66488fd237793", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2018-12-26T21:31:57.000Z", "max_forks_repo_forks_event_min_datetime": "2018-12-26T21:31:57.000Z", "max_forks_repo_head_hexsha": "e7d663b63d89f380ab772ecb8d51c38c26952dbb", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "mikeshulman/HoTT-Agda", "max_forks_repo_path": "core/lib/types/Coproduct.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "e7d663b63d89f380ab772ecb8d51c38c26952dbb", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "mikeshulman/HoTT-Agda", "max_issues_repo_path": "core/lib/types/Coproduct.agda", "max_line_length": 73, "max_stars_count": null, "max_stars_repo_head_hexsha": "e7d663b63d89f380ab772ecb8d51c38c26952dbb", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "mikeshulman/HoTT-Agda", "max_stars_repo_path": "core/lib/types/Coproduct.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 1884, "size": 4024 }
open import Data.Empty open import Data.List hiding ([_]) renaming (_∷_ to _∷ₗ_) open import Data.Maybe open import Data.Product open import Data.Sum open import Data.Unit open import AEff open import AwaitingComputations open import EffectAnnotations open import Preservation open import Progress open import Renamings open import Substitutions open import Types open import Relation.Binary.PropositionalEquality hiding ([_]) open import Relation.Nullary open import Relation.Nullary.Negation module Finality where -- SMALL-STEP OPERATIONAL SEMANTICS FOR WELL-TYPED COMPUTATIONS -- WITH INLINED EVALUATION CONTEXT RULES mutual infix 10 _↝↝_ data _↝↝_ {Γ : Ctx} : {C : CType} → Γ ⊢M⦂ C → Γ ⊢M⦂ C → Set where -- COMPUTATIONAL RULES apply : {X : VType} {C : CType} → (M : Γ ∷ X ⊢M⦂ C) → (V : Γ ⊢V⦂ X) → ---------------------- (ƛ M) · V ↝↝ M [ id-subst [ V ]s ]m let-return : {X Y : VType} {o : O} {i : I} → (V : Γ ⊢V⦂ X) → (N : Γ ∷ X ⊢M⦂ Y ! (o , i)) → ----------------------------- let= (return V) `in N ↝↝ N [ id-subst [ V ]s ]m let-↑ : {X Y : VType} {o : O} {i : I} {op : Σₛ} → (p : op ∈ₒ o) → (V : Γ ⊢V⦂ ``(payload op)) → (M : Γ ⊢M⦂ X ! (o , i)) → (N : Γ ∷ X ⊢M⦂ Y ! (o , i)) → ----------------------------- let= (↑ op p V M) `in N ↝↝ ↑ op p V (let= M `in N) let-promise : {X Y Z : VType} {o o' : O} {i i' : I} {op : Σₛ} → (p : lkpᵢ op i ≡ just (o' , i')) → (M₁ : Γ ∷ ``(payload op) ⊢M⦂ ⟨ X ⟩ ! (o' , i')) → (M₂ : Γ ∷ ⟨ X ⟩ ⊢M⦂ Y ! (o , i)) → (N : Γ ∷ Y ⊢M⦂ Z ! (o , i)) → --------------------------------------------------------------------------- let= (promise op ∣ p ↦ M₁ `in M₂) `in N ↝↝ (promise op ∣ p ↦ M₁ `in (let= M₂ `in (M-rename (comp-ren exchange wk₁) N))) letrec-unfold : {X : VType} {C D : CType} (M : Γ ∷ (X ⇒ C) ∷ X ⊢M⦂ C) → (N : Γ ∷ (X ⇒ C) ⊢M⦂ D) → ---------------------------------------- (letrec M `in N) ↝↝ N [ id-subst [ ƛ (letrec M-rename wk₃ M `in M-rename exchange M) ]s ]m promise-↑ : {X Y : VType} {o o' : O} {i i' : I} {op op' : Σₛ} → (p : lkpᵢ op i ≡ just (o' , i')) → (q : op' ∈ₒ o) → (V : Γ ∷ ⟨ X ⟩ ⊢V⦂ ``(payload op')) → (M : Γ ∷ ``(payload op) ⊢M⦂ ⟨ X ⟩ ! (o' , i')) → (N : Γ ∷ ⟨ X ⟩ ⊢M⦂ Y ! (o , i)) → -------------------------------------------- (promise op ∣ p ↦ M `in (↑ op' q V N)) ↝↝ ↑ op' q (strengthen-val {Δ = X ∷ₗ []} V) (promise op ∣ p ↦ M `in N) ↓-return : {X : VType} {o : O} {i : I} {op : Σₛ} → (V : Γ ⊢V⦂ ``(payload op)) → (W : Γ ⊢V⦂ X) → ---------------------------------------------------------------- ↓ {o = o} {i = i} op V (return W) ↝↝ return {o = proj₁ (op ↓ₑ (o , i))} {i = proj₂ (op ↓ₑ (o , i))} W ↓-↑ : {X : VType} {o : O} {i : I} {op : Σₛ} {op' : Σₛ} → (p : op' ∈ₒ o) → (V : Γ ⊢V⦂ ``(payload op)) → (W : Γ ⊢V⦂ ``(payload op')) → (M : Γ ⊢M⦂ X ! (o , i)) → ------------------------------- ↓ op V (↑ op' p W M) ↝↝ ↑ op' (↓ₑ-⊑ₒ op' p) W (↓ op V M) ↓-promise-op : {X Y : VType} {o o' : O} {i i' : I} {op : Σₛ} → (p : lkpᵢ op i ≡ just (o' , i')) → (V : Γ ⊢V⦂ ``(payload op)) → (M : Γ ∷ ``(payload op) ⊢M⦂ ⟨ X ⟩ ! (o' , i')) → (N : Γ ∷ ⟨ X ⟩ ⊢M⦂ Y ! (o , i)) → --------------------------------------------------------------------------------------- ↓ op V (promise op ∣ p ↦ M `in N ) ↝↝ (let= (coerce (↓ₑ-⊑ₒ-o' {o} p) (↓ₑ-⊑ₒ-i' {o} p) (M [ id-subst [ V ]s ]m)) `in ↓ op (V-rename wk₁ V) ((M-rename (comp-ren exchange wk₁) N) [ id-subst [ ` Hd ]s ]m)) ↓-promise-op' : {X Y : VType} {o o' : O} {i i' : I} {op op' : Σₛ} → (p : ¬ op ≡ op') → (q : lkpᵢ op' i ≡ just (o' , i')) → (V : Γ ⊢V⦂ ``(payload op)) → (M : Γ ∷ ``(payload op') ⊢M⦂ ⟨ X ⟩ ! (o' , i')) → (N : Γ ∷ ⟨ X ⟩ ⊢M⦂ Y ! (o , i)) → ------------------------------------------------------------------------------------------ ↓ op V (promise op' ∣ q ↦ M `in N ) ↝↝ promise_∣_↦_`in_ {o' = proj₁ (lkpᵢ-↓ₑ-neq {o = o} {i = i} p q)} {i' = proj₁ (proj₂ (lkpᵢ-↓ₑ-neq {o = o} {i = i} p q))} op' (proj₁ (proj₂ (proj₂ (lkpᵢ-↓ₑ-neq {o = o} {i = i} p q)))) (coerce (proj₁ (proj₂ (proj₂ (proj₂ (lkpᵢ-↓ₑ-neq {o = o} {i = i} p q))))) (proj₂ (proj₂ (proj₂ (proj₂ (lkpᵢ-↓ₑ-neq {o = o} {i = i} p q))))) M) (↓ op (V-rename wk₁ V) N) await-promise : {X : VType} {C : CType} → (V : Γ ⊢V⦂ X) → (M : Γ ∷ X ⊢M⦂ C) → -------------------- await ⟨ V ⟩ until M ↝↝ M [ id-subst [ V ]s ]m -- INLINED EVALUATION CONTEXT RULES context-let : {X Y : VType} {o : O} {i : I} → {M M' : Γ ⊢M⦂ X ! (o , i)} → {N : Γ ∷ X ⊢M⦂ Y ! (o , i)} → M ↝↝ M' → ----------------------------- let= M `in N ↝↝ let= M' `in N context-↑ : {X : VType} {o : O} {i : I} {op : Σₛ} {p : op ∈ₒ o} {V : Γ ⊢V⦂ ``(payload op)} {M N : Γ ⊢M⦂ X ! (o , i)} → M ↝↝ N → --------------------------- ↑ op p V M ↝↝ ↑ op p V N context-↓ : {X : VType} {o : O} {i : I} {op : Σₛ} {V : Γ ⊢V⦂ ``(payload op)} {M N : Γ ⊢M⦂ X ! (o , i)} → M ↝↝ N → --------------------------- ↓ op V M ↝↝ ↓ op V N context-promise : {X Y : VType} {o o' : O} {i i' : I} {op : Σₛ} → {r : lkpᵢ op i ≡ just (o' , i')} {M : Γ ∷ ``(payload op) ⊢M⦂ ⟨ X ⟩ ! (o' , i')} → {N N' : Γ ∷ ⟨ X ⟩ ⊢M⦂ Y ! (o , i)} → N ↝↝ N' → ------------------------------------------------ promise op ∣ r ↦ M `in N ↝↝ promise op ∣ r ↦ M `in N' context-coerce : {X : VType} {o o' : O} {i i' : I} {p : o ⊑ₒ o'} {q : i ⊑ᵢ i'} → {M N : Γ ⊢M⦂ X ! (o , i)} → M ↝↝ N → --------------------------- coerce p q M ↝↝ coerce p q N -- COERCION RULES coerce-return : {X : VType} {o o' : O} {i i' : I} {p : o ⊑ₒ o'} {q : i ⊑ᵢ i'} → (V : Γ ⊢V⦂ X) → -------------------------------- coerce p q (return V) ↝↝ return V coerce-↑ : {X : VType} {o o' : O} {i i' : I} {p : o ⊑ₒ o'} {q : i ⊑ᵢ i'} {op : Σₛ} → (r : op ∈ₒ o) → (V : Γ ⊢V⦂ ``(payload op)) → (M : Γ ⊢M⦂ X ! (o , i)) → ------------------------------- coerce p q (↑ op r V M) ↝↝ ↑ op (p op r) V (coerce p q M) coerce-promise : {X Y : VType} {o o' o'' : O} {i i' i'' : I} {p : o ⊑ₒ o'} {q : i ⊑ᵢ i'} {op : Σₛ} → (r : lkpᵢ op i ≡ just (o'' , i'')) (M : Γ ∷ ``(payload op) ⊢M⦂ ⟨ X ⟩ ! (o'' , i'')) → (N : Γ ∷ ⟨ X ⟩ ⊢M⦂ Y ! (o , i)) → ------------------------------------------------------------------ coerce p q (promise op ∣ r ↦ M `in N) ↝↝ promise_∣_↦_`in_ {o' = lkpᵢ-nextₒ q r} {i' = lkpᵢ-nextᵢ q r} op (lkpᵢ-next-eq q r) (coerce (lkpᵢ-next-⊑ₒ q r) (lkpᵢ-next-⊑ᵢ q r) M) (coerce p q N) -- ONE-TO-ONE CORRESPONDENCE BETWEEN THE TWO SETS OF REDUCTION RULES ↝↝-to-↝ : {Γ : Ctx} {C : CType} {M N : Γ ⊢M⦂ C} → M ↝↝ N → ----------------- M ↝ N ↝↝-to-↝ (apply M V) = apply M V ↝↝-to-↝ (let-return V N) = let-return V N ↝↝-to-↝ (let-↑ p V M N) = let-↑ p V M N ↝↝-to-↝ (let-promise p M₁ M₂ N) = let-promise p M₁ M₂ N ↝↝-to-↝ (letrec-unfold M N) = letrec-unfold M N ↝↝-to-↝ (promise-↑ p q V M N) = promise-↑ p q V M N ↝↝-to-↝ (↓-return V W) = ↓-return V W ↝↝-to-↝ (↓-↑ p V W M) = ↓-↑ p V W M ↝↝-to-↝ (↓-promise-op p V M N) = ↓-promise-op p V M N ↝↝-to-↝ (↓-promise-op' p q V M N) = ↓-promise-op' p q V M N ↝↝-to-↝ (await-promise V M) = await-promise V M ↝↝-to-↝ (context-let r) = context _ (↝↝-to-↝ r) ↝↝-to-↝ (context-↑ r) = context _ (↝↝-to-↝ r) ↝↝-to-↝ (context-↓ r) = context _ (↝↝-to-↝ r) ↝↝-to-↝ (context-promise r) = context _ (↝↝-to-↝ r) ↝↝-to-↝ (context-coerce r) = context _ (↝↝-to-↝ r) ↝↝-to-↝ (coerce-return V) = coerce-return V ↝↝-to-↝ (coerce-↑ p V M) = coerce-↑ p V M ↝↝-to-↝ (coerce-promise p M N) = coerce-promise p M N mutual ↝-context-to-↝↝ : {Γ : Ctx} {Δ : BCtx} {C : CType} → (E : Γ ⊢E[ Δ ]⦂ C) → {M N : (Γ ⋈ Δ) ⊢M⦂ hole-ty-e E} → M ↝ N → --------------------------- E [ M ] ↝↝ E [ N ] ↝-context-to-↝↝ [-] r = ↝-to-↝↝ r ↝-context-to-↝↝ (let= E `in x) r = context-let (↝-context-to-↝↝ E r) ↝-context-to-↝↝ (↑ op p V E) r = context-↑ (↝-context-to-↝↝ E r) ↝-context-to-↝↝ (↓ op V E) r = context-↓ (↝-context-to-↝↝ E r) ↝-context-to-↝↝ (promise op ∣ p ↦ M `in E) r = context-promise (↝-context-to-↝↝ E r) ↝-context-to-↝↝ (coerce p q E) r = context-coerce (↝-context-to-↝↝ E r) ↝-to-↝↝ : {Γ : Ctx} {C : CType} {M N : Γ ⊢M⦂ C} → M ↝ N → ----------------- M ↝↝ N ↝-to-↝↝ (apply M V) = apply M V ↝-to-↝↝ (let-return V N) = let-return V N ↝-to-↝↝ (let-↑ p V M N) = let-↑ p V M N ↝-to-↝↝ (let-promise p M₁ M₂ N) = let-promise p M₁ M₂ N ↝-to-↝↝ (letrec-unfold M N) = letrec-unfold M N ↝-to-↝↝ (promise-↑ p q V M N) = promise-↑ p q V M N ↝-to-↝↝ (↓-return V W) = ↓-return V W ↝-to-↝↝ (↓-↑ p V W M) = ↓-↑ p V W M ↝-to-↝↝ (↓-promise-op p V M N) = ↓-promise-op p V M N ↝-to-↝↝ (↓-promise-op' p q V M N) = ↓-promise-op' p q V M N ↝-to-↝↝ (await-promise V M) = await-promise V M ↝-to-↝↝ (context E r) = ↝-context-to-↝↝ E r ↝-to-↝↝ (coerce-return V) = coerce-return V ↝-to-↝↝ (coerce-↑ p V M) = coerce-↑ p V M ↝-to-↝↝ (coerce-promise p M N) = coerce-promise p M N -- FINALITY OF RESULT FORMS run-invert-let : {Γ : Ctx} {X Y : VType} {o : O} {i : I} {M : ⟨⟨ Γ ⟩⟩ ⊢M⦂ X ! (o , i)} {N : (⟨⟨ Γ ⟩⟩ ∷ X) ⊢M⦂ Y ! (o , i)} → RunResult⟨ Γ ∣ let= M `in N ⟩ → ------------------------------------- RunResult⟨ Γ ∣ M ⟩ run-invert-let (awaiting (let-in R)) = awaiting R run-invert-↓ : {Γ : Ctx} {X : VType} {o : O} {i : I} {op : Σₛ} {V : ⟨⟨ Γ ⟩⟩ ⊢V⦂ ``(payload op)} {M : ⟨⟨ Γ ⟩⟩ ⊢M⦂ X ! (o , i)} → RunResult⟨ Γ ∣ ↓ op V M ⟩ → ------------------------------- RunResult⟨ Γ ∣ M ⟩ run-invert-↓ (awaiting (interrupt await)) = awaiting await run-invert-↓ (awaiting (interrupt (let-in R))) = awaiting (let-in R) run-invert-↓ (awaiting (interrupt (interrupt R))) = awaiting (interrupt R) run-invert-↓ (awaiting (interrupt (coerce R))) = awaiting (coerce R) run-invert-promise : {Γ : Ctx} {X Y : VType} {o o' : O} {i i' : I} {op : Σₛ} {p : lkpᵢ op i ≡ just (o' , i')} {M : (⟨⟨ Γ ⟩⟩ ∷ `` (payload op)) ⊢M⦂ (⟨ X ⟩ ! (o' , i'))} {N : (⟨⟨ Γ ⟩⟩ ∷ ⟨ X ⟩) ⊢M⦂ (Y ! (o , i))} → RunResult⟨ Γ ∣ (promise op ∣ p ↦ M `in N) ⟩ → -------------------------------------------------------- RunResult⟨ Γ ∷ X ∣ N ⟩ run-invert-promise (promise R) = R run-invert-coerce : {Γ : Ctx} {X : VType} {o o' : O} {i i' : I} {p : o ⊑ₒ o'} {q : i ⊑ᵢ i'} {M : ⟨⟨ Γ ⟩⟩ ⊢M⦂ X ! (o , i)} → RunResult⟨ Γ ∣ coerce p q M ⟩ → ------------------------------- RunResult⟨ Γ ∣ M ⟩ run-invert-coerce (awaiting (coerce R)) = awaiting R run-apply-⊥ : {Γ : Ctx} {X : VType} {C : CType} {M : (⟨⟨ Γ ⟩⟩ ∷ X) ⊢M⦂ C} {V : ⟨⟨ Γ ⟩⟩ ⊢V⦂ X} → RunResult⟨ Γ ∣ ƛ M · V ⟩ → -------------------------- ⊥ run-apply-⊥ (awaiting ()) run-↑-⊥ : {Γ : Ctx} {X : VType} {o : O} {i : I} {op : Σₛ} {p : op ∈ₒ o} {V : ⟨⟨ Γ ⟩⟩ ⊢V⦂ ``(payload op)} {M : ⟨⟨ Γ ⟩⟩ ⊢M⦂ (X ! (o , i))} → RunResult⟨ Γ ∣ ↑ op p V M ⟩ → -------------------------------- ⊥ run-↑-⊥ (awaiting ()) run-let-return-⊥ : {Γ : Ctx} {X Y : VType} {o : O} {i : I} {V : ⟨⟨ Γ ⟩⟩ ⊢V⦂ X} {N : (⟨⟨ Γ ⟩⟩ ∷ X) ⊢M⦂ (Y ! (o , i))} → RunResult⟨ Γ ∣ let= return V `in N ⟩ → -------------------------------------- ⊥ run-let-return-⊥ (awaiting (let-in ())) run-let-promise-⊥ : {Γ : Ctx} {X Y Z : VType} {o o' : O} {i i' : I} {op : Σₛ} {p : lkpᵢ op i ≡ just (o' , i')} {M₁ : (⟨⟨ Γ ⟩⟩ ∷ `` (payload op)) ⊢M⦂ (⟨ X ⟩ ! (o' , i'))} {M₂ : (⟨⟨ Γ ⟩⟩ ∷ ⟨ X ⟩) ⊢M⦂ (Y ! (o , i))} {N : (⟨⟨ Γ ⟩⟩ ∷ Y) ⊢M⦂ (Z ! (o , i))} → RunResult⟨ Γ ∣ let= promise op ∣ p ↦ M₁ `in M₂ `in N ⟩ → ---------------------------------------------------------- ⊥ run-let-promise-⊥ (awaiting (let-in ())) run-finality-↝↝ : {Γ : Ctx} {C : CType} {M N : ⟨⟨ Γ ⟩⟩ ⊢M⦂ C} → RunResult⟨ Γ ∣ M ⟩ → M ↝↝ N → ----------------------- ⊥ run-finality-↝↝ (awaiting ()) (apply M V) run-finality-↝↝ R (let-return V N) = run-let-return-⊥ R run-finality-↝↝ R (let-↑ p V M N) = run-↑-⊥ (run-invert-let R) run-finality-↝↝ R (let-promise p M₁ M₂ N) = run-let-promise-⊥ R run-finality-↝↝ (awaiting ()) (letrec-unfold M N) run-finality-↝↝ (promise (awaiting ())) (promise-↑ p q V M N) run-finality-↝↝ (awaiting (interrupt ())) (↓-return V W) run-finality-↝↝ (awaiting (interrupt ())) (↓-↑ p V W M) run-finality-↝↝ (awaiting (interrupt ())) (↓-promise-op p V M N) run-finality-↝↝ (awaiting (interrupt ())) (↓-promise-op' p q V M N) run-finality-↝↝ (awaiting ()) (await-promise V M) run-finality-↝↝ R (context-let r) = run-finality-↝↝ (run-invert-let R) r run-finality-↝↝ R (context-↑ r) = run-↑-⊥ R run-finality-↝↝ R (context-↓ r) = run-finality-↝↝ (run-invert-↓ R) r run-finality-↝↝ R (context-promise r) = run-finality-↝↝ (run-invert-promise R) r run-finality-↝↝ R (context-coerce r) = run-finality-↝↝ (run-invert-coerce R) r run-finality-↝↝ (awaiting (coerce ())) (coerce-return V) run-finality-↝↝ (awaiting (coerce ())) (coerce-↑ p V M) run-finality-↝↝ (awaiting (coerce ())) (coerce-promise p M N) comp-finality-↝↝ : {Γ : Ctx} {C : CType} {M N : ⟨⟨ Γ ⟩⟩ ⊢M⦂ C} → CompResult⟨ Γ ∣ M ⟩ → M ↝↝ N → ----------------------- ⊥ comp-finality-↝↝ (comp R) r = run-finality-↝↝ R r comp-finality-↝↝ (signal R) (context-↑ r) = comp-finality-↝↝ R r {- LEMMA 3.2 -} comp-finality : {Γ : Ctx} {C : CType} {M N : ⟨⟨ Γ ⟩⟩ ⊢M⦂ C} → CompResult⟨ Γ ∣ M ⟩ → M ↝ N → ----------------------- ⊥ comp-finality R r = comp-finality-↝↝ R (↝-to-↝↝ r)
{ "alphanum_fraction": 0.2851319678, "avg_line_length": 33.896373057, "ext": "agda", "hexsha": "950fce3548bb5463430415ae592a4de3c5f63657", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "71ebed9f90a3eb37ae6cd209457bae23a4d122d1", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "danelahman/aeff-agda", "max_forks_repo_path": "Finality.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "71ebed9f90a3eb37ae6cd209457bae23a4d122d1", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "danelahman/aeff-agda", "max_issues_repo_path": "Finality.agda", "max_line_length": 112, "max_stars_count": 4, "max_stars_repo_head_hexsha": "71ebed9f90a3eb37ae6cd209457bae23a4d122d1", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "danelahman/aeff-agda", "max_stars_repo_path": "Finality.agda", "max_stars_repo_stars_event_max_datetime": "2021-03-22T22:48:48.000Z", "max_stars_repo_stars_event_min_datetime": "2020-07-17T00:15:00.000Z", "num_tokens": 6676, "size": 19626 }
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.BinNat where open import Cubical.Data.BinNat.BinNat public
{ "alphanum_fraction": 0.7480916031, "avg_line_length": 26.2, "ext": "agda", "hexsha": "db9daa048e5a57b8ba1f27dc5faf61016a3eaa63", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-22T02:02:01.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-22T02:02:01.000Z", "max_forks_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "dan-iel-lee/cubical", "max_forks_repo_path": "Cubical/Data/BinNat.agda", "max_issues_count": 1, "max_issues_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_issues_repo_issues_event_max_datetime": "2022-01-27T02:07:48.000Z", "max_issues_repo_issues_event_min_datetime": "2022-01-27T02:07:48.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "dan-iel-lee/cubical", "max_issues_repo_path": "Cubical/Data/BinNat.agda", "max_line_length": 50, "max_stars_count": null, "max_stars_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "dan-iel-lee/cubical", "max_stars_repo_path": "Cubical/Data/BinNat.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 36, "size": 131 }
{-# OPTIONS --safe #-} module Cubical.Algebra.MonoidSolver.MonoidExpression where open import Cubical.Foundations.Prelude open import Cubical.Data.FinData open import Cubical.Data.Nat open import Cubical.Data.Vec open import Cubical.Algebra.CommMonoid private variable ℓ : Level infixl 7 _⊗_ -- Expression in a type M with n variables data Expr (M : Type ℓ) (n : ℕ) : Type ℓ where ∣ : Fin n → Expr M n ε⊗ : Expr M n _⊗_ : Expr M n → Expr M n → Expr M n
{ "alphanum_fraction": 0.7046413502, "avg_line_length": 20.6086956522, "ext": "agda", "hexsha": "cc8b1c27ba6d05b143693b7a64ee02c25784bd8c", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "58c0b83bb0fed0dc683f3d29b1709effe51c1689", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "thomas-lamiaux/cubical", "max_forks_repo_path": "Cubical/Algebra/MonoidSolver/MonoidExpression.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "58c0b83bb0fed0dc683f3d29b1709effe51c1689", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "thomas-lamiaux/cubical", "max_issues_repo_path": "Cubical/Algebra/MonoidSolver/MonoidExpression.agda", "max_line_length": 58, "max_stars_count": 1, "max_stars_repo_head_hexsha": "58c0b83bb0fed0dc683f3d29b1709effe51c1689", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "thomas-lamiaux/cubical", "max_stars_repo_path": "Cubical/Algebra/MonoidSolver/MonoidExpression.agda", "max_stars_repo_stars_event_max_datetime": "2021-10-31T17:32:49.000Z", "max_stars_repo_stars_event_min_datetime": "2021-10-31T17:32:49.000Z", "num_tokens": 156, "size": 474 }
{- The equivalent "goodness" of can-θ w.r.t. the rmerge reduction. The main properties of the Can function proved in this file are: canθₛ-mergeˡ : ∀ {E θ' r p BV FV} sigs θ → CorrectBinding p BV FV → p ≐ E ⟦ ρ θ' · r ⟧e → ∀ S' → Signal.unwrap S' ∉ SigMap.keys (Env.sig θ') → Signal.unwrap S' ∈ Canθₛ (SigMap.union sigs (Env.sig θ')) 0 (E ⟦ r ⟧e) θ → Signal.unwrap S' ∈ Canθₛ sigs 0 p θ canθₛ-mergeʳ : ∀ sigs θ' r θ → distinct' (proj₁ (Dom θ)) (SigMap.keys sigs) → ∀ S' → Signal.unwrap S' ∈ Canθₛ (SigMap.union sigs (Env.sig θ')) 0 r θ → Signal.unwrap S' ∈ Canθₛ (Env.sig θ') 0 r θ and their corresponding counterparts for the shared variables. -} module Esterel.Lang.CanFunction.MergePotentialRuleTheta where open import utility renaming (_U̬_ to _∪_ ; _|̌_ to _-_) open import Esterel.Lang open import Esterel.Lang.Binding open import Esterel.Lang.CanFunction open import Esterel.Lang.CanFunction.Base open import Esterel.Lang.CanFunction.CanThetaContinuation open import Esterel.Lang.CanFunction.MergePotentialRuleLeftInductive open import Esterel.Lang.CanFunction.NonMergePotentialRules open import Esterel.Context using (EvaluationContext1 ; EvaluationContext ; _⟦_⟧e ; _≐_⟦_⟧e) open import Esterel.Context.Properties using (plug ; unplug) open import Esterel.Environment as Env using (Env ; Θ ; _←_ ; Dom ; module SigMap ; module ShrMap ; module VarMap) open import Esterel.CompletionCode as Code using () renaming (CompletionCode to Code) open import Esterel.Variable.Signal as Signal using (Signal ; _ₛ) open import Esterel.Variable.Shared as SharedVar using (SharedVar ; _ₛₕ) open import Esterel.Variable.Sequential as SeqVar using (SeqVar) open EvaluationContext1 open _≐_⟦_⟧e open import Data.Bool using (Bool ; not ; if_then_else_) open import Data.Empty using (⊥ ; ⊥-elim) open import Data.List using (List ; [] ; _∷_ ; _++_ ; map ; concatMap ; foldr) open import Data.List.Properties using (map-id) open import Data.List.Any using (Any ; any ; here ; there) open import Data.List.Any.Properties using () renaming (++⁺ˡ to ++ˡ ; ++⁺ʳ to ++ʳ) open import Data.Maybe using (Maybe ; maybe ; just ; nothing) open import Data.Nat using (ℕ ; zero ; suc ; _≟_ ; _+_) open import Data.Nat.Properties.Simple using (+-comm) open import Data.Product using (Σ ; proj₁ ; proj₂ ; ∃ ; _,_ ; _,′_ ; _×_) open import Data.Sum using (_⊎_ ; inj₁ ; inj₂) open import Function using (_∘_ ; id ; _∋_) open import Relation.Nullary using (¬_ ; Dec ; yes ; no) open import Relation.Nullary.Decidable using (⌊_⌋) open import Relation.Binary.PropositionalEquality using (_≡_ ; _≢_ ; refl ; trans ; sym ; cong ; subst ; module ≡-Reasoning) open ListSet Data.Nat._≟_ using (set-subtract ; set-subtract-[] ; set-subtract-split ; set-subtract-merge ; set-subtract-notin ; set-remove ; set-remove-mono-∈ ; set-remove-removed ; set-remove-not-removed ; set-subtract-[a]≡set-remove) open import Data.OrderedListMap Signal Signal.unwrap Signal.Status as SigM open import Data.OrderedListMap SharedVar SharedVar.unwrap (Σ SharedVar.Status (λ _ → ℕ)) as ShrM open import Data.OrderedListMap SeqVar SeqVar.unwrap ℕ as SeqM open ≡-Reasoning canθₖ-mergeˡ : ∀ {E θ' r p BV FV A} sigs θ → CorrectBinding p BV FV → p ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e → ∀ k → k ∈ Canθₖ (SigMap.union sigs (Env.sig θ')) 0 (E ⟦ r ⟧e) θ → k ∈ Canθₖ sigs 0 p θ canθₖ-mergeˡ {E} {θ'} {r} {A = A} sigs θ cb p≐E⟦ρθ'r⟧ k k∈canθ-sigs←θ'-E⟦r⟧-θ rewrite sym (unplug p≐E⟦ρθ'r⟧) with binding-extract cb (((E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ∋ plug refl) ... | (BVp , FVp) , (BVp⊆BV , FVp⊆FV) , cbρθ'r@(CBρ cbp) with binding-subst cb (((E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ∋ plug refl) cbρθ'r ((λ _ ()) ,′ (λ _ ()) ,′ (λ _ ())) ((λ _ ()) ,′ (λ _ ()) ,′ (λ _ ())) CBnothing ... | (BV' , FV') , (BVnothin⊆BV , FVnothin⊆FV) , cbnothin rewrite canθ'-←-distribute sigs (Env.sig θ') 0 (E ⟦ r ⟧e) θ = canθₖ-mergeˡ-sigs-induction sigs 0 (Env.sig θ') (Env.shr θ') (Env.var θ') r θ ((E ⟦ nothin ⟧e ≐ E ⟦ nothin ⟧e) ∋ plug refl) cbnothin (distinct'-sym (dist'++ˡ (distinct'-sym (proj₁ (distinct-term-context-help (ρ⟨ θ' , A ⟩· r) E cb cbρθ'r BVp⊆BV cbnothin))))) k k∈canθ-sigs←θ'-E⟦r⟧-θ canθₛ-mergeˡ : ∀ {E θ' r p BV FV A} sigs θ → CorrectBinding p BV FV → p ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e → ∀ S' → Signal.unwrap S' ∉ SigMap.keys (Env.sig θ') → Signal.unwrap S' ∈ Canθₛ (SigMap.union sigs (Env.sig θ')) 0 (E ⟦ r ⟧e) θ → Signal.unwrap S' ∈ Canθₛ sigs 0 p θ canθₛ-mergeˡ {E} {θ'} {r} {A = A} sigs θ cb p≐E⟦ρθ'r⟧ S' S'∉Domθ' S'∈canθ-sigs←θ'-E⟦r⟧-θ rewrite sym (unplug p≐E⟦ρθ'r⟧) with binding-extract cb (((E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ∋ plug refl) ... | (BVp , FVp) , (BVp⊆BV , FVp⊆FV) , cbρθ'r@(CBρ cbp) with binding-subst cb (((E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ∋ plug refl) cbρθ'r ((λ _ ()) ,′ (λ _ ()) ,′ (λ _ ())) ((λ _ ()) ,′ (λ _ ()) ,′ (λ _ ())) CBnothing ... | (BV' , FV') , (BVnothin⊆BV , FVnothin⊆FV) , cbnothin rewrite canθ'-←-distribute sigs (Env.sig θ') 0 (E ⟦ r ⟧e) θ = canθₛ-mergeˡ-sigs-induction sigs 0 (Env.sig θ') (Env.shr θ') (Env.var θ') r θ ((E ⟦ nothin ⟧e ≐ E ⟦ nothin ⟧e) ∋ plug refl) cbnothin (distinct'-sym (dist'++ˡ (distinct'-sym (proj₁ (distinct-term-context-help (ρ⟨ θ' , A ⟩· r) E cb cbρθ'r BVp⊆BV cbnothin))))) (Signal.unwrap S') S'∉Domθ' S'∈canθ-sigs←θ'-E⟦r⟧-θ canθₛₕ-mergeˡ : ∀ {E θ' r p BV FV A} sigs θ → CorrectBinding p BV FV → p ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e → ∀ s' → SharedVar.unwrap s' ∉ ShrMap.keys (Env.shr θ') → SharedVar.unwrap s' ∈ Canθₛₕ (SigMap.union sigs (Env.sig θ')) 0 (E ⟦ r ⟧e) θ → SharedVar.unwrap s' ∈ Canθₛₕ sigs 0 p θ canθₛₕ-mergeˡ {E} {θ'} {r} {A = A} sigs θ cb p≐E⟦ρθ'r⟧ s' s'∉Domθ' s'∈canθ-sigs←θ'-E⟦r⟧-θ rewrite sym (unplug p≐E⟦ρθ'r⟧) with binding-extract cb (((E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ∋ plug refl) ... | (BVp , FVp) , (BVp⊆BV , FVp⊆FV) , cbρθ'r@(CBρ cbp) with binding-subst cb (((E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ≐ E ⟦ ρ⟨ θ' , A ⟩· r ⟧e) ∋ plug refl) cbρθ'r ((λ _ ()) ,′ (λ _ ()) ,′ (λ _ ())) ((λ _ ()) ,′ (λ _ ()) ,′ (λ _ ())) CBnothing ... | (BV' , FV') , (BVnothin⊆BV , FVnothin⊆FV) , cbnothin rewrite canθ'-←-distribute sigs (Env.sig θ') 0 (E ⟦ r ⟧e) θ = canθₛₕ-mergeˡ-sigs-induction sigs 0 (Env.sig θ') (Env.shr θ') (Env.var θ') r θ ((E ⟦ nothin ⟧e ≐ E ⟦ nothin ⟧e) ∋ plug refl) cbnothin (distinct'-sym (dist'++ˡ (distinct'-sym (proj₁ (distinct-term-context-help (ρ⟨ θ' , A ⟩· r) E cb cbρθ'r BVp⊆BV cbnothin))))) (SharedVar.unwrap s') s'∉Domθ' s'∈canθ-sigs←θ'-E⟦r⟧-θ canθₛ-mergeʳ-add-sig-notin : ∀ sigs' r θ S status → S ∉ proj₁ (Dom θ) → S ∉ SigMap.keys sigs' → ∀ S'' → S'' ∈ Canθₛ sigs' 0 r (θ ← [ (S ₛ) ↦ status ]) → S'' ∈ Canθₛ sigs' 0 r θ canθₛ-mergeʳ-add-sig-notin sigs' r θ S status S∉Domθ S∉sigs' S'' S''∈canθ-sigs'-r-θ←[S] rewrite canθ-is-unknown-lemma sigs' 0 r θ (S ₛ) S∉Domθ (subst (S ∉_) (sym (map-id (SigMap.keys sigs'))) S∉sigs') = canθₛ-add-sig-monotonic sigs' 0 r θ (S ₛ) status S'' S''∈canθ-sigs'-r-θ←[S] canθₛ-mergeʳ-sigs-induction : ∀ sigs S sigs' r θ → distinct' (proj₁ (Dom θ)) (map (_+_ S) (SigMap.keys sigs)) → ∀ S'' → S'' ∈ proj₁ (Canθ' sigs S (Canθ sigs' 0 r) θ) → S'' ∈ proj₁ (Canθ sigs' 0 r θ) canθₛ-mergeʳ-sigs-induction [] S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ = S''∈canθ'-sigs-canθ-sigs'-r-θ canθₛ-mergeʳ-sigs-induction (nothing ∷ sigs) S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ rewrite map-+-compose-suc S (SigMap.keys sigs) = canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ canθₛ-mergeʳ-sigs-induction (just Signal.present ∷ sigs) S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.present θ S∈sigs' = canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛ-mergeʳ-add-sig-notin sigs' r θ S Signal.present (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' S'' (canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env-present (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.present S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env-present (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛ-mergeʳ-sigs-induction (just Signal.absent ∷ sigs) S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.absent θ S∈sigs' = canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛ-mergeʳ-add-sig-notin sigs' r θ S Signal.absent (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' S'' (canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env-absent (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.absent S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env-absent (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛ-mergeʳ-sigs-induction (just Signal.unknown ∷ sigs) S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ with any (_≟_ S) (proj₁ (Canθ' sigs (suc S) (Canθ sigs' 0 r) (θ ← [S]-env (S ₛ)))) canθₛ-mergeʳ-sigs-induction (just Signal.unknown ∷ sigs) S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ | yes S∈canθ'-sigs-canθ-sigs'-r-θ←[S] rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.unknown θ S∈sigs' = canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛ-mergeʳ-add-sig-notin sigs' r θ S Signal.unknown (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' S'' (canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.unknown S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛ-mergeʳ-sigs-induction (just Signal.unknown ∷ sigs) S sigs' r θ θ≠sigs S'' S''∈canθ'-sigs-canθ-sigs'-r-θ | no S∉canθ'-sigs-canθ-sigs'-r-θ←[S] rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.absent θ S∈sigs' = canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛ-mergeʳ-add-sig-notin sigs' r θ S Signal.absent (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' S'' (canθₛ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env-absent (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.absent S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env-absent (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) S'' S''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛ-mergeʳ : ∀ sigs θ' r θ → distinct' (proj₁ (Dom θ)) (SigMap.keys sigs) → ∀ S' → Signal.unwrap S' ∈ Canθₛ (SigMap.union sigs (Env.sig θ')) 0 r θ → Signal.unwrap S' ∈ Canθₛ (Env.sig θ') 0 r θ canθₛ-mergeʳ sigs θ' r θ θ≠sigs S' S'∈canθ-sigs←θ'-r-θ rewrite canθ'-←-distribute sigs (Env.sig θ') 0 r θ = canθₛ-mergeʳ-sigs-induction sigs 0 (Env.sig θ') r θ (subst (distinct' _) (sym (map-id (SigMap.keys sigs))) θ≠sigs) (Signal.unwrap S') S'∈canθ-sigs←θ'-r-θ canθₛₕ-mergeʳ-add-sig-notin : ∀ sigs' r θ S status → S ∉ proj₁ (Dom θ) → S ∉ SigMap.keys sigs' → ∀ s'' → s'' ∈ Canθₛₕ sigs' 0 r (θ ← [ (S ₛ) ↦ status ]) → s'' ∈ Canθₛₕ sigs' 0 r θ canθₛₕ-mergeʳ-add-sig-notin sigs' r θ S status S∉Domθ S∉sigs' s'' s''∈canθ-sigs'-r-θ←[S] rewrite canθ-is-unknown-lemma sigs' 0 r θ (S ₛ) S∉Domθ (subst (S ∉_) (sym (map-id (SigMap.keys sigs'))) S∉sigs') = canθₛₕ-add-sig-monotonic sigs' 0 r θ (S ₛ) status s'' s''∈canθ-sigs'-r-θ←[S] canθₛₕ-mergeʳ-sigs-induction : ∀ sigs S sigs' r θ → distinct' (proj₁ (Dom θ)) (map (_+_ S) (SigMap.keys sigs)) → ∀ s'' → s'' ∈ proj₂ (proj₂ (Canθ' sigs S (Canθ sigs' 0 r) θ)) → s'' ∈ proj₂ (proj₂ (Canθ sigs' 0 r θ)) canθₛₕ-mergeʳ-sigs-induction [] S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ = s''∈canθ'-sigs-canθ-sigs'-r-θ canθₛₕ-mergeʳ-sigs-induction (nothing ∷ sigs) S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ rewrite map-+-compose-suc S (SigMap.keys sigs) = canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ canθₛₕ-mergeʳ-sigs-induction (just Signal.present ∷ sigs) S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.present θ S∈sigs' = canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛₕ-mergeʳ-add-sig-notin sigs' r θ S Signal.present (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' s'' (canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env-present (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.present S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env-present (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛₕ-mergeʳ-sigs-induction (just Signal.absent ∷ sigs) S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.absent θ S∈sigs' = canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛₕ-mergeʳ-add-sig-notin sigs' r θ S Signal.absent (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' s'' (canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env-absent (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.absent S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env-absent (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛₕ-mergeʳ-sigs-induction (just Signal.unknown ∷ sigs) S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ with any (_≟_ S) (proj₁ (Canθ' sigs (suc S) (Canθ sigs' 0 r) (θ ← [S]-env (S ₛ)))) canθₛₕ-mergeʳ-sigs-induction (just Signal.unknown ∷ sigs) S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ | yes S∈canθ'-sigs-canθ-sigs'-r-θ←[S] rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.unknown θ S∈sigs' = canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛₕ-mergeʳ-add-sig-notin sigs' r θ S Signal.unknown (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' s'' (canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.unknown S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛₕ-mergeʳ-sigs-induction (just Signal.unknown ∷ sigs) S sigs' r θ θ≠sigs s'' s''∈canθ'-sigs-canθ-sigs'-r-θ | no S∉canθ'-sigs-canθ-sigs'-r-θ←[S] rewrite map-+-compose-suc S (SigMap.keys sigs) with any (_≟_ S) (SigMap.keys sigs') ... | yes S∈sigs' rewrite canθ'-inner-shadowing-irr sigs (suc S) sigs' r S Signal.absent θ S∈sigs' = canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r θ (dist'++ʳ {V2 = S + 0 ∷ []} θ≠sigs) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ ... | no S∉sigs' rewrite +-comm S 0 = canθₛₕ-mergeʳ-add-sig-notin sigs' r θ S Signal.absent (λ S∈Domθ → θ≠sigs S S∈Domθ (here refl)) S∉sigs' s'' (canθₛₕ-mergeʳ-sigs-induction sigs (suc S) sigs' r (θ ← [S]-env-absent (S ₛ)) (λ S'' S''∈Domθ←[S] S''∈map-+-suc-S-sigs → -- TODO: should make this a function Data.Sum.[ (λ S''∈Domθ → θ≠sigs S'' S''∈Domθ (there S''∈map-+-suc-S-sigs)) , (λ S''∈[S] → subst (_∉ _) (sym (Env.sig-single-∈-eq (S'' ₛ) (S ₛ) Signal.absent S''∈[S])) (n∉map-suc-n-+ S (SigMap.keys sigs)) S''∈map-+-suc-S-sigs) ] (Env.sig-←⁻ {θ} {[S]-env-absent (S ₛ)} (S'' ₛ) S''∈Domθ←[S])) s'' s''∈canθ'-sigs-canθ-sigs'-r-θ) canθₛₕ-mergeʳ : ∀ sigs θ' r θ → distinct' (proj₁ (Dom θ)) (SigMap.keys sigs) → ∀ s' → SharedVar.unwrap s' ∈ Canθₛₕ (SigMap.union sigs (Env.sig θ')) 0 r θ → SharedVar.unwrap s' ∈ Canθₛₕ (Env.sig θ') 0 r θ canθₛₕ-mergeʳ sigs θ' r θ θ≠sigs s' s'∈canθ-sigs←θ'-r-θ rewrite canθ'-←-distribute sigs (Env.sig θ') 0 r θ = canθₛₕ-mergeʳ-sigs-induction sigs 0 (Env.sig θ') r θ (subst (distinct' _) (sym (map-id (SigMap.keys sigs))) θ≠sigs) (SharedVar.unwrap s') s'∈canθ-sigs←θ'-r-θ
{ "alphanum_fraction": 0.5510540344, "avg_line_length": 45.9576837416, "ext": "agda", "hexsha": "127fd24d80eec13e858c02c085dfba927ef5bd94", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2020-04-15T20:02:49.000Z", "max_forks_repo_forks_event_min_datetime": "2020-04-15T20:02:49.000Z", "max_forks_repo_head_hexsha": "4340bef3f8df42ab8167735d35a4cf56243a45cd", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "florence/esterel-calculus", "max_forks_repo_path": "agda/Esterel/Lang/CanFunction/MergePotentialRuleTheta.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "4340bef3f8df42ab8167735d35a4cf56243a45cd", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "florence/esterel-calculus", "max_issues_repo_path": "agda/Esterel/Lang/CanFunction/MergePotentialRuleTheta.agda", "max_line_length": 97, "max_stars_count": 3, "max_stars_repo_head_hexsha": "4340bef3f8df42ab8167735d35a4cf56243a45cd", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "florence/esterel-calculus", "max_stars_repo_path": "agda/Esterel/Lang/CanFunction/MergePotentialRuleTheta.agda", "max_stars_repo_stars_event_max_datetime": "2020-07-01T03:59:31.000Z", "max_stars_repo_stars_event_min_datetime": "2020-04-16T10:58:53.000Z", "num_tokens": 9290, "size": 20635 }
------------------------------------------------------------------------------ -- Conversion rules for the nest function ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOT.FOTC.Program.Nest.ConversionRulesATP where open import FOT.FOTC.Program.Nest.NestConditional open import FOTC.Base ------------------------------------------------------------------------------ postulate nest-0 : nest zero ≡ zero {-# ATP prove nest-0 #-} postulate nest-S : ∀ n → nest (succ₁ n) ≡ nest (nest n) {-# ATP prove nest-S #-}
{ "alphanum_fraction": 0.4228650138, "avg_line_length": 31.5652173913, "ext": "agda", "hexsha": "ce8f5ec5f2cb72d1e66d7a94eb96495fbd9ffd9a", "lang": "Agda", "max_forks_count": 3, "max_forks_repo_forks_event_max_datetime": "2018-03-14T08:50:00.000Z", "max_forks_repo_forks_event_min_datetime": "2016-09-19T14:18:30.000Z", "max_forks_repo_head_hexsha": "2fc9f2b81052a2e0822669f02036c5750371b72d", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "asr/fotc", "max_forks_repo_path": "notes/FOT/FOTC/Program/Nest/ConversionRulesATP.agda", "max_issues_count": 2, "max_issues_repo_head_hexsha": "2fc9f2b81052a2e0822669f02036c5750371b72d", "max_issues_repo_issues_event_max_datetime": "2017-01-01T14:34:26.000Z", "max_issues_repo_issues_event_min_datetime": "2016-10-12T17:28:16.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "asr/fotc", "max_issues_repo_path": "notes/FOT/FOTC/Program/Nest/ConversionRulesATP.agda", "max_line_length": 78, "max_stars_count": 11, "max_stars_repo_head_hexsha": "2fc9f2b81052a2e0822669f02036c5750371b72d", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/fotc", "max_stars_repo_path": "notes/FOT/FOTC/Program/Nest/ConversionRulesATP.agda", "max_stars_repo_stars_event_max_datetime": "2021-09-12T16:09:54.000Z", "max_stars_repo_stars_event_min_datetime": "2015-09-03T20:53:42.000Z", "num_tokens": 129, "size": 726 }
module Structure.Relator.Function where import Lvl open import Lang.Instance open import Logic open import Logic.Propositional open import Logic.Predicate open import Functional open import Structure.Setoid open import Structure.Setoid.Uniqueness open import Structure.Relator open import Type private variable ℓₒ₁ ℓₒ₂ ℓₒ₃ ℓₑ₂ : Lvl.Level module _ {A : Type{ℓₒ₁}}{B : Type{ℓₒ₂}} ⦃ equiv-B : Equiv{ℓₑ₂}(B) ⦄ (φ : A → B → Stmt{ℓₒ₃}) where module _ (f : A → B) where record Computable : Stmt{ℓₒ₁ Lvl.⊔ ℓₒ₂ Lvl.⊔ ℓₒ₃ Lvl.⊔ ℓₑ₂} where constructor intro field proof : ∀{x}{y} → (f(x) ≡ y) → φ(x)(y) computable = inst-fn Computable.proof -- A binary operation is total when every LHS have at least one RHS in which the relation holds. record Total : Stmt{ℓₒ₁ Lvl.⊔ ℓₒ₂ Lvl.⊔ ℓₒ₃} where constructor intro field proof : ∀{x} → ∃(y ↦ φ(x)(y)) compute : A → B compute(x) = [∃]-witness(proof{x}) computableFunction : ⦃ _ : ∀{x} → UnaryRelator(φ(x)) ⦄ → ∃(Computable) ∃.witness computableFunction = compute Computable.proof (∃.proof computableFunction) {x} eq = substitute₁(φ(x)) eq ([∃]-proof(proof{x})) total = inst-fn Total.proof -- A binary operation is a function when every LHS have at least one RHS in which the relation holds. record Function : Stmt{ℓₒ₁ Lvl.⊔ ℓₒ₂ Lvl.⊔ ℓₒ₃ Lvl.⊔ ℓₑ₂} where constructor intro field proof : ∀{x} → Unique(φ(x)) function = inst-fn Function.proof -- (∀{x}{y₁ y₂} → φ(x)(y₁) → φ(x)(y₂) → (y₁ ≡ y₂)) totalFunction : ⦃ _ : Total ⦄ → ⦃ _ : Function ⦄ → (∀{x} → ∃!(φ(x))) totalFunction = [∧]-intro total function
{ "alphanum_fraction": 0.6572133169, "avg_line_length": 36.0444444444, "ext": "agda", "hexsha": "53c679512d69472527ff8261cc1e23f4e347f2da", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Lolirofle/stuff-in-agda", "max_forks_repo_path": "Structure/Relator/Function.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Lolirofle/stuff-in-agda", "max_issues_repo_path": "Structure/Relator/Function.agda", "max_line_length": 103, "max_stars_count": 6, "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_path": "Structure/Relator/Function.agda", "max_stars_repo_stars_event_max_datetime": "2022-02-05T06:53:22.000Z", "max_stars_repo_stars_event_min_datetime": "2020-04-07T17:58:13.000Z", "num_tokens": 629, "size": 1622 }
data ⊥ : Set where record ⊤ : Set where data Bool : Set where false : Bool true : Bool True : Bool → Set True false = ⊥ True true = ⊤ Foo : (b : Bool) → True b → Set Foo true _ = ⊤ -- The problem rises because I have removed this impossible case. -- Foo false () test : (b : Bool) (t : True b) → Foo b t → ⊤ test true p x = _ test false p x = _
{ "alphanum_fraction": 0.5927977839, "avg_line_length": 17.1904761905, "ext": "agda", "hexsha": "7e1f75b02546d378d63d02abdeef3f77a430b6bd", "lang": "Agda", "max_forks_count": 371, "max_forks_repo_forks_event_max_datetime": "2022-03-30T19:00:30.000Z", "max_forks_repo_forks_event_min_datetime": "2015-01-03T14:04:08.000Z", "max_forks_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "cruhland/agda", "max_forks_repo_path": "test/Succeed/Issue3407.agda", "max_issues_count": 4066, "max_issues_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_issues_repo_issues_event_max_datetime": "2022-03-31T21:14:49.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-10T11:24:51.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "cruhland/agda", "max_issues_repo_path": "test/Succeed/Issue3407.agda", "max_line_length": 65, "max_stars_count": 1989, "max_stars_repo_head_hexsha": "7f58030124fa99dfbf8db376659416f3ad8384de", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "cruhland/agda", "max_stars_repo_path": "test/Succeed/Issue3407.agda", "max_stars_repo_stars_event_max_datetime": "2022-03-30T18:20:48.000Z", "max_stars_repo_stars_event_min_datetime": "2015-01-09T23:51:16.000Z", "num_tokens": 124, "size": 361 }
------------------------------------------------------------------------------ -- Testing nested axioms ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module NestedAxioms.B where open import NestedAxioms.A ------------------------------------------------------------------------------ postulate c : D b≡c : b ≡ c {-# ATP axiom b≡c #-}
{ "alphanum_fraction": 0.3120437956, "avg_line_length": 27.4, "ext": "agda", "hexsha": "6a0c168d262b4400997eb1fdc9456e6f13fab4dc", "lang": "Agda", "max_forks_count": 4, "max_forks_repo_forks_event_max_datetime": "2016-08-03T03:54:55.000Z", "max_forks_repo_forks_event_min_datetime": "2016-05-10T23:06:19.000Z", "max_forks_repo_head_hexsha": "a66c5ddca2ab470539fd68c42c4fbd45f720d682", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "asr/apia", "max_forks_repo_path": "test/Succeed/fol-theorems/NestedAxioms/B.agda", "max_issues_count": 121, "max_issues_repo_head_hexsha": "a66c5ddca2ab470539fd68c42c4fbd45f720d682", "max_issues_repo_issues_event_max_datetime": "2018-04-22T06:01:44.000Z", "max_issues_repo_issues_event_min_datetime": "2015-01-25T13:22:12.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "asr/apia", "max_issues_repo_path": "test/Succeed/fol-theorems/NestedAxioms/B.agda", "max_line_length": 78, "max_stars_count": 10, "max_stars_repo_head_hexsha": "a66c5ddca2ab470539fd68c42c4fbd45f720d682", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "asr/apia", "max_stars_repo_path": "test/Succeed/fol-theorems/NestedAxioms/B.agda", "max_stars_repo_stars_event_max_datetime": "2019-12-03T13:44:25.000Z", "max_stars_repo_stars_event_min_datetime": "2015-09-03T20:54:16.000Z", "num_tokens": 87, "size": 548 }
module LearnYouAn where data ℕ : Set where zero : ℕ suc : ℕ → ℕ _+_ : ℕ → ℕ → ℕ zero + n = n (suc n) + m = suc (n + m) -- if_then_else_ : ∀ { a } → Bool → a → a → a data _even : ℕ → Set where ZERO : zero even STEP : ∀ {x} → x even → suc (suc x) even proof₁ : suc (suc (suc (suc zero))) even proof₁ = STEP (STEP ZERO) proof₂′ : (A : Set) → A → A proof₂′ _ x = x proof₂ : ℕ → ℕ proof₂ = proof₂′ ℕ
{ "alphanum_fraction": 0.5056689342, "avg_line_length": 18.375, "ext": "agda", "hexsha": "ee5e15f9e0faeda8627db7eef48b03cbcb0ec2f4", "lang": "Agda", "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_head_hexsha": "11f8071e325d07d19a53157cb065d88244b20cb4", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "alf239/tao", "max_forks_repo_path": "LearnYouAn.agda", "max_issues_count": null, "max_issues_repo_head_hexsha": "11f8071e325d07d19a53157cb065d88244b20cb4", "max_issues_repo_issues_event_max_datetime": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "alf239/tao", "max_issues_repo_path": "LearnYouAn.agda", "max_line_length": 47, "max_stars_count": null, "max_stars_repo_head_hexsha": "11f8071e325d07d19a53157cb065d88244b20cb4", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "alf239/tao", "max_stars_repo_path": "LearnYouAn.agda", "max_stars_repo_stars_event_max_datetime": null, "max_stars_repo_stars_event_min_datetime": null, "num_tokens": 180, "size": 441 }
{-# OPTIONS --warning=error #-} open import LogicalFormulae open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import Numbers.Naturals.Semiring open import Numbers.Naturals.Order open import Vectors open import Semirings.Definition open import Categories.Definition open import Orders open import Categories.Functor.Definition open import Categories.Examples module Categories.Category where postulate extensionality : {a b : _} {S : Set a} {T : S → Set b} {f g : (x : S) → T x} → ((x : S) → f x ≡ g x) → f ≡ g ≡Unique : {a : _} {X : Set a} → {a b : X} → (p1 p2 : a ≡ b) → (p1 ≡ p2) ≡Unique refl refl = refl NatPreorder : Category {lzero} {lzero} NatPreorder = record { objects = ℕ ; arrows = λ m n → m ≤N n ; id = λ x → inr refl ; _∘_ = λ f g → leqTransitive g f ; rightId = λ x<y → leqUnique (leqTransitive x<y (inr refl)) x<y ; leftId = λ x<y → leqUnique (leqTransitive (inr refl) x<y) x<y ; associative = λ z<=w y<=z x<=y → leqUnique (leqTransitive (leqTransitive x<=y y<=z) z<=w) (leqTransitive x<=y (leqTransitive y<=z z<=w)) } where leqTransitive : {a b c : ℕ} → (a ≤N b) → (b ≤N c) → (a ≤N c) leqTransitive (inl a<b) (inl b<c) = inl (TotalOrder.<Transitive ℕTotalOrder a<b b<c) leqTransitive (inl a<b) (inr b=c) rewrite b=c = inl a<b leqTransitive (inr a=b) (inl b<c) rewrite a=b = inl b<c leqTransitive (inr a=b) (inr b=c) rewrite a=b | b=c = inr refl <Nunique : {a b : ℕ} → (p1 p2 : a <N b) → p1 ≡ p2 <Nunique {a} {b} (le a-b pr1) (le a-b2 pr2) = go a-b pr1 a-b2 pr2 p' where p : a-b2 +N a ≡ a-b +N a p rewrite equalityCommutative pr1 = succInjective pr2 p' : a-b2 ≡ a-b p' = canSubtractFromEqualityRight p go : (a-b : ℕ) (pr1 : succ (a-b +N a) ≡ b) (a-b2 : ℕ) (pr2 : succ (a-b2 +N a) ≡ b) (p : a-b2 ≡ a-b) → (le a-b pr1) ≡ (le a-b2 pr2) go a-b pr1 a-b2 pr2 eq rewrite eq = applyEquality (λ i → le a-b i) (≡Unique pr1 pr2) leqUnique : {a b : ℕ} → (p1 : a ≤N b) → (p2 : a ≤N b) → p1 ≡ p2 leqUnique (inl a<b) (inl a<b2) = applyEquality inl (<Nunique a<b a<b2) leqUnique (inl a<b) (inr a=b) rewrite a=b = exFalso (lessIrreflexive a<b) leqUnique (inr a=b) (inl a<b) rewrite a=b = exFalso (lessIrreflexive a<b) leqUnique (inr a=b1) (inr a=b2) rewrite a=b1 | a=b2 = refl NatMonoid : Category {lzero} {lzero} NatMonoid = record { objects = True ; arrows = λ _ _ → ℕ ; id = λ x → 0 ; _∘_ = λ f g → f +N g ; rightId = λ f → refl ; leftId = λ f → Semiring.sumZeroRight ℕSemiring f ; associative = λ a b c → Semiring.+Associative ℕSemiring a b c } typeCastCat : {a b c d : _} {C : Category {a} {b}} {D : Category {c} {d}} (F : Functor C D) (G : Functor C D) (S T : Category.objects C) (pr : Functor.onObj F ≡ Functor.onObj G) → Category.arrows D (Functor.onObj G S) (Functor.onObj G T) ≡ Category.arrows D (Functor.onObj F S) (Functor.onObj F T) typeCastCat F G S T pr rewrite pr = refl equalityFunctionsEqual : {a b : _} {A : Set a} {B : Set b} (f : A → (B ≡ B)) → (g : A → (B ≡ B)) → (f ≡ g) equalityFunctionsEqual f g = extensionality λ x → ≡Unique (f x) (g x) equalityFunctionsEqual' : {a b : _} {A : Set a} {B : Set b} (f : A → (B ≡ B)) → (g : A → (B ≡ B)) → (f ≡ g) equalityFunctionsEqual' f g = extensionality λ x → ≡Unique (f x) (g x) functorsEqual' : {a b c d : _} {C : Category {a} {b}} {D : Category {c} {d}} (F : Functor C D) (G : Functor C D) (objEq : (Functor.onObj F) ≡ Functor.onObj G) (arrEq : ∀ {S T : Category.objects C} → {f : Category.arrows C S T} → (Functor.onArrow F {S} {T} f ≡ (typeCast (Functor.onArrow G {S} {T} f) (typeCastCat F G S T objEq)))) → F ≡ G functorsEqual' record { onObj = onObjF ; onArrow = onArrowF ; mapId = mapIdF ; mapCompose = mapComposeF } record { onObj = onObjG ; onArrow = onArrowG ; mapId = mapIdG ; mapCompose = mapComposeG } prObj prArr rewrite prObj = {!!} VEC : {a : _} → ℕ → Functor (SET {a}) (SET {a}) VEC {a} n = record { onObj = λ X → Vec X n ; onArrow = λ f → λ v → vecMap f v ; mapId = extensionality mapId' ; mapCompose = λ f g → extensionality λ vec → help f g vec } where vecMapLemma : {a : _} {T : Set a} {n : ℕ} (v : Vec T n) → vecMap (Category.id SET T) v ≡ v vecMapLemma {a} v with inspect (SET {a}) vecMapLemma {a} v | y with≡ SetCopy = vecMapIdFact (λ i → refl) v mapId' : {a : _} {T : Set a} {n : ℕ} → (v : Vec T n) → vecMap (Category.id SET T) v ≡ Category.id SET (Vec T n) v mapId' v rewrite vecMapLemma v = refl help : ∀ {a n} {X Y Z : Category.objects (SET {a})} (f : X → Y) (g : Y → Z) (vec : Vec X n) → vecMap (λ x → g (f x)) vec ≡ vecMap g (vecMap f vec) help f g vec = equalityCommutative (vecMapCompositionFact (λ x → refl) vec) CATEGORY : {a b : _} → Category {lsuc b ⊔ lsuc a} {b ⊔ a} CATEGORY {a} {b} = record { objects = Category {a} {b} ; arrows = λ C D → Functor C D ; _∘_ = λ F G → functorCompose F G ; id = λ C → idFunctor C ; rightId = λ F → {!!} ; leftId = λ F → {!!} ; associative = {!!} } where rightIdFact : {a b c d : _} → {C : Category {a} {b}} {D : Category {c} {d}} (F : Functor C D) → functorCompose (idFunctor D) F ≡ F rightIdFact {C = C} {D} F = {!!}
{ "alphanum_fraction": 0.5952380952, "avg_line_length": 65.6923076923, "ext": "agda", "hexsha": "41dde7d2d35259c4cbe18ff829272c4a1ca337fb", "lang": "Agda", "max_forks_count": 1, "max_forks_repo_forks_event_max_datetime": "2021-11-29T13:23:07.000Z", "max_forks_repo_forks_event_min_datetime": "2021-11-29T13:23:07.000Z", "max_forks_repo_head_hexsha": "0f4230011039092f58f673abcad8fb0652e6b562", "max_forks_repo_licenses": [ "MIT" ], "max_forks_repo_name": "Smaug123/agdaproofs", "max_forks_repo_path": "Categories/Category.agda", "max_issues_count": 14, "max_issues_repo_head_hexsha": "0f4230011039092f58f673abcad8fb0652e6b562", "max_issues_repo_issues_event_max_datetime": "2020-04-11T11:03:39.000Z", "max_issues_repo_issues_event_min_datetime": "2019-01-06T21:11:59.000Z", "max_issues_repo_licenses": [ "MIT" ], "max_issues_repo_name": "Smaug123/agdaproofs", "max_issues_repo_path": "Categories/Category.agda", "max_line_length": 386, "max_stars_count": 4, "max_stars_repo_head_hexsha": "0f4230011039092f58f673abcad8fb0652e6b562", "max_stars_repo_licenses": [ "MIT" ], "max_stars_repo_name": "Smaug123/agdaproofs", "max_stars_repo_path": "Categories/Category.agda", "max_stars_repo_stars_event_max_datetime": "2022-01-28T06:04:15.000Z", "max_stars_repo_stars_event_min_datetime": "2019-08-08T12:44:19.000Z", "num_tokens": 2010, "size": 5124 }