{"id":27214602,"url":"https://github.com/rocq-community/dblib","last_synced_at":"2026-04-01T17:22:03.376Z","repository":{"id":18696495,"uuid":"21906499","full_name":"rocq-community/dblib","owner":"rocq-community","description":"Coq library for working with de Bruijn indices [maintainer=@KevOrr]","archived":false,"fork":false,"pushed_at":"2021-09-15T17:07:24.000Z","size":211,"stargazers_count":30,"open_issues_count":7,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-28T00:37:23.093Z","etag":null,"topics":["coq","debruijn-indices","variable-binding"],"latest_commit_sha":null,"homepage":"","language":"Coq","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocq-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-16T15:30:28.000Z","updated_at":"2026-01-27T13:07:34.000Z","dependencies_parsed_at":"2022-07-26T23:32:04.333Z","dependency_job_id":null,"html_url":"https://github.com/rocq-community/dblib","commit_stats":null,"previous_names":["rocq-community/dblib","coq-community/dblib"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rocq-community/dblib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fdblib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fdblib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fdblib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fdblib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocq-community","download_url":"https://codeload.github.com/rocq-community/dblib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocq-community%2Fdblib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coq","debruijn-indices","variable-binding"],"created_at":"2025-04-10T03:24:49.357Z","updated_at":"2026-04-01T17:22:03.354Z","avatar_url":"https://github.com/rocq-community.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!---\nThis file was generated from `meta.yml`, please do not edit manually.\nFollow the instructions on https://github.com/coq-community/templates to regenerate.\n---\u003e\n# Dblib\n\n[![Docker CI][docker-action-shield]][docker-action-link]\n[![Contributing][contributing-shield]][contributing-link]\n[![Code of Conduct][conduct-shield]][conduct-link]\n[![Zulip][zulip-shield]][zulip-link]\n\n[docker-action-shield]: https://github.com/coq-community/dblib/workflows/Docker%20CI/badge.svg?branch=master\n[docker-action-link]: https://github.com/coq-community/dblib/actions?query=workflow:\"Docker%20CI\"\n\n[contributing-shield]: https://img.shields.io/badge/contributions-welcome-%23f7931e.svg\n[contributing-link]: https://github.com/coq-community/manifesto/blob/master/CONTRIBUTING.md\n\n[conduct-shield]: https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-%23f15a24.svg\n[conduct-link]: https://github.com/coq-community/manifesto/blob/master/CODE_OF_CONDUCT.md\n\n[zulip-shield]: https://img.shields.io/badge/chat-on%20zulip-%23c1272d.svg\n[zulip-link]: https://coq.zulipchat.com/#narrow/stream/237663-coq-community-devs.20.26.20users\n\n\n\nLibrary with facilities for working with de Bruijn indices in Coq to\nreason about capture-avoiding substitution of variables in syntax with binders.\n\n## Meta\n\n- Author(s):\n  - François Pottier (initial)\n- Coq-community maintainer(s):\n  - Kevin Orr ([**@KevOrr**](https://github.com/KevOrr))\n- License: [GNU General Public License v3.0](LICENSE)\n- Compatible Coq versions: 8.7 or later\n- Additional dependencies: none\n- Coq namespace: `Dblib`\n- Related publication(s): none\n\n## Building and installation instructions\n\nThe easiest way to install the latest released version of Dblib\nis via [OPAM](https://opam.ocaml.org/doc/Install.html):\n\n```shell\nopam repo add coq-released https://coq.inria.fr/opam/released\nopam install coq-dblib\n```\n\nTo instead build and install manually, do:\n\n``` shell\ngit clone https://github.com/coq-community/dblib.git\ncd dblib\nmake   # or make -j \u003cnumber-of-cores-on-your-machine\u003e \nmake install\n```\n\n\n## Documentation\n\n### Workflow\n\nThe basic workflow for using the library is as follows:\n\n1. The client manually defines the syntax of terms (or types, or whatever\n   syntax she is interested in) as usual, as an inductive type.\n2. The client manually defines a higher-order `traverse` function, which can\n   be thought of as a generic, capture-avoiding substitution function. Its\n   job is (i) to apply a user-supplied function `f` at every variable, and\n   (ii) to inform `f` about the number of binders that have been entered. By\n   defining `traverse`, the client effectively defines the binding structure.\n3. The client proves that the `traverse` function is well-behaved, i.e., it\n   satisfies half a dozen reasonable properties. These proofs are usually\n   trivial, because the library provides tailor-made tactics for this\n   purpose.\n4. The library defines weakening (`lift`) and substitution (`subst`) in\n   terms of `traverse`, and proves a rather large number of properties of\n   these functions.\n5. The functions `lift` and `subst` are opaque, so an application of these\n   functions cannot be reduced by Coq's builtin tactic `simpl`. The library\n   provides `simpl_lift_goal` and `simpl_subst_goal` for this purpose (plus\n   a few variants of these tactics that perform simplification within a\n   hypothesis, or within all hypotheses).\n6. The library also provides hint databases, to be used with `eauto`, that\n   can prove many of the typical equalities that arise when proving\n   weakening or substitution lemmas.\n7. The library defines a `closed` term as one that is invariant under\n   lifting (and substitution), and provides lemmas/tactics for reasoning\n   about this notion.\n\nEverything is based on type classes: `traverse`, `lift`, `subst`, etc. are\noverloaded, so the whole process can be repeated, if desired, for another\ninductive type.\n\nThe library *does* support multiple *independent* namespaces: for instance, it\nis possible to have terms that contain term variables and types that contain\ntype variables.\n\nThe library does *not* support multiple namespaces when there is interaction\nbetween them: for instance, it is *not* possible to have terms that contain\nboth term variables and type variables, as in a standard presentation of\nSystem F. A possible work-around is to define a single namespace of\n\"variables\" and to use a separate well-kindedness judgement in order to\ndistinguish between \"term\" variables and \"type\" variables. This\napproach has been used in a large proof, where it has turned out\nto be extremely beneficial.\n\n### Library Files\n\nThe library consists of the following files:\n\n- [DblibTactics.v](src/DblibTactics.v)  \n  A small number of hints and tactics that are used in the library.\n  The end user should not need to worry about them, but can go and\n  have a look.\n\n- [DeBruijn.v](src/DeBruijn.v)  \n  The core library. The end user is encouraged to read the first\n  two parts of this file, which present 1- the operations and\n  properties that the client is expected to provide; and 2- the\n  operations and properties that the library provides. These two\n  parts extend up to the first double dashed line, near line 432.\n\n- [Environments.v](src/Environments.v)  \n  This auxiliary library defines a notion of environment, which\n  is typically useful when defining a typing judgement. The use\n  of this library is optional.\n\n### Demos\n\nThe documentation takes the form of a few demo files:\n\n- [DemoLambda.v](src/DemoLambda.v)  \n  Small-step operational semantics and typing judgement for the\n  simply-typed lambda-calculus. Proof of type preservation and\n  of a few other basic lemmas.\n\n- [DemoValueTerm.v](src/DemoValueTerm.v)  \n  Short demo of how to use the library in the case where there\n  are two distinct syntactic categories of things in which we\n  substitute (e.g., terms) and things that we substitute (e.g.,\n  values).\n\n- [DemoExplicitSystemF.v](src/DemoExplicitSystemF.v)  \n  Proof of type preservation for System F, in a version where\n  the presence of type abstractions and type applications is\n  explicit in the syntax of terms. (Still, terms do not refer\n  to types!)\n\n- [DemoImplicitSystemF.v](src/DemoImplicitSystemF.v)  \n  Proof of type preservation for System F, in a version where\n  type abstraction and type application are implicit, i.e.,\n  the syntax of terms is untyped. This proof is trickier than\n  the one above, in that it requires induction over the height\n  of type derivations. But as far as binding is concerned, no\n  new problems arise.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocq-community%2Fdblib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocq-community%2Fdblib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocq-community%2Fdblib/lists"}