Skip to Content.
Sympa Menu

ssreflect - Re: [ssreflect] The irreflexive transitive closure

Subject: Ssreflect Users Discussion List

List archive

Re: [ssreflect] The irreflexive transitive closure


Chronological Thread 
  • From: Christian Doczkal <>
  • To:
  • Subject: Re: [ssreflect] The irreflexive transitive closure
  • Date: Fri, 18 May 2018 20:44:40 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Neutral ; spf=None
  • Ironport-phdr: 9a23:GAMhMBc2doYzCxRTbCBX0DtplGMj4u6mDksu8pMizoh2WeGdxcS5ZB7h7PlgxGXEQZ/co6odzbaO6Oa4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahb75+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hycdLzM37X/ZisJwgqxYrhyuqRNwzIzIb4+aL/d+YqDQcMkGSWZdUMtcVSpMCZ68YYsVCOoBOP5Vopf9p1sUrBu+HhWsBOL1xT9Om3T406o63PggEAHFxgMgG88FvXPIo9X1LqcSUPu1zLXJzTrZafNawyry6I/UfREgovGDR7ZwfNHPxkkpDAPJl1GQqIziPzOTzOgNvXKb4vNmWOmyhWAnrARxrSKuxscqkoTJiYMVykzE9SVk24k5P8G3SEl+YdOiDZBetDmaOpNrTs4tX21koiQ3x78ctZKmfSUHyo4rywDBZ/CZa4SF4QzvWPyPLTp4mX5pYqyziwux/ES61+HwSMq53VBXpSRfiNbMrGoC1xnL58iHVPR9+kCh1C6L1w/J8e5LOl47mbDFJJ4n2b48j54TsETEHi/wgkn2grWWel0l+uiu9evnfq3rqoKTOoNokA3zMKYjltaiDek5MAUCRXaX9fqi2LH7+E32WrRKjvk4kqnDt5DaINwWqbK5Aw9P04Yj8Aq/Dza839Qeh3UIMVVFdw6GjojqIV7OJOv1Aum5g1S3iTtrw/DHPrrnApnXIHjDiq/tfaxh5E5E1Aoz0ddf6opPCrEaOvL8REHxtNjGARAlLwy52P3nCdV41oMGQ22DGK6ZMKXIsV+J/O0jOeeMZJVG8Ar6fuM+/fPgiXIyhXcYZrPs3J0NaXn+H/J8Ikzfb2C/rM0GFDIhvhA/V/DrgVvKfTlYdXW7W+po7TEhCZm6DI7FAIyqi66C1SOTE5tNI2RXDVbKH22+JNbMYOsFdC/HepwpqTcDT7X0E9ZwhyHrjxfzzv9cFsSR/yQZsZz5090svL/ekwp38S1zCYKTyTPXFj0mriYzXzYzmZtHjwll0F7aivp1hecdEc1U4bVHSFVibMOO/6lBE9n3Hzn5UJKJRVKhG4T0BTg7RN93ztkVJkJsHNPkgAqRhyc=

Hello,

I've been using the fingraph library quite extensively and there has only
ever been one instance where I found myself needing the (non-reflexive)
transitive closure. I ended up defining it roughly as follows:

Definition trans_closure e x y := [exists z, e x z && connect e z y]

This allows properties like transitivity etc. pp. to be proved using the
existing lemmas for connect.

Best,
Christian

On 05/18/2018 08:08 PM, Erik Martin-Dorel wrote:
> Dear MathComp developers,
>
> We recently explored the fingraph.v formalization (for reusing its
> definition of transitive closure that comes for free with a
> decidability proof of the obtained order…), and we noticed after a
> while that this definition "connect" was reflexive (cf. the presence
> of the "connect0" lemma).
>
> It seems to us that the usual definition of the transitive closure
> (such as the one that can be found in Wikipedia articles) does not
> perform the reflexive closure at the same time.
>
> So our question is twofold:
>
> 1. Would you agree to change the documentation of fingraph to account
> for that? basically by replacing [1] with
> (* connect e == the reflexive transitive closure of e (computed by dfs). *)
>
> [1]
> https://github.com/math-comp/math-comp/blob/mathcomp-1.7.0/mathcomp/ssreflect/fingraph.v#L17
>
>
> 2. Would it be interesting for some users to provide a separate
> definition of the usual transitive closure in that file?
>
> (If yes, maybe we could also refactor the current lemmas about the
> reflexive-transitive closure to depend on the new definition? but of
> course that latter refactoring effort is maybe not worth it…)
>
> I give below a tentative definition for the transitive closure that we
> have started exploring (proving a few lemmas that are ommitted here).
>
> --8<---------------cut here---------------start------------->8---
> (* The transitive closure is defined by "strict_connect".
> "dfs_excl" could be removed and inlined in this definition… *)
>
> Definition dfs_excl' (g : T->seq T) (n:nat) (v:seq T) (x:T) :=
> if x \in v then v else
> match n with
> | 0 => v
> | n'.+1 => foldl (dfs g n') v (g x)
> end.
>
> Definition dfs_excl (g : T->seq T) (x:T) :=
> dfs_excl' g (#|T|.+1) [::] x.
>
> Definition strict_connect (e : rel T) : rel T :=
> fun x y => y \in dfs_excl (rgraph e) x.
> --8<---------------cut here---------------end--------------->8---
>
> Feel free to comment if you think that another definition would be
> more appropriate.
>
> Kind regards,
>
> Erik and Marc
>




Archive powered by MHonArc 2.6.18.

Top of Page