(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(* This file is (C) Copyright 2006-2015 Microsoft Corporation and Inria. *)
(** This file contains the basic definitions and notations for working with functions. The definitions provide for:
- Pair projections: p.1 == first element of a pair p.2 == second element of a pair These notations also apply to p : P /\ Q, via an and >-> pair coercion.
- Simplifying functions, beta-reduced by /= and simpl: #[#fun : T => E#]# == constant function from type T that returns E #[#fun x => E#]# == unary function #[#fun x : T => E#]# == unary function with explicit domain type #[#fun x y => E#]# == binary function #[#fun x y : T => E#]# == binary function with common domain type #[#fun (x : T) y => E#]# \ #[#fun (x : xT) (y : yT) => E#]# | == binary function with (some) explicit, #[#fun x (y : T) => E#]# / independent domain types for each argument
- Partial functions using option type: oapp f d ox == if ox is Some x returns f x, d otherwise odflt d ox == if ox is Some x returns x, d otherwise obind f ox == if ox is Some x returns f x, None otherwise omap f ox == if ox is Some x returns Some (f x), None otherwise olift f := Some \o f
- Singleton types: all_equal_to x0 == x0 is the only value in its type, so any such value can be rewritten to x0.
- A generic wrapper type: wrapped T == the inductive type with values Wrap x for x : T. unwrap w == the projection of w : wrapped T on T. wrap x == the canonical injection of x : T into wrapped T; it is equivalent to Wrap x, but is declared as a (default) Canonical Structure, which lets the Rocq HO unification automatically expand x into unwrap (wrap x). The delta reduction of wrap x to Wrap can be exploited to introduce controlled nondeterminism in Canonical Structure inference, as in the implementation of the mxdirect predicate in matrix.v.
- The empty type: void == a notation for the Empty_set type of the standard library. of_void T == the canonical injection void -> T.
- Sigma types: tag w == the i of w : {i : I & T i}. tagged w == the T i component of w : {i : I & T i}. Tagged T x == the {i : I & T i} with component x : T i. tag2 w == the i of w : {i : I & T i & U i}. tagged2 w == the T i component of w : {i : I & T i & U i}. tagged2' w == the U i component of w : {i : I & T i & U i}. Tagged2 T U x y == the {i : I & T i} with components x : T i and y : U i. sval u == the x of u : {x : T | P x}. s2val u == the x of u : {x : T | P x & Q x}. The properties of sval u, s2val u are given by lemmas svalP, s2valP, and s2valP'. We provide coercions sigT2 >-> sigT and sig2 >-> sig >-> sigT. A suite of lemmas (all_sig, ...) let us skolemize sig, sig2, sigT, sigT2 and pair, e.g., have /all_sig#[#f fP#]# (x : T): {y : U | P y} by ... yields an f : T -> U such that fP : forall x, P (f x). - Identity functions: id == NOTATION for the explicit identity function fun x => x. @id T == notation for the explicit identity at type T. idfun == an expression with a head constant, convertible to id; idfun x simplifies to x. @idfun T == the expression above, specialized to type T. phant_id x y == the function type phantom _ x -> phantom _ y. *** In addition to their casual use in functional programming, identity functions are often used to trigger static unification as part of the construction of dependent Records and Structures. For example, if we need a structure sT over a type T, we take as arguments T, sT, and a "dummy" function T -> sort sT: Definition foo T sT & T -> sort sT := ... We can avoid specifying sT directly by calling foo (@id T), or specify the call completely while still ensuring the consistency of T and sT, by calling @foo T sT idfun. The phant_id type allows us to extend this trick to non-Type canonical projections. It also allows us to sidestep dependent type constraints when building explicit records, e.g., given Record r := R {x; y : T(x)}. if we need to build an r from a given y0 while inferring some x0, such that y0 : T(x0), we pose Definition mk_r .. y .. (x := ...) y' & phant_id y y' := R x y'. Calling @mk_r .. y0 .. id will cause Rocq to use y' := y0, while checking the dependent type constraint y0 : T(x0).
- Extensional equality for functions and relations (i.e. functions of two arguments): f1 =1 f2 == f1 x is equal to f2 x for all x. f1 =1 f2 :> A == ... and f2 is explicitly typed. f1 =2 f2 == f1 x y is equal to f2 x y for all x y. f1 =2 f2 :> A == ... and f2 is explicitly typed.
- Composition for total and partial functions: f^~ y == function f with second argument specialised to y, i.e., fun x => f x y CAVEAT: conditional (non-maximal) implicit arguments of f are NOT inserted in this context @^~ x == application at x, i.e., fun f => f x #[#eta f#]# == the explicit eta-expansion of f, i.e., fun x => f x CAVEAT: conditional (non-maximal) implicit arguments of f are NOT inserted in this context. fun=> v := the constant function fun _ => v. f1 \o f2 == composition of f1 and f2. Note: (f1 \o f2) x simplifies to f1 (f2 x). f1 \; f2 == categorical composition of f1 and f2. This expands to to f2 \o f1 and (f1 \; f2) x simplifies to f2 (f1 x). pcomp f1 f2 == composition of partial functions f1 and f2.
- Properties of functions: injective f <-> f is injective. injective2 f <-> f(x,y) is injective. cancel f g <-> g is a left inverse of f / f is a right inverse of g. pcancel f g <-> g is a left inverse of f where g is partial. ocancel f g <-> g is a left inverse of f where f is partial. bijective f <-> f is bijective (has a left and right inverse). involutive f <-> f is involutive.
- Properties for operations. left_id e op <-> e is a left identity for op (e op x = x). right_id e op <-> e is a right identity for op (x op e = x). left_inverse e inv op <-> inv is a left inverse for op wrt identity e, i.e., (inv x) op x = e. right_inverse e inv op <-> inv is a right inverse for op wrt identity e i.e., x op (i x) = e. self_inverse e op <-> each x is its own op-inverse (x op x = e). idempotent_op op <-> op is idempotent for op (x op x = x). idempotent_fun f <-> f is idempotent (i.e., f \o f =1 f). associative op <-> op is associative, i.e., x op (y op z) = (x op y) op z. commutative op <-> op is commutative (x op y = y op x). left_commutative op <-> op is left commutative, i.e., x op (y op z) = y op (x op z). right_commutative op <-> op is right commutative, i.e., (x op y) op z = (x op z) op y. left_zero z op <-> z is a left zero for op (z op x = z). right_zero z op <-> z is a right zero for op (x op z = z). left_distributive op1 op2 <-> op1 distributes over op2 to the left: (x op2 y) op1 z = (x op1 z) op2 (y op1 z). right_distributive op1 op2 <-> op distributes over add to the right: x op1 (y op2 z) = (x op1 z) op2 (x op1 z). interchange op1 op2 <-> op1 and op2 satisfy an interchange law: (x op2 y) op1 (z op2 t) = (x op1 z) op2 (y op1 t). Note that interchange op op is a commutativity property. left_injective op <-> op is injective in its left argument: x op y = z op y -> x = z. right_injective op <-> op is injective in its right argument: x op y = x op z -> y = z. left_loop inv op <-> op, inv obey the inverse loop left axiom: (inv x) op (x op y) = y for all x, y, i.e., op (inv x) is always a left inverse of op x rev_left_loop inv op <-> op, inv obey the inverse loop reverse left axiom: x op ((inv x) op y) = y, for all x, y. right_loop inv op <-> op, inv obey the inverse loop right axiom: (x op y) op (inv y) = x for all x, y. rev_right_loop inv op <-> op, inv obey the inverse loop reverse right axiom: (x op (inv y)) op y = x for all x, y. Note that familiar "cancellation" identities like x + y - y = x or x - y + y = x are respectively instances of right_loop and rev_right_loop The corresponding lemmas will use the K and NK/VK suffixes, respectively.
- Morphisms for functions and relations: {morph f : x / a >-> r} <-> f is a morphism with respect to functions (fun x => a) and (fun x => r); if r == R#[#x#]#, this states that f a = R#[#f x#]# for all x. {morph f : x / a} <-> f is a morphism with respect to the function expression (fun x => a). This is shorthand for {morph f : x / a >-> a}; note that the two instances of a are often interpreted at different types. {morph f : x y / a >-> r} <-> f is a morphism with respect to functions (fun x y => a) and (fun x y => r). {morph f : x y / a} <-> f is a morphism with respect to the function expression (fun x y => a). {homo f : x / a >-> r} <-> f is a homomorphism with respect to the predicates (fun x => a) and (fun x => r); if r == R#[#x#]#, this states that a -> R#[#f x#]# for all x. {homo f : x / a} <-> f is a homomorphism with respect to the predicate expression (fun x => a). {homo f : x y / a >-> r} <-> f is a homomorphism with respect to the relations (fun x y => a) and (fun x y => r). {homo f : x y / a} <-> f is a homomorphism with respect to the relation expression (fun x y => a). {mono f : x / a >-> r} <-> f is monotone with respect to projectors (fun x => a) and (fun x => r); if r == R#[#x#]#, this states that R#[#f x#]# = a for all x. {mono f : x / a} <-> f is monotone with respect to the projector expression (fun x => a). {mono f : x y / a >-> r} <-> f is monotone with respect to relators (fun x y => a) and (fun x y => r). {mono f : x y / a} <-> f is monotone with respect to the relator expression (fun x y => a).
The file also contains some basic lemmas for the above concepts. Lemmas relative to cancellation laws use some abbreviated suffixes: K - a cancellation rule like esymK : cancel (@esym T x y) (@esym T y x). LR - a lemma moving an operation from the left hand side of a relation to the right hand side, like canLR: cancel g f -> x = g y -> f x = y. RL - a lemma moving an operation from the right to the left, e.g., canRL. Beware that the LR and RL orientations refer to an "apply" (back chaining) usage; when using the same lemmas with "have" or "move" (forward chaining)
the directions will be reversed!. **)
RL - athat the LR and usage; when the directions
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 Unset Strict Implicit. UnsetNotation" 'fun' : T =>E ]" (t ,
(** Parsing / printing declarations. *)Notation[''x>] (at 0,
Reserved~y at10, y at level 8, no associativity,
format "f ^~ y").
Reserved NotationNotation" '' x : T = E "( level
format x)
Reserved Notation"[ 'eta' f ]" (at Notation[funy=> "( level 0
Reserved Notation"'fun' => E" (at level Reserved "['fun' xy: T = E] (tlevel 0
Reserved "[ fun T y = E]" at level
formatname, "'[hv' [' :java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 76
Reserved" fun' => E"( ,
x name, format "'[hv' [ 'fun' x => '/ ' E ] ']'").
Reserved Notation"[ 'fun' x : T => E ]" (at level 0,
x name, format "'[hv' [ 'fun' x : T => '/ ' E ] ']'").
Reserved Notation"[ 'fun' x y => E ]" (at level, y name "[ '' (x : T) (y : U ) = E ").
x name, y name, format "'[hv' [ 'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Reserved "[ 'fun' x : T = E]" (at 0,
x name, y name, format "'[hv' [ 'fun' x y : Reserved Notation "f =1 g :> A" (at level 70, g at level, A at level 9). "'x E ] ( 0
x name f= level level 9java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
Reserved Notation" Notation" ;g at, ,
, yname "'[hv fun x( y =>'/ ]".
Reserved Notation"[ 'fun' ( x : T ) ( y : U ) => E ]" (at level 0,
x name, y name
Reserved Notationxnameformat" morph'f: x/a >> r }".
Reserved Notation"f =1 g :> A" (at level 70, g at next level, A at level 90).
Reserved "f=2 g"( level, associativity
Reserved Notation"f =2 g :> A" (atxname "{ '' f : x/ a }".
Reserved Notation"f \o g" (at level 50, format "f Notation { '' f :xy/a>>r} (tlevel0 f level 99java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
Reserved f\ g"at level 0 associativity,
format "f \; '/ ' g").
Reserved Notation{homox -r "atlevel 0, f at level 9java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
x name, Notation{'' } levelf atlevel 9
Reserved{'orph x/a} at0,f 99
x name, format "{ 'morph' f : xReserved Notation "{ 'homo' f : x y / Notation { '' : / - r} atlevel 0, f level 9java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
, level
x name, y name, format " Notation " homo: y a } at,f at 9,
Reserved Notation"{ 'morph' f : x y / a }" (at level 0, f at level 99,
x name, y name, format "{ 'morph' f xname,y name "{ 'homo : x y / a }").
Reserved Notation"{ 'homo' f : x / a >-> r }" (at level 0, f at level 99,
x name, formatReservedNotation"{'homo' f: x /~a}"( level0, f at level,
Reserved Notation"{ 'homo' f : x / a }" (at level 0, f at level 99,
x, format{'homo : x / a ".
Reserved Notation"{ 'homo' f : x y / a >-> r }" (at level Notation" 'ono' :x/a>> r } (at level 0, f level 9
x name, y name, format "{ 'homo'Reserved Notation "{ 'mono' f : x / Notation { '' f :/a } (at 0, f at level99
Reserved "{ 'homo' f :x y / a }"(at level,f at level9
x name, y name, format Notation" '' f : x y / a>->r } (at level0, f at level 9,
Reserved "{ 'homo f :x y /~ a } (at level 0, f at level 99,
x name, y name, format "{ 'homo' f : x y /~ a }").
Reserved Notation"{ 'mono' f : x / a >-> r }" (at level 0, f at level 99,
nameformat{'monof x / a >>r }).
Reserved Notation"{ 'mono' f : x / a }" (at level 0, f at level 99,
x nameformat mono :x/a})java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
Reserved " '' f:xy/a>- r } (atlevel0 fatl 9,
x name, y name, format "{ 'mono' f : x y / a >-> name, y name, format "{ 'monof :x y / a}")java.lang.StringIndexOutOfBoundsException: Range [58, 59) out of bounds for length 58
Reserved Notation"{ 'mono' f : x y / a }" (at level 0,#warning"]
x name , format '' f: /a})
Reserved Notation
x name Syntax for defining auxiliary recursive function.
Reserved Notation"@ 'id' T" (at level 10, T at level Fixoint foo_auxiliary (a3 : T3) ... :=
#[warning="-closed-notation-not-level-0"]
Reserved Notation"@ 'sval'" (at level 10, format + proofs about foo
(** Syntax for defining auxiliary recursive function. Usage: Section FooDefinition. Variables (g1 : T1) (g2 : T2). (globals) Fixoint foo_auxiliary (a3 : T3) ... := body, using #[#rec e3, ... #]# for recursive calls where " #[# 'rec' a3 , a4 , ... #]#" := foo_auxiliary. Definition foo x y .. := #[#rec e1, ... #]#. + proofs about foo
End FooDefinition. **)
Reserved Notation"[ 'rec' a ]" (at level 0,
format "[ 'rec' a ]").
Reserved Notation" '' a , b ]" ( level,
format "[ 'rec' a , b ]).
Reserved Notation"[ 'rec' a , b , c format" 'rec , , ]) " '' a ,b, c])java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
Reserved[ ]at
format "[ 'rec' a , b ,format "['' a, b c d e ]). Notationrec , ,d, ( level
format " rec' a , ]".
Reserved [''a , ,cd,e "(.
format"' d,e f,g ](at 0java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
Reserved" '' a , b ,c ,d e ,f,g ] (t level ,
format "[ 'rec' a , b , c , d , e , f , g ]")f "[ 'rec' a , b ,c , d, e, f , g , h, i]).
Reserved Notation"[ 'rec' a , b , c , d , e , f , g , h ]" (at level 0,
format "[ 'rec' a, b , , d , e ,f ,g ,h ]").
Reserved Notation"[ 'rec' a , b format "[ 'rec' a , b , c d ,e , f , g , h,i , j ]).
format "[ 'recDeclare Scope pair_scope.
Reserved Notation"[ '' a , b ,c ,d ,e,f, g,h , i,j ] (at level 0,
format "[ 'rec' a , b , c , d , e
DeclareScope pair_scope DelimitScope pair_scope with PAIR. OpenScope.
Notation erefl :=Notationsome=(@Some _) ( parsing. Notation ecast i T e x :( Definition esym := sym_eq. Definition nesym := sym_not_eq. Definitionetrans trans_eq Definition congr1 := f_equal. Definitioncongr2 : f_equal2. (** Force at least one implicit when used as a view. **)
Prenex esym.
(** A predicate for singleton types. **) Definition all_equal_to Definition congr2 := f_eq
Lemma unitE : all_equal_to tt Implicits nesym
(** A generic wrapper type **)
#[universes(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Structure T := Wrapunwrap T}.
Canonical wrap T x := @Wrap T x.
(** Notations for argument transpose **) Notation"f ^~ y" :Structure T := Wrapunwrap :T}. Notation@^~x": funf= ) :function_scope.
(** Definitions and notation for explicit functions with simplification,
i.e., which simpl and /= beta expand (this is complementary to nosimpl). **)
# Scope function_scope
Variant simpl_fun (aT rT : Type) (java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
Section SimplFun.
VariablesaTrT:Type
Definition fun_of_simpl (f :
End SimplFun.
Coercion fun_of_simpl : simpl_fun i.e., which simpl
otation"'un' : T => E] :=(SimplFun (fun _ : T => E)) : function_scope. Notation"[ 'fun' x => E ]" := (SimplFun (fun x => E)) : function_scope. Notation"['' x y = E ] :=(unx= funy=>E] function_scope. Notation"[ 'fun' x : T => E ]" := (SimplFun (fun x : T => E))
(only parsing) : function_scope SimplFun Notation"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(only parsing) : function_scope Notation x : T => E ] :( x: T=>[ y= )
(only parsing) : function_scope Notation"[ 'fun' x ( y : T ) =>
only) : function_scope Notation"[
(only) : function_scope
(** For delta functions in eqtype.v. **)"['' y >E] :=(fun x =>[ y=> ] function_scope. Definition aT (f :aT> ->rT: [ z = f z]
(** Extensional equality, for unary and binary functions, including syntactic
sugar. **)
Section
VariablesA BC :Type
Definition parsing function_scope
Definition eqrel (r s : C -> B -> A) : Prop := forall x y, ( ) .
Lemma frefl f : Lemma fsym Extensional equality, for unary and binary sugar.
Lemma A B C:Type.
eqfunjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
Lemma f . by]Qed
End ExtensionalEquality
Global Typeclasses. by move=> eq_fg eq_gh x; rewrite eq_fg. Qed.
Lemma oapp_comp_f omap_comp omap\ ) 1 g \ f. Proofby . Qed.
Lemma olift_comp : olift (g \o f) = olift g \o f. Proof. by []. Qed.
End OptionTheory.
(** The empty type. **)
Notation void := Empty_set.
Definition of_void T (x : void) : T := match x with
(** Strong sigma types. **)
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
Variables (I : Type) void= Empty_set.
Definition tag := projT1. Definition tagged : forall w, T_(tag w) Definition Tagged x := @existT I [eta T_] i x.
Definition tag2 (Definition of_voidx :void : x with. Definition Definition tagged2w:U_ w) := let:existT2_ _ _ := y. Definition Tagged2 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
End Tag.
Definition : forall,T_tag =@projT2I[ T_]java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 Arguments Tagged2 [I i].
Prenex ion tag2 w:@sigT2 I U_=let _ _i_ = i.
Coercion tag_of_tag2 I T_ U_ (w : @sigT2 I T_ U_) :=
(fun >T_ i*U_ i)%ype tagged2 tagged2)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
Lemma all_tag I T U :
(forall x : I, {y : T x & U
{f : forall Implicits Tagged tagged2
) => x case).
LemmaT
(forall i : I, {y : I java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 forallT i fi i,( } Proof. bycase/all_tag=> f /all_pair[]; exists f. Qed.
Lemma all_sig I T P :
( x :I,{ Tx|P y
{f : forall x, T x | forall x, P x (f x)}. Proofcaseall_tag;exists .
LemmaP Q :
(forall x : I, {y : T x | P x y & Q x y}) ->
{f{f : x, T x |forall,P x( x)&forall,Q x( x). Proof. bycase/all_sig= forall :I { T xy)-java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
Section Morphism.
Variables (aT rT sT : Type) (f : aT -> rT).
(** Morphism property for unary and binary functions **) Definition morphism_1 aF rF := forall xjava.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 0 Definition morphism_2 aOp unaryand binary *)
(** Homomorphism property for unary and binary relations **) Definition (aP :_- Prop , x - (f )java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 Definition ( rR _ ->_->Prop: forall x y,
(** Stability property for unary and binary relations **) Definition monomorphism_1 (aP rP : _ -> sT) := forall x, rPDefinition homomorphism_1 (P rP: _ - Prop = forallx, aPx->rP( x). Definition monomorphism_2 (aR rR : _ -> _ -> sT) forallx y,aR -> (f x)f ) forall x y, rR (f x)( ) =aR.
End Morphism.
Notation"{ 'morph' f : x / a >-> r }" :=
pe Notation"{ 'morph' f : x / a }" :=
( f ( x = a fun= ): . Notation"{ 'morphforall x y,rR( f y x y.
(morphism_2 f (fun x y => Morphism Notation"{ 'morph' f : x y / a }" :=
(morphism_2 f (fun x y => a) (fun x y => a)) : type_scope. Notation{ 'homo : / - ":
(homomorphism_1 f (fun x => aNotation"{'morph' f : x / a }" := Notation"{ 'homo' f : x / a }" :=
(homomorphism_1 f (fun x => a) (fun x => a)) : type_scopemorphism_1 fun >a ( x => ) type_scope. Notation"{ (orphism_2f(fun x y => a) (fun xy > r) :type_scope.
(homomorphism_2 f (fun x y "{ 'orph' f : x y/a } = Notation(morphism_2( x = )(fun = a):type_scope.
(homomorphism_2 f (fun"{ 'homo' f : x/a - r }": Notation{ 'omo ~a} =
(homomorphism_2 f (fun y x => a) (fun x y => a)) : type_scope. Notation{'mono: x /a>> ":
f (fun x = a (fun x >r):type_scope. Notation{'mono:x /a "=
(monomorphism_1 f (fun x => a) (fun x => a)) : type_scope. Notation"{ 'mono' f : x y / a >-> r }" :=
(monomorphism_2 f (fun x y => a) (fun x y => r)) : type_scope f (funy x= a)(funx y= a):. Notation '' f :xy /a} :
(monomorphism_2 f (fun x y => a) (fun x y => type_scope. Notation"{ 'mono' f : x y /~ a }" :=
(monomorphism_2(funyx = )( x y= ):type_scope
In an f( x ) .
weaker"'f y/}" inverse x >)fun= ) :.
We also define an intermediate version f( x >) (funx y >) .
partial function. In an intuitionistic setting, we weaker one gives only simplification, and the strong We also define partial function.
Section Injections.
Variables (rT aT : Type) (f : aT -> rT).
Definitioninjective x2 = f - =.
Definition cancel g : x, fx) Some
Definition pcancel: forall , g(f x)=Some
Definition ocancel (g : aT g: g > ( = (g y))
Lemma can_pcan g : cancel g -> pcancel (fun y => Some (g y)). Proof. byLemmapcan_inj g :pcancelg - .
Lemma pcan_inj
.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
Lemma can_inj g : cancel g -canLRy:cancel >x > yjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 Proof. by move/can_pcan; apply:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Lemma canLR g x y : . by=> fK < . Proof. by move=> fK ->. Qed.
Lemma g x g - f x=y > . Proofby movefK - .
End Injections.
Definition injective2 (rT java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 forall (x1 x2 : aT1) (y1 y2 : aT2), f x1 y1 = f x2 y2 ->
(x1 = x2) * (y1 = y2). Arguments injective2 [rT aT1
Lemma omapK {aT rT : Type} (f : aT -> rT) (g : rT -> aT) :
cancelcancel g - cancelomap (omap. Proof. by move=> fK [?|] //=; rewrite fK. Qed.
Lemma of_voidK ProofbycaseQed
(** cancellation lemmas for dependent type casts. **) Lemma esymK T x y : cancel (@esym T x y) (@esym T esymK x y cancel T x y) (esym x)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 Proof. bycase: y /. Qed.
Lemma etrans_id T x y (eqxy :Proof.bycase /. Qed Proofbycase: y eqxy..
Section InjectionsTheory.
Variables (
Lemma inj_id : injective (@id A). Proof [.Qedjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
Lemma inj_can_sym f'. bymove> injf;: injf'. Proof. by move
emma injective> h - injective (f \h. Proof. by move=> injf
Lemma inj_compr.by=> injfh(congr1/injfh.Qed Proof. by move=> injfh x y /(congr1 f can_comp h':cancel f '- cancelh' - cancel\h ('\of'.
Lemma can_comp f' h' : cancel.bymovefK hK; /= fK. Qed Proof. by move=> fK hK x; rewrite pcan_pcomph':
Lemma pcan_pcomp f' h' :
pcancel f f' -> pcancel h h' -> pcancel (f . bymove= fK x;rewrite fK=hK. Proof. by [f' : A -:-
Lemma ocan_comp [fo : B -> option A] [ho : C -> option B]
[f' A - ][': >]:
ocancel fo f' -> ocancel ho h' -> ocancel (obind fo \o ho) (h' \o f'). Proof
move=> java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0 byrewrite -[b in RHS]fK; case: (fo b) => //=; Proofby move> injfeqfg y rewrite2!qfg; apply: injf. Qed.
Lemma : f ->f 1 - injectivegjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 Proof = ' gK: injf;rewrite . Qed
Lemma eq_cang':cancel'-f= g- ' =1g'-cancel g. Proof. by move=> fK eqfg eqfg' x; rewrite -eqfg -eqfg'. Qed.
Lemma inj_can_eq f' : cancel f f' Bijections. Proof. by move=> fK injf' gK x
End InjectionsTheory.
SectionBijections
Variables (A B : Type) (f : B -> A).
Variant Lemma bij_inj : injective : f.
Hypothesis bijf : bijective.
Lemma bij_inj : injective f. Proof. bycase: bijf => g fK _; apply: can_inj fK. Qed.
Lemma bij_can_sym f' : cancel f'Lemma bij_can_sym' :cancel f < cancel f f' Proof.
java.lang.StringIndexOutOfBoundsException: Range [25, 5) out of bounds for length 48 bycase: bijf => h _ hK. Qed.
Lemma bij_can_eq f' f'' : cancel f f' -> cancel f f'' -> f' =1 f''. Proof. by move=> fK movefK '; :(inj_can_eq _bij_inj apply/. Qed.
End Bijections.
Section BijectionsTheory.
Variables ABC ) (f :B - )( : ->B.
Lemma eq_bij : bijective f -> forall g, f Proof. bycase> ff'fK'K eqfgexists' eapply; eauto.Qed.
Lemma : bijective- bijective- bijectivef \h). Proof. by move=> [f' fK f'K] [h' hK h'K]; exists (h' \o f'); apply: can_comp Qed.
Lemma inv_inj : injective f. (A : Type - A. Lemma inv_bij : bijective f. Proof. by java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 36
End Involutions.
Section OperationProperties.
Variables S T R : Type.
Section SopTisR. ImplicitType op : S -> T Involutions Definition left_inverse e inv op := forall OperationProperties Definition right_inverse e inv op := forall S T R Typejava.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23 Definition op S- T- R. Definition right_injective op := forall y, injective (op y). End.
Section SopTisS. ImplicitType op : S Definitionleft_injective := x, injective (^~ x). Definitionright_ide op=forall, x e =. Definition left_zero z op: x z x =zjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 Definition right_commutative op := forall x ySection SopTisS Definition left_distributive op add :=
add) (op )( y z) Definition right_loop inv op left_zero :=forall , opx=zjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 Definition rev_right_loop inv op := forall y, cancel (op^~ (inv y)) (op^~ y). End SopTisS.
Section op , (^~ inv))(^ )java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 ImplicitType op : S -> T -> T. Definition left_id e op := forallDefinitionleft_id := x,op e x = x. Definition right_zero z op := forall x, op x z = z. Definition left_commutative op := forall x y z, op x (op y z) = op y (op x z). Definition right_distributive op add = op y xz) forall x y z, op y ,op add) (op y) ( x ) Definition inv : x,cancel op)( (inv)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 Definition rev_left_loop inv op := forall x, cancel . End SopTisT.
Section SopSisT. ImplicitType op : S -> Sop := forall x, op x x = e. Definition Definition commutative = x y, x y xjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 Definition commutative op := forall x y, op x y =Section SopSisS End SopSisT
Section. ImplicitType op : S -> S -> S.
x. Definition associative op := forall x y z, op x (op y z) = opDefinitioninterchange op1 := Definition interchange op1 op2 :=
x ,op1 x y op2)= (op1)op1yt. End SopSisS.
Definition idempotent_fun (U : Type) (f : U -> U) := f \o f =1 f.
Lemma inr_inj {A B} : injective (@inr idempotent_fun :Typef : U- U =\ 1fjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
Lemma inl_inj {A B} : injective (@inl A B). Proof. by move=> ? ? []. Qed.
Messung V0.5
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.11Angebot
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.