val lemma_seq_sub_compatilibity_is_reflexive (#a: Type0) (len: nat) (rel: srel a)
    : Lemma (compatible_sub_preorder len rel 0 len rel)
let lemma_seq_sub_compatilibity_is_reflexive (#a:Type0) (len:nat) (rel:srel a)
  :Lemma (compatible_sub_preorder len rel 0 len rel)
  = assert (forall (s1 s2:Seq.seq a). Seq.length s1 == Seq.length s2 ==>
                                 Seq.equal (Seq.replace_subseq s1 0 (Seq.length s1) s2) s2)
val lemma_seq_sub_compatilibity_is_reflexive (#a: Type0) (len: nat) (rel: srel a)
    : Lemma (compatible_sub_preorder len rel 0 len rel)
let lemma_seq_sub_compatilibity_is_reflexive (#a: Type0) (len: nat) (rel: srel a)
    : Lemma (compatible_sub_preorder len rel 0 len rel) =
assert (forall (s1: Seq.seq a) (s2: Seq.seq a).
      Seq.length s1 == Seq.length s2 ==> Seq.equal (Seq.replace_subseq s1 0 (Seq.length s1) s2) s2)
LowStar.Monotonic.Buffer.fst.checked
prims.fst.checked FStar.UInt32.fsti.checked FStar.Set.fsti.checked FStar.Seq.fst.checked FStar.Preorder.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.ModifiesGen.fsti.checked FStar.Map.fsti.checked FStar.List.Tot.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Heap.fst.checked FStar.Ghost.fsti.checked FStar.Classical.fsti.checked
LowStar.Monotonic.Buffer.fst
Prims.nat LowStar.Monotonic.Buffer.srel Prims._assert Prims.l_Forall FStar.Seq.Base.seq Prims.l_imp Prims.eq2 FStar.Seq.Base.length FStar.Seq.Base.equal FStar.Seq.Properties.replace_subseq Prims.unit Prims.l_True Prims.squash LowStar.Monotonic.Buffer.compatible_sub_preorder Prims.Nil FStar.Pervasives.pattern
(*
   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.Monotonic.Buffer

module P = FStar.Preorder
module G = FStar.Ghost
module U32 = FStar.UInt32
module Seq = FStar.Seq

module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST

private let srel_to_lsrel (#a:Type0) (len:nat) (pre:srel a) :P.preorder (Seq.lseq a len) = pre

(*
 * Counterpart of compatible_sub from the fsti but using sequences
 *
 * The patterns are guarded tightly, the proof of transitivity gets quite flaky otherwise
 * The cost is that we have to additional asserts as triggers
 *)
let compatible_sub_preorder (#a:Type0)
  (len:nat) (rel:srel a) (i:nat) (j:nat{i <= j /\ j <= len}) (sub_rel:srel a)
  = compatible_subseq_preorder len rel i j sub_rel

(*
 * Reflexivity of the compatibility relation
 *)
let lemma_seq_sub_compatilibity_is_reflexive (#a:Type0) (len:nat) (rel:srel a)
val lemma_seq_sub_compatilibity_is_reflexive (#a: Type0) (len: nat) (rel: srel a)
    : Lemma (compatible_sub_preorder len rel 0 len rel)
len: Prims.nat -> rel: LowStar.Monotonic.Buffer.srel a
  -> FStar.Pervasives.Lemma
    (ensures LowStar.Monotonic.Buffer.compatible_sub_preorder len rel 0 len rel)