val elim_eq_laws (#a: _) (eq: equiv a)
    : Lemma
    ((forall x. {:pattern (x `eq.eq` x)} x `eq.eq` x) /\
      (forall x y. {:pattern (x `eq.eq` y)} x `eq.eq` y ==> y `eq.eq` x) /\
      (forall x y z. {:pattern eq.eq x y; eq.eq y z} (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z))
let elim_eq_laws #a (eq:equiv a)
  : Lemma (
          (forall x.{:pattern (x `eq.eq` x)} x `eq.eq` x) /\
          (forall x y.{:pattern (x `eq.eq` y)} x `eq.eq` y ==> y `eq.eq` x) /\
          (forall x y z.{:pattern eq.eq x y; eq.eq y z} (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z)
          )
  = introduce forall x. x `eq.eq` x
    with (eq.reflexivity x);

    introduce forall x y. x `eq.eq` y ==> y `eq.eq` x
    with (introduce _ ==> _
          with _. eq.symmetry x y);

    introduce forall x y z. (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z
    with (introduce _ ==> _
          with _. eq.transitivity x y z)
val elim_eq_laws (#a: _) (eq: equiv a)
    : Lemma
    ((forall x. {:pattern (x `eq.eq` x)} x `eq.eq` x) /\
      (forall x y. {:pattern (x `eq.eq` y)} x `eq.eq` y ==> y `eq.eq` x) /\
      (forall x y z. {:pattern eq.eq x y; eq.eq y z} (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z))
let elim_eq_laws #a (eq: equiv a)
    : Lemma
    ((forall x. {:pattern (x `eq.eq` x)} x `eq.eq` x) /\
      (forall x y. {:pattern (x `eq.eq` y)} x `eq.eq` y ==> y `eq.eq` x) /\
      (forall x y z. {:pattern eq.eq x y; eq.eq y z} (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z)) =
introduce forall x . x `eq.eq` x
with (eq.reflexivity x);
introduce forall x y . x `eq.eq` y ==> y `eq.eq` x
with (introduce _ ==> _
  with _. eq.symmetry x y);
introduce forall x y z . (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z
with (introduce _ ==> _
  with _. eq.transitivity x y z)
FStar.Algebra.CommMonoid.Equiv.fst.checked
prims.fst.checked FStar.Pervasives.fsti.checked FStar.Mul.fst.checked FStar.Classical.Sugar.fsti.checked
FStar.Algebra.CommMonoid.Equiv.fst
FStar.Algebra.CommMonoid.Equiv.equiv FStar.Classical.Sugar.forall_intro Prims.l_Forall Prims.l_imp Prims.l_and FStar.Algebra.CommMonoid.Equiv.__proj__EQ__item__eq FStar.Classical.Sugar.implies_intro Prims.squash FStar.Algebra.CommMonoid.Equiv.__proj__EQ__item__transitivity Prims.unit FStar.Algebra.CommMonoid.Equiv.__proj__EQ__item__symmetry FStar.Algebra.CommMonoid.Equiv.__proj__EQ__item__reflexivity Prims.l_True 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 FStar.Algebra.CommMonoid.Equiv

open FStar.Mul

unopteq
type equiv (a:Type) =
  | EQ :
    eq:(a -> a -> Type0) -> 
    reflexivity:(x:a -> Lemma (x `eq` x)) ->
    symmetry:(x:a -> y:a -> Lemma (requires (x `eq` y)) (ensures (y `eq` x))) ->
    transitivity:(x:a -> y:a -> z:a -> Lemma (requires (x `eq` y /\ y `eq` z)) (ensures (x `eq` z))) ->
    equiv a

let elim_eq_laws #a (eq:equiv a)
  : Lemma (
          (forall x.{:pattern (x `eq.eq` x)} x `eq.eq` x) /\
          (forall x y.{:pattern (x `eq.eq` y)} x `eq.eq` y ==> y `eq.eq` x) /\
          (forall x y z.{:pattern eq.eq x y; eq.eq y z} (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z)
val elim_eq_laws (#a: _) (eq: equiv a)
    : Lemma
    ((forall x. {:pattern (x `eq.eq` x)} x `eq.eq` x) /\
      (forall x y. {:pattern (x `eq.eq` y)} x `eq.eq` y ==> y `eq.eq` x) /\
      (forall x y z. {:pattern eq.eq x y; eq.eq y z} (x `eq.eq` y /\ y `eq.eq` z) ==> x `eq.eq` z))
eq: FStar.Algebra.CommMonoid.Equiv.equiv a
  -> FStar.Pervasives.Lemma
    (ensures
      (forall (x: a). {:pattern EQ?.eq eq x x} EQ?.eq eq x x) /\
      (forall (x: a) (y: a). {:pattern EQ?.eq eq x y} EQ?.eq eq x y ==> EQ?.eq eq y x) /\
      (forall (x: a) (y: a) (z: a). {:pattern EQ?.eq eq x y; EQ?.eq eq y z}
          EQ?.eq eq x y /\ EQ?.eq eq y z ==> EQ?.eq eq x z))