use super::functions::*;
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct CoveringSpaceData {
pub total: String,
pub base: String,
pub sheets: Option<usize>,
pub deck_group: String,
pub is_universal: bool,
}
#[allow(dead_code)]
impl CoveringSpaceData {
pub fn new(total: &str, base: &str, sheets: Option<usize>) -> Self {
CoveringSpaceData {
total: total.to_string(),
base: base.to_string(),
sheets,
deck_group: "unknown".to_string(),
is_universal: false,
}
}
pub fn with_deck_group(mut self, g: &str) -> Self {
self.deck_group = g.to_string();
self
}
pub fn universal(mut self) -> Self {
self.is_universal = true;
self
}
pub fn monodromy_description(&self) -> String {
let n = self
.sheets
.map(|k| k.to_string())
.unwrap_or("∞".to_string());
format!("Monodromy: π_1({}) → S_{}", self.base, n)
}
pub fn lifting_theorem(&self) -> String {
format!(
"π_1({}) ≅ subgroup of π_1({}) with index {:?}",
self.total, self.base, self.sheets
)
}
}
#[allow(dead_code)]
#[derive(Debug, Clone, Default)]
pub struct SeparationAxioms {
pub t0: bool,
pub t1: bool,
pub t2: bool,
pub t2_5: bool,
pub t3: bool,
pub t3_5: bool,
pub t4: bool,
}
#[allow(dead_code)]
impl SeparationAxioms {
pub fn normal_hausdorff() -> Self {
SeparationAxioms {
t0: true,
t1: true,
t2: true,
t2_5: true,
t3: true,
t3_5: true,
t4: true,
}
}
pub fn hausdorff() -> Self {
SeparationAxioms {
t0: true,
t1: true,
t2: true,
t2_5: false,
t3: false,
t3_5: false,
t4: false,
}
}
pub fn is_tychonoff(&self) -> bool {
self.t3_5
}
pub fn urysohn_lemma_applies(&self) -> bool {
self.t4
}
pub fn tietze_applies(&self) -> bool {
self.t4
}
}
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct TychonoffData {
pub factors: Vec<String>,
pub product_compact: bool,
}
#[allow(dead_code)]
impl TychonoffData {
pub fn new(factors: Vec<String>) -> Self {
TychonoffData {
product_compact: !factors.is_empty(),
factors,
}
}
pub fn tychonoff_theorem(&self) -> String {
format!(
"Tychonoff: ∏ {} is compact (using AC)",
self.factors.join(" × ")
)
}
pub fn cech_stone_connection(&self) -> String {
"βX = Stone-Čech compactification = max compact Hausdorff extension of X".to_string()
}
}
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct CompactHausdorffData {
pub space: String,
pub metrizable: bool,
pub second_countable: bool,
pub connected: bool,
pub dimension: Option<usize>,
}
#[allow(dead_code)]
impl CompactHausdorffData {
pub fn new(space: &str) -> Self {
CompactHausdorffData {
space: space.to_string(),
metrizable: false,
second_countable: false,
connected: false,
dimension: None,
}
}
pub fn metrizable(mut self) -> Self {
self.metrizable = true;
self.second_countable = true;
self
}
pub fn connected(mut self) -> Self {
self.connected = true;
self
}
pub fn with_dimension(mut self, d: usize) -> Self {
self.dimension = Some(d);
self
}
pub fn urysohn_metrization(&self) -> bool {
self.second_countable
}
pub fn stone_weierstrass_applies(&self) -> bool {
true
}
pub fn tietze_extension(&self) -> String {
format!(
"Tietze: every f: A → R (A ⊆ {} closed) extends to F: {} → R",
self.space, self.space
)
}
}
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct QuotientSpaceData {
pub space: String,
pub relation: String,
pub quotient: String,
pub open_map: bool,
}
#[allow(dead_code)]
impl QuotientSpaceData {
pub fn new(space: &str, relation: &str, quotient: &str) -> Self {
QuotientSpaceData {
space: space.to_string(),
relation: relation.to_string(),
quotient: quotient.to_string(),
open_map: false,
}
}
pub fn is_hausdorff_when_compact_and_closed(&self) -> bool {
true
}
pub fn characteristic_property(&self) -> String {
format!(
"f: {}/~ → Y is continuous iff f∘π: {} → Y is continuous",
self.space, self.space
)
}
pub fn with_open_map(mut self) -> Self {
self.open_map = true;
self
}
}