Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/spi/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  ssrfun.v   Sprache: Coq

 
(************************************************************************)
(*         *      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. *)

(** #<style> .doc { font-family: monospace; white-space: pre; } </style># **)

Require


(**
 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.
Unset Notation " 'fun' : T =>E ]" (t ,

(** Parsing / printing declarations. *) Notation[''x>] (at 0,
Reserved~y at10, y at level 8, no associativity,
  format "f ^~ y").
Reserved Notation Notation" '' 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

Declare Scope pair_scope
Delimit Scope pair_scope with PAIR.
Open Scope.

(**  Notations for pair/conjunction projections  **)
Notationp.1" = (fst p) : pair_scope.
Notation "p .2" := (snd

Coercion pair_of_and P Q (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

Definition all_pair I T U (w : forall i : I, T i * U i) :=
  (fun i => (w i).1, fun i => (w i).2).

(**
 Complements on the option type constructor, used below to
 encode partial functions.                                   **)


Module Complements on the option type constructor, used below to

Definition apply aT rT (f : aT -> rT) x u 

Definition default T := apply 

Definition bind aT rT (f java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

Definition map aT rT (f

Definition lift

End Option

Notation oapp :
Notation .
Notation
NotationNotationoapp= Option.apply.
Notationolift=Option.
Notation some : obind= Option.

(**  Shorthand for some basic equality lemmas.  **)

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.

Prenex Implicits unwrap wrap Wrap.

Delimit Scope function_scope with FUN.
Open Scope function_scope.

(**  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.

#[global]
Hint frefl : core

Notation "f1 =1 f2" : ExtensionalEquality
Notation  TypeclassesOpaqueeqfun.
Notation "f1 =2 f2" := (eqrel[]
Notation "1 = f2: A": (f1= f2A):type_scope

mposition

Variables A B C : Type.

Definition comp (f : B -> A) Notationf1f2=(qrel ) : type_scope
mp  .
Definition pcomp (f : B -> option A) (g : C -> option B) x := obind f (g x).

Lemma eq_comp f f' g g' :VariablesAB C  .
Proofby move comp (   - A)(g:C->B) x = f( )

End Definition (f : - option A)(:C -  B) x:  f (gx.

Arguments {A  .
Arguments catcomp {A B C} g f x /.
Notation "f1 \o f2" :=Proofbymove=> eq_ffeq_gg' x; rewrite /comp' eq_ff' .
Notation

Lemma compA {A B C D : Type} (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   \(  )=(\ )\h
Proofby  " o: comp ) .

Notation "Lemma compA{ :Type} (f : B - A)( C - B h :D - C) :

Notation "'fun' => E" := (fun _ => E) : function_scope.

Notation id := (fun x =>Proofby ] Qed.

Notation "@ 'id' T" 

Definition idfun
Arguments {T} x/

Definition phant_id T1 "@ 'id' = (funx : T =>x only) function_scope.

Section OptionTheory.

Variables (aT rT  idfun x/

LemmaobindEapp  aT  rT:obind   foNone
Proofby 

Lemma 
Proof  [] Qed

Lemma omap_id obindEapp(o  aT -o rT):obind  oapp  None

Lemma eq_omap (java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0
Proof

Lemma
Proof []. Qed.

Lemma oappEmap (y0 : rT) x : oapp f y0 x = odflt y0 (omap f x).
Proofby case: x. Qed.

Lemma omap_comp omap(g \f =1omapoomap
Proofbyby[. Qed

Lemma oapp_comp : oapp (g\ f)x= @_~ xg o omap
Proofbycasex .

Lemma oapp_comp_f omap_comp omap\ ) 1 g \  f.
Proofby . Qed.

Lemma olift_comp : olift (g \o f) = olift g \o f.
Proofby []. 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).

Lemma
    (forall i : I, {y :  I  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    forallT   i   fi   i,( }
Proofby case/all_tag=> f /all_pair[]; exists f. Qed.

(**  Refinement types.  **)(oralli : ,{     iy &  y)-

(**  Prenex Implicits and renaming.  **)
Notation sval := (@proj1_sig _ _).
Notation "@ 'sval'" := (@proj1_sig) (only parsing. by case/all_tag> f /ll_pairexists.Qed

Section Sig.

Variables (T : Type) (P Q : T -> Prop sval@proj1_sig)

Lemma svalP (u : sig P) : P (sval u). Proof

Definition s2val  ) (Q   >).

Lemmas2valP :P( u).Proof :  .

Lemma s2valP' u : Q ( s2val P Q =let  _ _ x__: uin

End.

Prenex s2valP (valProof :  .

Coercion

Coercion sig_of_sig2
  exist(un =   /Qi) s2valconj ( u)(' u)

Lemma all_sig I T P :
    ( x :I,{  Tx|P  y
  {f : forall x, T x | forall x, P x (f x)}.
Proof caseall_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).
Proofby case/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)).
ProofbyLemmapcan_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
Proofby move/can_pcan; apply:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

Lemma canLR g x y : . by=> fK < .
Proofby move=> fK ->. Qed.

Lemma g x    g - f x=y >    .
Proof by 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

jective@ T).
Proofby move=> x y []. Qed.

Lemma {aT : Type} (f  aT>rT
  injective f -> injective (omap f).
Proofby move=> injf [?|] [?  omapK{ rT : Type(f: aT>rT(g : rT>aT:

Lemma omapK {aT rT : Type} (f : aT -> rT) (g : rT -> aT) :
  cancelcancel g - cancelomap (omap.
Proofby move=> fK [?|] //=; rewrite fK. Qed.

Lemma of_voidK
Proofby caseQed

(**  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
Proofby case: 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'.
Proofby move

emma  injective> h - injective (f \h.
Proofby move=> injf 

Lemma inj_compr.by=> injfh(congr1/injfh.Qed
Proofby 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
Proofby 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.
Proofby     [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
by rewrite -[b in RHS]fK; case: (fo b) => //=; Proof by 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.
Proofby move=> fK eqfg eqfg' x; rewrite -eqfg -eqfg'. Qed.

Lemma inj_can_eq f' : cancel f f' Bijections.
Proofby 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.
Proofby case: 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
by case: 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
Proofby case> 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 bij_can_bij : bijective f -> forall f', cancel=> ['fK'K [  h'K;existsh \f) apply:can_comp.
Proofby move bijf f;first/( bijf. Qed.

End BijectionsTheory.

Section Involutions

Variables(A  ) (f : A- A.

Definition involutive := cancel f f.

Hypothesis Hf : involutive.

Lemma inv_inj : injective f. (A : Type   - A.
Lemma inv_bij : bijective f. Proofby java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 36

End Involutions.

Section OperationProperties.

Variables S T R : Type.

Section SopTisR.
Implicit Type 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.
Implicit Type 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
Implicit Type op :  S -> T -> T.
Definition left_id e op := forall Definitionleft_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.
Implicit Type 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.
Implicit Type 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.

End OperationProperties.

#[deprecated(since
Notation#[eprecatedsince9.1, useidempotent_op)]

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). Proofby move=> ? ? []. Qed.

Messung V0.5
C=94 H=95 G=94

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.11Angebot  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.