val inverses : f: (_: a -> Prims.GTot b) -> g: (_: b -> Prims.GTot a) -> Prims.logical
let inverses #a #b
             (f: (a -> GTot b))
             (g: (b -> GTot a)) =
  (forall x. g (f x) == x) /\
  (forall y. f (g y) == y)
(*
   Copyright 2008-2018 Microsoft Research

   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, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*)
module LowStar.BufferView.Down

(**
 * A "down view" on a buffer allows treating a
 * `Buffer.buffer a` as a
 * `BufferView.Down.buffer b`
 *
 * A "view" on a buffer is intended for specification purposes only
 * It does not correspond to a pointer cast in C.
 *
 * Building a down view requires providing a pair of mutually inverse functions
 * from `a` to sequences of `b`. (e.g., from a `lbuffer u32 n` to a `lbuffer u8 (4*n)`)
 *
 * I.e., a down view allows "exploding" an `a` into its component `b`'s.

 * In contrast, an "up view" (see LowStar.BufferView.Up) allows
 * "compacting" a sequences of `a`'s into a `b`.
 * (e.g., from an `lbuffer u8 (4*n)` to an `lbuffer u32 n`)
 **)
 
open LowStar.Monotonic.Buffer
open FStar.Mul
module HS=FStar.HyperStack
module B=LowStar.Monotonic.Buffer

(** Definition of a view **)
/
prims.fst.checked LowStar.Monotonic.Buffer.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.Mul.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked
LowStar.BufferView.Down.fsti
f: (_: a -> Prims.GTot b) -> g: (_: b -> Prims.GTot a) -> Prims.logical
Prims.l_and Prims.l_Forall Prims.eq2 Prims.logical
let inverses #a #b (f: (a -> GTot b)) (g: (b -> GTot a)) =
  
(forall x. g (f x) == x) /\ (forall y. f (g y) == y)