val equality_equiv (a: Type) : equiv a
let equality_equiv (a:Type) : equiv a =
  EQ (fun x y -> x == y) (fun x -> ()) (fun x y -> ()) (fun x y z -> ())
val equality_equiv (a: Type) : equiv a
let equality_equiv (a: Type) : equiv a =
EQ (fun x y -> x == y) (fun x -> ()) (fun x y -> ()) (fun 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.EQ Prims.eq2 Prims.unit FStar.Algebra.CommMonoid.Equiv.equiv
(*
   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)
          )
  = 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 equality_equiv (a: Type) : equiv a
a: Type -> FStar.Algebra.CommMonoid.Equiv.equiv a