forked from alangpierce/TheProofIsTrivial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
188 lines (174 loc) · 4.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>The proof is trivial!</title>
</head>
<body>
<script type="text/javascript">
//<![CDATA[
/*
* Hosted on GitHub.
* Project page: https://github.com/alangpierce/TheProofIsTrivial
*/
var intros = [
"Just biject it to a",
"Just view the problem as a",
];
var adjectives = [
"abelian",
"associative",
"computable",
"Lebesgue-measurable",
"semi-decidable",
"simple",
"combinatorial",
"structure-preserving",
"diagonalizable",
"nonsingular",
"orientable",
"twice-differentiable",
"thrice-differentiable",
"countable",
"prime",
"complete",
"continuous",
"trivial",
"3-connected",
"bipartite",
"planar",
"finite",
"nondeterministic",
"alternating",
"convex",
"undecidable",
"dihedral",
"context-free",
"rational",
"regular",
"Noetherian",
"Cauchy",
"open",
"closed",
"compact",
"clopen",
"pointless",
"perfect",
"non-degenerate",
"degenerate",
"skew-symmetric",
"sesquilinear",
"fundamental",
"smooth",
"connected",
"simplicial",
"universal",
"greedy",
"normal",
"total",
"left invertible",
"exact",
"empty",
];
/*
* For each noun, the first string is the singular version, and the second
* string specifies the plural version if it can't be inferred from the simple
* algorithm in the plural() method.
*/
var setNouns = [
["multiset"],
["metric space"],
["group"],
["monoid"],
["semigroup"],
["ring"],
["field"],
["module"],
["topological space"],
["Hilbert space"],
["manifold"],
["hypergraph"],
["DAG"],
["residue class"],
["logistic system"],
["complexity class"],
["language"],
["poset"],
["algebra"],
["Lie algebra"],
["Dynkin system"],
["sigma-algebra"],
["ultrafilter"],
["Cayley graph"],
["variety"],
["orbit"],
]
var allNouns = setNouns.concat([
/*
* Mathematical objects that can't contain elements (unless you're a set
* theorist).
*/
["integer"],
["Turing machine"],
["automorphism"],
["bijection"],
["generating function"],
["taylor series", "taylor series"],
["linear transformation"],
["pushdown automaton", "pushdown automata"],
["combinatorial game"],
["equivalence relation"],
["tournament"],
["random variable"],
["triangulation"],
["unbounded-fan-in circuit"],
["log-space reduction"],
["Markov chain"],
["4-form"],
["7-chain"],
["operator"],
["homeomorphism"],
["color"],
["Betti number"],
["Radon-Nikodym derivative"],
])
function randomFromList(list) {
return list[Math.floor(Math.random() * list.length)];
}
function writeLine(fontSize, text) {
document.write('<p style="font-size:' + fontSize + "px" +
'; text-align: center; margin:0; padding:0; border:0">' + text +
'</p>');
}
function plural(nounWithOverride) {
if (nounWithOverride.length === 2) {
return nounWithOverride[1];
} else {
var text = nounWithOverride[0];
if (text[text.length - 1] === "s") {
return text + "es";
} else {
return text + "s";
}
}
}
var firstAdjective = randomFromList(adjectives)
var introSuffix = "aeiou".indexOf(firstAdjective[0]) === -1 ? "" : "n";
writeLine(40, "The proof is trivial! " + randomFromList(intros) + introSuffix);
writeLine(70, firstAdjective);
writeLine(70, randomFromList(setNouns)[0]);
writeLine(40, "whose elements are");
writeLine(70, randomFromList(adjectives));
writeLine(70, plural(randomFromList(allNouns)));
// Google Analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46763418-1', 'theproofistrivial.com');
ga('send', 'pageview');
//]]>
</script>
</body>
</html>