text stringlengths 4 690k |
|---|
module foldr-++ where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; cong)
open Eq.≡-Reasoning
open import lists using (List; _∷_; []; _++_; foldr)
-- 結合したリストの重畳は、重畳した結果を初期値とした重畳と等しいことの証明
foldr-++ : ∀ {A B : Set} → (_⊗_ : A → B → B) → (e : B) → (xs ys : List A)
→ foldr _⊗_ e (xs ++ ys) ≡ fo... |
module LC.Subst.Term where
open import LC.Base
open import LC.Subst.Var
open import Data.Nat
open import Data.Nat.Properties
open import Relation.Nullary
--------------------------------------------------------------------------------
-- lifting terms
lift : (n i : ℕ) → Term → Term
lift n i (var x) = var (lift-v... |
{- 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
open import LibraBFT.Concrete.Records
open im... |
open import Level
open import Data.Product
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong)
module AlgProg where
-- 1.1 Datatypes
private
variable
l : Level
data Bool : Set where
false : Bool
true : Bool
data Char : Set where
ca : Char
cb : Char
cc : C... |
{- Formal verification of authenticated append-only skiplists in Agda, version 1.0.
Copyright (c) 2020 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 Data.Unit.NonEta
open import Data.Empty
open import Data... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import groups.Pointed
module groups.Int where
abstract
ℤ→ᴳ-η : ∀ {i} {G : Group i} (φ : ℤ-group →ᴳ G)
→ GroupHom.f φ ∼ Group.exp G (GroupHom.f φ 1)
ℤ→ᴳ-η φ (pos 0) = GroupHom.pres-ident φ
ℤ→ᴳ-η φ (pos 1) = idp
ℤ→ᴳ-η {G = G} φ (pos (S (S n))) =... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import LogicalFormulae
open import Sets.EquivalenceRelations
open import Setoids.Setoids
module Setoids.Equality {a b : _} {A : Set a} (S : Setoid {a} {b} A) where
open import Setoids.Subset S
_=S_ : {... |
-- Andreas, 2015-10-28 adapted from test case by
-- Ulf, 2014-02-06, shrunk from Wolfram Kahl's report
open import Common.Equality
open import Common.Unit
open import Common.Nat
postulate
prop : ∀ x → x ≡ unit
record StrictTotalOrder : Set where
field compare : Unit
open StrictTotalOrder
module M (Key : StrictT... |
------------------------------------------------------------------------
-- A non-recursive variant of H-level.Truncation.Propositional.Erased
------------------------------------------------------------------------
-- The definition does use natural numbers. The code is based on van
-- Doorn's "Constructing the Propo... |
module Pi-.Properties where
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Relation.Binary.Core
open import Relation.Binary
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Data.Nat
open import Data.Nat.Induction
open impo... |
-- Andreas, 2020-11-16, issue #5055, reported by nad
-- Internal error caused by record pattern on pattern synonym lhs
-- (unreleased regression in 2.6.2).
open import Agda.Builtin.Sigma
data Shape : Set where
c : Shape → Shape
pattern p (s , v) = c s , v
-- Should give some parse error or other controlled error.... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Relation.Nullary.DecidableEq where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Data.Empty
open import Cubical.Relation.Nullary
-- Proof of Hedberg's theorem: a type with decidable equality is an h-set
Dec→Stable : ... |
------------------------------------------------------------------------
-- A large(r) class of algebraic structures satisfies the property
-- that isomorphic instances of a structure are equal (assuming
-- univalence)
------------------------------------------------------------------------
{-# OPTIONS --without-K --s... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import homotopy.CoHSpace
open import homotopy.Cogroup
module groups.FromSusp where
module _ {i} (X : Ptd i) where
private
A = de⊙ X
e = pt X
module Pinch = SuspRec (winl north) (winr south)
(λ a → ap winl (σloop X a) ∙ wglue ∙ ap winr (me... |
module Issue1105 where
module So.Bad where
|
open import FRP.JS.Nat using ( ℕ ; suc ; _+_ ; _≟_ )
open import FRP.JS.Maybe using ( Maybe ; just ; nothing ; _≟[_]_ )
open import FRP.JS.Bool using ( Bool ; not )
open import FRP.JS.QUnit using ( TestSuite ; ok ; ok! ; test ; _,_ )
module FRP.JS.Test.Maybe where
_≟¹_ : Maybe ℕ → Maybe ℕ → Bool
xs ≟¹ ys = xs ≟[ _≟_ ... |
module Homogenous.Nat where
import PolyDepPrelude
open PolyDepPrelude using (zero; one; _::_; nil; right; left; pair; unit)
import Homogenous.Base
open Homogenous.Base using (Sig; T; Intro)
-- The code for natural numbers is [0 1]
codeNat : Sig
codeNat = zero :: (one :: nil)
iNat : Set
iNat = T codeNat
-- Short-... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Magma where
open import Cubical.Algebra.Base public
open import Cubical.Algebra.Definitions public
open import Cubical.Algebra.Structures public using (IsMagma; ismagma)
open import Cubical.Algebra.Bundles public using (Magma; mkmagma; MagmaCar... |
module CaseSplit1 where
data ℕ : Set where
Z : ℕ
S : ℕ → ℕ
f0 : ℕ → ℕ
f0 = λ { x → {! !} ; y → {! !} }
f1 : ℕ → ℕ
f1 = λ
{ x → {! !}
; y → {! !}
}
g0 : ℕ → ℕ
g0 = λ where x → {! !}
y → {! !}
g1 : ℕ → ℕ
g1 = λ where
x → {! !}
y → {! !}
issue16 : ℕ → ℕ
issue16 = λ {... |
------------------------------------------------------------------------------
-- ABP auxiliary lemma
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIO... |
-- simply-typed labelled λ-calculus w/ DeBruijn indices
-- {-# OPTIONS --show-implicit #-}
module LLC 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 _+ᴺ_ ; _≤_ ... |
{-
This file contains:
- Path lemmas used in the colimit-equivalence proof.
Verbose, indeed. But should be simple. The length mainly thanks to:
- Degenerate cubes that seem "obvious", but have to be constructed manually;
- J rule is cubersome to use, especially when iteratively applied,
also it is overcompl... |
module Data.Option.Setoid where
import Lvl
open import Data
open import Data.Option
open import Functional
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties
open import Structure.Setoid
open import Type
private variable ℓ ℓₑ ℓₑₐ : Lvl.Level
private variable A : Type{ℓ}
instance
... |
open import Nat
open import Prelude
open import core
open import contexts
open import htype-decidable
open import lemmas-matching
open import disjointness
module elaborability where
mutual
elaborability-synth : {Γ : tctx} {e : hexp} {τ : htyp} →
Γ ⊢ e => τ →
Σ[... |
open import Agda.Builtin.Char
open import Agda.Builtin.Coinduction
open import Agda.Builtin.IO
open import Agda.Builtin.List
open import Agda.Builtin.Unit
open import Agda.Builtin.String
data Colist {a} (A : Set a) : Set a where
[] : Colist A
_∷_ : A → ∞ (Colist A) → Colist A
{-# FOREIGN GHC
data Colist a =... |
module Categories.Comonad.Cofree where
|
-- Andreas, 2011-10-06
module Issue483c where
data _≡_ {A : Set}(a : A) : A → Set where
refl : a ≡ a
record _×_ (A B : Set) : Set where
constructor _,_
field fst : A
snd : B
postulate
A : Set
f : .A → A
-- this succeeds
test : let X : .A → A
X = _
in .(x : A) → (X ≡ f) × (X (f x... |
------------------------------------------------------------------------
-- Alpha-equivalence
------------------------------------------------------------------------
open import Atom
module Alpha-equivalence (atoms : χ-atoms) where
open import Equality.Propositional
open import Prelude hiding (const)
open import B... |
-- {-# OPTIONS -v tc.term.exlam:100 -v extendedlambda:100 -v int2abs.reifyterm:100 -v tc.with:100 -v tc.mod.apply:100 #-}
module Issue778b (Param : Set) where
open import Issue778M Param
data D : (Nat → Nat) → Set where
d : D pred → D pred
test : (f : Nat → Nat) → D f → Nat
test .pred (d x) = bla
where bla : Nat... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import Groups.Definition
open import Setoids.Setoids
open import Groups.Subgroups.Definition
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Groups.Subgroups.Normal.Definition {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ : A → A → A} (G :... |
------------------------------------------------------------------------------
-- Distributive laws on a binary operation: Lemma 3
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-univer... |
module nat-tests where
open import eq
open import nat
open import nat-division
open import nat-to-string
open import product
{- you can prove x + 0 ≡ x and 0 + x ≡ x without induction, if you
use this more verbose definition of addition: -}
_+a_ : ℕ → ℕ → ℕ
0 +a 0 = 0
(suc x) +a 0 = (suc x)
0 +a (suc y) = (suc y)
... |
{-# OPTIONS --cubical --safe --exact-split --without-K #-}
-- this depends mainly on agda/cubical, but also uses the standard library for `Function`
module scratch where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.GroupoidLaws
open import Cubical.Foundations.HLevels
open import Cubical.Rel... |
data Bool : Set where
true false : Bool
data Nat : Set where
zero : Nat
suc : Nat → Nat
one : Nat
one = suc zero
two : Nat
two = suc one
data Fin : Nat → Set where
zero : ∀{n} → Fin (suc n)
suc : ∀{n} (i : Fin n) → Fin (suc n)
--This part works as expected:
s : ∀ n → (f : (k : Fin n) → Bool) → Fin (su... |
{-# OPTIONS --rewriting #-}
open import Reflection hiding (return; _>>=_) renaming (_≟_ to _≟r_)
open import Data.List hiding (_++_)
open import Data.Vec as V using (Vec; updateAt)
open import Data.Unit
open import Data.Nat as N
open import Data.Nat.Properties
open import Data.Fin using (Fin; #_; suc; zero)
open impo... |
open import Structure.Operator.Monoid
open import Structure.Setoid
open import Type
module Numeral.Natural.Oper.Summation {ℓᵢ ℓ ℓₑ} {I : Type{ℓᵢ}} {T : Type{ℓ}} {_▫_ : T → T → T} ⦃ equiv : Equiv{ℓₑ}(T) ⦄ ⦃ monoid : Monoid{T = T}(_▫_) ⦄ where
open Monoid(monoid)
import Lvl
open import Data.List
open import Data.L... |
------------------------------------------------------------------------
-- Vectors, defined using a recursive function
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Equality
module Vec
{reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexi... |
open import Signature
import Program
module Observations (Σ : Sig) (V : Set) (P : Program.Program Σ V) where
open import Terms Σ
open import Program Σ V
open import Rewrite Σ V P
open import Function
open import Relation.Nullary
open import Relation.Unary
open import Data.Product as Prod renaming (Σ to ⨿)
open import... |
module ImportWarnings where
open import ImportWarningsB
-- A warning in the top-level file
{-# REWRITE #-}
-- make sure that this file is long enough to detect if we inherit
-- also the warning highlighting
fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo... |
open import Type
open import Structure.Setoid
module Structure.Operator.Lattice {ℓ ℓₑ} (L : Type{ℓ}) ⦃ equiv-L : Equiv{ℓₑ}(L) ⦄ where
import Lvl
open import Functional
import Function.Names as Names
open import Logic
open import Logic.IntroInstances
open import Logic.Propositional
open import Logic.Predicat... |
open import Agda.Primitive
open import Agda.Builtin.Nat
open import Agda.Builtin.Bool
-----------------------------------------------------
-- Σ types
-----------------------------------------------------
data Σ {A : Set} (P : A → Set) : Set where
Σ_intro : ∀ (a : A) → P a → Σ P
----------------------------------... |
open import Oscar.Prelude
open import Oscar.Class
open import Oscar.Class.Leftunit
open import Oscar.Class.Reflexivity
open import Oscar.Class.Transitivity
module Oscar.Class.Transrightidentity where
module Transrightidentity
{𝔬} {𝔒 : Ø 𝔬}
{𝔯} (_∼_ : 𝔒 → 𝔒 → Ø 𝔯)
{ℓ} (_∼̇_ : ∀ {x y} → x ∼ y → x ∼ y → Ø ... |
module Types where
import Level
open import Data.Unit as Unit renaming (tt to ∗)
open import Data.List as List
open import Data.Product
open import Categories.Category using (Category)
open import Function
open import Relation.Binary.PropositionalEquality as PE hiding ([_]; subst)
open import Relation.Binary using (m... |
module Structure.OrderedField where
import Lvl
open import Data.Boolean
open import Data.Boolean.Proofs
import Data.Either as Either
open import Data.Tuple as Tuple
open import Functional
open import Logic
open import Logic.Classical
open import Logic.IntroInstances
open import Logic.Propositional
open impor... |
module Global where
open import Data.List
open import Data.Maybe
open import Data.Product
open import Relation.Binary.PropositionalEquality
open import Typing
-- specific
data PosNeg : Set where
POS NEG POSNEG : PosNeg
-- global session context
SEntry = Maybe (STypeF SType × PosNeg)
SCtx = List SEntry
-- SSplit ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Products of nullary relations
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Relation.Nullary.Product where
open import Data.Product
open imp... |
module Impure.STLCRef.Readme where
open import Impure.STLCRef.Syntax
open import Impure.STLCRef.Welltyped
open import Impure.STLCRef.Eval
open import Impure.STLCRef.Properties.Soundness
|
-- You can omit the right hand side if you pattern match on an empty type. But
-- you have to do the matching.
module NoRHSRequiresAbsurdPattern where
data Zero : Set where
good : {A : Set} -> Zero -> A
good ()
bad : {A : Set} -> Zero -> A
bad h
|
open import FRP.JS.Maybe using ( Maybe ; just ; nothing )
open import FRP.JS.Bool using ( Bool ; true ; false ; _∨_ ; _∧_ )
open import FRP.JS.True using ( True ; tt ; contradiction ; ∧-intro ; ∧-elim₁ ; ∧-elim₂ )
open import FRP.JS.Nat using ( ℕ ; _+_ ; _∸_ )
open import FRP.JS.Keys using ( Keys ; IKeys ; _<?_ ; sorte... |
open import Web.Semantic.DL.ABox.Interp using ( _*_ )
open import Web.Semantic.DL.Category.Object using ( Object )
open import Web.Semantic.DL.Category.Morphism using ( _⇒_ ; _≣_ ; _⊑_ ; _,_ )
open import Web.Semantic.DL.Category.Composition using ( _∙_ )
open import Web.Semantic.DL.Category.Properties.Composition.Lemm... |
module Issue328 where
mutual
postulate D : Set
-- An internal error has occurred. Please report this as a bug.
-- Location of the error: src/full/Agda/Syntax/Concrete/Definitions.hs:398
|
module Elem where
open import Prelude
open import Star
Elem : {X : Set}(R : Rel X) -> Rel X
Elem R x y = Star (LeqBool [×] R) (false , x) (true , y)
|
module Test where
open import LF
open import IID
-- r←→gArgs-subst eliminates the identity proof stored in the rArgs. If this proof is
-- by reflexivity r←→gArgs-subst is a definitional identity. This is the case
-- when a = g→rArgs a'
r←→gArgs-subst-identity :
{I : Set}(γ : OPg I)(U : I -> Set)
(C : (i : I) -... |
{-# OPTIONS --safe --without-K #-}
module Erased-cubical.Without-K where
data D : Set where
c : D
|
open import Everything
module Test.Functor where
List = List⟨_⟩
module _
{a b} {A : Set a} {B : Set b}
where
map-list : (A → B) → List A → List B
map-list f ∅ = ∅
map-list f (x , xs) = f x , map-list f xs
instance
SurjtranscommutativityList : ∀ {ℓ} → Surjtranscommutativity.class Function⟦ ℓ ⟧ (MFunct... |
module Imports.Test where
open import Common.Level
record Foo (ℓ : Level) : Set ℓ where
|
-- {-# OPTIONS -v scope:10 -v scope.inverse:100 #-}
open import Common.Equality
open import A.Issue1635 Set
test : ∀ x → x ≡ foo
test x = refl
-- ERROR:
-- x != .#A.Issue1635-225351734.foo of type Foo
-- when checking that the expression refl has type x ≡ foo
-- SLIGHTLY BETTER:
-- x != .A.Issue1635.Foo.foo of type... |
{-# OPTIONS --safe --without-K #-}
open import Generics.Prelude hiding (lookup)
open import Generics.Telescope
open import Generics.Desc
open import Generics.HasDesc
module Generics.Constructions.Case
{P I ℓ} {A : Indexed P I ℓ}
(H : HasDesc A) (open HasDesc H)
{p c} (Pr : Pred′ I λ i → A′ (p , i) → Set c)
wh... |
open import Agda.Builtin.Bool
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit
P : Bool → Set
P true = Bool
P false = Bool
f : (b : Bool) → P b
f true = true
f false = false
pattern varg x = arg (arg-info visible relevant) x
create-constraint : TC Set
create-constrai... |
module Numeric.Nat.LCM.Properties where
open import Prelude
open import Numeric.Nat.Divide
open import Numeric.Nat.Divide.Properties
open import Numeric.Nat.LCM
is-lcm-unique : ∀ {m m₁ a b} → IsLCM m a b → IsLCM m₁ a b → m ≡ m₁
is-lcm-unique {m} {m₁} (is-lcm a|m b|m lm) (is-lcm a|m₁ b|m₁ lm₁) =
divides-antisym (lm... |
{-# OPTIONS --without-K #-}
module function.extensionality.computation where
open import equality
open import function.isomorphism
open import function.core
open import function.extensionality.core
open import function.extensionality.proof
open import function.extensionality.strong
funext-inv-hom : ∀ {i j}{X : Set i}... |
module trie where
open import string
open import maybe
open import trie-core public
open import empty
trie-lookup : ∀{A : Set} → trie A → string → maybe A
trie-lookup t s = trie-lookup-h t (string-to-𝕃char s)
trie-insert : ∀{A : Set} → trie A → string → A → trie A
trie-insert t s x = trie-insert-h t (string-to-𝕃ch... |
module Everything where
-- Categories
import Categories.Category
-- 2-categories
-- XXX need to finish the last 3 laws
import Categories.2-Category
-- The strict 2-category of categories
-- XXX laws not proven yet
-- import Categories.2-Category.Categories
-- Adjunctions between functors
import Categories.Adjunctio... |
open import Common.Prelude
module TestHarness where
record ⊤ : Set where
data ⊥ : Set where
T : Bool → Set
T true = ⊤
T false = ⊥
infixr 4 _,_
data Asserts : Set where
ε : Asserts
_,_ : Asserts → Asserts → Asserts
assert : (b : Bool) → {b✓ : T b} → String → Asserts
Tests : Set
Tests = ⊤ → Asserts
|
open import Agda.Builtin.Coinduction
open import Agda.Builtin.Equality
open import Agda.Builtin.List
open import Agda.Builtin.Nat
infixr 5 _∷_
data Stream (A : Set) : Set where
_∷_ : (x : A) (xs : ∞ (Stream A)) → Stream A
head : ∀ {A} → Stream A → A
head (x ∷ xs) = x
tail : ∀ {A} → Stream A → Stream A
tail (x ∷ x... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.types.Pi
open import lib.types.TwoSemiCategory
open import lib.two-semi-categories.Functor
module lib.two-semi-categories.FunCategory where
module _ {i j k} (A : Type i) (G : TwoSemiCategory j k) where
private
module G = TwoSemiCat... |
module Prelude.Sum where
open import Agda.Primitive
open import Prelude.Empty
open import Prelude.Unit
open import Prelude.List
open import Prelude.Functor
open import Prelude.Applicative
open import Prelude.Monad
open import Prelude.Equality
open import Prelude.Decidable
open import Prelude.Product
open import Prelu... |
module snoc where
open import unit
open import empty
open import bool
open import product
data Snoc (A : Set) : Set where
[] : Snoc A
_::_ : Snoc A → A → Snoc A
infixl 6 _::_ _++_
[_] : {A : Set} → A → Snoc A
[ x ] = [] :: x
_++_ : {A : Set} → Snoc A → Snoc A → Snoc A
[] ++ l₂ = l₂
(l₁ :: x) ++ l₂ = (l₁ ++ l₂)... |
{-# OPTIONS --allow-unsolved-metas #-}
module nat where
open import Data.Nat
open import Data.Nat.Properties
open import Data.Empty
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Relation.Binary.Core
open import Relation.Binary.Definitions
open import logic
open import ... |
-- Andreas, 2021-04-21, issue #5334
-- Improve sorting of constructors to data for interleaved mutual blocks.
{-# OPTIONS --allow-unsolved-metas #-}
module Issue5334 where
module Works where
data Nat : Set where
zero : Nat
data Fin : Nat → Set where
zero : Fin {!!}
interleaved mutual
data Nat : Set
... |
module Metaprog2016 where
open import Data.List using (List) renaming ([] to ⌀)
open import Data.Maybe using (Maybe)
open import Data.Product using (_×_)
open import Data.Unit using () renaming (⊤ to 𝟙)
-- TOWARDS INTENSIONAL ANALYSIS OF SYNTAX
--
-- Miëtek Bak
-- mietek@bak.io
--
-- http://github.com/mietek/meta... |
module _ where
record Structure : Set1 where
infixl 20 _×_
infix 8 _⟶_
infixl 20 _,_
infixr 40 _∘_
infix 5 _~_
field
Type : Set
_×_ : Type → Type → Type
_⟶_ : Type → Type → Set
_∘_ : ∀ {X Y Z} → Y ⟶ Z → X ⟶ Y → X ⟶ Z
_,_ : ∀ {X A B} → X ⟶ A → X ⟶ B → X ⟶ A × B
π₁ : ∀ {A B} →... |
-- Andreas, 2016-01-19, issue raised by Twey
-- {-# OPTIONS -v 10 #-}
{-# OPTIONS --allow-unsolved-metas #-}
Rel : Set → Set₁
Rel A = A → A → Set
record Category : Set₁ where
field
Obj : Set
_⇒_ : Rel Obj -- unfolding the definition of Rel removes the error
record Product (C : Category) (A B : Category.Ob... |
{-
This file introduces the "powerset" of a type in the style of
Escardó's lecture notes:
https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/HoTT-UF-Agda.html#propositionalextensionality
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Foundations.Powerset where
open import Cubical.Fou... |
{-# OPTIONS --safe #-}
module Issue2792.Safe where
|
{-# OPTIONS --without-K --exact-split --safe #-}
open import Fragment.Algebra.Signature
module Fragment.Algebra.Algebra (Σ : Signature) where
open import Level using (Level; _⊔_; suc)
open import Data.Vec using (Vec)
open import Data.Vec.Relation.Binary.Pointwise.Inductive using (Pointwise)
open import Relation.Bina... |
{-
This type ℕ₋₂ was originally used as the index to n-truncation in order to
be consistent with the notation in the HoTT book. However, ℕ was already
being used as an analogous index in Foundations.HLevels, and it became
clear that having two different indexing schemes for truncation levels was
very inco... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
-- Mainly *properties* of isomorphisms, and a lot of other things too
-- TODO: split things up more semantically?
module Categories.Morphism.Isomorphism {o ℓ e} (𝒞 : Category o ℓ e) where
open import Level using (_⊔_)
open import Function using (fl... |
module Generic.Test.Data.Lift where
open import Generic.Main as Main hiding (Lift; lift; lower)
Lift : ∀ {α} β -> Set α -> Set (α ⊔ β)
Lift = readData Main.Lift
pattern lift x = !#₀ (relv x , lrefl)
lower : ∀ {α} {A : Set α} β -> Lift β A -> A
lower β (lift x) = x
|
------------------------------------------------------------------------
-- Extra lemmas about substitutions
------------------------------------------------------------------------
{-# OPTIONS --safe --without-K #-}
module Data.Fin.Substitution.ExtraLemmas where
open import Data.Fin using (Fin; zero; suc)
open impo... |
{-# OPTIONS --cubical --safe #-}
module Relation.Binary.Equivalence.PropHIT where
open import Prelude
open import Relation.Nullary.Stable
open import HITs.PropositionalTruncation
open import HITs.PropositionalTruncation.Sugar
open import Relation.Binary
infix 4 _≐_
_≐_ : A → A → Type _
x ≐ y = ∥ x ≡ y ∥
import Rela... |
module Extensions.ListFirst where
open import Prelude hiding (_⊔_)
open import Data.Product
open import Data.List
open import Data.List.Any
open Membership-≡ hiding (find)
open import Level
-- proof that an element is the first in a vector to satisfy the predicate B
data First {a b} {A : Set a} (B : A → Set b) : (x ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some theory for Semigroup
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Algebra using (Semigroup)
module Algebra.Properties.Semigroup {... |
------------------------------------------------------------------------
-- Infinite grammars
------------------------------------------------------------------------
-- The grammar language introduced below is not more expressive than
-- the one in Grammar.Infinite.Basic. There are two reasons for
-- introducing this... |
{- Copyright © 2015 Benjamin Barenblat
Licensed under the Apache License, Version 2.0 (the ‘License’); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... |
module FRP.JS.Bool where
open import FRP.JS.Primitive public using ( Bool ; true ; false )
not : Bool → Bool
not true = false
not false = true
{-# COMPILED_JS not function(x) { return !x; } #-}
_≟_ : Bool → Bool → Bool
true ≟ b = b
false ≟ b = not b
{-# COMPILED_JS _≟_ function(x) { return function(y) { return x... |
module Text.Greek.SBLGNT.Phil where
open import Data.List
open import Text.Greek.Bible
open import Text.Greek.Script
open import Text.Greek.Script.Unicode
ΠΡΟΣ-ΦΙΛΙΠΠΗΣΙΟΥΣ : List (Word)
ΠΡΟΣ-ΦΙΛΙΠΠΗΣΙΟΥΣ =
word (Π ∷ α ∷ ῦ ∷ ∙λ ∷ ο ∷ ς ∷ []) "Phil.1.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "Phil.1.1"
∷ word (Τ ∷ ι ∷ μ ∷ ό ... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Orders.Total.Definition
module Orders.Total.Lemmas {a b : _} {A : Set a} (order : TotalOrder A {b}) where
open TotalOrder order
equivMin : {x y : A} → (x < y) → min x y ≡ x
equivMin {x} {y} x<y with totality x y
equivMin {x}... |
module Dave.LeibnizEquality where
open import Dave.Equality public
_≐_ : ∀ {A : Set} (x y : A) → Set₁
_≐_ {A} x y = ∀ (P : A → Set) → P x → P y
refl-≐ : ∀ {A : Set} {x : A} → x ≐ x
refl-≐ P Px = Px
trans-≐ : ∀ {A : Set} {x y z : A} → x ≐ y → y ≐ z → x ≐ z
trans-≐ x≐y y≐z P Px = y≐z P (x≐y... |
------------------------------------------------------------------------
-- Code used to construct tactics aimed at making equational reasoning
-- proofs more readable
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Equality
module Tactic.By {c⁺... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Unit.Properties where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Nat
open import Cubical.Data.Unit.Base
open import Cubical.Data.Prod.Base
open imp... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Relation.Binary.Base where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
open import Cubical.HITs.SetQuotients.Base
open import Cubical.HITs.Propositio... |
{-# OPTIONS --cubical --no-import-sorts #-}
module Number.Bundles2 where
open import Agda.Primitive renaming (_⊔_ to ℓ-max; lsuc to ℓ-suc; lzero to ℓ-zero)
open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc)
-- open import Cubical.Foundations.Logic
-- open import Cubical.Structures.Rin... |
-- {-# OPTIONS -v tc.meta.assign:50 #-}
module Issue483c where
import Common.Level
data _≡_ {A : Set}(a : A) : A → Set where
refl : a ≡ a
data ⊥ : Set where
record ⊤ : Set where
refute : .⊥ → ⊥
refute ()
mk⊤ : ⊥ → ⊤
mk⊤ ()
X : .⊤ → ⊥
bad : .(x : ⊥) → X (mk⊤ x) ≡ refute x
X = _
bad x = refl
false : ⊥
false... |
------------------------------------------------------------------------
-- Lemmas related to bisimilarity and CCS, implemented using the
-- coinductive definition of bisimilarity
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
open import Prelude
module Bisimil... |
-- A certified implementation of the extended Euclidian algorithm,
-- which in addition to the gcd also computes the coefficients of
-- Bézout's identity. That is, integers x and y, such that
-- ax + by = gcd a b.
-- See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
-- for details.
module Numeric.Nat.GCD... |
module Naturals where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
-- type definition
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
-- bind builtin (aka Haskell integers) to my natural type
{-# BUILTIN NATURAL ℕ #-}
-- define addition pro... |
{-# OPTIONS --safe --warning=error #-}
open import Sets.Cardinality.Infinite.Definition
open import Sets.EquivalenceRelations
open import Setoids.Setoids
open import Groups.FreeGroup.Definition
open import Groups.Homomorphisms.Definition
open import Groups.Definition
open import Decidable.Sets
open import Numbers.Natu... |
open import Agda.Primitive.Cubical
test : (J : IUniv) → J → J
test J j = primHComp {φ = i0} (λ k → λ ()) j
|
{-# OPTIONS --allow-unsolved-metas #-}
-- {-# OPTIONS -v tc.meta:45 #-}
-- Andreas, 2014-12-07 found a bug in pruning
open import Common.Prelude
open import Common.Product
open import Common.Equality
postulate
f : Bool → Bool
test : let
X : Bool → Bool → Bool
X = _
Y : Bool
Y = _
in ∀ b → Y ≡ f ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.