diff --git a/app/components/Math.tsx b/app/components/Math.tsx new file mode 100644 index 0000000..f0c9f2b --- /dev/null +++ b/app/components/Math.tsx @@ -0,0 +1,17 @@ +"use client" + +import React from "react" +import { InlineMath, BlockMath } from 'react-katex' +import 'katex/dist/katex.min.css' + +type Props = { math: string; className?: string } + +export function Inline({ math, className = "" }: Props) { + return +} + +export function Block({ math, className = "" }: Props) { + return +} + +export default { Inline, Block } diff --git a/app/components/subjects.tsx b/app/components/subjects.tsx index 588c63a..23a7b77 100644 --- a/app/components/subjects.tsx +++ b/app/components/subjects.tsx @@ -100,7 +100,7 @@ const subjectCodes: Record = { "Web Technologies": "wt", "DevOps & Linux Administration": "dops", "Organizational Behavior": "ob", - "Discrete Mathematics": "dm", + "Discrete Mathematics": "discrete", "Data Science using Python Libraries": "dsp", "Artificial Intelligence": "ai", @@ -129,7 +129,7 @@ const subjectCodes: Record = { }; // Available subjects -const available = ["ep", "c", "em1", "em2", "oops", "dsc", "coa", "os", "ml", "dops", "cd", "cle", "ec", "dbms", "bme", "cns", "vlsi", "mb"]; +const available = ["ep", "c", "em1", "em2", "oops", "dsc", "coa", "os", "discrete","ml", "dops", "cd", "cle", "ec", "dbms", "bme", "cns", "vlsi", "mb"]; export default function SubjectsSection() { return ( diff --git a/app/sem4/discrete/[chapter]/page.tsx b/app/sem4/discrete/[chapter]/page.tsx new file mode 100644 index 0000000..ba3a142 --- /dev/null +++ b/app/sem4/discrete/[chapter]/page.tsx @@ -0,0 +1,132 @@ +import Link from "next/link"; +import { Ch0Content } from "../content/chapter0"; +import { Ch1Content } from "../content/chapter1"; +import { Ch2Content } from "../content/chapter2"; +import { Ch3Content } from "../content/chapter3"; +import { Ch4Content } from "../content/chapter4"; +import { Ch5Content } from "../content/chapter5"; +import { Ch6Content } from "../content/chapter6"; +import BookmarkButton from "../../../components/BookmarkButton"; + + +import ChapterQuizInline from "../components/ChapterQuizInline"; +import { ArrowBigLeft, ArrowBigRight } from "lucide-react"; +import { Righteous } from "next/font/google"; +import { moduleQuizzes } from "@/lib/quizData"; + +const righteous = Righteous({ + subsets: ["latin"], + weight: "400", + variable: "--font-righteous", +}); + +const chapters = [ + { id: "ch0", title: "Course Outline", component: Ch0Content }, + { id: "ch1", title: "Sets and Logic", component: Ch1Content }, + { id: "ch2", title: "Relations and Functions", component: Ch2Content }, + { id: "ch3", title: "Combinatorics and Counting", component: Ch3Content }, + { id: "ch4", title: "Graph Theory", component: Ch4Content }, + { id: "ch5", title: "Recurrence Relations", component: Ch5Content }, + { id: "ch6", title: "Boolean Algebra and Automata", component: Ch6Content }, +]; + +type ChapterProps = { + params: { chapter: string }; +}; + +export default function ChapterPage({ params }: ChapterProps) { + const currentIndex = chapters.findIndex((c) => c.id === params.chapter); + + const chapter = chapters[currentIndex]; + + if (!chapter) { + return

Chapter not found

; + } + + const ChapterComponent = chapter.component; + + const prevChapter = currentIndex > 0 ? chapters[currentIndex - 1] : null; + const nextChapter = currentIndex < chapters.length - 1 ? chapters[currentIndex + 1] : null; + + const chapterQuizSlugMap: Record = {}; + const chapterQuiz = moduleQuizzes.find((quiz) => quiz.slug === chapterQuizSlugMap[params.chapter]); + + return ( +
+
+

Discrete Mathematics

+ +
+

{chapter.title}

+ +
+ +
+ {prevChapter ? ( + + + Previous + + ) : ( +
+ )} + + {nextChapter ? ( + + Next + + + ) : ( +
+ )} +
+ +
+ + + + {chapterQuiz ? ( +
+ +
+ ) : null} +
+ +
+ {prevChapter ? ( + + + {prevChapter.title} + + ) : ( +
+ )} + + {nextChapter ? ( + + {nextChapter.title} + + + ) : ( +
+ )} +
+
+ ); +} diff --git a/app/sem4/discrete/components/ChapterQuizInline.tsx b/app/sem4/discrete/components/ChapterQuizInline.tsx new file mode 100644 index 0000000..109d4de --- /dev/null +++ b/app/sem4/discrete/components/ChapterQuizInline.tsx @@ -0,0 +1,47 @@ +"use client"; + +import { useState } from "react"; +import type { Quiz } from "@/lib/quizData"; +import QuizClient from "@/app/quiz/[slug]/QuizClient"; + +interface Props { + quiz: Quiz; +} + +export default function ChapterQuizInline({ quiz }: Props) { + const [showQuiz, setShowQuiz] = useState(false); + + if (showQuiz) { + return setShowQuiz(false)} />; + } + + return ( +
+
+

+ Ready to test your {quiz.moduleTitle} knowledge? +

+

+ {quiz.moduleTitle} +

+

+ {quiz.description} +

+
+ {Math.min(5, quiz.questions.length)} questions + · + No time limit + · + Instant feedback +
+ +
+
+ ); +} diff --git a/app/sem4/discrete/components/sidebar.tsx b/app/sem4/discrete/components/sidebar.tsx new file mode 100644 index 0000000..1062188 --- /dev/null +++ b/app/sem4/discrete/components/sidebar.tsx @@ -0,0 +1,91 @@ +"use client"; +import { Righteous } from "next/font/google"; +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { useState, useEffect } from "react"; + +const righteous = Righteous({ + subsets: ["latin"], + weight: "400", + variable: "--font-righteous", +}); + +export default function Sidebar() { + const pathname = usePathname(); + const [open, setOpen] = useState(false); + + useEffect(() => { + if (window.innerWidth >= 768) { + setOpen(true); + } + }, []); + +const chapters = [ + { id: "ch0", title: "Chapter 0: Course Outline" }, + { id: "ch1", title: "Chapter 1: Mathematical Logic and Proofs" }, + { id: "ch2", title: "Chapter 2: Set Theory, Relations, and Functions" }, + { id: "ch3", title: "Chapter 3: Combinatorics, Number Theory, and Recurrence Relations" }, + { id: "ch4", title: "Chapter 4: Graph Theory" }, + { id: "ch5", title: "Chapter 5: Algebraic Structures" }, +]; + + return ( + <> +
setOpen(false)} + /> + +
+ + + +
+ + ); +} diff --git a/app/sem4/discrete/content/chapter0.tsx b/app/sem4/discrete/content/chapter0.tsx new file mode 100644 index 0000000..1c69787 --- /dev/null +++ b/app/sem4/discrete/content/chapter0.tsx @@ -0,0 +1,162 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch0Content() { + return ( +
+

+ Welcome to Discrete Mathematics — a core foundational syllabus designed to analyze mathematical elements that take on distinct, separated values rather than continuous intervals. This course acts as the absolute structural pillar for algorithm layout complexity bounds, microprocessor logic paths, cryptographic keyspaces, and formal grammar verification. +

+ +
+ +
+

+ Chapter 1: Mathematical Logic and Proofs +

+

+ Establishes the un-ambiguous truth checking models used to construct flawless mathematical arguments. +

+
    +
  • + Propositional Logic Syntax: Declarative assertions, complete primitive connectives (, , , , , ), functional truth matrices, and invariant edge exceptions like vacuous truth states. +
  • +
  • + Algebraic Equivalence Laws: Minimizing complex logical chaining expressions using Idempotent, Absorption, Domination, Distributive, and De Morgan algebraic invariants. +
  • +
  • + Predicate Scoping: Bounding variable properties using Universal () and Existential () operators, and the non-commutative sequence limitations of nested quantifier scopes. +
  • +
  • + Formal Proof Methodologies: Structural proofs via Direct derivation (), Invariant Contraposition (), Elimination by Contradiction (), and complete Mathematical Induction step mappings. +
  • +
+
+ +
+ +
+

+ Chapter 2: Set Theory, Relations, and Functions +

+

+ Defines the core groupings, ordered pairings, and deterministic transformations of discrete variables. +

+
    +
  • + Set Topology Invariants: Subsets (), Power sets () with cardinality metrics (), operations (), and algebraic identities. +
  • +
  • + Binary Coordinate Relations: Cartesian products (), relational profiles, and exact matrix classifications (Reflexive, Irreflexive, Symmetric, Asymmetric, Anti-Symmetric, Transitive). +
  • +
  • + Partitions & Equivalence Domains: Constructing equivalence relations, parsing element classes (), and structural block formatting using the Fundamental Partition Theorem. +
  • +
  • + Posets & Order Systems: Partial orderings (), Linear Total orders, immediate covering parameters, and structural visual formatting of Hasse Diagrams. +
  • +
  • + Functional Mappings: Functional boundary setups (), structural classification types (Injective, Surjective, Bijective matchings), function composition associativity, non-commutativity laws, and inverse step criteria (). +
  • +
+
+ +
+ +
+

+ Chapter 3: Combinatorics, Number Theory, and Recurrence Relations +

+

+ Measures layout configuration paths, numerical divisibility bounds, and sequential recursive equations. +

+
    +
  • + Combinatorial Counting Invariants: Fundamental Sum and Product rules, the Principle of Inclusion-Exclusion for discrete probabilities, and worst-case bounds under the Generalized Pigeonhole Principle. +
  • +
  • + Number Theory Systems: Greatest Common Divisors (), Least Common Multiples (), Bézout Coefficients derived from the Extended Euclidean Algorithm, solvability limits of Linear Diophantine Equations (), and unique modular roots via the Chinese Remainder Theorem. +
  • +
  • + Recurrence System Classifications: Formulating relational models from applications, linear homogeneous sequences, and linear non-homogeneous systems containing forcing factors (). +
  • +
  • + Analytical Resolution Tracks: Resolving boundary steps via Repeated Substitution iterations, polynomial Characteristic Root extractions (Distinct vs. Multiplicity root chains), and infinite power series transformations using formal Generating Functions paired with the Extended Binomial Theorem. +
  • +
+
+ +
+ +
+

+ Chapter 4: Graph Theory +

+

+ Models topological network connections, traversal routing optimization, and spatial space partitioning. +

+
    +
  • + Graph Topologies: Vertices, edges, Order () and Size () parameters, localized degree behaviors, and the invariant constraints of the Handshaking Lemma. +
  • +
  • + Graph Operations & Sub-units: Subgraphs, Subtrees, structural Graph Joins (), and spatial Cartesian Products (). +
  • +
  • + Computational Layout Matrices: Square Adjacency Matrices (), non-square Incidence Matrices (), and memory-optimized dynamic Adjacency Lists. +
  • +
  • + Network Traversal Paths: Differentiating Walks, Trails, Paths, Circuits, and Cycles. Historic roots from Leonhard Euler's Königsberg Bridge problem. +
  • +
  • + Routing & Traversal Optimization: Parity guidelines for Eulerian paths/circuits, the Chinese Postman Problem, Dirac and Ore boundaries for Hamiltonian circuits, and NP-hard constraints of the Traveling Salesperson Problem. +
  • +
  • + Isomorphism & Surface Embedding: Mapping bijections () using structural invariant tests, topological Planar Graphs, Euler's Region Formula (), and Kuratowski's forbidden non-planar subgraphs (, ). +
  • +
  • + Coloring & Partitioning: Chromatic numbers (), planar graph mapping bounds under the Four-Color Theorem, and edge set partitioning into matching perfect subsets via 1-Factorization and 2-Factorization rules. +
  • +
+
+ +
+ +
+

+ Chapter 5: Algebraic Structures +

+

+ Analyzes abstract axiomatic systems governing single and dual operational numeric domains. +

+
    +
  • + Binary Rule Axioms: Core operational guidelines spanning Closure bounds, Associativity grouping, Identity retention (), and unique Inverse reflections (). +
  • +
  • + Single Operation Hierarchies: System classifications tracking from basic Magmas and Semigroups to Monoids, full algebraic Groups, and commutative Abelian systems. +
  • +
  • + Modular Groups: Finite additive groups (, ), coprime multiplicative groups (, ), and crypto-safe prime order fields (). +
  • +
  • + Sub-domains & Generators: Subgroup validation criteria, generative tracking elements of Cyclic Groups (), left/right coset configurations, and index scaling based on Lagrange's Subgroup Order Theorem. +
  • +
  • + Dual Operation Rings: System behaviors under two concurrent operators (, ) satisfying Ring axioms, Commutative rings, Rings with Unity, Zero Divisor hazards, and cancellation-safe fields of Integral Domains. +
  • +
  • + Invertible Fields: Global completeness criteria of algebraic Fields, finite Galois Field limits ( or ), and their performance configuration rules inside numeric engineering applications. +
  • +
+
+ +
+ +

+ By mastering these 5 discrete structural chapters, you will possess the complete analytical toolkit required to formally evaluate algorithmic complexities, prove computing safety properties, layout database schemas, and optimize hardware gate configurations. +

+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter1.tsx b/app/sem4/discrete/content/chapter1.tsx new file mode 100644 index 0000000..3c5a9b1 --- /dev/null +++ b/app/sem4/discrete/content/chapter1.tsx @@ -0,0 +1,543 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch1Content() { + return ( +
+ {/* Overview */} +

+ Welcome to the comprehensive study of Mathematical Logic and Proofs. This field acts as the absolute bedrock for formal computer science engineering. It dictates how microprocessors execute boolean branching, forms the mechanical rules behind automated software verification, and guarantees that structural derivations in mathematics are free from human conversational ambiguity. +

+ +
+ + {/* 1. Propositional Logic */} +
+

+ 1. Deep Dive into Propositional Logic & Structural Operators +

+

+ A Proposition is defined strictly as a declarative sentence that possesses exactly one invariant truth value—either completely True or completely False—but never both, never ambiguous, and never dependent on context or subjective interpretation. +

+ +
+
+

Valid Mathematical Propositions

+
    +
  • "The integer is a prime number." (Evaluates to True)
  • +
  • (Evaluates cleanly to False)
  • +
  • "The binary string contains exactly four digits." (Evaluates to True)
  • +
+
+
+

Invalid Non-Propositional Assertions

+
    +
  • "Please compile this module immediately." (An imperative command or request)
  • +
  • "Is the system path set correctly?" (An interrogative question)
  • +
  • (An open sentence; truth value remains variable until is assigned a domain item)
  • +
+
+
+ +

Formal Logical Connectives & Complete Truth Matrix

+

+ Complex algorithmic structures are constructed by modifying or joining primitive propositions using explicit operational connectives. Let us define the exact operational logic for every single connective: +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operator NameSymbolStrict Invariant Evaluation Condition
Negation (NOT)Flips the truth value cleanly. Invents an opposite polarity state.
Conjunction (AND)Evaluates to strictly True only if both constituent elements are simultaneously True.
Disjunction (OR)Inclusive operational rule. Evaluates to False only if both constituent elements are simultaneously False.
Exclusive OR (XOR)Evaluates to True if and only if the inputs possess differing or mismatched truth parameters.
Conditional (Implication)Asserts directional consequence. Evaluates to False only if a True premise triggers a False conclusion.
Biconditional (IFF)Equivalence evaluation. Yields True if and only if both components share an identical state.
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TTFTTFTT
TFFFTTFF
FTTFTTTF
FFTFFFTT
+
+ +
+
+ ⚠️ Invariant Edge Cases & Logical Exceptions of Implications: +
+

+ 1. Vacuous Truth: Look carefully at rows 3 and 4 of the truth table. When the premise is entirely False, the implication statement evaluates to True automatically, completely independent of the truth state of the conclusion . This is known as a vacuous truth mapping. For instance, the statement: "If an odd integer is divisible by , then the moon is manufactured out of green cheese" is completely mathematically valid and evaluates to True. +
+ 2. Logical Mismatch: Implication does not signify causal correlation or chronological dependency. It is strictly an algebraic gating condition. +

+
+
+ +
+ + {/* 2. Conversions of an Implication */} +
+

+ 2. Systematic Structural Variations of a Conditional Statement +

+

+ Given a base structural implication , engineers derive three explicitly distinct logical configurations that alter operator placement and variable inversion: +

+ +
    +
  • + The Converse: Swaps the structural position of the components entirely. Formally mapped as: . +
  • +
  • + The Inverse: Retains the position but negates the truth value of both components. Formally mapped as: . +
  • +
  • + The Contrapositive: Simultaneously swaps positions and negates both constituent terms. Formally mapped as: . +
  • +
+ +
+

Critical Logical Equivalence Pairings:

+

+ An implication statement is always completely equivalent to its contrapositive. They share identical truth tables: +
+ + + + Similarly, the converse statement is always completely equivalent to the inverse statement: +
+ + + + Warning: A common engineering flaw is to assume that the converse or inverse matches the truth profile of the original implication. They are completely independent mappings. +

+
+
+ +
+ + {/* 3. Laws of Propositional Logic */} +
+

+ 3. Algebraic Equivalences & Logical Laws +

+

+ Just as numerical algebra possesses rules for factoring constants, propositional expressions can be structurally manipulated or minimized using strict algebraic laws. These equivalences provide the absolute mechanical rules used to optimize digital logical gate routing in hardware verification compilers. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Law DesignationFormal Equivalence Rule Expressions
Identity Laws
Domination Laws
Idempotent Laws
Double Negation
Commutative Laws
Associative Laws
Distributive Laws
De Morgan's Laws
Absorption Laws
Negation Axioms (Law of Excluded Middle)
(Law of Contradiction)
Conditional Equivalent
+
+
+ +
+ + {/* 4. Predicate Logic & Quantifier Invariants */} +
+

+ 4. Advanced Predicate Logic & Domain Quantifiers +

+

+ Propositional logic lacks structural granularity because it cannot look inside elements or address variables over variable domains. Predicate Logic expands on this by introducing variables, descriptive properties, and quantifiers. A predicate expression maps an assertion to an object variable inside a defined domain space. It transforms into a standard concrete proposition only when is bounded by an explicit domain item or quantifier loop. +

+ +

Core Bounding Quantifiers

+
    +
  • + Universal Quantifier (): States that the target predicate condition is completely and uniformly valid for every single element within the active domain. It represents a bound conjunction across the domain pool: +
  • +
  • + Existential Quantifier (): States that there exists at least one distinct element within the domain for which evaluates to True. It represents a bound disjunction across the domain pool: +
  • +
+ +

Topological Quantifier Rules & De Morgan Invariants

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Quantifier Rule ConceptStructural Algebraic RepresentationOperational Boundary Logic
Quantifier De Morgan (1)To completely invalidate a universal law, you only need to locate one counterexample item.
Quantifier De Morgan (2)Asserting that an object instance does not exist means it evaluates to false for all items across the domain.
Universal DistributivityUniversal scoping applies directly over conjunction operations without leakage.
Existential DistributivityExistential allocation splits completely over active inclusive disjunction pathways.
+
+ +
+
+ ⚠️ Exception Invariant: Critical Scope Gating of Nested Quantifiers +
+

+ The relative parsing sequence of nested asymmetric quantifiers is strictly one-way and cannot be swapped. Consider this directional theorem condition: +
+ +   is True, but its converse is completely False. + + Let our domain pool be all human beings, and let represent the predicate property string: "Object has cleared system access keys for user ". +
+ - The left-hand expression asserts: There exists a specific, master administrator who holds systemic clearance keys matching absolutely every person in the corporation. +
+ - The right-hand expression asserts: For every single corporate user , there is at least one clearing technician assigned to them (but it can be a completely distinct, unique employee for every person). +
+ Clearly, a master administrator implies everyone has a key-holder, but everyone having an individual technician does not imply the existence of a single master administrator. Quantifier sequence swapping causes systemic logical collapse. +

+
+
+ +
+ + {/* 5. Rules of Inference */} +
+

+ 5. Structural Rules of Formal Inference +

+

+ To build complex structural proofs without writing out massive multi-variable truth tables, logical engines leverage standardized deductive templates. These are called the Rules of Inference. Each rule represents a tautological implication framework where if the input conditions (premises) are accepted as True, the resulting logical consequence must be True. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rule DesignationFormal Symbolic Gating LayoutNatural Logical Execution Meaning
Modus Ponens

The mode of affirming. If a conditional implication is true, and its starting premise is met, the consequence is verified.
Modus Tollens

The mode of denying. If an implication holds true, but its expected structural consequence is entirely false, the premise must be false.
Hypothetical Syllogism

Transitive chaining of logic. Connects distinct operations into a single merged processing path.
Disjunctive Syllogism

Exclusive elimination. If an inclusive OR clause is true, but one choice is explicitly negated, the other choice must be true.
+
+
+ +
+ + {/* 6. Proof Techniques with Structural Examples */} +
+

+ 6. Exhaustive Mathematical Proof Methodologies +

+

+ A rigorous mathematical proof is a chain of deductive steps using rules of inference that establishes the absolute truth of a theorem statement beyond question. +

+ + {/* 6.1 Direct Proof */} +
+

Methodology I: Direct Proof Construction ()

+

+ Strategy Rule: Assume the initial prerequisite premise condition is strictly true. Leverage active definitions, algebraic identities, and verified axioms to perform calculations until the target consequence is directly deduced. +

+
+

Theorem Formulation: If an integer is strictly odd, then its squared product is an odd integer.

+

Deductive Step Profile:

+
    +
  1. Assume the premise holds true: belongs to the set of odd integers.
  2. +
  3. By algebraic definition, any odd integer can be written as for some structural integer element .
  4. +
  5. Perform immediate expansion of the squared variable: .
  6. +
  7. Evaluate polynomial expansion: .
  8. +
  9. Isolate a common factor of to assess divisibility parameters: .
  10. +
  11. Assign a temporary placeholder variable: Let . Since integers are closed under multiplication and addition, is guaranteed to be a solid integer ().
  12. +
  13. Substitute back: This yields . This matches the exact definition layout of an odd integer. Therefore, the statement is directly verified.
  14. +
+
+
+ + {/* 6.2 Contraposition */} +
+

Methodology II: Proof by Structural Contraposition

+

+ Strategy Rule: Since , we bypass a complex forward calculation by assuming that the conclusion is completely False (). We use this setup to perform calculations and derive that the prerequisite premise must be completely False (). +

+
+

Theorem Formulation: For any integer , if the complex product expression is an odd integer, then is an odd integer.

+

Deductive Step Profile:

+
    +
  1. Formulate the contrapositive setup: Assume the conclusion is NOT odd, meaning is an even integer.
  2. +
  3. By basic numerical definition, an even integer can be written as for some reference element .
  4. +
  5. Substitute this expression back into the initial calculation target: .
  6. +
  7. Simplify expression: .
  8. +
  9. Factor out a common divisor of to check for parity parameters: .
  10. +
  11. Let . Because integers are closed under arithmetic transformations, .
  12. +
  13. This yields , proving that the expression is a clean multiple of two, meaning it is an even integer.
  14. +
  15. Since we demonstrated that holds true, the original implication is formally locked.
  16. +
+
+
+ + {/* 6.3 Contradiction */} +
+

Methodology III: Proof by Logical Contradiction ( )

+

+ Strategy Rule: Assume that the statement you wish to prove is completely and entirely False. Proceed to analyze deductions based on this assumption until your steps run into an absolute structural impossibility, violating a known axiom or creating a logical clash (). This demonstrates that your starting assumption was a logical impossibility, proving the original theorem true. +

+
+

Theorem Formulation: The root value is an irrational number.

+

Deductive Step Profile:

+
    +
  1. Assume the contradiction configuration: The theorem is false, meaning is completely rational.
  2. +
  3. By structural definition of rational values, we must be able to express , where , , and the fraction is written strictly in **irreducible terms**. This means ; they share no common factor elements.
  4. +
  5. Perform algebraic squaring of both sides of the equation: .
  6. +
  7. Isolate terms: . This implies that is an even multiple of two.
  8. +
  9. By parity rules, if an integer square is even, the root base must be an even integer. Therefore, we can express for some .
  10. +
  11. Substitute this expression back into our step equation: .
  12. +
  13. Simplify by dividing both sides by two: . This implies that is also a clean multiple of two, meaning must be an even integer.
  14. +
  15. If both and are even integers, they both share a common factor of . This directly contradicts our initial prerequisite constraint that .
  16. +
  17. Because our starting assumption triggered a logical contradiction, the assumption is false. Thus, is irrational.
  18. +
+
+
+ + {/* 6.4 Induction */} +
+

Methodology IV: Complete Mathematical Induction

+

+ Strategy Rule: Used to prove a predicate statement holds completely across an infinite ordered set of positive integers . It operates via three sequential processing loops: +

+
    +
  • Base Case Evaluation: Prove the formula works perfectly for the initial boundary item, usually .
  • +
  • Inductive Hypothesis Setup: Assume that the property holds true for an arbitrary step state , establishing as a valid true baseline.
  • +
  • Inductive Step Execution: Use the inductive hypothesis to prove that the statement must then hold true for the immediate next integer step , completing the implication chain .
  • +
+ +
+

Theorem Formulation: Prove that the cumulative summation of the first positive integers is always bounded by: .

+

Deductive Step Profile:

+
    +
  • + Step A: Base Case Check (n = 1) +
    + Left-Hand Side (LHS) = . +
    + Right-Hand Side (RHS) = . +
    + Since LHS = RHS, evaluates cleanly to True. +
  • +
  • + Step B: Inductive Hypothesis Setup +
    + Assume that the statement holds completely true for an arbitrary integer . That is, we accept the following expression as a verified true premise: +
    + +
  • +
  • + Step C: Inductive Step Evaluation (Prove n = k + 1) +
    + We must show that the formula holds for the next step, which requires deriving: +
    + + Let us isolate the left-hand summation and group the first elements: +
    + + Substitute our assumed inductive hypothesis into the underlined component: +
    + + Find a common algebraic denominator to compute the fraction addition: +
    + + Factor out the common polynomial term from the numerator: +
    + + This matches our expected Right-Hand Side expression for . The implication chain is complete. Therefore, the theorem is verified for all positive integers . +
  • +
+
+
+
+ +
+ + {/* Summary */} +
+

+ Chapter Summary +

+

+ In this chapter, we explored mathematical logic and formal proofs. We constructed truth tables for foundational connectives, applied algebraic logical equivalences, analyzed domain variables under universal and existential quantifiers, and traced structural rules of inference. Finally, we executed formal proof systems across multiple templates—including direct proofs, structural contraposition, reduction by contradiction, and infinite steps of complete mathematical induction. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter2.tsx b/app/sem4/discrete/content/chapter2.tsx new file mode 100644 index 0000000..d806932 --- /dev/null +++ b/app/sem4/discrete/content/chapter2.tsx @@ -0,0 +1,435 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch2Content() { + return ( +
+

+ Sets, Relations, and Functions form the fundamental foundational language for all of discrete mathematics and computer science. This chapter establishes the core structural groupings used to collect elements, map objects, organize hierarchies, and model deterministic operations within computational environments. +

+ +
+ + {/* Section 1: Set Theory */} +
+

1. Set Theory, Operations, and Identities

+

+ A Set is an unordered collection of distinct, well-defined objects. The objects belonging to a set are called its elements. +

+ +

Subsets and Power Sets

+
    +
  • Subset (): Set is a subset of set if and only if every element that belongs to also belongs to . Formally: .
  • +
  • Proper Subset (): Set is a proper subset of if and . This implies contains at least one element not present in .
  • +
  • Power Set (): The power set of a set is the collection of all possible subsets of , including the empty set () and the set itself.
  • +
+ +
+

💡 Power Set Cardinality Theorem:

+

If a finite set has elements, then its power set contains elements.

+

Example:

+

Let . Then . Here, and .

+
+ +

Set Operators and Mathematical Definitions

+

+ Let represent the universal set containing all possible elements under discussion. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationNotationFormal Set-Builder Definition
Union{"{ x | x ∈ A ∨ x ∈ B }"}
Intersection{"{ x | x ∈ A ∧ x ∈ B }"}
Difference{"{ x | x ∈ A ∧ x ∉ B }"}
Complement (or ){"{ x | x ∈ U ∧ x ∉ A }"}
Symmetric Difference{"{ x | x ∈ (A − B) ∨ x ∈ (B − A) }"}
+
+ +

Algebraic Properties and Identities of Sets

+

+ Set operations satisfy algebraic laws that parallel propositional logic equivalences. +

+
    +
  • Commutative Laws: and .
  • +
  • Associative Laws: and .
  • +
  • Distributive Laws: and .
  • +
  • De Morgan's Laws for Sets: and .
  • +
  • Absorption Laws: and .
  • +
+ +

Inclusion-Exclusion Principle Formulas

+

+ The Principle of Inclusion-Exclusion (PIE) computes the total cardinality of a union of multiple intersecting sets by alternately adding individual sizes and subtracting shared elements to prevent double-counting. +

+
+
+

1. Two-Set Formula:

+

+
+
+

2. Three-Set Formula:

+

+
+
+ +
+

⚠️ Critical Edge Case (Disjoint Sets):

+

+ If sets and are mutually exclusive / disjoint, their intersection is empty: . In this scenario, the Inclusion-Exclusion formula simplifies directly into the Sum Rule: . +

+
+
+ +
+ + {/* Section 2: Relations */} +
+

2. Binary Relations & Properties

+

+ Given two sets and , the Cartesian Product is the set of all ordered pairs such that and . A **Binary Relation** from to is structurally a subset of this product: . If , we write . +

+ +

Classifications and Structural Types of Relations on a Set A

+

+ A relation defined on a single set () can possess specific properties across its coordinate matrix. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyFormal Logical Constraint RuleConcrete Example or Counter-Example
Reflexive + + + The relation "" on integers, since every number . +
Irreflexive + + + The relation "" on integers, since a number can never be strictly less than itself. +
Symmetric + + + "Is a sibling of" relation across a human demographic set. +
Asymmetric + + + The relation "". If , it is impossible for . Implies irreflexivity. +
Anti-SymmetricThe subset relation "". If and , then .
Transitive"Divides" relation on integers. If and , then .
+
+ +
+

💡 Critical Matrix Edge Case (Asymmetric vs Anti-Symmetric):

+

+ Students often confuse Asymmetric and Anti-Symmetric properties. +
+ - Asymmetry strictly prohibits any bidirectional pairings, meaning diagonal entries like can never belong to the relation. +
+ - Anti-symmetry permits diagonal elements to exist seamlessly, but guarantees that if an off-diagonal forward link exists, its reverse link is completely blocked. +

+
+ +

Equivalence Relations, Classes, and Partitions

+

+ An Equivalence Relation is a relation on a set that satisfies three properties simultaneously: Reflexive, Symmetric, and Transitive. +

+
    +
  • Equivalence Class (): Given an equivalence relation on a set , the equivalence class of an element is the set of all elements linked to via . Formally: .
  • +
  • Partition: A partition of a set is a grouping of into non-empty, mutually disjoint subsets (called blocks) such that their collective union reconstructs the entire set .
  • +
+ +
+

The Fundamental Partition Theorem:

+

+ Every equivalence relation on a set partitions into distinct, mutually disjoint equivalence classes. Conversely, any partition of a set naturally induces an equivalence relation on that set. +

+
+

Example: Modular Arithmetic (Congruence modulo 3 on integers)

+

Relation: divides

+

This partitions the infinite set of integers () into exactly three disjoint equivalence classes:

+

+ [0] = (Remainder 0)
+ [1] = (Remainder 1)
+ [2] = (Remainder 2) +

+
+
+
+ +
+ + {/* Section 3: Posets and Hasse Diagrams */} +
+

3. Orderings, Posets, and Hasse Diagrams

+

+ Relations can establish hierarchical ordering guidelines across a set, allowing elements to be compared based on prioritization or containment. +

+ +

Partial Orders vs Total Orders

+
    +
  • Partial Order (Poset): A relation on a set is a partial ordering if it is Reflexive, Anti-symmetric, and Transitive. The set paired with this relation is called a Partially Ordered Set, denoted as . Elements are comparable if or , otherwise they are incomparable.
  • +
  • Total Order (Linear Order): A partial order is a total order if every single pair of elements in the set is comparable. Formally: . There are no incomparable components.
  • +
+ +

Hasse Diagram Construction Rules

+

+ A Hasse diagram is a simplified visual representation of a finite partial order. It is drawn using the following optimization constraints: +

+
    +
  1. If , vertex is placed physically higher on the plane page view than vertex .
  2. +
  3. A directional line is drawn between and if and only if is immediately covered by (meaning and there is no intermediate element such that ).
  4. +
  5. All reflexive self-loops are omitted since reflexivity is implied for every element.
  6. +
  7. All transitive directional lines are omitted since transitivity can be inferred by tracing connected paths upward.
  8. +
+ + {/* Integrated Hasse Diagram Visual Figure */} +
+
+

+ Visual Figures: Poset Structural Diagrams +

+
+
+
1. Partial Order Hasse Diagram
(Divisibility on set )
+
+
[6]
+
+ / + \ +
+
+ [2] + [3] +
+
+ \ + / +
+
[1]
+
+

Note: 2 and 3 are incomparable entries.

+
+ +
+
+
2. Total Order Chain Diagram
(Standard "less than or equal to" on )
+
+
[3]
+
|
+
[2]
+
|
+
[1]
+
+
+

Note: Complete connectivity; linear chain structural layout.

+
+
+
+
+
+ +
+ + {/* Section 4: Functions */} +
+

4. Functions, Structural Types, and Inverses

+

+ A Function from set to set (denoted ) is a special type of relation that maps each element in the domain set to **exactly one** element in the codomain set . We write . +

+ +

Classifications and Structural Types of Functions

+

+ Functions are classified based on how elements of the domain map to the codomain. +

+ + {/* Integrated Functional Mapping Diagrams */} +
+
+

+ Visual Mapping Diagrams: Classification Profiles +

+
+ + {/* Injection */} +
+
I. Injection (One-to-One)
+
+
+

a1

+

a2

+
+
+

+

+
+
+

b1

+

b2

+

b3

+
+
+

Constraint Rule: Distinct domain elements must map to completely distinct codomain targets.

+
+ + {/* Surjection */} +
+
II. Surjection (Onto)
+
+
+

a1

+

a2

+

a3

+
+
+

+

+

+
+
+

b1

+

b2

+
+
+

Constraint Rule: Every element in the codomain must be mapped to. There are no leftover codomain items.

+
+ + {/* Bijection */} +
+
III. Bijection (1-to-1 & Onto)
+
+
+

a1

+

a2

+
+
+

+

+
+
+

b1

+

b2

+
+
+

Constraint Rule: Perfect matching. Every element matches precisely one-to-one with no leftovers anywhere.

+
+ +
+
+
+ +
    +
  • Injection (One-to-One): is injective if distinct inputs always map to distinct outputs. Formally: .
  • +
  • Surjection (Onto): is surjective if the range equals the codomain. Every element in has at least one preimage in . Formally: .
  • +
  • Bijection: A function that is simultaneously injective and surjective. It represents a perfect matching layout between sets.
  • +
+ +

Composition of Functions & Algebraic Properties

+

+ Given functions and , the **Composition Function** is defined as: +
+ +

+

Properties of Function Composition:

+
    +
  • Associativity: If , , and , composition is associative: .
  • +
  • Non-Commutativity: Function composition is generally **not** commutative: . Order of evaluation matters.
  • +
  • Preservation: If both and are injections, then is an injection. If both and are surjections, then is a surjection.
  • +
+ +

Inverse of a Function

+

+ If is a bijection, its **Inverse Function** maps each element in back to its unique preimage in . Formally: +
+ +

+ +
+

⚠️ Critical Existence Constraint Rule:

+

+ The inverse function only exists if the original function is a strict Bijection. +
+ - If is not injective, multiple elements in map to the same , making ambiguous (violating function definition rules). +
+ - If is not surjective, some elements in are unmapped, meaning would be undefined for those elements. +

+
+
+ +
+ + {/* Summary */} +
+

Summary

+

+ In this chapter, we explored set operators, subsets, power sets, and the Inclusion-Exclusion principle. We categorized relationships into reflexive, symmetric, transitive, equivalence, and partial order types, and analyzed how to visualize posets using Hasse diagrams. Finally, we studied functional properties, analyzing injective, surjective, and bijective mappings, along with function composition rules and inverse constraints. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter3.tsx b/app/sem4/discrete/content/chapter3.tsx new file mode 100644 index 0000000..2b711db --- /dev/null +++ b/app/sem4/discrete/content/chapter3.tsx @@ -0,0 +1,328 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch3Content() { + return ( +
+

+ Welcome to the comprehensive module on Combinatorics, Number Theory, and Recurrence Relations. These structural topics provide the computational machinery for calculating algorithmic complexity thresholds, analyzing cryptographic keyspaces, and implementing secure numeric communications. +

+ +
+ + {/* SECTION 1: COMBINATORICS & PROBABILITY */} +
+

1. Advanced Combinatorics & Basic Probability

+

+ Combinatorics provides the foundational counting mechanics required to measure sample space boundaries without the exhaustive physical enumeration of states. +

+ +

Fundamental Counting Rules

+
    +
  • + The Sum Rule: Asserts that if a choice can be performed in independent ways, and a choice can be performed in independent ways, then executing either task or task can be completed in exactly structural ways. +
  • +
  • + The Product Rule: Asserts that if a strategic procedure is broken down into two sequential, dependent processing stages where stage one yields distinct outcomes, and stage two yields unique outcomes, the total combined procedure can be executed in exactly ways. +
  • +
+ +

Basic Probability & Inclusion-Exclusion for Probability

+

+ The classical Probability of a discrete event within a finite, uniform sample space is mathematically defined as the ratio: . + When managing compound event tracks that maintain intersection points, the Principle of Inclusion-Exclusion for Probability (PIE) eliminates double-counting errors across non-disjoint domains: +

+
+ +

+ Expansion layout for three overlapping spaces: +

+ +
+ +

The Pigeonhole Principle & Bounded Applications

+
    +
  • + Basic Structural Assertion: If or more item elements are mapped into exactly distinct space boxes, then at least one target box is guaranteed to contain two or more elements. +
  • +
  • + Generalized Pigeonhole Theorem: If discrete objects are distributed into exactly boxes, then at least one box must contain a minimum of items, where the ceiling function rounds up to the closest integer boundary. +
  • +
+ +
+

Concrete Deep-Dive Application Profiles:

+

+ 1. Card Set Extremum Check: What is the absolute minimum number of cards that must be extracted from a shuffled 52-card standard deck to guarantee that at least three cards share an identical suit? +
+ + Domain Boxes suits. We require: . To isolate the critical boundary threshold, find the absolute worst-case scenario before matching (drawing exactly 2 cards for each of the 4 suits: cards). The next single card drawn () breaks the layout symmetry, guaranteeing a triplet. Thus, . + +

+

+ 2. Birthday Invariant: Within any arbitrary group containing a minimum of people, at least two individuals are mathematically guaranteed to share a matching calendar birthday, because the absolute maximal bounds of unique birthdays in a leap year is . +

+
+
+ +
+ + {/* SECTION 2: NUMBER THEORY */} +
+

2. Number Theory & Linear Diophantine Equations

+

+ Number Theory analyzes the properties of integers, providing the algebraic structures used to construct modern public-key encryption schemes. +

+ +

GCD, LCM, and Fundamental Parity Relations

+

+ The Greatest Common Divisor () is the maximal positive integer that divides both and cleanly. The Least Common Multiple () is the minimal positive integer that is a multiple of both inputs. For any two non-zero integers, their products map directly to their shared divisor fields: +

+
+ +
+ +

Bézout's Identity & The Extended Euclidean Algorithm

+

+ Bézout's Identity Statement: For any non-zero integer parameters and , there exist unique integer linear coefficients and that satisfy the equation: +
+ + These structural coefficients are derived computationally by operating the Extended Euclidean Algorithm, tracking the forward quotient remainders down to the zero state and substituting the evaluations back in reverse order. +

+ +
+

Step-by-Step Computational Tracing: Extract and calculate coefficients and

+
+

Stage 1: Forward Euclidean Divisions (Isolating the GCD Matrix)

+

     (Remainder )

+

      (Remainder )

+

       (Remainder ← Last non-zero remainder matches the GCD)

+

        (Remainder )

+

Resulting Divisor: .

+ +

Stage 2: Structural Backward Substitutions (Resolving Bézout Targets)

+

Isolate the remainder from the step above the zero state:

+

Substitute from the second-stage equation ():

+

+

Substitute from the first-stage equation ():

+

+

+

Resulting Identity Coefficients: and .

+
+
+ +

Linear Diophantine Equations

+

+ A Linear Diophantine Equation is an algebraic expression of the form: , where the coefficients are fixed integers, and solutions are strictly restricted to integer elements for and . +

+
+
⚠️ Solvability Constraints & Infinite Solution Sets:
+

+ An integer mapping for exists if and only if the greatest common divisor divides perfectly (). If this condition is satisfied and an initial particular baseline solution is calculated, the complete infinite set of solutions is generated by tracking parametric adjustments: +

+
+ +
+

+ Where the variable divisor parameter matches and iterates over all integers (). +

+
+ +

The Chinese Remainder Theorem (CRT)

+

+ Let be a set of positive integers that are pairwise coprime ( for all index steps ). Then, the following simultaneous system of modular congruence relations is guaranteed to possess a unique solution modulo the global cumulative product : +

+
+ + +

+ +
+
+ +
+ + {/* SECTION 3: RECURRENCE RELATIONS */} +
+

3. Recurrence Relations & Resolution Methods

+

+ A Recurrence Relation defines an infinite sequence where a term is expressed as a mathematical function of its preceding history steps (e.g., the Fibonacci sequence ). +

+ +

Structural Classifications

+
    +
  • + Linear Homogeneous: Every term is a first-degree linear function of past elements with no isolated scalar offsets or functions of . Example structure: . +
  • +
  • + Linear Non-Homogeneous: Contains an added isolated forcing function block . Example structure: . +
  • +
+ + {/* METHOD 1 */} +

Method I: Repeated Substitution (Iterative Gating Method)

+

+ This strategy operates by sequentially expanding the recursive terms back to base conditions until an algebraic pattern emerges as a explicit closed function of the index parameter . +

+
+

Pattern Tracing Example: Solve subject to the base condition .

+
+

+

Substitute the definition for into the main chain expression:

+

+

Substitute the definition for into the main chain expression:

+

+

Projecting this substitution tracking down to the -th complete iteration level:

+

+

Inject the localized static boundary value :

+

+ Closed-Form Evaluation: +

+
+
+ + {/* METHOD 2 */} +

Method II: The Characteristic Root Framework

+

+ Transforms linear constant-coefficient recurrence relations into classic algebraic polynomials to isolate structural roots. +

+ +
1. Second-Order Homogeneous Systems
+

+ Given the second-order expression , map the terms directly to a Characteristic Polynomial Equation: . +

+
+ + + + + + + + + + + + + + + + + +
Polynomial Root ConditionExplicit General Solution Formula Layout ()
Distinct Roots ()
Repeated Roots ()
+
+ +
+

Distinct Roots Execution: Solve given .

+
+

1. Transpose terms to homogeneous form:

+

2. Set up characteristic polynomial structure:

+

3. Factor to isolate characteristic roots:

+

4. Instantiate general algebraic formula:

+

5. Apply base constraints to build simultaneous coefficients systems:

+

   For index :

+

   For index :

+

6. Resolving this linear layout matrix yields values: and .

+

+ Final Explicit Solution: +

+
+
+ +
2. Higher-Order Homogeneous Systems
+

+ When scaling up to higher-order systems, if a polynomial characteristic root exhibits an algebraic multiplicity factor of (repeated times), its unique block mapping within the general solution framework expands as a polynomial scalar chain: +

+
+ +
+ +
3. Non-Homogeneous Adjustments with Constant Coefficients
+

+ The comprehensive structural evaluation for an active non-homogeneous line expression is achieved by combining two distinct sub-solutions: +
+ + Where represents the baseline solution of the matching homogeneous setup (), and is a targeted particular solution shaped explicitly to reflect the structural format of the forcing function . +

+
+ + + + + + + + + + + + + + + + + + + + + +
Forcing Function Profile Assumed Particular Solution Format
Linear Polynomial ()
Pure Exponential ()    (valid if does not clash with homogeneous roots)
⚠️ Homogeneous Root Clash Case    (where indicates the root multiplicity value)
+
+ + {/* METHOD 3 */} +

Method III: Generating Functions

+

+ A Generating Function maps an infinite discrete structural sequence directly into the formal linear coefficients of a continuous power series parameter layout: +

+
+ +
+ +
The Extended Binomial Theorem
+

+ To convert complex fractional generating equations back into discrete sequences, expansions invoke the Extended Binomial Theorem configured for negative integer exponents: +

+
+ +

+ Standard Explicit Reference Mappings: +

+
+

+

+
+
+ +
+

Generating Function Tracing: Solve given .

+
+

1. Scale the relation by and run a summation over all items :

+

   

+

2. Substitute definitions to map this summation line directly back to structures:

+

   Left side mapping:

+

   Right side mapping:

+

3. Merge the sub-equations back into unified structural terms:

+

   

+

4. Factor in the explicit boundary condition and solve to isolate :

+

   

+

5. Invoke geometric convergence properties ():

+

   

+

6. Extract the unique tracking coefficient of to resolve the closed sequence function:

+

Final Solution Sequence:

+
+
+
+ +
+ + {/* SUMMARY */} +
+

Summary

+

+ In this module, we evaluated advanced combinatorics counting logic, probability distributions, and bounding metrics governed by the Pigeonhole Principle. We analyzed structural number theory foundations using Bézout's linear coefficient identity and systems of simultaneous congruence parameters solved via the Chinese Remainder Theorem. Finally, we isolated closed expressions for recursive configurations, utilizing repeated substitution tracking matrices, polynomial root structures, and infinite formal generating power series functions. +

+
+
+ ) +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter4.tsx b/app/sem4/discrete/content/chapter4.tsx new file mode 100644 index 0000000..0a54b49 --- /dev/null +++ b/app/sem4/discrete/content/chapter4.tsx @@ -0,0 +1,459 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch4Content() { + return ( +
+ {/* Introduction */} +

+ Welcome to the extensive module on Graph Theory. In computational engineering, graphs are the definitive structural abstraction used to model non-linear relational datasets. Whether representing network topologies, mapping memory pointer dependencies during data flow analysis, or computing optimized routes for packet data, graph theory provides the formal discrete axioms required to scale networked software systems safely. +

+ +
+ + {/* 1. Basics and Structural Parameters */} +
+

+ 1. Graph Fundamentals & Structural Parameters +

+

+ Formally, a Simple Graph is defined as an ordered pair , where represents a non-empty set of objects called vertices (or nodes) and represents a set of unordered pairs of distinct vertices called edges (or links). +

+ +
    +
  • + Order of a Graph (): The absolute total number of vertices present in the network topology. +
  • +
  • + Size of a Graph (): The absolute total number of edges present connecting the nodes. +
  • +
  • + Degree of a Vertex (): The number of edges incident upon node . +
    + Edge Case Exception: For multigraphs containing loops, each individual self-loop contributes exactly to that vertex's total degree counter. +
  • +
  • + Isolated Vertex: A node containing a degree configuration equal to zero (). It has no incident links. +
  • +
  • + Pendant Vertex: A node containing a degree configuration strictly equal to one (). +
  • +
+ +
+
+ The Handshaking Lemma (Fundamental Invariant Theorem of Graph Theory) +
+

+ For any undirected graph structure, the cumulative sum of the vertex degrees is always exactly equal to twice the total number of edges: +

+
+ +
+

+ ⚠️ Critical Systems Corollary: Every undirected graph must contain an even number of vertices that possess an odd degree profile. This structural constraint implies that it is mathematically impossible to construct a network layout consisting of, for example, exactly vertices where each node has a degree of (since , which is odd). +

+
+
+ +
+ + {/* 2. Classifications and Structural Varieties of Graphs */} +
+

+ 2. Structural Classifications & Varieties of Graphs +

+

+ Graphs are categorized into distinct structural classes depending on directional properties, weight settings, and localized boundary connectivity traits: +

+ +
+
+

Undirected vs. Directed Graphs (Digraphs)

+

+ In an undirected layout, edges are symmetric unordered pairs . In a Digraph, edges are ordered pairs , establishing an asymmetric directional vector from a source vertex to a target vertex . Digraph vertices track isolated split degree states: In-degree (, counting incoming vectors) and Out-degree (, counting outgoing vectors). +

+
+ +
+

Complete Graphs ()

+

+ A simple undirected graph where every single distinct pair of vertices is connected by a unique edge. A complete graph configured with nodes is designated as and contains precisely total edges. Every single vertex within has a uniform, regular degree matching . +

+
+ +
+

Weighted Graphs

+

+ A graph configuration where each edge is explicitly assigned a real numbers scalar value , representing physical cost, network traversal distance, maximum capacity limits, or line latency. These matrices form the foundation for shortest-path calculation algorithms. +

+
+ +
+

Bipartite Graphs ()

+

+ A graph whose primary vertex set can be divided cleanly into two separate, mutually disjoint subsets and such that every single edge in connects a node from directly to a node in . No internal links can connect nodes within the same subset. A complete bipartite graph is designated as . +

+
+
+
+ +
+ + {/* 3. Graph Operations: Joins, Cartesian Products, Subgraphs, and Subtrees */} +
+

+ 3. Graph Operations: Subgraphs, Subtrees, Joins, and Cartesian Products +

+

+ Complex system models can be dissected into structural sub-components or synthesized using standard binary algebraic operations on graph inputs: +

+ +
    +
  • + Subgraph: A graph is classified as a subgraph of if and such that every edge in has its terminal endpoints contained entirely within the modified vertex set . +
  • +
  • + Subtree: A specialized subgraph of a main interconnected tree structure that itself complies with all baseline tree properties—meaning it must remain completely connected and contain absolutely no internal cycles. +
  • +
  • + Graph Join (): Given two disjoint graphs and , the join operation produces a combined graph containing the total vertex set . Its edge set contains all original paths augmented with unique new links connecting every single vertex belonging to to every single vertex belonging to . +
  • +
  • + Cartesian Product (): A product synthesis layout where the new vertex set corresponds to the standard Cartesian product of sets . Two coordinate nodes and are adjacent in the output graph if and only if: +
    + - and node is adjacent to within the internal structure of , OR +
    + - and node is adjacent to within the internal structure of . +
    + This specific operation generates hypercubes and mesh grid structures used in parallel computing arrays. +
  • +
+
+ +
+ + {/* 4. Graph Representations */} +
+

+ 4. Algebraic and Computational Graph Representations +

+

+ To process graph layouts computationally, topologies are converted into equivalent algebraic matrices or structural arrays. Let be an undirected simple graph where vertices are indexed as : +

+ +
    +
  • + Adjacency Matrix (): A square matrix where matrix entry if a valid edge connects vertex and vertex , and otherwise. For simple undirected systems, this matrix is perfectly symmetric along the main diagonal () with zeros tracking down the primary diagonal axis. +
  • +
  • + Incidence Matrix (): An asymmetric matrix (where matches total edge size) aligning vertices against edge identifiers. Entry if vertex acts as a terminal endpoint for edge link , and otherwise. Each single column within an undirected incidence matrix contains exactly two entries. +
  • +
  • + Adjacency List: An array of dynamic linked lists or memory arrays, where each index position represents vertex and maps directly to a clean list detailing all its immediate neighboring adjacent nodes. This structural layout provides optimal performance for sparse graphs. +
  • +
+
+ +
+ + {/* 5. Graph Connectivity Definitions */} +
+

+ 5. Graph Connectivity: Walks, Trails, Paths, Circuits, and Cycles +

+

+ Navigating across graph networks requires explicit structural classifications based on whether nodes or edge links can be repeated along a traversal sequence: +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Traversal TypeCore Structural ConditionsRepetition Constraints
WalkAny arbitrary alternating sequence of vertices and edges.Both vertices and edges can be repeated infinitely.
TrailA walk containing strictly unique edges.Edges cannot be repeated. Vertices can be repeated.
PathAn open walk containing strictly unique vertices.Vertices must remain entirely unique (guaranteeing unique edges).
CircuitA closed trail that begins and ends at the identical node.Edges cannot be repeated. Vertices can be repeated.
CycleA closed path beginning and ending at the identical node.No vertices or edges can be repeated, except the terminal start-end pair.
+
+
+ +
+ + {/* 6. Historic Foundational Case: The Königsberg Bridge Problem */} +
+

+ 6. Foundational Case Study: The Königsberg Bridge Problem +

+

+ The field of graph theory originated with Leonhard Euler's resolution of the historic Königsberg Bridge Problem in 1736. The geography of Königsberg, Prussia, consisted of four major landmass territories split by the Pregel River, interconnected via seven active bridges. The citizens sought to determine whether it was possible to design a continuous walking route through the city that traveled across every individual bridge exactly once, returning back to the initial point of departure. +

+ + {/* Visual Figure for Königsberg Bridge Problem */} +
+
+

+ Visual Figures: The Königsberg Bridge Multigraph Model +

+ +
+
+ Landmass A (North Bank) +
+ +
+ / ‖ \ + / ‖ \ +
+ +
+
+ Landmass B
(Island) +
+
======
+
+ Landmass C
(East Bank) +
+
+ +
+ \ ‖ / + \ ‖ / +
+ +
+ Landmass D (South Bank) +
+
+ +
+

Euler's Abstract Resolution Mapping:

+

+ Euler mapped the landmass coordinates to abstract vertices and the bridges to multigraph edge links. The structural calculation revealed the following vertex degree parameters: , , , and . Because all four vertices contained an odd degree value, the multigraph structure lacked any valid Eulerian paths or circuits, rendering the citizens' walking target physically impossible. +

+
+
+
+
+ +
+ + {/* 7. Eulerian and Hamiltonian Systems & Edge Optimization Cases */} +
+

+ 7. Traversal Systems: Eulerian, Hamiltonian, and Edge Routing Problems +

+

+ Graph optimization focuses on navigating either every edge or every vertex efficiently. This maps directly to critical routing algorithms used in networking and logistics: +

+ +
+
+

Eulerian Paths and Circuits

+

+ An Eulerian Path is a trail that visits every edge in the graph layout exactly once. An Eulerian Circuit is an Eulerian path that begins and terminates at the identical vertex. +

+

+ Euler's Parity Theorems: +

+
    +
  • An undirected connected graph contains an Eulerian circuit if and only if every vertex has an even degree.
  • +
  • An undirected connected graph contains an Eulerian path if and only if it contains exactly two vertices with an odd degree. The path must begin at one odd node and end at the other.
  • +
+ +
+
Algorithmic Application: Chinese Postman Problem (CPP)
+

+ Given a connected weighted graph, find the shortest closed walk that travels across every edge at least once. If the graph is Eulerian, the solution matches the Eulerian circuit exactly. If odd vertices exist, certain edges must be repeated, which is solved via minimum-weight matching algorithms. +

+
+
+ +
+
+

Hamiltonian Paths and Circuits

+

+ A Hamiltonian Path is a simple path that visits every single vertex in the graph exactly once. A Hamiltonian Circuit is a closed loop that visits every node exactly once and returns back to the initial starting point. +

+

+ Sufficient Structural Bound Theorems: +

+
    +
  • Dirac's Theorem: If a simple graph contains vertices and every vertex satisfies , then the graph contains a Hamiltonian circuit.
  • +
  • Ore's Theorem: If a simple graph contains nodes and for every non-adjacent node pair , the condition is met, then the graph contains a Hamiltonian circuit.
  • +
+
+ +
+
Algorithmic Application: Traveling Salesperson Problem (TSP)
+

+ Given a weighted complete graph, find the Hamiltonian circuit that minimizes the total combined edge weight sum. Unlike the edge-focused Chinese Postman Problem, finding a Hamiltonian circuit is an NP-hard optimization challenge with no known polynomial-time solution. +

+
+
+
+
+ +
+ + {/* 8. Graph Isomorphism */} +
+

+ 8. Graph Isomorphism & Mapping Bijections +

+

+ Two separate graphs and are classified as Isomorphic () if they maintain the exact same internal structural connectivity alignment, differing solely in vertex naming conventions or spatial layout styles. Formally, there must exist a bijective mapping function such that vertex pairs and are adjacent within if and only if their mapped counterparts and are adjacent within . +

+ +
+
+ Isomorphic Invariant Metric Tests +
+

+ To satisfy isomorphism criteria, both graphs must match across multiple structural metrics. If any of these invariant conditions fail, the systems are guaranteed to be non-isomorphic: +

+
    +
  • They must share identical vertex counts ().
  • +
  • They must share identical edge counts ().
  • +
  • Their sorted vertex degree sequences must be completely identical.
  • +
  • They must match in internal cycle counts of specific lengths, connected components, and clique formations.
  • +
+

+ ⚠️ Systems Warning: Passing all invariant tests does not guarantee graph isomorphism; it merely establishes eligibility. Definitive confirmation requires constructing the precise bijective vertex-to-vertex function matrix. +

+
+
+ +
+ + {/* 9. Planar Graphs */} +
+

+ 9. Planar Graphs & Topological Surface Embeddings +

+

+ A graph is explicitly classified as Planar if it can be drawn or embedded within a two-dimensional geometric plane space in a manner where no two edges cross or intersect one another. A planar graph embedded without crossings divides the plane into bounded and unbounded geometric regions known as Regions (or Faces). +

+ +
+
+ Euler's Planar Polyhedron Formula +
+

+ For any connected planar graph configured with vertices, edges, and regions, the following equality remains invariant: +

+
+ +
+
+

Boundary Edge Inequalities for Simple Planar Layouts ():

+

1. In a standard planar simple graph, each face is bounded by at least 3 edges, creating the strict inequality: .

+

2. If the planar layout contains no cycles of length 3 (meaning it is completely triangle-free), each face is bounded by at least 4 edges, creating the inequality: .

+
+
+ +

+ Kuratowski's Structural Theorem: A graph is planar if and only if it does not contain a subgraph that is homeomorphic to, or can be reduced to, (the complete graph on 5 vertices) or (the complete non-planar utility graph on two sets of 3 vertices). These two configurations are the fundamental non-planar topological structures. +

+ +
+ +
+ + {/* 10. Graph Coloring and Chromatic Number */} +
+

+ 10. Graph Coloring & Partition Bounds +

+

+ A formal Vertex Coloring of an active graph is an assignment of specific color values to the vertices of such that no two adjacent nodes share the identical color tag. This configuration models channel allocation and scheduling tasks. +

+

+ The Chromatic Number (): The absolute minimal number of colors required to achieve a valid vertex coloring across graph . +

+ +
+
+ Chromatic Number Profiles for Core Graph Classes +
+
    +
  • + Complete Graph (): (since every vertex connects to all others, forcing unique colors). +
  • +
  • + Bipartite Graph (): (vertices partition into 2 independent color groupings). +
  • +
  • + Cycle Graph (): if is an even integer; if is an odd integer. +
  • +
+
+ The Famous Four-Color Theorem: The chromatic number of any valid planar graph embedded on a two-dimensional surface is at most 4 (). +
+
+
+ +
+ + {/* 11. Factorization of a Graph */} +
+

+ 11. Factorization of a Graph & Perfect Matchings +

+

+ A Factor of a graph is a spanning subgraph of that includes all vertices of . Graph Factorization partitions the edge set into disjoint factors: +

+ +
    +
  • + 1-Factorization: A 1-factor is a regular spanning subgraph of degree 1, which represents a perfect matching across the node pool. A graph can be 1-factored if its entire edge set can be divided into disjoint perfect matchings. A complete graph has a 1-factorization if and only if is an even integer. +
  • +
  • + 2-Factorization: A 2-factor is a regular spanning subgraph of degree 2, which physically manifests as a collection of disjoint components that are simple cycles. A complete graph can be divided into disjoint 2-factors if and only if is an odd integer. +
  • +
+
+ +
+ + {/* Summary */} +
+

+ Summary +

+

+ In this chapter, we explored graph theory from its structural foundations to its core algorithmic applications. We analyzed fundamental graph parameters like degrees, order, and edge sizes, along with algebraic representation techniques using adjacency matrices and lists. We integrated graph operations including subgraphs, subtrees, graph joins, and Cartesian products. We established structural conditions for graph isomorphism, topological constraints for planarity, and vertex coloring bounds. Finally, we studied optimization traversal systems like the Chinese Postman Problem (CPP) and Traveling Salesperson Problem (TSP), tracing their origins back to Euler's historic resolution of the Königsberg Bridge Problem. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter5.tsx b/app/sem4/discrete/content/chapter5.tsx new file mode 100644 index 0000000..89ed567 --- /dev/null +++ b/app/sem4/discrete/content/chapter5.tsx @@ -0,0 +1,289 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch5Content() { + return ( +
+ {/* Introduction */} +

+ Welcome to the exhaustive module on Algebraic Structures. This field provides the underlying formal mathematical framework used across modern system design to establish rules of symmetry, verify protocol properties, and build public-key cryptographic primitives such as Rivest-Shamir-Adleman () and Elliptic Curve Cryptography (). +

+ +
+ + {/* 1. Binary Operations & Properties */} +
+

+ 1. Binary Operations & Mathematical Properties +

+

+ Let be a non-empty set. A Binary Operation on is a function or mapping that combines two elements of to produce a unique third element also belonging to . Formally, this is written as: . +

+ +

Core Axiomatic Properties:

+
    +
  • + Closure Property: An operation exhibits closure if for every possible element pair , the resulting output value satisfies . If any pair escapes the set domain, closure is broken. +
  • +
  • + Associative Property: For all elements , the relative sequence of evaluations can be regrouped arbitrarily without changing the outcome: . +
  • +
  • + Commutative Property: For all elements , the relative spatial positions of the operands can be rearranged freely: . +
  • +
  • + Identity Element (): There exists a unique identity element such that for absolutely any element , operating with preserves the element exactly: . +
  • +
  • + Inverse Element (): For every individual element , there must exist a unique corresponding inverse element such that executing the operation yields the group identity: . +
  • +
+
+ +
+ + {/* 2. The Algebraic Hierarchy */} +
+

+ 2. The Algebraic Hierarchy: From Magmas to Groups +

+

+ Abstract algebraic systems are categorized into a strict hierarchy based on the subset of structural axioms their underlying binary operation satisfies: +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StructureRequired Invariant Axiom Sets
Groupoid (Magma)Closure Only.
SemigroupClosure Associativity.
MonoidClosure Associativity Identity Element.
GroupClosure Associativity Identity Inverse Element.
Abelian GroupClosure Associativity Identity Inverse Commutativity.
+
+
+ +
+ + {/* 3. Modular Groups & Prime Fields */} +
+

+ 3. Concrete Groups over Modular Systems & Prime Order Bounds +

+

+ Modular arithmetic architectures restrict infinite numerical systems into stable, finite sets ideal for encryption protocols. +

+ +
+
+

Additive Modular Group (, )

+

+ The finite remainder set paired with addition modulo forms a valid, complete Abelian Group. +
+ - Additive Identity Element: . +
+ - Additive Inverse of element : . +
+ This system satisfies closure, associativity, and commutativity bounds for absolutely any positive integer parameter . +

+
+ +
+

Multiplicative Modular Group (, )

+

+ The standard set under multiplication modulo lacks group compliance because the zero element can never have a valid multiplicative inverse. To solve this, we extract the coprime reduced set: +
+ + + + This system forms a strict Abelian Group under multiplication modulo , containing only elements relatively prime to the boundary parameter . +

+
+
+ +
+

⚠️ Critical Crytographic Exception (Prime Modulus Order):

+

+ If the modular structural parameter is chosen as a strict Prime Number, every single non-zero integer less than is guaranteed to be coprime to . Consequently, the multiplicative group framework expands to include all non-zero remainders: . This set has an exact cardinality of and satisfies all multiplicative inverse parameters natively. +

+
+
+ +
+ + {/* 4. Subgroups & Cyclic Groups */} +
+

+ 4. Subgroups, Cyclic Groups, and Generative Elements +

+

+ A non-empty subset of a parent group is formally classified as a Subgroup (denoted as ) if and only if itself forms a valid standalone group when using the exact same operational rule . +

+ +
+
+ The Multi-Step Subgroup Evaluation Criteria +
+

+ A subset is a verified subgroup if and only if it clears three specific structural checks cleanly: +

+
    +
  1. Identity element retention: The identity element of the main group belongs to the subset ().
  2. +
  3. Operational closure: For all element pairs .
  4. +
  5. Inverse closure: For any individual element .
  6. +
+
+ +

Cyclic Groups & Group Generators

+

+ A group is defined as a Cyclic Group if every single element contained within the structure can be constructed by applying the operation repeatedly to one single chosen base element . The element is designated as the Generator of the cyclic group, written as: . +

+
    +
  • In a multiplicative group setting, this takes the form of power steps: .
  • +
  • In an additive group setting, this takes the form of scalar steps: .
  • +
+

+ Theorem on Cyclic Symmetry: Every cyclic group is guaranteed to be an Abelian group, meaning commutativity is an intrinsic property of cyclic systems. However, the converse does not hold—Abelian groups are not necessarily cyclic (e.g., the Klein -group). +

+
+ +
+ + {/* 5. Cosets & Lagrange's Theorem */} +
+

+ 5. Cosets & Lagrange's Structural Partition Theorem +

+

+ Let be a fixed subgroup of a group , and let be any arbitrary element belonging to the parent group . +

+
    +
  • Left Coset Formulation: The set .
  • +
  • Right Coset Formulation: The set .
  • +
+

+ Cosets partition the elements of the parent group into completely disjoint subsets of uniform sizes. This geometric uniformity provides the foundation for Lagrange's theorem: +

+ +
+
+ Lagrange's Subgroup Order Theorem +
+

+ If is a finite group and is a valid subgroup of , then the order (cardinality) of must divide the order of perfectly: +

+
+ +
+
+

🚨 Crucial Structural Deductions & Cryptographic Realities:

+

1. The exact ratio determines the total count of distinct, unique cosets of inside group . This integer quotient value is designated as the Index of Subgroup .

+

2. **The Prime Order Invariant:** Any finite group containing a strictly prime order () possesses absolutely no non-trivial subgroups. Its only mathematically viable subgroups are the trivial group and the group itself. Thus, every group of prime order is guaranteed to be a cyclic group, and any non-identity element serves as its generator.

+
+
+
+ +
+ + {/* 6. Rings, Commutative Rings & Integral Domains */} +
+

+ 6. Dual Operation Systems: Rings, Commutative Rings, and Integral Domains +

+

+ When an abstract system incorporates two unique binary operations—traditionally designated as Addition () and Multiplication ()—it progresses past group definitions into standard dual-operation Ring Systems. +

+ +

+ A formal Ring is an ordered triple satisfying three integrated modular stages of algebraic axioms: +

+
    +
  1. The algebraic structure forms a complete Abelian Group (satisfying additive closure, associativity, identity element , inverse mappings , and perfect commutativity).
  2. +
  3. The algebraic structure forms a baseline Semigroup (satisfying multiplicative closure and associativity axioms).
  4. +
  5. Distributive Axioms: Multiplication distributes over addition across all element pathways: and for all .
  6. +
+ +

Specialized Varieties of Ring Structures:

+
    +
  • + Commutative Ring: A ring where the multiplicative operation satisfies commutative order properties: . +
  • +
  • + Ring with Unity: A ring that contains an explicit multiplicative identity element (denoted as ) such that . +
  • +
  • + Zero Divisors: This condition occurs when two non-zero elements multiply together to produce zero: while and . For instance, in the modular ring , elements and are zero divisors because . +
  • +
  • + Integral Domain: A commutative ring with unity that contains absolutely no zero divisors. This constraint preserves the classic algebraic cancellation law: if holds and , then . +
  • +
+
+ +
+ + {/* 7. Fields */} +
+

+ 7. Fields & Global Algebraic Completeness +

+

+ A Field represents the highest tier of algebraic completeness. It is an integral domain where every single non-zero element possesses a unique, verifiable multiplicative inverse, allowing for division operations to occur. +

+ +
+

The Definitive Field Requirements:

+

An abstract structure qualifies as a field if and only if it fulfills three integrated structural tiers:

+
    +
  • The structure forms a fully compliant Abelian Group with additive identity element .
  • +
  • The non-zero set forms an independent, complete Abelian Group with multiplicative identity element .
  • +
  • Multiplication distributes over addition perfectly.
  • +
+

+ Structural Comparison: The sets of Rational Numbers (), Real Numbers (), and Complex Numbers () are complete fields. The set of integers () is **not** a field because integers like lack integer multiplicative inverses (). Thus, remains classified as an integral domain. +

+
+ +

Finite Fields (Galois Fields, )

+

+ In computer algorithms, applications utilize bounded finite field fields. A finite field can be synthesized out of a modular integer system if and only if the modulus boundary parameter is chosen as a strict Prime Number . The resulting algebraic triple forms a finite field, denoted in cryptography as or . +

+
+ +
+ + {/* Summary */} +
+

+ Chapter Summary +

+

+ In this chapter, we explored abstract algebraic structures across an increasing progression of axiomatic constraints. We mapped single-operation structures from magmas and semigroups to groups and cyclic Abelian configurations, analyzing sub-components using Lagrange's subgroup order theorem. Finally, we scaled our system architectures to dual-operation networks, detailing the algebraic requirements needed to build rings, cancellation-safe integral domains, and globally invertible finite fields. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter6.tsx b/app/sem4/discrete/content/chapter6.tsx new file mode 100644 index 0000000..909f0f1 --- /dev/null +++ b/app/sem4/discrete/content/chapter6.tsx @@ -0,0 +1,17 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + +export function Ch6Content() { + return ( +
+

Boolean Algebra and Automata

+

Module 6 (Advanced / Optional) — high-level unit headings; fill details later.

+
    +
  • Boolean functions and simplification techniques
  • +
  • Karnaugh maps (K-maps) and minimization
  • +
  • Formal languages, grammars, and finite automata (intro)
  • +
+
+ ); +} diff --git a/app/sem4/discrete/layout.tsx b/app/sem4/discrete/layout.tsx new file mode 100644 index 0000000..7e1b42f --- /dev/null +++ b/app/sem4/discrete/layout.tsx @@ -0,0 +1,29 @@ +// app/sem4/discrete/layout.tsx + +import Navbar from "../../components/navbar"; +import Sidebar from "./components/sidebar"; + +export const metadata = { + title: "Discrete Mathematics | openCSE", + description: "Free and Open Documentations for Discrete Mathematics", +}; + +export default function DiscreteLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( +
+ + +
+ + +
+
{children}
+
+
+
+ ); +} diff --git a/app/sem4/discrete/page.tsx b/app/sem4/discrete/page.tsx new file mode 100644 index 0000000..0e544d8 --- /dev/null +++ b/app/sem4/discrete/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function Page() { + redirect("/sem4/discrete/ch0"); +} diff --git a/package-lock.json b/package-lock.json index 4b72912..f62b808 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,12 @@ "name": "opencse", "version": "0.1.0", "dependencies": { + "katex": "^0.17.0", "lucide-react": "^0.544.0", "next": "15.5.9", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "react-katex": "^3.1.0" }, "devDependencies": { "@eslint/eslintrc": "^3", @@ -2343,6 +2345,14 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "engines": { + "node": ">= 12" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4091,7 +4101,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -4157,6 +4166,21 @@ "node": ">=4.0" } }, + "node_modules/katex": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.17.0.tgz", + "integrity": "sha512-Vdw0ATsQ9V+LuegM/BTwQqV/6cTl5lbGcIrU+BCgLxyf6bo38ybOr372tuSIxir3CN720flu1meYR6XzNMwQnw==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4467,7 +4491,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -4723,7 +4746,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -5022,7 +5044,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", @@ -5086,9 +5107,35 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, "license": "MIT" }, + "node_modules/react-katex": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-katex/-/react-katex-3.1.0.tgz", + "integrity": "sha512-At9uLOkC75gwn2N+ZXc5HD8TlATsB+3Hkp9OGs6uA8tM3dwZ3Wljn74Bk3JyHFPgSnesY/EMrIAB1WJwqZqejA==", + "dependencies": { + "katex": "^0.16.0" + }, + "peerDependencies": { + "prop-types": "^15.8.1", + "react": ">=15.3.2 <20" + } + }, + "node_modules/react-katex/node_modules/katex": { + "version": "0.16.47", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz", + "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", diff --git a/package.json b/package.json index 0fb9526..eeacd6e 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,12 @@ "lint": "eslint" }, "dependencies": { + "katex": "^0.17.0", "lucide-react": "^0.544.0", "next": "15.5.9", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "react-katex": "^3.1.0" }, "devDependencies": { "@eslint/eslintrc": "^3",