friedman-tree
Construction of Friedman's tree(n) and TREE(n) in Coq
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.4%) to scientific vocabulary
Repository
Construction of Friedman's tree(n) and TREE(n) in Coq
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 3
Metadata Files
README.md
(**************************************************************)
(* Copyright Dominique Larchey-Wendling [*] *)
(* *)
(* [*] Affiliation LORIA -- CNRS *)
(**************************************************************)
(* This file is distributed under the terms of the *)
(* Mozilla Public License Version 2.0, MPL-2.0 *)
(**************************************************************)
Friedman-TREE
In this small project, depending on Coq-Kruskal in an essential way,
we build Harvey Friedman's tree(n) and TREE(n) fast growing functions.
Reminders:
```coq
Fixpoint listsum {X} (f : X → nat) l := match l with | [] => 0 | x :: l => f x + listsum l end.
(** Reminder: idx m ≃ {0,...,m-1}. vec X m are vectors of carrier type X and length m If v : vec X m and i : idx m, then vᵢ is the i-th component of v *)
Inductive idx : nat → Type. Inductive vec : Type → nat → Type. ```
The Friedman tree(n) function
The Friedman tree(n) function is informally defined
as the largest natural number m for which there is a sequence of length m of undecorated
rose trees [t₁;...;tₘ] such that:
1. the number of nodes of those trees are 1+n,...,m+n respectivelly;
2. the sequence is bad for the homeomorphic embedding ≤ₕ.
Formally in Coq, this gives the following specification and the theorem Friedman_tree_spec established in tree.v:
```coq
Inductive rtree : Type := ⟨ _ ⟩ᵣ : list rtree → rtree.
Inductive rtreehomeoembed : rtree → rtree → Prop := | rtreehomeoembedsubt s t l : t ∈ l → s ≤ₕ t → s ≤ₕ ⟨l⟩ᵣ | rtreehomeoembedroot l m : listembed rtreehomeoembed l m → ⟨l⟩ᵣ ≤ₕ ⟨m⟩ᵣ where "s ≤ₕ t" := (rtreehomeo_embed s t).
Definition rtreesize : rtree → nat. Notation "⌊ t ⌋ᵣ" := (rtreesize t).
Fact rtreesizefix l : ⌊⟨l⟩ᵣ⌋ᵣ = 1 + listsum rtreesize l.
Definition Friedman_tree : nat → nat.
Theorem Friedmantreespec n : ∀m, m ≤ Friedman_tree n ↔ ∃ t : vec rtree m, (∀i, ⌊tᵢ⌋ᵣ = 1+i+n) ∧ (∀ i j, i < j → ¬ tᵢ ≤ₕ tⱼ). ```
The essential argument to built the value Friedman_tree n is to show that there is a length m such that any sequence
of trees [t₁;...;tₘ] of increasing sizes (as specified above) is good for the homeomorphic embedding ≤ₕ:
- first, using Kruskal's theorem in its (equivalent) formulation using inductive bars, any (ever expending)
sequence of trees is bound to become ≤ₕ-good;
- second, at any given value s, the trees which have size s are finitely many;
- hence, we build the "set" of size increasing sequences of trees as a finitary FAN, ie a
finite collection of choice sequences;
- then, applying the FAN theorem for inductive bars, all the size increasing sequences are bound to
become ≤ₕ-good uniformly, ie all simultaneously;
- the point m where all the size increasing sequences of length m become ≤ₕ-good is the needed value.
Since, the spec of Friedman_tree n is decidable, anti-monotonic and bounded (by the above m),
the value Friedman_tree n can be computed by linear search using a variant of Constructive Epsilon.
Notice that our implementation is axiom free, hence purely constructive. Compared to the argument developed in Wikipedia, we here use a constructive version of Kruskal's theorem from Kruskal-Theorems, and we replace Koenig's lemma with the FAN theorem for inductive bars as established constructivelly also in Kruskal-FAN.
The Friedman TREE(n) function
The Friedman TREE(n) function is insanely fast growing function of which the termination proof depends on the proof of Kruskal's tree theorem itself. The construction we perfom in Coq is similar to the previous one but operates on rose trees decorated with the finite type idx n ≃ [1,...,n] where n is the parameter of Friedman_TREE n. The construction of Friedman_TREE and the theorem Friedman_TREE_spec are performed in TREE.v:
```coq Definition ntree (n : nat) := ltree (idx n). Notation "⟨i|l⟩ₗ" := (ltree_node i l).
Definition ntreesize {n} : ntree n → nat := @ltreesize . Notation "⌊ t ⌋ₙ" := (ntreesize t). Fact ntreesizefix i l : ⌊⟨i,l⟩ₗ⌋ₙ = 1 + listsum ntreesize l.
Definition ntreeembed {n} : rel₂ (ntree n) := ltreehomeoembed (@eq _). Notation "l ≤ₕ m" := (ntreehomeo_embed l m).
Definition Friedman_TREE : nat → nat.
Theorem FriedmanTREEspec n : ∀m, m ≤ Friedman_TREE n ↔ ∃ t : vec (ntree n) m, (∀i, ⌊tᵢ⌋ₙ ≤ 1+i) ∧ (∀ i j, i < j → ¬ tᵢ ≤ₕ tⱼ). ```
Owner
- Name: Dominique Larchey-Wendling
- Login: DmxLarchey
- Kind: user
- Location: Nancy, France
- Company: CNRS
- Repositories: 9
- Profile: https://github.com/DmxLarchey
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Larchey-Wendling
given-names: Dominique
orcid: https://orcid.org/0000-0001-9860-7203
title: "The Friedman-TREE project"
version: 1.2
date-released: 2024-11-25
url: https://github.com/DmxLarchey/Friedman-TREE
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"type": "SoftwareSourceCode",
"author": [
{
"id": "https://orcid.org/0000-0001-9860-7203",
"type": "Person",
"affiliation": {
"type": "Organization",
"name": "Departement of Formal Method, TYPES team, LORIA, CNRS"
},
"email": "dominique.larchey-Wendling@loria.fr",
"familyName": "Larchey-Wendling",
"givenName": "Dominique"
}
],
"codeRepository": "git+https://github.com/DmxLarchey/Friedman-TREE.git",
"dateCreated": "2024-05-10",
"dateModified": "2024-11-25",
"datePublished": "2024-05-10",
"description": "In this small project, depending on Kruskal-[AlmostFull,Fan,Theorems] in an essential way, we build Harvey Friedman's tree(n) and TREE(n) fast growing functions.",
"downloadUrl": "https://github.com/DmxLarchey/Friedman-TREE/archive/refs/tags/1.2.tar.gz",
"funder": {
"type": "Organization",
"name": "CNRS"
},
"isPartOf": "https://github.com/DmxLarchey/Coq-Kruskal",
"keywords": [
"coq",
"dependent types",
"almost full relations",
"Kruskal's tree theorem"
],
"license": "https://spdx.org/licenses/MPL-2.0",
"name": "Friedman-TREE",
"operatingSystem": [
"Linux",
"MacOS"
],
"programmingLanguage": "Coq",
"relatedLink": [
"https://github.com/DmxLarchey/Kruskal-AlmostFull",
"https://github.com/DmxLarchey/Kruskal-Fan",
"https://github.com/DmxLarchey/Kruskal-Theorems"
],
"softwareRequirements": "opam, ocaml",
"version": "1.2",
"developmentStatus": "active",
"issueTracker": "https://github.com/DmxLarchey/Friedman-TREE/issues"
}
GitHub Events
Total
- Push event: 2
- Pull request event: 2
- Create event: 1
Last Year
- Push event: 2
- Pull request event: 2
- Create event: 1
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Dominique Larchey-Wendling | l****y@g****m | 23 |
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: about 1 hour
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- DmxLarchey (1)
Pull Request Authors
- DmxLarchey (5)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2 composite
- coq-community/docker-coq-action v1 composite