"""Create fact_checker
Generated by Phi-Octopus Eden
2025-11-06 14:52:07.284974
"""

```python
from typing import List, Optional
from collections import defaultdict

class FactChecker:
    """
    A class to check facts based on a set of rules or predefined knowledge.

    Attributes:
        rules (List[Callable[[str], bool]]): A list of functions that represent the rules for fact checking.
        knowledge (defaultdict[str, List[str]]): A dictionary storing known facts categorized by topic.

    Methods:
        add_rule(rule: Callable[[str], bool]): Adds a new rule function to the checker.
        add_knowledge(topic: str, statement: str): Adds a known fact under a specific topic.
        check_fact(fact: str) -> Optional[str]: Checks if a given fact is true based on rules and knowledge base.
    """

    def __init__(self):
        self.rules = []
        self.knowledge = defaultdict(list)

    def add_rule(self, rule: Callable[[str], bool]) -> None:
        """Add a new rule function to the checker."""
        self.rules.append(rule)

    def add_knowledge(self, topic: str, statement: str) -> None:
        """Add a known fact under a specific topic."""
        self.knowledge[topic].append(statement)

    def check_fact(self, fact: str) -> Optional[str]:
        """
        Check if a given fact is true based on rules and knowledge base.

        Args:
            fact (str): The statement to be checked as a fact.

        Returns:
            Optional[str]: The topic associated with the fact if it's considered true, otherwise None.
        """
        for rule in self.rules:
            if rule(fact):
                return "General Knowledge"
        for topic, statements in self.knowledge.items():
            if any(statement == fact for statement in statements):
                return topic
        return None

# Example usage:

def is_even(fact: str) -> bool:
    """Check if a number represented as a string is even."""
    try:
        num = int(fact.split()[-1])
        return num % 2 == 0
    except ValueError:
        return False

def main():
    fact_checker = FactChecker()
    
    # Adding rules
    fact_checker.add_rule(is_even)

    # Adding knowledge
    fact_checker.add_knowledge("Math", "2 + 3 = 5")
    fact_checker.add_knowledge("Math", "10 % 2 = 0")

    # Checking facts
    print(fact_checker.check_fact("Is 4 even?"))  # Should return "General Knowledge"
    print(fact_checker.check_fact("What is 2 + 3?"))  # Should return "Math"

if __name__ == "__main__":
    main()
```

This code snippet defines a `FactChecker` class with methods to add rules and knowledge, as well as a method to check facts against these. The example usage demonstrates how to use the class to define rules and add known facts for checking.