diff --git a/databases/catdat/data/config.yaml b/databases/catdat/data/config.yaml index 1c596e0c..f67ae6a4 100644 --- a/databases/catdat/data/config.yaml +++ b/databases/catdat/data/config.yaml @@ -18,6 +18,9 @@ functor_tags: - forgetful - free +morphism_tags: + - misc + category_property_tags: - limits - colimits @@ -41,6 +44,11 @@ functor_property_tags: - invertibility - misc +morphism_property_tags: + - types of monomorphisms + - types of epimorphisms + - invertibility + relations: - relation: is conditional: would be diff --git a/databases/catdat/data/morphism-implications/mono-epi-iso.yaml b/databases/catdat/data/morphism-implications/mono-epi-iso.yaml new file mode 100644 index 00000000..7cedee2c --- /dev/null +++ b/databases/catdat/data/morphism-implications/mono-epi-iso.yaml @@ -0,0 +1,66 @@ +- id: iso_is_mono + assumptions: + - isomorphism + conclusions: + - split monomorphism + proof: This is trivial. + is_equivalence: false + +- id: split_mono_is_regular_mono + assumptions: + - split monomorphism + conclusions: + - regular monomorphism + proof: 'Let $f : A \to B$ be a split monomorphism, and choose a morphism $g : B \to A$ with $g \circ f = \id_A$. Then it is easy to check that $f$ is an equalizer of $\id_B, f \circ g : B \rightrightarrows B$.' + is_equivalence: false + +- id: mono_is_iso + assumptions: + - monomorphism + mapped_assumptions: + category: + - subobject-trivial + conclusions: + - isomorphism + proof: This holds by definition of a subobject-trivial category. + is_equivalence: false + +- id: balanced_def + assumptions: + - monomorphism + - epimorphism + mapped_assumptions: + category: + - balanced + conclusions: + - isomorphism + proof: This holds by definition of a balanced category. + is_equivalence: false + +- id: regular_mono_is_mono + assumptions: + - regular monomorphism + conclusions: + - monomorphism + proof: This is an immediate consequence of the definition of an equalizer. + is_equivalence: false + +- id: mono-regular_def + assumptions: + - monomorphism + mapped_assumptions: + category: + - mono-regular + conclusions: + - regular monomorphism + proof: This is the definition of a mono-regular category. + is_equivalence: false + +- id: regular_epi_and_mono_is_iso + assumptions: + - regular epimorphism + - monomorphism + conclusions: + - isomorphism + proof: 'If $p : A \to B$ is the coequalizer of $f,g : C \rightrightarrows A$, then $p \circ f = p \circ g$. If $p$ is also a monomorphism, this implies $f = g$. But then $\id_B$ is a coequalizer of $f,g$, so that $p$ is an isomorphism.' + is_equivalence: false diff --git a/databases/catdat/data/morphism-properties/epimorphism.yaml b/databases/catdat/data/morphism-properties/epimorphism.yaml new file mode 100644 index 00000000..322a1ff3 --- /dev/null +++ b/databases/catdat/data/morphism-properties/epimorphism.yaml @@ -0,0 +1,12 @@ +id: epimorphism +relation: is an +description: 'A morphism $f : A \to B$ is an epimorphism if it is right-cancellative, i.e. if $g \circ f = h \circ f$ for two morphisms $g,h : B \rightrightarrows T$, then $g = h$. In many concrete categories appearing in practice, these are are a bit harder to understand than monomorphisms; in particular, epimorphisms usually are not to be confused with surjective structure-preserving maps.' +nlab_link: https://ncatlab.org/nlab/show/epimorphism +invariant_under_equivalences: true +dual_property: monomorphism +related_properties: + - isomorphism + - regular epimorphism + +tags: + - types of epimorphisms diff --git a/databases/catdat/data/morphism-properties/isomorphism.yaml b/databases/catdat/data/morphism-properties/isomorphism.yaml new file mode 100644 index 00000000..9d86db1d --- /dev/null +++ b/databases/catdat/data/morphism-properties/isomorphism.yaml @@ -0,0 +1,12 @@ +id: isomorphism +relation: is an +description: 'A morphism $f : A \to B$ is an isomorphism if it has an inverse, i.e. a morphism $f^{-1} : B \to A$ satisfying $f \circ f^{-1} = \id_B$ and $f^{-1} \circ f = \id_A$.' +nlab_link: https://ncatlab.org/nlab/show/isomorphism +invariant_under_equivalences: true +dual_property: isomorphism +related_properties: + - monomorphism + - epimorphism + +tags: + - invertibility diff --git a/databases/catdat/data/morphism-properties/monomorphism.yaml b/databases/catdat/data/morphism-properties/monomorphism.yaml new file mode 100644 index 00000000..664c832d --- /dev/null +++ b/databases/catdat/data/morphism-properties/monomorphism.yaml @@ -0,0 +1,12 @@ +id: monomorphism +relation: is a +description: 'A morphism $f : A \to B$ is a monomorphism if it is left-cancellative, i.e. if $f \circ g = f \circ h$ for two morphisms $g,h : T \rightrightarrows A$, then $g = h$. In many concrete categories appearing in practice, these are injective structure-preserving maps.' +nlab_link: https://ncatlab.org/nlab/show/monomorphism +invariant_under_equivalences: true +dual_property: epimorphism +related_properties: + - isomorphism + - regular monomorphism + +tags: + - types of monomorphisms diff --git a/databases/catdat/data/morphism-properties/regular epimorphism.yaml b/databases/catdat/data/morphism-properties/regular epimorphism.yaml new file mode 100644 index 00000000..ff0a8532 --- /dev/null +++ b/databases/catdat/data/morphism-properties/regular epimorphism.yaml @@ -0,0 +1,11 @@ +id: regular epimorphism +relation: is a +description: 'A morphism $f : A \to B$ is a regular epimorphism if it is the coequalizer of a pair of morphisms $g,h : C \rightrightarrows A$. In many categories appearing in practice, this is the same as a quotient.' +nlab_link: https://ncatlab.org/nlab/show/regular+epimorphism +invariant_under_equivalences: true +dual_property: regular monomorphism +related_properties: + - epimorphism + +tags: + - types of epimorphisms diff --git a/databases/catdat/data/morphism-properties/regular monomorphism.yaml b/databases/catdat/data/morphism-properties/regular monomorphism.yaml new file mode 100644 index 00000000..1788bdcd --- /dev/null +++ b/databases/catdat/data/morphism-properties/regular monomorphism.yaml @@ -0,0 +1,11 @@ +id: regular monomorphism +relation: is a +description: 'A morphism $f : A \to B$ is a regular monomorphism if it is the equalizer of a pair of morphisms $g,h : B \rightrightarrows C$. In many categories appearing in practice, this is the same as an embedding.' +nlab_link: https://ncatlab.org/nlab/show/regular+monomorphism +invariant_under_equivalences: true +dual_property: regular epimorphism +related_properties: + - monomorphism + +tags: + - types of monomorphisms diff --git a/databases/catdat/data/morphism-properties/split epimorphism.yaml b/databases/catdat/data/morphism-properties/split epimorphism.yaml new file mode 100644 index 00000000..d2076752 --- /dev/null +++ b/databases/catdat/data/morphism-properties/split epimorphism.yaml @@ -0,0 +1,11 @@ +id: split epimorphism +relation: is a +description: 'A morphism $f : A \to B$ is a split epimorphism if there is a morphism $g : B \to A$ with $f \circ g = \id_B$.' +nlab_link: https://ncatlab.org/nlab/show/split+epimorphism +invariant_under_equivalences: true +dual_property: split monomorphism +related_properties: + - epimorphism + +tags: + - types of epimorphisms diff --git a/databases/catdat/data/morphism-properties/split monomorphism.yaml b/databases/catdat/data/morphism-properties/split monomorphism.yaml new file mode 100644 index 00000000..3c6caee5 --- /dev/null +++ b/databases/catdat/data/morphism-properties/split monomorphism.yaml @@ -0,0 +1,11 @@ +id: split monomorphism +relation: is a +description: 'A morphism $f : A \to B$ is a split monomorphism if there is a morphism $g : B \to A$ with $g \circ f = \id_A$.' +nlab_link: https://ncatlab.org/nlab/show/split+monomorphism +invariant_under_equivalences: true +dual_property: split epimorphism +related_properties: + - monomorphism + +tags: + - types of monomorphisms diff --git a/databases/catdat/data/morphisms/empty-map.yaml b/databases/catdat/data/morphisms/empty-map.yaml new file mode 100644 index 00000000..cc53d00c --- /dev/null +++ b/databases/catdat/data/morphisms/empty-map.yaml @@ -0,0 +1,22 @@ +id: empty-map +name: map from the empty set +notation: $!$ +category: Set +description: 'For every set $X$ there is a unique map $! : \varnothing \hookrightarrow X$, the empty map. In this entry, we require that $X$ is non-empty.' +nlab_link: https://ncatlab.org/nlab/show/empty+set + +tags: + - set theory + +related_morphisms: [] + +satisfied_properties: + - property: monomorphism + proof: It is vacuously injective. + +unsatisfied_properties: + - property: epimorphism + proof: Since $X$ is non-empty, the map is not surjective. + + - property: split monomorphism + proof: There is no map $X \to \varnothing$. diff --git a/databases/catdat/data/morphisms/id_X.yaml b/databases/catdat/data/morphisms/id_X.yaml new file mode 100644 index 00000000..6595e969 --- /dev/null +++ b/databases/catdat/data/morphisms/id_X.yaml @@ -0,0 +1,17 @@ +id: id_X +name: identity map of a set +notation: $\id_X$ +category: Set +description: 'Every object of a category has an identity morphism. In this case, we take a set $X$ and consider its identity morphism $\id_X : X \to X$ in $\Set$.' +nlab_link: https://ncatlab.org/nlab/show/identity+morphism + +tags: + - set theory + +related_morphisms: [] + +satisfied_properties: + - property: isomorphism + proof: This is obvious. + +unsatisfied_properties: [] diff --git a/databases/catdat/data/morphisms/integer-rational-embedding.yaml b/databases/catdat/data/morphisms/integer-rational-embedding.yaml new file mode 100644 index 00000000..5641ed10 --- /dev/null +++ b/databases/catdat/data/morphisms/integer-rational-embedding.yaml @@ -0,0 +1,22 @@ +id: integer-rational-embedding +name: embedding of integer into rational numbers +notation: $\iota_{\IZ,\IQ}$ +category: CRing +description: 'The inclusion $\iota_{\IZ,\IQ} : \IZ \hookrightarrow \IQ$ is a typical example of a localization. It is a standard example of a mono- and epimorphism which is not an isomorphism in the category of (commutative) rings.' +nlab_link: https://ncatlab.org/nlab/show/localization+of+a+commutative+ringlization + +tags: + - algebra + +related_morphisms: [] + +satisfied_properties: + - property: monomorphism + proof: It is clearly injective. + + - property: epimorphism + proof: Every localization $R \to S^{-1} R$ has this property by the universal property of localizations. + +unsatisfied_properties: + - property: isomorphism + proof: Clearly, this map is not surjective. diff --git a/databases/catdat/data/morphisms/terminal-map.yaml b/databases/catdat/data/morphisms/terminal-map.yaml new file mode 100644 index 00000000..3e3c891e --- /dev/null +++ b/databases/catdat/data/morphisms/terminal-map.yaml @@ -0,0 +1,19 @@ +id: terminal-map +name: map into the singleton set +notation: $!$ +category: Set +description: 'For every set $X$ there is a unique map $! : X \to 1$, where $1$ is the singleton set. In this entry, we require that $X$ has at least $2$ elements.' +nlab_link: null + +tags: + - set theory + +related_morphisms: [] + +satisfied_properties: + - property: split epimorphism + proof: 'Take any element $x \in X$. The corresponding map $x : 1 \to X$ is a section of $! : X \to 1$.' + +unsatisfied_properties: + - property: monomorphism + proof: Since $X$ has two different elements by assumption, which trivially have the same image, the map is not injective. diff --git a/databases/catdat/schema/001_structures.sql b/databases/catdat/schema/001_structures.sql index 9662fa6e..18313c1f 100644 --- a/databases/catdat/schema/001_structures.sql +++ b/databases/catdat/schema/001_structures.sql @@ -4,7 +4,8 @@ CREATE TABLE structure_types ( INSERT INTO structure_types (type) VALUES ('category'), - ('functor'); + ('functor'), + ('morphism'); CREATE TABLE structures ( id TEXT PRIMARY KEY, @@ -73,4 +74,5 @@ INSERT INTO structure_maps (map, type, mapped_type) VALUES ('source', 'functor', 'category'), - ('target', 'functor', 'category'); \ No newline at end of file + ('target', 'functor', 'category'), + ('category', 'morphism', 'category'); \ No newline at end of file diff --git a/databases/catdat/schema/008_morphisms.sql b/databases/catdat/schema/008_morphisms.sql new file mode 100644 index 00000000..dfc9ea41 --- /dev/null +++ b/databases/catdat/schema/008_morphisms.sql @@ -0,0 +1,17 @@ +CREATE TABLE morphisms ( + id TEXT PRIMARY KEY, + category TEXT NOT NULL, + FOREIGN KEY (id) REFERENCES structures (id) ON DELETE CASCADE, + FOREIGN KEY (category) REFERENCES categories (id) ON DELETE CASCADE +); + +CREATE TRIGGER trg_morphism_type_check +BEFORE INSERT ON morphisms +BEGIN + SELECT + CASE + WHEN + (SELECT type FROM structures WHERE id = NEW.id) != 'morphism' + THEN RAISE(ABORT, 'Morphisms must have type "morphism"') + END; +END; \ No newline at end of file diff --git a/databases/catdat/scripts/config.ts b/databases/catdat/scripts/config.ts index 2b08d9a1..b916e370 100644 --- a/databases/catdat/scripts/config.ts +++ b/databases/catdat/scripts/config.ts @@ -1,15 +1,17 @@ -export type StructureType = 'category' | 'functor' +export type StructureType = 'category' | 'functor' | 'morphism' export const PLURALS = { category: 'categories', functor: 'functors', + morphism: 'morphisms', } as const -export const STRUCTURES: StructureType[] = ['category', 'functor'] +export const STRUCTURES: StructureType[] = ['category', 'functor', 'morphism'] export const STRUCTURES_WITH_DUALS: StructureType[] = ['category'] export const TABLES = { category: 'categories', functor: 'functors', + morphism: 'morphisms', } as const diff --git a/databases/catdat/scripts/deduce.ts b/databases/catdat/scripts/deduce.ts index 80c8c69c..65f2b382 100644 --- a/databases/catdat/scripts/deduce.ts +++ b/databases/catdat/scripts/deduce.ts @@ -27,4 +27,9 @@ function deduce() { create_dualized_implications('functor') deduce_properties_for_structures('functor') restrict_representable_functors() + + // --- morphisms --- + clear_deduced_implications('morphism') + create_dualized_implications('morphism') + deduce_properties_for_structures('morphism') } diff --git a/databases/catdat/scripts/expected-data/decided-morphisms.json b/databases/catdat/scripts/expected-data/decided-morphisms.json new file mode 100644 index 00000000..10d11d5c --- /dev/null +++ b/databases/catdat/scripts/expected-data/decided-morphisms.json @@ -0,0 +1 @@ +["id_X"] diff --git a/databases/catdat/scripts/seed.ts b/databases/catdat/scripts/seed.ts index 91abc95c..0d5c6e5d 100644 --- a/databases/catdat/scripts/seed.ts +++ b/databases/catdat/scripts/seed.ts @@ -9,6 +9,7 @@ import type { PropertyEntry, StructureYaml, PropertyYaml, + MorphismYaml, } from './utils/seed.types' import { create_schema_hash, get_saved_schema_hash } from './utils/schema' import { PLURALS, STRUCTURES, type StructureType } from './config' @@ -36,6 +37,10 @@ function seed() { seed_properties({ type: 'functor', folder: 'functor-properties' }) seed_implications({ type: 'functor', folder: 'functor-implications' }) seed_structures({ type: 'functor', folder: 'functors', extra: insert_functor }) + + seed_properties({ type: 'morphism', folder: 'morphism-properties' }) + seed_implications({ type: 'morphism', folder: 'morphism-implications' }) + seed_structures({ type: 'morphism', folder: 'morphisms', extra: insert_morphism }) } /** @@ -218,6 +223,7 @@ function seed_structures({ structure.notation, structure.description, structure.nlab_link, + // @ts-ignore FIXME structure[`dual_${type}`] || null, ) @@ -301,6 +307,18 @@ function insert_functor(functor: FunctorYaml) { ) } +/** + * Inserts the data of a morphism that is specific to morphisms. + */ +function insert_morphism(morphism: MorphismYaml) { + const morphism_insert = db.prepare( + `INSERT INTO morphisms (id, category) + VALUES (?, ?)`, + ) + + morphism_insert.run(morphism.id, morphism.category) +} + /** * Seeds all properties of a given type from YAML files. */ diff --git a/databases/catdat/scripts/test.ts b/databases/catdat/scripts/test.ts index ae5a9484..a1bcfd7d 100644 --- a/databases/catdat/scripts/test.ts +++ b/databases/catdat/scripts/test.ts @@ -11,6 +11,7 @@ import forget_vector_expected from './expected-data/forget_vector.json' import id_Set_expected from './expected-data/id_Set.json' import decided_categories from './expected-data/decided-categories.json' import decided_functors from './expected-data/decided-functors.json' +import decided_morphisms from './expected-data/decided-morphisms.json' import { capitalize } from './utils/helpers' import { get_client } from './utils/db' import { PLURALS, STRUCTURES, type StructureType } from './config' @@ -31,6 +32,7 @@ function execute_tests() { check_link_targets_exist() console.info('\n--- Test categories ---') + test_mutual_structure_duals('category') test_positivity('1', 'category') test_mutual_property_duals('category') @@ -41,6 +43,7 @@ function execute_tests() { ) console.info('\n--- Test functors ---') + test_positivity('id_Set', 'functor') test_mutual_property_duals('functor') test_decided_structures(decided_functors, 'functor') @@ -48,6 +51,11 @@ function execute_tests() { { forget_vector: forget_vector_expected, id_Set: id_Set_expected }, 'functor', ) + + console.info('\n--- Test morphisms ---') + + test_positivity('id_X', 'morphism') + test_decided_structures(decided_morphisms, 'morphism') } catch (err) { if (err instanceof Error) { console.error(err.message) diff --git a/databases/catdat/scripts/utils/seed.types.ts b/databases/catdat/scripts/utils/seed.types.ts index 2d0b24d0..f266a68c 100644 --- a/databases/catdat/scripts/utils/seed.types.ts +++ b/databases/catdat/scripts/utils/seed.types.ts @@ -2,8 +2,10 @@ export type ConfigYaml = { structure_tags: string[] category_tags: string[] functor_tags: string[] + morphism_tags: string[] category_property_tags: string[] functor_property_tags: string[] + morphism_property_tags: string[] relations: { relation: string conditional: string @@ -43,8 +45,8 @@ export type StructureYaml = { tags: string[] related_categories?: string[] // TODO: improve this related_functors?: string[] + related_morphisms?: string[] dual_category?: string // TODO: improve this - dual_functor?: string satisfied_properties: PropertyEntry[] unsatisfied_properties: PropertyEntry[] undecidable_properties?: PropertyEntry[] @@ -65,6 +67,10 @@ export type FunctorYaml = StructureYaml & { left_adjoint?: string } +export type MorphismYaml = StructureYaml & { + category: string +} + export type PropertyYaml = { id: string relation: string diff --git a/src/lib/commons/structures.ts b/src/lib/commons/structures.ts index 72e79708..37f9699a 100644 --- a/src/lib/commons/structures.ts +++ b/src/lib/commons/structures.ts @@ -1,10 +1,11 @@ import type { StructureType } from './types' -export const STRUCTURES: StructureType[] = ['category', 'functor'] +export const STRUCTURES: StructureType[] = ['category', 'functor', 'morphism'] export const PLURALS = { category: 'categories', functor: 'functors', + morphism: 'morphisms', } export function get_selected_type(pathname: string): StructureType { diff --git a/src/lib/commons/types.ts b/src/lib/commons/types.ts index af2ebcb2..cc128c81 100644 --- a/src/lib/commons/types.ts +++ b/src/lib/commons/types.ts @@ -4,7 +4,7 @@ export type Arrayed = { type Replace>> = Omit & R -export type StructureType = 'category' | 'functor' +export type StructureType = 'category' | 'functor' | 'morphism' export type StructureShort = { id: string @@ -44,6 +44,12 @@ export type FunctorSpecificDisplay = { right_adjoint_notation: string | null } +export type MorphismSpecificDisplay = { + category: string + category_name: string + category_notation: string +} + export type MappedTypes = Record export type TagObject = { tag: string } diff --git a/src/lib/server/fetchers/morphism.ts b/src/lib/server/fetchers/morphism.ts new file mode 100644 index 00000000..c1b7d33b --- /dev/null +++ b/src/lib/server/fetchers/morphism.ts @@ -0,0 +1,25 @@ +import type { MorphismSpecificDisplay } from '$lib/commons/types' +import sql from 'sql-template-tag' +import { query } from '$lib/server/db.catdat' +import { error } from '@sveltejs/kit' + +export function fetch_morphism(id: string) { + const { rows: morphisms, err } = query( + // specific information for the morphism + sql` + SELECT + c.id AS category, + c.name AS category_name, + c.notation AS category_notation + FROM morphisms m + INNER JOIN structures AS c ON c.id = m.category + WHERE m.id = ${id} + `, + ) + + if (err) error(500, 'Could not load morphism') + + if (!morphisms.length) error(404, `Could not find morphism with ID '${id}'`) + + return morphisms[0] +} diff --git a/src/pages/ImplicationPage.svelte b/src/pages/ImplicationPage.svelte index 39db6aa7..3dc99f43 100644 --- a/src/pages/ImplicationPage.svelte +++ b/src/pages/ImplicationPage.svelte @@ -42,7 +42,7 @@ {#each Object.entries(implication.mapped_assumptions) as [map, list]} {#if list?.length}

- Assumptions on {map} {mapped_types[map]}: + Requirements of the {map}: {#each list as property, index} {property} {/if} + {#if type === 'morphism'} + +

+ + The morphism application is still in its early stages. More morphisms will be added + soon. +

+ {/if} +

diff --git a/src/routes/missing/+page.server.ts b/src/routes/missing/+page.server.ts index 7017258e..b25f2c69 100644 --- a/src/routes/missing/+page.server.ts +++ b/src/routes/missing/+page.server.ts @@ -1,29 +1,29 @@ import { fetch_missing_data } from '$lib/server/fetchers/missing_data' import { fetch_categories_with_missing_morphisms } from '$lib/server/fetchers/category' +import { STRUCTURES } from '$lib/commons/structures' export const load = () => { const categories_with_missing_morphisms = fetch_categories_with_missing_morphisms() - const missing_category_data = fetch_missing_data('category') - const missing_functor_data = fetch_missing_data('functor') + const missing_data = Object.fromEntries( + STRUCTURES.map((type) => [type, fetch_missing_data(type)]), + ) + + function select( + selector: (data: (typeof missing_data)[keyof typeof missing_data]) => T, + ) { + return Object.fromEntries( + STRUCTURES.map((type) => [type, selector(missing_data[type])]), + ) + } return { - structures_with_unknown_properties: { - category: missing_category_data.structures_with_unknown_properties, - functor: missing_functor_data.structures_with_unknown_properties, - }, - unknown_totals: { - category: missing_category_data.total_unknown_property_pairs, - functor: missing_functor_data.total_unknown_property_pairs, - }, - undistinguishable_pairs: { - category: missing_category_data.undistinguishable_structure_pairs, - functor: missing_functor_data.undistinguishable_structure_pairs, - }, - missing_combinations: { - category: missing_category_data.missing_combinations, - functor: missing_functor_data.missing_combinations, - }, + structures_with_unknown_properties: select( + (data) => data.structures_with_unknown_properties, + ), + unknown_totals: select((data) => data.total_unknown_property_pairs), + undistinguishable_pairs: select((data) => data.undistinguishable_structure_pairs), + missing_combinations: select((data) => data.missing_combinations), categories_with_missing_morphisms, } } diff --git a/src/routes/missing/+page.svelte b/src/routes/missing/+page.svelte index 117a5191..b566f809 100644 --- a/src/routes/missing/+page.svelte +++ b/src/routes/missing/+page.svelte @@ -87,33 +87,35 @@ {#each STRUCTURES as type} {@const combinations = data.missing_combinations[type]} -

-

Missing {type} combinations

+ {#if combinations.length > 0} +
+

Missing {type} combinations

-

- Among the consistent {type} combinations of the form p ∧ ¬q, the following - are not yet witnessed by a {type} in the database or its dual. If some of these - combinations are - inconsistent, this indicates that some - implication is missing. -

+

+ Among the consistent {type} combinations of the form p ∧ ¬q, the following + are not yet witnessed by a {type} in the database or its dual. If some of these + combinations are + inconsistent, this indicates that some + implication is missing. +

-
- - Show all {combinations.length} combinations - - -
    - {#each combinations as [p, q]} -
  • - {p} ∧ ¬{q} -
  • - {/each} -
-
-
+
+ + Show all {combinations.length} combinations + + +
    + {#each combinations as [p, q]} +
  • + {p} ∧ ¬{q} +
  • + {/each} +
+
+
+ {/if} {/each} diff --git a/src/routes/morphism-comparison/+page.server.ts b/src/routes/morphism-comparison/+page.server.ts new file mode 100644 index 00000000..27b026bc --- /dev/null +++ b/src/routes/morphism-comparison/+page.server.ts @@ -0,0 +1,5 @@ +import { fetch_structures } from '$lib/server/fetchers/structures' + +export const load = () => { + return fetch_structures('morphism') +} diff --git a/src/routes/morphism-comparison/+page.svelte b/src/routes/morphism-comparison/+page.svelte new file mode 100644 index 00000000..626b192e --- /dev/null +++ b/src/routes/morphism-comparison/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism-comparison/[...ids]/+page.server.ts b/src/routes/morphism-comparison/[...ids]/+page.server.ts new file mode 100644 index 00000000..12443fd9 --- /dev/null +++ b/src/routes/morphism-comparison/[...ids]/+page.server.ts @@ -0,0 +1,12 @@ +import { fetch_comparison_result } from '$lib/server/fetchers/comparison' +import { cache_page } from '$lib/server/utils' + +export const prerender = false + +export const load = (event) => { + const compared_ids = event.params.ids.split('/') + + return fetch_comparison_result(compared_ids, 'morphism', () => { + cache_page(event) + }) +} diff --git a/src/routes/morphism-comparison/[...ids]/+page.svelte b/src/routes/morphism-comparison/[...ids]/+page.svelte new file mode 100644 index 00000000..11f4d1e6 --- /dev/null +++ b/src/routes/morphism-comparison/[...ids]/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism-implication/[id]/+page.server.ts b/src/routes/morphism-implication/[id]/+page.server.ts new file mode 100644 index 00000000..bb302106 --- /dev/null +++ b/src/routes/morphism-implication/[id]/+page.server.ts @@ -0,0 +1,8 @@ +import { fetch_implication } from '$lib/server/fetchers/implication' +import { render_nested_formulas } from '$lib/server/formulas' + +export const load = (event) => { + const id = event.params.id + + return render_nested_formulas(fetch_implication('morphism', id)) +} diff --git a/src/routes/morphism-implication/[id]/+page.svelte b/src/routes/morphism-implication/[id]/+page.svelte new file mode 100644 index 00000000..a97e46ff --- /dev/null +++ b/src/routes/morphism-implication/[id]/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism-implications/+page.server.ts b/src/routes/morphism-implications/+page.server.ts new file mode 100644 index 00000000..c3c4e42b --- /dev/null +++ b/src/routes/morphism-implications/+page.server.ts @@ -0,0 +1,8 @@ +import { render_nested_formulas } from '$lib/server/formulas' +import { fetch_implications } from '$lib/server/fetchers/implications' + +export const load = () => { + const { implications } = fetch_implications('morphism') + + return render_nested_formulas({ implications }) +} diff --git a/src/routes/morphism-implications/+page.svelte b/src/routes/morphism-implications/+page.svelte new file mode 100644 index 00000000..fd3605ac --- /dev/null +++ b/src/routes/morphism-implications/+page.svelte @@ -0,0 +1,15 @@ + + + + {#snippet hints()} +

+ *Deductions from these implications are automatically incorporated into each + morphism whenever applicable. Moreover, implications are automatically + dualized when the corresponding dual properties exist. +

+ {/snippet} +
diff --git a/src/routes/morphism-properties/+page.server.ts b/src/routes/morphism-properties/+page.server.ts new file mode 100644 index 00000000..65095e1b --- /dev/null +++ b/src/routes/morphism-properties/+page.server.ts @@ -0,0 +1,5 @@ +import { fetch_grouped_properties_and_tags } from '$lib/server/fetchers/properties' + +export const load = () => { + return fetch_grouped_properties_and_tags('morphism') +} diff --git a/src/routes/morphism-properties/+page.svelte b/src/routes/morphism-properties/+page.svelte new file mode 100644 index 00000000..dadefb7f --- /dev/null +++ b/src/routes/morphism-properties/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism-properties/[tag]/+page.server.ts b/src/routes/morphism-properties/[tag]/+page.server.ts new file mode 100644 index 00000000..ccbb6896 --- /dev/null +++ b/src/routes/morphism-properties/[tag]/+page.server.ts @@ -0,0 +1,11 @@ +import { fetch_tagged_properties } from '$lib/server/fetchers/properties' +import { fetch_property_tags } from '$lib/server/fetchers/tags' +import type { EntryGenerator } from './$types' + +export const entries: EntryGenerator = () => { + return fetch_property_tags('morphism') +} + +export const load = (event) => { + return fetch_tagged_properties('morphism', event.params.tag) +} diff --git a/src/routes/morphism-properties/[tag]/+page.svelte b/src/routes/morphism-properties/[tag]/+page.svelte new file mode 100644 index 00000000..62fb6cb9 --- /dev/null +++ b/src/routes/morphism-properties/[tag]/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism-property/[id]/+page.server.ts b/src/routes/morphism-property/[id]/+page.server.ts new file mode 100644 index 00000000..3ce350d5 --- /dev/null +++ b/src/routes/morphism-property/[id]/+page.server.ts @@ -0,0 +1,11 @@ +import { render_nested_formulas } from '$lib/server/formulas' +import { decode_property_ID } from '$lib/commons/property.url' +import { fetch_property } from '$lib/server/fetchers/property' + +export const load = (event) => { + const id = decode_property_ID(event.params.id) + + const property_data = fetch_property('morphism', id) + + return render_nested_formulas(property_data) +} diff --git a/src/routes/morphism-property/[id]/+page.svelte b/src/routes/morphism-property/[id]/+page.svelte new file mode 100644 index 00000000..acb5718b --- /dev/null +++ b/src/routes/morphism-property/[id]/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism-search/+page.server.ts b/src/routes/morphism-search/+page.server.ts new file mode 100644 index 00000000..6ba761c3 --- /dev/null +++ b/src/routes/morphism-search/+page.server.ts @@ -0,0 +1,5 @@ +import { get_property_ids } from '$lib/server/fetchers/properties' + +export const load = () => { + return { all_properties: get_property_ids('morphism') } +} diff --git a/src/routes/morphism-search/+page.svelte b/src/routes/morphism-search/+page.svelte new file mode 100644 index 00000000..d62dc5d3 --- /dev/null +++ b/src/routes/morphism-search/+page.svelte @@ -0,0 +1,13 @@ + + + + Search for morphism with certain properties while excluding others. For example, you + can look for morphisms which are monomorphisms and epimorphisms, + but no isomorphisms. + diff --git a/src/routes/morphism-search/results/+page.server.ts b/src/routes/morphism-search/results/+page.server.ts new file mode 100644 index 00000000..390cfa6b --- /dev/null +++ b/src/routes/morphism-search/results/+page.server.ts @@ -0,0 +1,13 @@ +import { fetch_search_results } from '$lib/server/fetchers/search' +import { cache_page } from '$lib/server/utils' + +export const prerender = false + +export const load = (event) => { + const satisfied_query = event.url.searchParams.get('satisfied') + const unsatisfied_query = event.url.searchParams.get('unsatisfied') + + return fetch_search_results(satisfied_query, unsatisfied_query, 'morphism', () => + cache_page(event), + ) +} diff --git a/src/routes/morphism-search/results/+page.svelte b/src/routes/morphism-search/results/+page.svelte new file mode 100644 index 00000000..2a2557f4 --- /dev/null +++ b/src/routes/morphism-search/results/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphism/[id]/+page.server.ts b/src/routes/morphism/[id]/+page.server.ts new file mode 100644 index 00000000..6923eaf4 --- /dev/null +++ b/src/routes/morphism/[id]/+page.server.ts @@ -0,0 +1,34 @@ +import { fetch_morphism } from '$lib/server/fetchers/morphism' +import { fetch_structure } from '$lib/server/fetchers/structure' +import { render_nested_formulas } from '$lib/server/formulas' + +export const load = (event) => { + const id = event.params.id + + const { + structure, + related_structures, + tags, + satisfied_properties, + unsatisfied_properties, + unknown_properties, + undecidable_properties, + undistinguishable_structures, + comments, + } = fetch_structure('morphism', id) + + const morphism = fetch_morphism(id) + + return render_nested_formulas({ + structure, + morphism, + related_structures, + tags, + satisfied_properties, + unsatisfied_properties, + unknown_properties, + undecidable_properties, + undistinguishable_structures, + comments, + }) +} diff --git a/src/routes/morphism/[id]/+page.svelte b/src/routes/morphism/[id]/+page.svelte new file mode 100644 index 00000000..0e2550a6 --- /dev/null +++ b/src/routes/morphism/[id]/+page.svelte @@ -0,0 +1,16 @@ + + + + {#snippet definition()} +
  • + Category: + + {data.morphism.category_name} + +
  • + {/snippet} +
    diff --git a/src/routes/morphisms/+page.server.ts b/src/routes/morphisms/+page.server.ts new file mode 100644 index 00000000..0825b73e --- /dev/null +++ b/src/routes/morphisms/+page.server.ts @@ -0,0 +1,5 @@ +import { fetch_structures_and_tags } from '$lib/server/fetchers/structures' + +export const load = () => { + return fetch_structures_and_tags('morphism') +} diff --git a/src/routes/morphisms/+page.svelte b/src/routes/morphisms/+page.svelte new file mode 100644 index 00000000..f94edcfc --- /dev/null +++ b/src/routes/morphisms/+page.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/morphisms/[tag]/+page.server.ts b/src/routes/morphisms/[tag]/+page.server.ts new file mode 100644 index 00000000..7624ca36 --- /dev/null +++ b/src/routes/morphisms/[tag]/+page.server.ts @@ -0,0 +1,12 @@ +import type { EntryGenerator } from './$types' +import { fetch_tagged_structures } from '$lib/server/fetchers/structures' +import { fetch_structure_tags } from '$lib/server/fetchers/tags' + +export const entries: EntryGenerator = () => { + return fetch_structure_tags('morphism') +} + +export const load = (event) => { + const tag = event.params.tag + return fetch_tagged_structures('morphism', tag) +} diff --git a/src/routes/morphisms/[tag]/+page.svelte b/src/routes/morphisms/[tag]/+page.svelte new file mode 100644 index 00000000..d3340462 --- /dev/null +++ b/src/routes/morphisms/[tag]/+page.svelte @@ -0,0 +1,7 @@ + + +