Skip to content

Commit

Permalink
add script to remove trailing whitespace
Browse files Browse the repository at this point in the history
<!-- ps-id: 925b1ad7-6f77-4af7-9bcc-67adb5a6f2f9 -->

Signed-off-by: Ali Caglayan <[email protected]>
  • Loading branch information
Alizter committed Mar 6, 2024
1 parent 4043e0f commit f7f317f
Show file tree
Hide file tree
Showing 109 changed files with 346 additions and 341 deletions.
8 changes: 4 additions & 4 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- *generated with [DocToc](https://github.com/thlorenz/doctoc)* -->
<!-- Ali: VSCode is able to do the TOC using the "Markdown All in One" extension. Section numbering too! -->
## Table of Contents
## Table of Contents

- [1. Conventions And Style Guide](#1-conventions-and-style-guide)
- [1.1. Organization](#11-organization)
Expand Down Expand Up @@ -676,7 +676,7 @@ in `bar` appropriately.

(It is possible to explicitly declare and name universes globally with
the `Universe` command, but we are not using that in the HoTT
library. Universes declared with `Universe` will be discharged on each
library. Universes declared with `Universe` will be discharged on each
section definition independently.)

Unfortunately it is not currently possible to declare the universe
Expand Down Expand Up @@ -1124,7 +1124,7 @@ where they are defined.
The unification algorithm used by `apply` is different and often
less powerful than the one used by `refine`, though it is
occasionally better at pattern matching.

Here are some tips:
- If `apply` fails with a unification error you think it shouldn't
have, try `rapply`.
Expand All @@ -1135,7 +1135,7 @@ where they are defined.
- If you don't want Coq to create evars for certain subgoals,
add an `s` to the tactic name to make it use `simple refine`.


## 1.12. Contributing to the library ##

### 1.12.1. Fork & Pull ###
Expand Down
6 changes: 3 additions & 3 deletions contrib/SetoidRewrite.v
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Proof.
intros f1 f2.
apply (is0functor_postcomp a b c g ).
Defined.

#[export] Instance IsProper_catcomp {A : Type} `{Is1Cat A}
{a b c : A}
: CMorphisms.Proper (GpdHom ==> GpdHom ==> GpdHom)
Expand All @@ -111,7 +111,7 @@ Proof.
exact eq_g.
Defined.

#[export] Instance gpd_hom_to_hom_proper {A B: Type} `{Is0Gpd A}
#[export] Instance gpd_hom_to_hom_proper {A B: Type} `{Is0Gpd A}
{R : Relation B} (F : A -> B)
`{CMorphisms.Proper _ (GpdHom ==> R) F}
: CMorphisms.Proper (Hom ==> R) F.
Expand Down Expand Up @@ -194,7 +194,7 @@ Defined.

Proposition nat_equiv_faithful {A B : Type}
{F G : A -> B} `{Is1Functor _ _ F}
`{!Is0Functor G, !Is1Functor G}
`{!Is0Functor G, !Is1Functor G}
`{!HasEquivs B} (tau : NatEquiv F G)
: Faithful F -> Faithful G.
Proof.
Expand Down
2 changes: 1 addition & 1 deletion etc/Book.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def die(msg):
content = content[content.index('\n')+1:]
# Update Book_X_Y_Z
book = "_".join(map(str,entry['number']))
# content = re.sub('Book_[0-9_]*[0-9]', 'Book_{0}'.format(book), content)
# content = re.sub('Book_[0-9_]*[0-9]', 'Book_{0}'.format(book), content)
# content = re.sub('Definition Book_[0-9_]*[0-9]', 'Definition Book_{0}'.format(book), content)
# previous two removed since they break Exercise 2.2 and 2.3
# It is a common error to write things like Lemma_X_Y_Z instead of Book_X_Y_Z,
Expand Down
2 changes: 1 addition & 1 deletion etc/coqcreplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def replace(vfile):
if not match:
break
lines[i] = replace_match(match, coqc_replace, lines[i])

attempts += 1
with open(vfile, 'w', encoding="utf-8") as f:
f.write(''.join(lines))
Expand Down
5 changes: 5 additions & 0 deletions etc/fix_trailing_whitespace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# This command removes trailing whitespace from all files in the repository.

git grep -l -z -E '\s+$' | xargs -0 sed -i 's/\s\+$//'
2 changes: 1 addition & 1 deletion etc/generate_coqproject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
fi

## List untracked .v files
#UNTRACKED_V_FILES=$(git ls-files --others --exclude-standard "*.v")
#UNTRACKED_V_FILES=$(git ls-files --others --exclude-standard "*.v")

## Combine untracked and tracked .v files
printf -v UNSORTED_V_FILES '%s\n%s' "$TRACKED_V_FILES" "$UNTRACKED_V_FILES"
Expand Down
96 changes: 48 additions & 48 deletions etc/homotopy.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
text in crazy fonts and colors. */

body { padding: 0px 0px;
margin: 0px 0px;
margin: 0px 0px;
background-color: white }

#page { display: block;
Expand All @@ -18,7 +18,7 @@ body { padding: 0px 0px;
border-bottom-style: solid;
border-width: thin }

#header h1 { padding: 0;
#header h1 { padding: 0;
margin: 0;}


Expand All @@ -45,28 +45,28 @@ body { padding: 0px 0px;
#main .keyword { color : #cf1d1d }
#main { color: black }

.section {padding-top: 13px;
padding-bottom: 13px;
padding-left: 3px;
.section {padding-top: 13px;
padding-bottom: 13px;
padding-left: 3px;
margin-top: 5px;
margin-bottom: 5px;
font-size : 175% }

h2.section {padding-left: 3px;
padding-top: 12px;
padding-bottom: 10px;
h2.section {padding-left: 3px;
padding-top: 12px;
padding-bottom: 10px;
font-size : 130% }

h3.section {padding-left: 3px;
padding-top: 7px;
padding-bottom: 7px;
h3.section {padding-left: 3px;
padding-top: 7px;
padding-bottom: 7px;
font-size : 115% }

h4.section {
h4.section {
background-color: white;
padding-left: 0px;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-top: 0px;
padding-bottom: 0px;
font-size : 100%;
font-style : bold;
text-decoration : underline;
Expand All @@ -81,45 +81,45 @@ h4.section {
padding-bottom: 10px;
border-style: plain}

.inlinecode {
.inlinecode {
display: inline;
/* font-size: 125%; */
color: #666666;
font-family: monospace }
font-family: monospace }

.doc .inlinecode {
.doc .inlinecode {
display: inline;
font-size: 120%;
font-size: 120%;
color: rgb(30%,30%,70%);
font-family: monospace }
font-family: monospace }

.doc .inlinecode .id {
color: rgb(30%,30%,70%);
}
.doc .inlinecode .id {
color: rgb(30%,30%,70%);
}

.inlinecodenm {
.inlinecodenm {
display: inline;
color: #444444;
}

.doc .code {
.doc .code {
display: inline;
font-size: 120%;
color: rgb(30%,30%,70%);
font-family: monospace }
font-size: 120%;
color: rgb(30%,30%,70%);
font-family: monospace }

.comment {
.comment {
display: inline;
font-family: monospace;
color: rgb(50%,50%,80%);
}
color: rgb(50%,50%,80%);
}

.code {
.code {
display: block;
/* padding-left: 15px; */
font-size: 110%;
font-size: 110%;
font-family: monospace;
}
}

table.infrule {
border: 0px;
Expand All @@ -141,7 +141,7 @@ tr.infrulemiddle hr {
}

.infrulenamecol {
color: rgb(60%,60%,60%);
color: rgb(60%,60%,60%);
font-size: 80%;
padding-left: 1em;
padding-bottom: 0.1em
Expand All @@ -154,55 +154,55 @@ tr.infrulemiddle hr {

.id { display: inline; }

.id[type="constructor"] {
.id[type="constructor"] {
color: rgb(60%,0%,0%);
}

.id[type="var"] {
.id[type="var"] {
color: rgb(40%,0%,40%);
}

.id[type="variable"] {
.id[type="variable"] {
color: rgb(40%,0%,40%);
}

.id[type="definition"] {
.id[type="definition"] {
color: rgb(0%,40%,0%);
}

.id[type="abbreviation"] {
.id[type="abbreviation"] {
color: rgb(0%,40%,0%);
}

.id[type="lemma"] {
.id[type="lemma"] {
color: rgb(0%,40%,0%);
}

.id[type="instance"] {
.id[type="instance"] {
color: rgb(0%,40%,0%);
}

.id[type="projection"] {
.id[type="projection"] {
color: rgb(0%,40%,0%);
}

.id[type="method"] {
.id[type="method"] {
color: rgb(0%,40%,0%);
}

.id[type="inductive"] {
.id[type="inductive"] {
color: rgb(0%,0%,80%);
}

.id[type="record"] {
.id[type="record"] {
color: rgb(0%,0%,80%);
}

.id[type="class"] {
.id[type="class"] {
color: rgb(0%,0%,80%);
}

.id[type="keyword"] {
.id[type="keyword"] {
color : #cf1d1d;
/* color: black; */
}
Expand Down
2 changes: 1 addition & 1 deletion test/Algebra/Groups/Presentation.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Local Open Scope mc_mult_scope.
Check ⟨ x | x * x * x , -x ⟩.
Check ⟨ x , y | x * y , x * y * x , x * (-y) * x * x * x⟩.
Check ⟨ x , y , z | x * y * z , x * -z , x * y⟩.

2 changes: 1 addition & 1 deletion test/Metatheory/FunextVarieties.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From HoTT.Metatheory Require Import FunextVarieties.
From HoTT.Metatheory Require Import FunextVarieties.

(** Checking the universes of FunextVarieties.v *)

Expand Down
6 changes: 3 additions & 3 deletions theories/Algebra/AbGroups/Abelianization.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ From this we can show that Abel G is an abelian group.
In fact this models the following HIT:
HIT Abel (G : Group) :=
HIT Abel (G : Group) :=
| ab : G -> Abel G
| ab_comm : forall x y z, ab (x * (y * z)) = ab (x * (z * y)).
Expand Down Expand Up @@ -77,7 +77,7 @@ Section Abel.
Global Instance istrunc_abel : IsHSet Abel := _.

(** We can derive the induction principle from the ones for truncation and the coequalizer. *)
Definition Abel_ind (P : Abel -> Type) `{forall x, IsHSet (P x)}
Definition Abel_ind (P : Abel -> Type) `{forall x, IsHSet (P x)}
(a : forall x, P (ab x)) (c : forall x y z, DPath P (ab_comm x y z)
(a (x * (y * z))) (a (x * (z * y))))
: forall (x : Abel), P x.
Expand Down Expand Up @@ -111,7 +111,7 @@ Section Abel.
Defined.

(** Here is a simpler version of Abel_ind when our target is an HProp. This lets us discard all the higher paths. *)
Definition Abel_ind_hprop (P : Abel -> Type) `{forall x, IsHProp (P x)}
Definition Abel_ind_hprop (P : Abel -> Type) `{forall x, IsHProp (P x)}
(a : forall x, P (ab x)) : forall (x : Abel), P x.
Proof.
srapply (Abel_ind _ a).
Expand Down
2 changes: 1 addition & 1 deletion theories/Algebra/AbSES/PullbackFiberSequence.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Require Import Basics Types HSet HFiber Limits.Pullback.
Require Import WildCat Pointed.Core Homotopy.ExactSequence.
Require Import Groups.QuotientGroup.
Require Import AbGroups.AbelianGroup AbGroups.AbPullback AbGroups.Biproduct.
Require Import AbSES.Core AbSES.Pullback.
Require Import AbSES.Core AbSES.Pullback.
Require Import Modalities.Identity Modalities.Modality Truncations.Core.

Local Open Scope pointed_scope.
Expand Down
4 changes: 2 additions & 2 deletions theories/Algebra/AbSES/Pushout.v
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Proof.
+ exact (ap (fun x => _ + g1.1 x) (grp_unit_l _)^).
Defined.

Definition abses_pushout_path_data_1 `{Univalence} {A A' B : AbGroup} (f : A $-> A') {E : AbSES B A}
Definition abses_pushout_path_data_1 `{Univalence} {A A' B : AbGroup} (f : A $-> A') {E : AbSES B A}
: fmap (abses_pushout f) (Id E) = Id (abses_pushout f E).
Proof.
srapply path_sigma_hprop.
Expand Down Expand Up @@ -243,7 +243,7 @@ Proof.
- snrefine (ab_pushout_rec ab_biprod_inl _ _).
+ exact (functor_ab_biprod f grp_homo_id).
+ reflexivity.
- intro a'.
- intro a'.
apply path_prod.
+ simpl.
exact (ap _ (grp_homo_unit f) @ right_identity _).
Expand Down
2 changes: 1 addition & 1 deletion theories/Algebra/Groups/FreeGroup.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Section Reduction.

Local Notation "[ x ]" := (word_sing x).

(** Now we wish to define the free group on A as the following HIT:
(** Now we wish to define the free group on A as the following HIT:
HIT N(A) : hSet
| eta : Words -> N(A)
Expand Down
4 changes: 2 additions & 2 deletions theories/Algebra/Groups/Group.v
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Section GroupMovement.
Definition grp_moveR_gV : x = y * z <~> x * -z = y
:= equiv_moveR_equiv_V (f := fun t => t * z) _ _.

Definition grp_moveR_Vg : x = y * z <~> -y * x = z
Definition grp_moveR_Vg : x = y * z <~> -y * x = z
:= equiv_moveR_equiv_V (f := fun t => y * t) _ _.

Definition grp_moveL_gV : x * y = z <~> x = z * -y
Expand Down Expand Up @@ -520,7 +520,7 @@ Proof.
snrapply @isequiv_homotopic.
1: exact (equiv_path_grouphomomorphism^-1%equiv).
1: exact _.
intros []; reflexivity.
intros []; reflexivity.
Defined.

Global Instance hasequivs_group
Expand Down
Loading

0 comments on commit f7f317f

Please sign in to comment.