More rings stuff (#83)

This commit is contained in:
Patrick Stevens
2019-11-23 13:53:54 +00:00
committed by GitHub
parent 660d7aa27c
commit 2ed7bd8044
12 changed files with 260 additions and 17 deletions

View File

@@ -1,10 +1,11 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Setoids.Setoids
open import Setoids.Subset
module Setoids.Functions.Definition where
WellDefined : {a b c d : _} {A : Set a} {B : Set b} (S : Setoid {a} {c} A) (T : Setoid {b} {d} B) (f : A B) Set (a c d)
WellDefined {A = A} S T f = {x y : A} Setoid.__ S x y Setoid.__ T (f x) (f y)
module Setoids.Functions.Definition {a b c d : _} {A : Set a} {B : Set b} where
WellDefined : (S : Setoid {a} {c} A) (T : Setoid {b} {d} B) (f : A B) Set (a c d)
WellDefined S T f = {x y : A} Setoid.__ S x y Setoid.__ T (f x) (f y)

View File

@@ -0,0 +1,19 @@
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Setoids.Setoids
open import Setoids.Subset
open import Setoids.Functions.Definition
open import Sets.EquivalenceRelations
module Setoids.Functions.Lemmas {a b c d : _} {A : Set a} {B : Set b} {S : Setoid {a} {c} A} {T : Setoid {b} {d} B} {f : A B} (w : WellDefined S T f) where
inverseImagePred : {e : _} {pred : B Set e} (sub : subset T pred) A Set (b d e)
inverseImagePred {pred = pred} subset a = Sg B (λ b (pred b) && (Setoid.__ T (f a) b))
inverseImageWellDefined : {e : _} {pred : B Set e} (sub : subset T pred) subset S (inverseImagePred sub)
inverseImageWellDefined sub {x} {y} x=y (b , (predB ,, fx=b)) = f x , (sub (symmetric fx=b) predB ,, symmetric (w x=y))
where
open Setoid T
open Equivalence eq