Changes
109 changed files (+1677/-11495)
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>1. Introduction — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>2. Basics — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>3. Logic — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>4. Sets and Functions — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>5. Number Theory — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>6. Structures — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>7. Hierarchies — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>8. Topology — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>9. Differential Calculus — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Integration and Measure Theory — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,7 +1,7 @@<!DOCTYPE html> <html class="writer-html5" lang="en" > <head> <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Mathematics in Lean — Mathematics in Lean 0.1 documentation</title>
-
-
-
@@ -1,1 +1,1 @@Search.setIndex({"docnames": ["C01_Introduction", "C02_Basics", "C03_Logic", "C04_Sets_and_Functions", "C05_Number_Theory", "C06_Structures", "C07_Hierarchies", "C08_Topology", "C09_Differential_Calculus", "C10_Integration_and_Measure_Theory", "genindex", "index"], "filenames": ["C01_Introduction.rst", "C02_Basics.rst", "C03_Logic.rst", "C04_Sets_and_Functions.rst", "C05_Number_Theory.rst", "C06_Structures.rst", "C07_Hierarchies.rst", "C08_Topology.rst", "C09_Differential_Calculus.rst", "C10_Integration_and_Measure_Theory.rst", "genindex.rst", "index.rst"], "titles": ["<span class=\"section-number\">1. </span>Introduction", "<span class=\"section-number\">2. </span>Basics", "<span class=\"section-number\">3. </span>Logic", "<span class=\"section-number\">4. </span>Sets and Functions", "<span class=\"section-number\">5. </span>Number Theory", "<span class=\"section-number\">6. </span>Structures", "<span class=\"section-number\">7. </span>Hierarchies", "<span class=\"section-number\">8. </span>Topology", "<span class=\"section-number\">9. </span>Differential Calculus", "Integration and Measure Theory", "Index", "Mathematics in Lean"], "terms": {"The": [0, 1, 4, 5, 6, 7, 8, 11], "goal": [0, 1, 2, 3, 4, 5, 7], "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8], "book": [0, 7], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8], "teach": 0, "you": [0, 1, 2, 3, 4, 5, 6, 7, 8], "formal": [0, 1, 2, 3, 4, 5, 6, 7, 8], "mathemat": [0, 1, 2, 3, 4, 5, 6, 7], "us": [0, 2, 3, 4, 5, 6, 7, 8, 11], "lean": [0, 1, 2, 3, 4, 5, 6, 7, 8], "4": [0, 1, 2, 4, 5, 7, 8], "interact": [0, 5, 6], "proof": [0, 1, 2, 3, 4, 5, 6, 7, 8], "assist": [0, 5], "It": [0, 1, 2, 3, 4, 5, 6, 7, 8], "assum": [0, 1, 2, 3, 4, 6, 7], "know": [0, 1, 2, 3, 4, 5, 6, 7, 8], "some": [0, 1, 2, 3, 4, 5, 6, 7, 8], "doe": [0, 1, 2, 3, 4, 5, 6, 7, 8], "requir": [0, 1, 2, 3, 4, 5, 6, 7, 8], "much": [0, 2, 4, 6, 7, 8], "although": [0, 3, 4, 5, 6, 7], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8], "cover": [0, 1, 3, 6, 7, 8], "exampl": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rang": [0, 2, 3, 4, 7], "from": [0, 1, 2, 3, 4, 5, 6, 7, 8], "number": [0, 1, 2, 3, 5, 6, 7, 8, 11], "theori": [0, 1, 2, 3, 6, 7, 8, 11], "measur": [0, 5, 7, 8], "analysi": [0, 5, 8], "focu": [0, 1, 7], "elementari": [0, 3, 4, 5, 7, 11], "aspect": [0, 5], "those": [0, 1, 2, 3, 5, 6, 7, 8], "field": [0, 1, 5, 6, 8], "hope": 0, "thei": [0, 1, 2, 3, 4, 5, 6, 7, 8], "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8], "familiar": [0, 1, 4, 5, 7, 8], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8], "pick": [0, 6], "them": [0, 1, 2, 3, 4, 5, 6, 7], "up": [0, 2, 3, 4, 5, 6, 7], "go": [0, 1, 2, 3, 4, 6, 7], "also": [0, 1, 2, 3, 4, 5, 6, 7, 8], "don": [0, 1, 2, 3, 4, 5, 6, 7], "t": [0, 1, 2, 3, 4, 5, 6, 7], "presuppos": 0, "ani": [0, 1, 2, 3, 4, 5, 6, 7, 8], "background": 0, "seen": [0, 1, 2, 4, 5, 6, 7], "kind": [0, 1, 6, 7], "comput": [0, 3, 4, 5, 8], "program": [0, 1], "write": [0, 1, 2, 3, 4, 5, 6, 7, 8], "definit": [0, 1, 2, 3, 4, 5, 6, 7, 8], "theorem": [0, 2, 4, 5, 7, 8, 11], "regiment": 0, "languag": [0, 1, 3], "like": [0, 1, 2, 3, 4, 5, 6, 7], "understand": [0, 2, 3, 4, 5, 6, 7], "In": [0, 1, 2, 3, 4, 5, 6, 7, 8], "return": [0, 2, 3, 4, 5, 7], "provid": [0, 1, 2, 3, 4, 5, 6, 7, 8], "feedback": 0, "inform": [0, 1, 2, 3, 5, 6, 7], "interpret": [0, 1, 4, 5, 7], "express": [0, 1, 2, 3, 4, 5, 6, 7, 8], "guarante": [0, 3, 5], "well": [0, 1, 2, 3, 4, 5, 6, 7], "form": [0, 1, 2, 3, 4, 5, 6, 7], "ultim": 0, "certifi": 0, "correct": [0, 1], "our": [0, 1, 2, 3, 4, 5, 6, 7], "learn": [0, 1, 2, 4, 5], "more": [0, 2, 3, 4, 5, 6, 7, 8, 11], "about": [0, 2, 3, 4, 5, 6, 7, 8, 11], "project": [0, 4, 5, 7], "page": [0, 1, 4], "commun": [0, 4], "web": [0, 1, 4], "tutori": 0, "base": [0, 3, 4, 6, 7, 8], "": [0, 1, 2, 3, 4, 5, 6, 7, 8], "larg": [0, 6, 7], "ever": [0, 7], "grow": [0, 6], "librari": [0, 1, 2, 3, 4, 5, 7, 8], "mathlib": [0, 1, 2, 3, 4, 5, 6, 7, 8], "strongli": 0, "recommend": [0, 1, 3], "take": [0, 1, 2, 3, 4, 5, 6, 7, 8], "look": [0, 1, 2, 3, 4, 6, 7], "zulip": [0, 4], "onlin": 0, "chat": 0, "group": [0, 1, 2, 3, 5, 6, 7, 8], "haven": [0, 2, 6, 7], "alreadi": [0, 1, 2, 3, 4, 5, 6, 7], "ll": [0, 1, 2, 4, 6, 7], "find": [0, 1, 2, 4, 5, 6, 7], "live": [0, 5], "welcom": [0, 1], "enthusiast": 0, "happi": 0, "answer": [0, 5, 7], "question": [0, 4, 6, 7], "offer": [0, 2, 5, 7], "moral": [0, 5], "support": [0, 1, 2, 3, 4, 5, 6, 7], "read": [0, 1, 4, 6, 7], "pdf": 0, "html": 0, "version": [0, 1, 2, 3, 4, 5, 6, 7, 8], "design": [0, 1, 2, 3, 5, 7], "run": 0, "insid": [0, 1, 2, 3], "v": [0, 1, 2, 3, 5, 7], "code": [0, 1, 2, 3, 5, 6], "editor": [0, 1], "To": [0, 1, 2, 3, 4, 5, 6, 7], "instal": [0, 6], "follow": [0, 1, 2, 3, 4, 5, 6, 7, 8], "instruct": [0, 1, 7], "http": [0, 6], "github": [0, 1], "com": 0, "leanprov": 0, "lean4": 0, "blob": 0, "master": [0, 1, 4], "doc": 0, "quickstart": 0, "md": 0, "_": [0, 1, 2, 3, 4, 5, 6, 7, 8], "termin": 0, "navig": 0, "folder": 0, "where": [0, 1, 2, 3, 4, 5, 6, 7, 8], "want": [0, 1, 2, 3, 4, 5, 6, 7, 8], "put": [0, 1, 2, 3, 4, 5, 6, 7], "copi": [0, 3, 4, 6, 7], "repositori": [0, 1], "type": [0, 1, 2, 3, 4, 5, 6, 7, 8], "git": 0, "clone": 0, "mathematics_in_lean": 0, "fetch": 0, "execut": 0, "lake": 0, "ex": [0, 2], "cach": 0, "compil": 0, "open": [0, 1, 2, 3, 4, 5, 8], "altern": [0, 2, 3, 4, 5, 6, 7], "choos": [0, 2, 3, 4, 5, 6, 7], "file": [0, 1, 4, 5, 6, 7], "menu": [0, 1], "Be": [0, 1, 3], "sure": [0, 1, 2, 3, 5, 6], "other": [0, 1, 2, 3, 4, 5, 6, 7], "simultan": 0, "window": [0, 1, 2, 5], "updat": 0, "newer": 0, "ty": 0, "pull": [0, 7], "cloud": 0, "gitpod": 0, "how": [0, 1, 2, 3, 4, 5, 6, 7], "do": [0, 1, 2, 3, 4, 5, 6, 7, 8], "each": [0, 1, 2, 3, 4, 5, 6, 7, 8], "section": [0, 1, 2, 3, 4, 5, 6, 7, 8], "ha": [0, 1, 2, 3, 4, 5, 6, 7, 8], "an": [0, 1, 2, 3, 4, 5, 6, 7, 8], "associ": [0, 1, 2, 4, 5, 6, 7], "exercis": [0, 1, 2, 3, 5, 6, 7, 8], "src": 0, "organ": 0, "chapter": [0, 1, 2, 3, 4, 5, 6, 7, 8], "make": [0, 1, 2, 3, 4, 5, 6, 7, 8], "so": [0, 1, 2, 3, 4, 5, 6, 7, 8], "experi": [0, 1, 7], "while": [0, 1, 2, 6, 7], "leav": [0, 1, 2, 3, 5, 6], "origin": [0, 1, 5], "intact": 0, "text": [0, 3, 5, 6, 7], "often": [0, 1, 2, 3, 4, 5, 6, 7], "includ": [0, 1, 2, 3, 4, 6, 7, 8], "one": [0, 1, 2, 3, 4, 5, 6, 7, 8], "eval": 0, "hello": 0, "world": 0, "should": [0, 1, 2, 3, 4, 5, 6, 7, 8], "abl": [0, 1, 2, 3, 4, 5, 6, 8], "correspond": [0, 1, 2, 3, 4, 5, 6, 7, 8], "If": [0, 1, 2, 3, 4, 5, 6, 7], "click": [0, 1, 3, 4, 5, 6], "line": [0, 1, 2, 3, 4, 6], "show": [0, 1, 2, 3, 4, 5, 6, 7, 8], "hover": [0, 1, 2, 3, 4, 5], "your": [0, 1, 2, 3, 5, 6, 7], "cursor": [0, 1, 2], "over": [0, 1, 2, 3, 4, 5, 6, 7, 8], "command": [0, 1, 2, 3, 4, 5, 6], "respons": [0, 1], "pop": 0, "encourag": [0, 1, 2, 3, 4, 5], "edit": 0, "try": [0, 1, 2, 3, 4, 5, 6, 7], "own": [0, 1, 4, 5, 6], "moreov": [0, 1, 4, 5, 7], "lot": [0, 3, 5, 6, 7], "challeng": [0, 1, 2, 3, 5, 8], "rush": 0, "past": [0, 1], "just": [0, 1, 2, 3, 4, 5, 6, 7], "work": [0, 1, 2, 3, 4, 5, 6, 7, 8], "through": [0, 1, 3, 4, 5, 6, 7], "central": [0, 4], "alwai": [0, 1, 2, 3, 5, 6], "compar": [0, 5, 6, 7], "solut": [0, 1, 4, 6], "ones": [0, 1, 2, 3, 5], "simpli": [0, 1, 2, 3, 4, 5, 6, 7], "tool": [0, 1, 2, 5, 6], "build": [0, 2, 4, 6, 7, 11], "complex": [0, 1, 2, 4, 5, 8], "known": [0, 1, 2, 3, 4, 5, 6, 7, 8], "depend": [0, 2, 3, 4, 5, 6, 7], "everi": [0, 1, 2, 3, 4, 5, 6, 7, 8], "check": [0, 1, 2, 3, 4, 5, 6, 7], "print": [0, 3, 4, 5], "have": [0, 1, 2, 3, 4, 5, 6, 7, 8], "\u2115": [0, 1, 2, 3, 4, 5, 6, 7, 8], "These": [0, 1, 2, 3, 4, 5, 8], "object": [0, 1, 2, 3, 4, 5, 11], "2": [0, 1, 2, 3, 4, 5, 6, 7, 8], "def": [0, 2, 3, 4, 5, 6, 7], "f": [0, 1, 2, 3, 4, 5, 6, 7, 8], "x": [0, 1, 2, 3, 4, 5, 6, 7, 8], "3": [0, 1, 2, 3, 4, 5, 6, 7], "prop": [0, 2, 3, 4, 5, 6, 7], "statement": [0, 1, 2, 3, 4, 5, 6, 7, 8], "fermatlasttheorem": 0, "y": [0, 1, 2, 3, 4, 5, 6, 7, 8], "z": [0, 1, 2, 5, 6, 7, 8], "n": [0, 1, 2, 3, 4, 5, 6, 7, 8], "0": [0, 1, 2, 3, 4, 5, 6, 7, 8], "p": [0, 1, 2, 3, 4, 5, 6, 7], "itself": [0, 3, 5, 6, 7, 8], "Such": [0, 1, 2, 6], "proposit": [0, 2, 3, 4, 5], "easi": [0, 4, 5, 6, 7], "rfl": [0, 1, 2, 3, 4, 5, 6, 7, 8], "hard": [0, 1, 3, 5, 6], "sorri": [0, 1, 2, 3, 4, 5, 6, 7, 8], "manag": [0, 1, 4, 5, 7], "construct": [0, 2, 3, 4, 5, 6, 7], "fermat_last_theorem": 0, "accept": [0, 1, 7], "term": [0, 1, 2, 3, 4, 5, 7], "done": [0, 2, 3, 4, 6, 7], "someth": [0, 1, 2, 4, 6, 7], "veri": [0, 2, 4, 6, 7], "impress": 0, "cheat": [0, 1], "now": [0, 1, 2, 3, 4, 5, 6, 7, 8], "game": [0, 6], "all": [0, 1, 2, 3, 4, 5, 6, 7, 8], "left": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rule": [0, 2, 4, 5, 6, 7], "complementari": 0, "companion": [0, 1], "prove": [0, 2, 3, 4, 5, 6, 7, 8, 11], "which": [0, 1, 2, 3, 4, 5, 6, 7, 8], "thorough": 0, "underli": [0, 1, 5, 6], "logic": [0, 1, 3, 4, 5, 11], "framework": 0, "core": [0, 4, 5], "syntax": [0, 1, 3, 4, 6], "peopl": [0, 1], "who": [0, 7], "prefer": [0, 1, 3], "user": [0, 2, 6], "manual": [0, 3, 4], "befor": [0, 1, 2, 3, 4, 5, 6], "new": [0, 1, 2, 3, 4, 5, 6, 7], "dishwash": 0, "person": 0, "hit": [0, 1], "button": 0, "figur": [0, 1, 2, 5], "out": [0, 1, 2, 3, 4, 5, 6, 7], "activ": 0, "potscrubb": 0, "featur": [0, 2, 4], "later": [0, 1, 2, 4, 5, 6, 7], "sens": [0, 2, 3, 4, 5, 6, 7, 8], "here": [0, 1, 2, 3, 4, 5, 6, 7, 8], "refer": [0, 1, 2, 4, 5, 6, 7, 8], "back": [0, 1, 2, 3, 5, 6, 7], "necessari": [0, 2, 4, 5], "anoth": [0, 1, 2, 3, 4, 5, 6, 7], "thing": [0, 1, 2, 3, 4, 5, 6, 7], "distinguish": [0, 5, 6, 7, 8], "place": [0, 1, 2, 5, 7], "greater": [0, 1, 2, 3, 4, 7], "emphasi": [0, 6], "tactic": [0, 1, 2, 3, 4, 5, 6, 7, 8], "given": [0, 1, 2, 3, 4, 5, 6, 7], "two": [0, 1, 2, 3, 4, 5, 6, 7], "wai": [0, 1, 2, 3, 4, 5, 6, 7], "down": [0, 3, 4, 6, 7], "themselv": [0, 4, 5], "suitabl": [0, 1, 2, 5, 7], "descript": [0, 1, 2, 4, 7], "thereof": 0, "For": [0, 1, 2, 3, 4, 5, 6, 7, 8], "repres": [0, 1, 2, 3, 4, 5, 6, 8], "fact": [0, 2, 3, 4, 5, 6, 7, 8, 11], "even": [0, 1, 2, 3, 4, 5, 6, 7, 8], "m": [0, 1, 2, 4, 6, 7, 8], "nat": [0, 1, 2, 3, 4, 5, 7], "fun": [0, 2, 3, 4, 5, 6, 7, 8], "k": [0, 2, 4, 5, 7, 8], "hk": [0, 8], "hmn": 0, "rw": [0, 1, 2, 3, 4, 5, 6, 7], "mul_add": [0, 1, 4, 6], "l": [0, 1, 8], "compress": [0, 1, 7], "singl": [0, 1, 2, 3, 4, 5, 6, 8], "instead": [0, 1, 2, 3, 4, 5, 6, 7], "style": [0, 1], "same": [0, 1, 2, 3, 4, 5, 6, 7], "sai": [0, 1, 2, 3, 4, 5, 6, 7], "natur": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rintro": [0, 2, 3, 4, 5, 7], "need": [0, 1, 2, 3, 4, 5, 6, 7], "twice": [0, 7], "let": [0, 1, 2, 3, 4, 5, 6, 7, 8], "substitut": [0, 2], "obviou": [0, 4, 5, 6], "ring": [0, 1, 2, 3, 4, 5, 6], "As": [0, 1, 2, 3, 4, 5, 6, 7, 8], "enter": [0, 1, 2, 3, 7], "displai": [0, 2, 6], "state": [0, 1, 2, 3, 4, 6, 7, 8], "separ": [0, 1, 2, 4, 5], "tell": [0, 2, 3, 4, 5, 6], "what": [0, 1, 2, 3, 4, 5, 6, 7], "establish": [0, 1, 2, 3, 4, 5], "task": [0, 2, 4, 5, 6, 7], "remain": [0, 1, 2, 3, 5, 6, 7], "replai": 0, "step": [0, 1, 2, 3, 4, 5, 6], "sinc": [0, 1, 2, 3, 4, 5, 6, 7], "continu": [0, 1, 4, 5, 6], "point": [0, 1, 2, 3, 5, 6, 7, 8], "see": [0, 1, 2, 3, 4, 5, 6, 7, 8], "first": [0, 1, 2, 3, 4, 5, 6, 7, 8], "introduc": [0, 1, 2, 3, 4, 7], "could": [0, 1, 2, 4, 5, 6, 7], "renam": 0, "decompos": [0, 3, 5], "hypothesi": [0, 1, 2, 3, 4], "assumpt": [0, 1, 2, 3, 4, 5, 7, 8], "second": [0, 1, 2, 3, 4, 5, 6, 7], "declar": [0, 1, 4, 5, 6], "next": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rewrit": [0, 1, 2, 3, 4, 5, 6, 7], "replac": [0, 1, 2, 3, 4, 6], "solv": [0, 1, 2, 3, 4, 5, 6, 7], "result": [0, 1, 2, 3, 4, 5, 6, 7], "abil": 0, "small": [0, 4, 5, 7], "increment": [0, 1], "extrem": [0, 6, 7], "power": [0, 2, 3, 4, 5, 6], "reason": [0, 1, 2, 4, 5, 6, 7], "easier": [0, 1, 3, 4, 6, 7], "quicker": 0, "than": [0, 1, 2, 3, 4, 5, 6, 7, 8], "There": [0, 1, 2, 3, 4, 6, 7, 8], "isn": [0, 2, 3, 4, 6], "sharp": 0, "distinct": [0, 2, 3, 4, 5, 7], "between": [0, 1, 2, 3, 4, 5, 6, 7, 8], "insert": [0, 2, 4, 5, 7, 8], "did": [0, 2, 6, 7], "phrase": [0, 1, 2, 4, 5], "mul_left_comm": [0, 4], "abov": [0, 1, 2, 3, 4, 5, 6, 7], "convers": [0, 2, 4, 7], "short": [0, 1, 2, 3, 4, 5], "middl": [0, 1, 2, 7], "That": [0, 4, 5, 6], "said": [0, 2, 4, 5], "reduc": [0, 2, 3, 4, 5], "liner": 0, "carri": [0, 1, 2, 3, 4, 5, 6, 7], "But": [0, 1, 2, 3, 4, 5, 6, 7], "substanti": 0, "autom": [0, 1, 5], "justifi": [0, 1, 2, 7], "longer": [0, 4, 5], "calcul": [0, 2, 4, 5, 11], "bigger": [0, 3, 8], "inferenti": 0, "invok": [0, 1, 7], "simplifi": [0, 2, 3, 4, 5, 7], "specif": [0, 1, 3, 4, 5, 6], "pariti": [0, 4], "automat": [0, 1, 2, 3, 4, 5, 6, 7, 8], "intro": [0, 1, 2, 3, 4, 5, 6, 7], "simp": [0, 2, 3, 4, 5, 6, 7, 8], "parity_simp": 0, "big": [0, 5, 7, 8], "differ": [0, 1, 2, 3, 4, 5, 6, 7, 8], "onli": [0, 1, 2, 3, 4, 5, 6, 7, 8], "its": [0, 1, 2, 3, 4, 5, 6, 7, 8], "built": [0, 2, 6], "wherea": [0, 1, 3, 5, 7], "top": [0, 6, 7, 8], "meant": [0, 2, 6], "contain": [0, 2, 3, 4, 5, 6, 7, 8], "extens": [0, 1, 6, 7, 8], "document": [0, 1, 3, 4, 6], "rather": [0, 1, 2, 4, 5, 6, 7], "think": [0, 1, 2, 3, 4, 5, 6, 7, 8], "comfort": [0, 2], "brows": [0, 1, 4], "frustrat": [0, 6], "curv": 0, "steep": 0, "newcom": 0, "avail": [0, 1, 4, 5, 6], "round": [0, 1, 5], "clock": 0, "doubt": 0, "soon": [0, 2, 6, 7], "enough": [0, 1, 2, 3, 4, 6, 7], "too": [0, 1, 3, 5, 6, 7], "contribut": [0, 3], "develop": [0, 1, 4], "mission": 0, "dive": 0, "come": [0, 1, 2, 3, 4, 5, 6, 7], "forewarn": 0, "fundament": [0, 4, 5, 6], "life": [0, 2], "mai": [0, 1, 2, 3, 5, 6, 7, 8], "never": [0, 6], "acknowledg": 0, "grate": [0, 5], "gabriel": 0, "ebner": 0, "set": [0, 1, 2, 4, 5, 6, 8, 11], "infrastructur": 0, "scott": 0, "morrison": 0, "mario": 0, "carneiro": 0, "help": [0, 1, 2, 3, 4, 5, 6, 7], "port": 0, "bryan": 0, "gin": 0, "ge": [0, 2, 5], "chen": 0, "johan": 0, "commelin": 0, "mathieu": 0, "guai": 0, "paquet": 0, "julian": 0, "k\u00fclshammer": 0, "giovanni": 0, "mascellani": 0, "hunter": 0, "monro": 0, "pietro": 0, "monticon": 0, "bartosz": 0, "piotrowski": 0, "guilherm": 0, "silva": 0, "been": [0, 1, 2, 4, 5, 6, 8], "partial": [0, 1, 2, 3, 5, 6], "hoskinson": 0, "center": [0, 7], "nut": 1, "bolt": 1, "appli": [1, 2, 3, 4, 5, 6, 7, 8], "gener": [1, 2, 3, 4, 5, 6, 7, 8], "without": [1, 2, 4, 5, 6, 7, 8], "when": [1, 2, 3, 4, 5, 6, 7, 8], "u": [1, 2, 3, 4, 5, 6, 7, 8], "net": 1, "hand": [1, 2, 3, 4, 5, 6, 7], "side": [1, 2, 3, 4, 5, 6, 7, 8], "equal": [1, 2, 3, 4, 5, 6, 7], "right": [1, 2, 3, 4, 5, 6, 7, 8], "tantamount": [1, 3], "name": [1, 2, 3, 4, 5, 6, 7, 8], "b": [1, 2, 3, 4, 5, 6, 7, 8], "c": [1, 2, 4, 5, 6, 7, 8], "real": [1, 2, 3, 4, 5, 6, 7, 8], "mul_assoc": [1, 2, 4, 5, 6], "mul_comm": [1, 2, 4, 5, 6], "elimin": 1, "explicitli": [1, 2, 3, 5, 6, 7, 8], "purpos": [1, 2, 3, 4, 5, 6, 7], "illustr": [1, 2, 3, 4, 5], "multipl": [1, 2, 3, 4, 5, 6, 8], "written": [1, 2, 3, 4, 5, 6, 7, 8], "howev": [1, 2, 5, 6, 7, 8], "good": [1, 2, 3, 4, 5, 6, 7], "mind": [1, 2, 5, 6], "notat": [1, 2, 3, 4, 5, 6, 7, 8], "convent": [1, 5], "parenthes": [1, 2, 3, 4], "\u211d": [1, 2, 3, 5, 6, 7, 8], "import": [1, 2, 3, 4, 5, 6, 7], "begin": [1, 2, 3, 4, 5, 6], "sake": [1, 4], "breviti": [1, 5], "suppress": 1, "repeat": [1, 4, 5, 6], "chang": [1, 2, 4, 5, 7], "happen": [1, 6, 7], "charact": [1, 3, 6], "r": [1, 2, 4, 5, 6, 7], "symbol": [1, 2, 5, 6], "doesn": [1, 2, 7], "appear": [1, 2, 5, 6, 7], "until": [1, 2, 4, 5, 6, 7], "space": [1, 3, 5, 6, 11], "tab": [1, 2, 3, 4], "kei": [1, 4, 5, 7], "curiou": [1, 6], "abrevi": 1, "ctrl": [1, 4, 5], "shift": [1, 6, 7], "abbrevi": [1, 2, 3, 5], "get": [1, 2, 3, 4, 6, 7, 8, 11], "access": [1, 3, 5, 6, 7], "keyboard": 1, "easili": [1, 4, 5, 6], "backslash": [1, 3], "lead": [1, 2, 4, 5, 6, 7], "input": [1, 3, 7], "leader": 1, "report": 1, "current": [1, 2, 6], "infoview": 1, "move": [1, 2, 6, 7], "A": [1, 2, 3, 4, 5, 6, 7, 8], "typic": 1, "might": [1, 2, 3, 4, 5], "1": [1, 2, 3, 4, 5, 6, 7, 8], "h\u2081": [1, 2, 3, 4], "prime": [1, 2, 3, 5, 6, 11], "h\u2082": [1, 3, 4], "h\u2083": [1, 3], "denot": [1, 3, 4, 6, 7], "context": [1, 2, 4, 5, 6, 7, 8], "plai": [1, 3, 4, 6, 7], "three": [1, 2, 4, 5, 7], "label": [1, 2], "everyth": [1, 2, 6, 7], "identifi": [1, 2, 4], "subscript": 1, "h": [1, 2, 3, 4, 5, 6, 7, 8], "legal": 1, "would": [1, 2, 3, 4, 5, 6, 7, 8], "h1": [1, 3, 4], "h2": [1, 3], "h3": 1, "foo": [1, 3, 5], "bar": [1, 2], "baz": 1, "last": [1, 2, 3, 4, 5, 6, 7], "sometim": [1, 2, 3, 4, 5, 6, 7], "target": [1, 6, 7], "combin": [1, 2, 5, 6, 7], "practic": [1, 2, 3, 6, 7], "intend": [1, 2, 5], "mean": [1, 2, 3, 4, 5, 6, 7, 8], "usual": [1, 2, 3, 4, 5, 7], "clear": [1, 2, 4, 5, 6], "case": [1, 2, 3, 4, 5, 6, 7], "With": [1, 3, 4, 6, 7], "arrow": [1, 2, 6, 7], "revers": [1, 2, 3, 5, 7], "note": [1, 2, 4, 5, 6, 7], "noth": [1, 2, 3, 4, 5, 6], "argument": [1, 2, 3, 4, 5, 6, 7], "tri": [1, 2, 4, 6], "match": [1, 2, 5], "pattern": [1, 2, 3, 5, 6], "local": [1, 2, 6, 7, 8], "d": [1, 2, 4, 5, 8], "e": [1, 2, 3, 4, 5, 6, 7, 8], "sub_self": [1, 2], "hyp": 1, "list": [1, 2, 3, 4, 5], "relev": [1, 2, 4, 5, 6, 7], "comma": 1, "squar": [1, 2, 4, 5, 6], "bracket": [1, 2, 5, 6], "still": [1, 2, 3, 4, 5, 6, 7], "progress": [1, 5], "after": [1, 2, 4, 6, 7, 8], "trick": [1, 2, 4, 6, 8], "variabl": [1, 2, 3, 4, 5, 6, 7, 8], "onc": [1, 2, 3, 4, 5, 6, 7], "outsid": [1, 4], "g": [1, 2, 3, 5, 6, 7, 8], "inspect": 1, "reveal": 1, "inde": [1, 5, 6, 7, 8], "delimit": 1, "scope": [1, 2, 3, 5], "end": [1, 2, 3, 4, 5, 6, 7, 8], "block": [1, 4], "final": [1, 2, 3, 5, 7], "recal": [1, 2, 4, 5, 7], "introduct": [1, 2, 7, 11], "determin": [1, 5, 7], "both": [1, 2, 3, 4, 5, 6, 7, 8], "expect": [1, 2, 3, 4, 5, 6, 7], "rais": [1, 4], "error": [1, 2, 3, 6], "explain": [1, 2, 3, 4, 5, 6, 7], "output": 1, "meanwhil": [1, 4], "two_mul": [1, 5], "add_mul": [1, 6], "distribut": [1, 4, 5, 6], "addit": [1, 2, 4, 5, 6, 7, 8], "add_assoc": [1, 4, 5, 6], "precis": [1, 3, 7, 8], "possibl": [1, 2, 3, 4, 5, 7], "calc": [1, 2, 3, 7], "keyword": [1, 2, 4, 5], "notic": [1, 2, 3, 4, 5, 7], "finicki": 1, "dot": [1, 7], "underscir": 1, "justif": [1, 2], "format": 1, "indic": [1, 2, 3, 5, 6], "indent": 1, "One": [1, 2, 3, 4, 5, 6, 7], "outlin": [1, 2, 4, 7], "modulo": [1, 4, 5], "individu": 1, "pure": [1, 7], "littl": [1, 2, 7, 8], "underneath": [1, 3], "pow_two": [1, 4, 5], "mul_sub": 1, "add_sub": 1, "sub_sub": 1, "add_zero": [1, 5, 6], "perform": [1, 2, 3], "exact": [1, 2, 3, 4, 5, 7], "becaus": [1, 2, 3, 4, 5, 6, 7, 8], "exactli": [1, 2, 3, 5, 6, 7], "close": [1, 2, 3, 6, 8], "bit": [1, 4, 6, 7], "commut": [1, 2, 3, 4, 5, 6, 8], "long": [1, 2, 3, 5, 6, 8], "axiom": [1, 3, 5, 6, 7], "indirectli": 1, "data": [1, 2, 4, 5, 6, 7], "similar": [1, 2, 3, 5, 6, 7], "common": [1, 2, 3, 4, 5, 7], "variat": [1, 3, 4, 5, 7, 8], "call": [1, 2, 3, 4, 5, 6, 7, 8], "nth_rewrit": 1, "allow": [1, 2, 3, 4, 5, 6, 7, 8], "particular": [1, 2, 5, 6, 7], "instanc": [1, 2, 3, 4, 5, 6, 7, 8], "enumer": [1, 2], "start": [1, 2, 3, 4, 6, 7, 8, 11], "zero": [1, 2, 3, 4, 5, 6, 7, 8], "occurr": 1, "nth_rw": 1, "consist": [1, 3, 5, 6, 7, 8], "collect": [1, 3, 5, 7], "oper": [1, 2, 3, 4, 5, 6, 7, 8], "time": [1, 4, 5, 6, 7, 8], "constant": [1, 2], "mapsto": [1, 5], "abelian": [1, 5, 6], "negat": [1, 5, 11], "invers": [1, 3, 5, 6, 8], "add_comm": [1, 4, 5, 6], "zero_add": [1, 4, 5, 6], "add_left_neg": [1, 5], "mul_on": [1, 5, 6], "one_mul": [1, 2, 5, 6], "being": [1, 3, 5, 7, 8], "suffic": [1, 2, 3, 7], "give": [1, 2, 3, 4, 6, 7], "element": [1, 2, 3, 4, 5, 6, 7, 8], "concret": [1, 2, 4, 5, 6, 7], "integ": [1, 2, 4, 6, 11], "abstract": [1, 2, 5, 6, 7], "character": [1, 3, 4, 7, 8], "axiomat": [1, 2, 3, 5], "train": [1, 6], "recogn": [1, 2, 4, 5, 6, 7], "appropri": [1, 2, 3, 5], "\u2124": [1, 4, 5, 6], "ration": [1, 2, 4, 7], "\u211a": [1, 4, 7], "\u2102": [1, 5, 8], "extend": [1, 3, 4, 5, 6, 7], "Not": [1, 5, 7], "properti": [1, 2, 3, 4, 5, 6, 7, 8], "hold": [1, 2, 3, 4, 5, 7], "arbitrari": [1, 2, 3, 4, 5], "taken": [1, 2], "cours": [1, 2, 4, 6, 7, 8], "linear": [1, 2, 5, 7], "matric": [1, 5], "fail": [1, 2, 3, 4, 5, 6, 7], "commr": [1, 2, 5], "unchang": [1, 2], "linarith": [1, 2, 4, 5], "permiss": 1, "strike": [1, 2], "balanc": 1, "concis": [1, 5], "readabl": [1, 2, 3, 4, 7], "strengthen": [1, 2, 4], "skill": [1, 2, 3, 4], "deriv": [1, 2, 4, 8], "most": [1, 2, 3, 4, 5, 6, 7], "content": [1, 4, 7], "organiz": 1, "mechan": [1, 2, 5], "namespac": [1, 2, 3, 4, 5, 7], "full": [1, 3, 4, 5, 6, 7], "shorter": [1, 3, 4, 7], "avoid": [1, 3, 4, 5, 6, 8], "due": [1, 3, 6], "clash": 1, "myre": 1, "add_right_neg": 1, "effect": [1, 3, 6, 7], "temporarili": [1, 2], "reprov": 1, "care": [1, 2, 3, 5], "earlier": 1, "pai": [1, 2, 6, 7], "attent": [1, 2, 4, 6, 7], "curli": [1, 2], "implicit": [1, 2, 5, 6, 7, 8], "moment": [1, 2, 5], "worri": [1, 3, 4, 5], "neg_add_cancel_left": 1, "add_neg_cancel_right": 1, "add_left_cancel": 1, "add_right_cancel": 1, "plan": [1, 6, 7], "brace": 1, "imagin": 1, "situat": [1, 3, 6, 7], "draw": [1, 5, 6], "conclus": [1, 2, 4], "hypothes": [1, 2, 3, 4, 5], "redund": [1, 5, 7], "few": [1, 2, 3, 4, 7], "extra": [1, 2, 3, 5, 6, 7], "oner": 1, "complic": [1, 2, 6], "tediou": [1, 2, 6], "mark": [1, 2, 6, 7], "suppos": [1, 2, 3, 4, 5, 7], "infer": [1, 2, 3, 5, 6], "mul_zero": [1, 5, 6], "serv": [1, 3, 4, 5], "therefor": [1, 4, 5, 7], "promot": 1, "modular": 1, "subproof": 1, "wa": [1, 3], "except": [1, 5], "ad": [1, 2, 3, 4, 5, 6, 7], "free": [1, 7], "At": [1, 2, 4, 5, 6], "rememb": [1, 2, 3, 4, 5, 6, 7], "zero_mul": [1, 2, 4, 5, 6], "By": [1, 3, 5, 6], "neg_eq_of_add_eq_zero": 1, "eq_neg_of_add_eq_zero": 1, "neg_zero": 1, "neg_neg": 1, "had": [1, 6], "annot": [1, 3, 4, 5, 6], "third": [1, 2, 3, 5, 7], "specifi": [1, 2, 3, 4, 5, 7, 8], "imposs": 1, "default": [1, 2, 3, 4, 5, 6, 8], "subtract": [1, 4, 5], "provabl": [1, 3, 6, 7], "sub_eq_add_neg": [1, 5], "On": [1, 2, 3, 5, 6, 7], "defin": [1, 2, 3, 4, 6, 7, 8, 11], "reflex": [1, 2], "present": [1, 2, 4, 7], "forc": [1, 2, 3], "unfold": [1, 2, 3, 4, 5, 7], "refl": [1, 2, 3, 5, 6], "deal": [1, 2, 3, 4, 5, 7], "equat": [1, 2, 3, 4, 5], "interchang": 1, "self_sub": 1, "either": [1, 2, 3, 5, 6, 7], "effort": [1, 4], "one_add_one_eq_two": 1, "norm_num": [1, 2, 4, 5], "strength": 1, "weaker": [1, 2], "notion": [1, 2, 3, 4, 5, 7, 8], "addgroup": 1, "otherwis": [1, 2, 3, 4, 5], "variant": [1, 2, 7], "addcommgroup": 1, "commgroup": 1, "mul_left_inv": [1, 5], "\u00b9": [1, 3, 5, 6, 7], "feel": [1, 2, 6, 7], "cocki": 1, "helper": 1, "along": [1, 4, 7], "hint": [1, 2], "mul_right_inv": [1, 5], "mul_inv_rev": 1, "non": [1, 3, 6, 7, 8], "abel": 1, "noncomm_r": 1, "seem": [1, 2, 4, 6, 7, 8], "odd": [1, 2, 3, 4], "partli": [1, 6], "histor": 1, "conveni": [1, 2, 3, 5, 6, 7], "great": [1, 5], "sort": [1, 3, 4], "inequ": [1, 2, 6, 7], "le": [1, 5, 6], "whenev": [1, 2, 4, 5], "consid": [1, 2, 3, 4, 5, 6, 7, 8], "le_refl": [1, 2], "le_tran": [1, 2, 5], "detail": [1, 2, 3, 4, 5, 6], "unless": [1, 2, 5], "realli": [1, 2, 3, 4, 6, 7], "insist": [1, 6], "discuss": [1, 2, 4, 5, 6, 7, 8], "implic": [1, 7, 11], "h\u2080": [1, 2, 3, 4, 7], "creat": [1, 6], "option": [1, 2, 4, 5, 6, 7], "within": [1, 2, 7], "visibl": 1, "must": [1, 5, 6, 7], "complet": [1, 2, 3, 4, 6, 8], "decreas": [1, 5], "fourth": [1, 2], "mode": [1, 2, 5], "entir": [1, 3, 5, 7, 8], "lt_of_le_of_lt": [1, 2, 5], "lt_of_lt_of_l": 1, "lt_tran": [1, 2], "togeth": [1, 2, 3, 4, 5, 7], "handl": [1, 3, 4, 6], "arithmet": 1, "5": [1, 2, 5, 7, 8], "pass": [1, 5], "exp_le_exp": 1, "mpr": [1, 2, 5, 7], "exp": [1, 3], "applic": [1, 2, 4, 5], "function": [1, 2, 4, 5, 6, 8, 11], "compound": [1, 2, 7], "pars": [1, 3], "exp_lt_exp": 1, "log_le_log": 1, "log": [1, 3], "log_lt_log": 1, "add_le_add": [1, 2, 5], "add_le_add_left": 1, "add_le_add_right": 1, "add_lt_add_of_le_of_lt": 1, "add_lt_add_of_lt_of_l": 1, "add_lt_add_left": 1, "add_lt_add_right": 1, "add_nonneg": [1, 5], "add_po": 1, "add_pos_of_pos_of_nonneg": 1, "exp_po": [1, 3], "bi": [1, 5, 11], "lr": 1, "iff": [1, 3, 7, 8], "connect": [1, 3, 5, 7], "equival": [1, 2, 3, 4, 5, 7, 8], "mp": [1, 2, 3, 4, 7], "forward": [1, 2, 5, 7], "direct": [1, 2, 3, 6, 7, 8], "stand": [1, 2, 5, 7, 8], "modu": 1, "ponen": 1, "respect": [1, 2, 3, 4, 5, 7], "thu": [1, 3, 4, 5, 7], "again": [1, 2, 3, 4, 5, 6, 7], "numer": [1, 4, 5], "constitut": 1, "part": [1, 2, 3, 4, 5, 6, 7], "strategi": [1, 2, 4], "api": 1, "reli": [1, 2, 3, 5, 7], "guess": [1, 2, 3, 4, 5], "a_of_b_of_c": 1, "approxim": 1, "loud": 1, "probabl": [1, 5, 6, 7], "add_l": 1, "choic": [1, 2, 3, 5, 7], "exist": [1, 2, 3, 6, 7], "jump": [1, 4, 5, 7], "nearbi": [1, 4], "library_search": [1, 4], "sq_nonneg": 1, "delet": [1, 2, 3, 4], "uncom": 1, "previou": [1, 2, 3, 5, 6, 7, 8], "suggest": [1, 2, 4, 5, 7], "better": [1, 3, 4, 5, 6, 7], "confirm": [1, 2, 3, 4], "finish": [1, 2, 3, 4], "job": 1, "pow_two_nonneg": [1, 2], "tend": [1, 7], "around": [1, 3, 6, 7], "binari": [1, 2, 4, 5, 6], "increas": 1, "worth": [1, 2, 5], "definition": [1, 4, 5, 7], "principl": [1, 2, 3, 4, 6, 8], "favor": [1, 2, 5], "timesav": 1, "clever": 1, "involv": [1, 2, 4, 5, 6, 7], "nice": [1, 2, 4, 6, 7], "idea": [1, 2, 3, 5, 6, 7], "abs_l": [1, 5], "ab": [1, 2, 5], "congratul": [1, 2, 4], "becom": [1, 4, 5, 6, 7], "min": [1, 2, 7], "uniqu": [1, 2, 3, 4, 5, 7], "min_le_left": 1, "min_le_right": 1, "le_min": 1, "max": [1, 2, 6, 7], "pair": [1, 2, 4, 5, 7], "act": 1, "curri": 1, "logician": 1, "haskel": 1, "bind": [1, 3], "tighter": [1, 3], "infix": [1, 6], "le_antisymm": [1, 2], "less": [1, 2, 3, 4, 5, 6, 7], "usag": 1, "inconsist": 1, "outer": 1, "level": [1, 2, 6], "nest": [1, 2], "maintain": 1, "bother": [1, 3], "repetit": 1, "foreshadow": 1, "univers": [1, 3, 5, 7, 11], "quantifi": [1, 3, 4, 5, 7, 11], "desir": [1, 3, 6, 7], "implicitli": [1, 2], "mani": [1, 2, 3, 5, 6, 7, 8, 11], "whether": [1, 2, 3, 4, 6, 7], "Of": [1, 2, 4, 6, 7, 8], "interest": [1, 2, 3, 5, 6, 7], "vice": [1, 3], "versa": [1, 3], "word": [1, 2, 3, 4, 5, 7], "switch": [1, 6], "transit": [1, 2, 5, 7], "total": 1, "satisfi": [1, 3, 4, 5, 6, 7, 8], "disjunct": [1, 3, 11], "stick": [1, 2, 7, 8], "split": [1, 2, 3, 4], "aux": [1, 2, 4, 7], "valu": [1, 2, 3, 4, 5, 6, 7, 8], "yield": [1, 2, 3, 4, 5, 7], "made": [1, 2, 3, 5, 7], "manifest": [1, 7], "triangl": [1, 2, 5], "abs_add": [1, 2], "sub_add_cancel": [1, 5], "relat": [1, 2, 3, 5, 6, 7, 8], "ordinari": [1, 2, 4, 5, 7], "unicod": [1, 3, 6], "obtain": [1, 2, 4, 5, 7, 8], "dvd": 1, "dvd_tran": 1, "dvd_mul_of_dvd_left": 1, "dvd_mul_left": 1, "expon": 1, "expand": [1, 2, 3, 4, 5], "w": [1, 6], "greatest": [1, 5, 7], "divisor": [1, 2, 4, 5], "gcd": [1, 2, 4], "least": [1, 5, 6, 7], "lcm": 1, "analog": [1, 2, 3, 4, 7], "divid": [1, 2, 4, 5], "gcd_zero_right": 1, "gcd_zero_left": 1, "lcm_zero_right": 1, "lcm_zero_left": 1, "similarli": [1, 2, 3, 4, 5], "prefix": [1, 4, 6], "dvd_antisymm": 1, "complain": 1, "ambigu": [1, 5], "_root_": [1, 4], "saw": [1, 5, 6, 7], "govern": [1, 5], "class": [1, 4, 5, 6, 7, 8], "describ": [1, 2, 3, 4, 5, 6, 7], "\u03b1": [1, 2, 3, 4, 5, 6, 7, 8], "partialord": [1, 2], "adopt": 1, "letter": [1, 5, 8], "\u03b2": [1, 2, 3, 5, 6, 7], "\u03b3": [1, 2, 5, 7], "greek": [1, 4], "especi": [1, 5, 6, 7], "strict": [1, 2], "somewhat": [1, 3, 7], "lt_irrefl": [1, 2], "lt_iff_le_and_n": 1, "lattic": [1, 5, 6, 7], "inf_le_left": [1, 7], "inf_le_right": 1, "le_inf": 1, "le_sup_left": 1, "le_sup_right": 1, "sup_l": 1, "lower": [1, 2, 4], "bound": [1, 2, 3, 4, 5, 7, 8], "upper": [1, 2], "glb": 1, "lub": 1, "infimum": [1, 6, 7], "supremum": [1, 4, 6], "inf": [1, 6, 7], "sup": [1, 4, 7], "further": [1, 7], "matter": [1, 2], "meet": [1, 2, 3, 5], "join": [1, 5], "keep": [1, 5, 6], "dictionari": 1, "subset": [1, 2, 3, 5, 7, 8], "domain": [1, 2, 3, 4, 5, 7], "boolean": 1, "truth": [1, 4], "fals": [1, 2, 3, 4, 6], "true": [1, 2, 3, 6, 7], "posit": [1, 3, 4, 5, 7], "subspac": [1, 6], "vector": [1, 3, 6, 8], "intersect": [1, 3, 5, 6, 7], "sum": [1, 2, 4, 5, 6, 7], "inclus": [1, 3, 7], "topologi": [1, 5, 6, 8, 11], "union": [1, 3, 4, 5, 6, 8], "inf_comm": 1, "inf_assoc": 1, "sup_comm": 1, "sup_assoc": 1, "absorpt": 1, "law": 1, "absorb1": 1, "absorb2": 1, "found": [1, 5, 8], "inf_sup_self": 1, "sup_inf_self": 1, "distriblattic": 1, "inf_sup_left": 1, "inf_sup_right": 1, "sup_inf_left": 1, "sup_inf_right": 1, "shown": [1, 5, 8], "explicit": [1, 2, 5, 6, 7], "nondistribut": 1, "finit": [1, 3, 4, 5, 7, 8], "impli": [1, 2, 3, 4, 5, 7], "larger": [1, 7], "carrier": [1, 5, 6], "compat": [1, 7], "strictorderedr": 1, "mul_po": [1, 4], "mul_nonneg": 1, "coupl": [1, 2, 6, 7], "metric": [1, 5, 8, 11], "equip": [1, 3, 5, 6, 7, 8], "distanc": [1, 2, 7, 8], "dist": [1, 7], "map": [1, 2, 3, 5, 6, 7], "metricspac": [1, 7, 8], "dist_self": 1, "dist_comm": [1, 7], "dist_triangl": [1, 7], "nonneg": [1, 5], "nonneg_of_mul_nonneg_left": 1, "dist_nonneg": [1, 7], "dealt": 2, "basic": [2, 4, 5, 7, 11], "simpl": [2, 4, 5, 6, 8], "absolut": 2, "\u03b5": [2, 7, 8], "though": [2, 3, 4, 5], "treat": [2, 3, 5, 6, 7, 8], "my_lemma": 2, "\u03b4": [2, 7], "hb": [2, 7], "subsequ": [2, 4, 7], "lemma": [2, 4, 5, 6, 7, 8, 11], "mention": [2, 3, 5, 6, 7], "my_lemma2": 2, "stage": [2, 5, 6], "my_lemma3": 2, "epo": 2, "ele1": 2, "xlt": 2, "ylt": 2, "essenti": [2, 3, 5, 7], "colon": 2, "why": [2, 4, 6, 7], "off": [2, 3, 4], "my_lemma4": 2, "abs_mul": 2, "mul_le_mul": 2, "abs_nonneg": 2, "mul_lt_mul_right": 2, "extract": [2, 7], "hidden": 2, "expos": [2, 7], "predic": [2, 3, 4, 6, 7, 8], "fn_ub": 2, "fn_lb": 2, "fnub": 2, "fnlb": 2, "hfa": 2, "hgb": 2, "dsimp": [2, 3, 4, 5], "simplif": [2, 3, 4], "contract": 2, "anyhow": 2, "control": 2, "transform": [2, 3], "rest": [2, 3, 5, 7], "routin": 2, "nnf": 2, "nng": 2, "hfb": 2, "nna": 2, "order": [2, 3, 4, 5, 6, 7, 8, 11], "codomain": [2, 4, 7], "structur": [2, 4, 6, 7, 8, 11], "monoid": [2, 3, 4, 6], "fn_ub_add": 2, "orderedcanceladdcommmonoid": 2, "high": 2, "monoton": [2, 6, 7], "nondecreas": [2, 4], "placehold": 2, "Or": [2, 3], "backward": [2, 7], "subgoal": 2, "mf": 2, "mg": 2, "aleb": 2, "lambda": [2, 5], "underscor": [2, 3], "flag": [2, 3], "squiggli": 2, "marker": 2, "nnc": 2, "bbb": [2, 5], "fneven": 2, "fnodd": 2, "ef": 2, "eg": 2, "og": 2, "shorten": 2, "rid": 2, "won": [2, 4, 6, 7], "cannot": [2, 3, 4, 5, 6, 7], "contrari": 2, "syntact": 2, "reduct": [2, 3], "erw": 2, "harder": 2, "spot": 2, "rudimentari": 2, "foundat": [2, 3, 4, 5], "impos": 2, "restrict": [2, 3, 4, 7], "talk": [2, 4, 7, 8], "assert": [2, 3, 6], "ask": [2, 4, 5, 6, 7], "tran": [2, 4, 5, 6], "setub": 2, "inject": [2, 3, 4, 6, 7], "x_1": [2, 3], "x_2": [2, 3], "x\u2081": [2, 3, 5, 7], "x\u2082": [2, 3, 5], "add": [2, 4, 5, 6, 7, 8], "nonzero": [2, 4, 5], "add_left_inj": 2, "composit": [2, 3, 5, 6, 7], "injg": 2, "injf": [2, 3], "canon": [2, 3, 4, 5], "exhibit": [2, 7], "anonym": [2, 3, 4, 5], "constructor": [2, 3, 4, 5, 6], "angl": 2, "whatev": [2, 4], "certain": [2, 6, 7], "fnhasub": 2, "fnhaslb": 2, "fnub_add": 2, "gun": 2, "ubf": 2, "ubg": 2, "ubfa": 2, "ubfb": 2, "unpack": [2, 3], "claus": [2, 6], "whose": [2, 4, 5, 6, 7, 8], "els": [2, 3, 4], "turn": [2, 3, 4, 5, 6, 7, 8], "directli": [2, 4, 5, 6, 7], "lbf": 2, "lbg": 2, "cousin": 2, "rcase": [2, 3, 4, 5, 7], "flexibl": [2, 7], "recurs": [2, 3, 5, 11], "harm": [2, 3], "swiss": 2, "armi": 2, "knive": 2, "wide": 2, "old": [2, 5, 6], "chestnut": 2, "product": [2, 4, 5, 6, 7], "magic": [2, 5, 6], "verifi": 2, "sumofsquar": 2, "sumofsquares_mul": 2, "sosx": 2, "sosi": 2, "xeq": [2, 3], "yeq": 2, "insight": 2, "motiv": 2, "gaussian": [2, 11], "sqrt": [2, 3, 4, 5], "norm": [2, 5, 7, 11], "reflect": 2, "di": [2, 5], "xy": [2, 5], "cryptic": 2, "easiest": [2, 4], "perspicu": 2, "divis": [2, 4, 5, 6, 11], "divab": 2, "divbc": 2, "beq": 2, "ceq": 2, "And": [2, 4, 6, 7], "pretti": [2, 6, 7], "Then": [2, 3, 5, 6, 7], "divac": 2, "alpha": [2, 3], "beta": [2, 3], "surject": [2, 3, 7], "yourself": [2, 5], "field_simp": [2, 5], "denomin": [2, 4, 5], "div_mul_cancel": 2, "hx": [2, 3, 5, 6, 8], "method": [2, 3, 4, 5], "surjg": 2, "surjf": [2, 3], "strictli": [2, 8], "contradict": [2, 3, 4], "speak": [2, 5, 7], "irreflex": 2, "asymmetri": 2, "lt_asymm": 2, "sugar": 2, "eventu": [2, 3, 7], "fnuba": 2, "not_le_of_gt": 2, "not_lt_of_g": [2, 4, 5], "lt_of_not_g": 2, "le_of_not_gt": 2, "snippet": [2, 4, 5], "counterexampl": [2, 8], "monof": 2, "four": [2, 5], "valid": 2, "far": [2, 3, 6, 7], "q": [2, 4, 5, 6, 7], "straightforward": [2, 6], "difficult": [2, 6], "conclud": [2, 8], "nonexist": 2, "contradictori": 2, "classic": [2, 3, 4], "by_contra": [2, 4], "not_not": 2, "front": 2, "push": [2, 4, 7], "inward": 2, "facilit": [2, 7], "push_neg": [2, 3, 4], "restat": [2, 6], "contrapos": [2, 3, 4], "yet": [2, 3, 4, 5, 6, 7], "semicolon": [2, 4], "falso": 2, "anyth": [2, 5, 7], "elim": 2, "strang": [2, 4], "fairli": 2, "reach": [2, 6], "37": 2, "exfalso": 2, "absurd": [2, 4], "slick": 2, "drop": 2, "manner": [2, 5], "contrast": [2, 3, 5, 7], "compon": [2, 3, 5, 7], "techniqu": [2, 7], "variou": [2, 3, 5, 6], "xltz": 2, "zlty": 2, "10": 2, "7": [2, 4], "behav": [2, 3, 6, 7], "roughli": [2, 3, 4], "friend": [2, 5], "were": [2, 4, 5, 7], "inscrut": [2, 3], "gadget": [2, 7], "auxiliari": [2, 7], "pow_eq_zero": [2, 4], "doubl": [2, 3], "symmetr": [2, 3], "abs_lt": 2, "dvd_gcd_iff": 2, "8": [2, 4, 7], "6": [2, 4, 5, 6, 7, 8], "15": 2, "below": [2, 3, 4, 5, 6, 7, 8], "not_monotone_iff": 2, "antisymmetr": 2, "aris": 2, "preorder": [2, 6, 7], "pre": 2, "lt_iff_le_not_l": 2, "beyond": [2, 6, 8], "repeatedli": [2, 7], "instanti": [2, 5, 6, 7], "inl": [2, 3], "inr": [2, 3], "produc": [2, 8], "branch": [2, 3, 6], "le_or_gt": 2, "abs_of_nonneg": [2, 5], "abs_of_neg": 2, "immedi": [2, 3, 5, 6], "myab": 2, "le_abs_self": [2, 5], "neg_le_abs_self": 2, "enjoi": [2, 3, 4, 7], "pun": 2, "lt_ab": 2, "genuin": 2, "vertic": [2, 5], "lt_trichotomi": 2, "xgt": 2, "dvd_mul_right": [2, 4], "eq_zero_or_eq_zero_of_mul_eq_zero": 2, "nontrivi": [2, 3, 4, 5, 7], "integr": [2, 8], "isdomain": 2, "em": [2, 3], "exclud": [2, 4], "by_cas": [2, 3, 4], "dispos": 2, "s_0": [2, 3], "s_1": 2, "s_2": 2, "ldot": [2, 3, 4], "varepsilon": [2, 7], "s_n": [2, 3], "render": [2, 4], "convergesto": 2, "ext": [2, 3, 4, 5, 6], "enabl": [2, 3, 4, 5], "actual": [2, 3, 4, 6, 7], "congr": 2, "reconcil": 2, "peel": 2, "convert": [2, 4], "quit": [2, 6, 7], "zero_lt_on": [2, 4], "fill": [2, 3, 4, 5], "convergesto_const": 2, "\u03b5po": [2, 7], "nge": 2, "abs_zero": 2, "save": [2, 3], "troubl": [2, 3, 5], "pen": 2, "paper": [2, 3, 5, 7], "nt": 2, "maximum": [2, 4, 7], "implement": [2, 5, 6, 8], "convergesto_add": 2, "ct": 2, "\u03b52po": 2, "ht": 2, "le_of_max_le_left": 2, "le_of_max_le_right": 2, "tricki": [2, 3, 4, 6], "convergesto_mul_const": 2, "mulzeroclass": [2, 6], "acpo": 2, "abs_po": 2, "independ": [2, 3, 5], "exists_abs_le_of_convergesto": 2, "strong": [2, 4], "n\u2080": 2, "bpo": [2, 7], "pos\u2080": 2, "div_po": 2, "n\u2081": 2, "convergesto_mul": 2, "sketch": [2, 3, 4, 7], "limit": [2, 6, 7], "bold": 2, "scratch": 2, "convergesto_uniqu": 2, "sa": 2, "sb": 2, "abn": 2, "na": 2, "hna": 2, "nb": 2, "hnb": 2, "absa": 2, "absb": 2, "observ": [2, 4, 7], "everywher": [2, 3, 6, 7], "linearord": 2, "vastli": 2, "awai": [2, 5], "vocabulari": 3, "uniform": [3, 7, 8], "primit": 3, "conceptu": 3, "advantag": [3, 4, 5, 8], "overload": 3, "verbos": 3, "system": [3, 4, 5, 6], "wrong": 3, "theoret": [3, 7], "ss": 3, "sub": [3, 7, 11], "cap": 3, "un": 3, "cup": 3, "univ": [3, 7, 8], "empti": [3, 4, 5, 7], "member": [3, 7], "membership": [3, 4, 6], "mem": 3, "notin": 3, "ident": [3, 4, 5, 6, 7, 11], "databas": [3, 4, 6, 7], "unlik": [3, 4], "existenti": [3, 11], "subset_def": 3, "inter_def": 3, "xu": 3, "mem_inter_iff": 3, "xsu": 3, "phenomenon": 3, "quirk": 3, "process": 3, "pitfal": 3, "heavili": [3, 7], "fall": 3, "union_def": 3, "mem_union": [3, 4], "xtu": 3, "xt": 3, "unnecessari": 3, "clearer": [3, 5], "correctli": 3, "special": [3, 4, 5, 6, 7], "rewritten": 3, "diff_eq": 3, "mem_diff": 3, "xstu": 3, "xnt": 3, "xnu": 3, "extension": [3, 5], "unsurprisingli": 3, "dollar": 3, "sign": [3, 7], "and_comm": 3, "antisymm": 3, "hood": [3, 5], "builder": 3, "trivial": [3, 4, 7], "eq_two_or_odd": 3, "even_iff": 3, "confus": [3, 4, 6, 7], "fortun": 3, "agre": 3, "prime_iff": 3, "symm": [3, 4, 5, 6, 7, 8], "rwa": [3, 4, 5], "signific": 3, "ball": [3, 8], "bex": 3, "bex_def": 3, "prime_x": 3, "slight": 3, "ssubt": 3, "index": [3, 6, 7], "model": [3, 7], "sequenc": [3, 6, 7, 8, 11], "a_0": 3, "a_1": 3, "a_2": 3, "mem_iunion": 3, "xai": 3, "mem_iint": 3, "mem_union\u2082": 3, "mem_inter\u2082": 3, "mem_iunion\u2082": 3, "exists_prime_and_dvd": 3, "eq_univ": 3, "eq_univ_of_foral": 3, "exists_infinite_prim": 3, "\u2080": 3, "sunion": 3, "sinter": 3, "relationship": [3, 4], "mem_iinter\u2082": 3, "sunion_eq_biunion": 3, "sinter_eq_biint": 3, "preimag": [3, 7], "imag": [3, 4, 6, 7], "tripl": 3, "tag": [3, 6], "mem_image_of_mem": 3, "galoi": [3, 5, 7], "image_subset_iff": 3, "represent": [3, 4, 5], "asid": 3, "raini": 3, "dai": 3, "behavior": [3, 6, 7], "nonempti": [3, 7], "condit": [3, 4, 6, 7, 8], "fxeq": 3, "ai": 3, "fx": 3, "eq": [3, 5], "injon": 3, "theme": 3, "rel": [3, 5], "relativ": 3, "xpo": 3, "ypo": 3, "exp_log": 3, "ingredi": [3, 5, 7, 8], "assign": [3, 5, 6], "inhabit": [3, 5, 7], "appeal": [3, 6], "choose_spec": 3, "some_spec": 3, "noncomput": [3, 5], "inverse_spec": 3, "dif_po": 3, "dif_neg": 3, "fulli": [3, 7], "alon": 3, "leftinvers": 3, "rightinvers": 3, "hack": 3, "half": 3, "dozen": 3, "condens": 3, "cantor": 3, "famou": 3, "miss": [3, 4], "j": [3, 5], "intuit": [3, 7], "cardin": 3, "biject": [3, 5], "nineteenth": 3, "centuri": 3, "infinit": [3, 7, 11], "dedekind": 3, "quickli": 3, "behind": 3, "problem": [3, 4, 5, 6, 7], "shade": 3, "region": 3, "diagram": 3, "circ": [3, 5], "scale": 3, "inner": 3, "smaller": [3, 4, 7], "concentr": 3, "unshad": 3, "compos": [3, 5, 7], "disjoint": 3, "sound": [3, 5, 6], "plausibl": 3, "delic": 3, "improv": [3, 4], "confid": 3, "invfun": [3, 5], "leftinverse_invfun": 3, "invfun_eq": 3, "sbaux": 3, "sbset": 3, "sb_aux": 3, "s_": 3, "sb_set": 3, "bigcup_": 3, "mathbb": [3, 4, 5], "sbfun": 3, "complement": [3, 7], "outermost": 3, "setminu": 3, "inv_fun": 3, "inv_fun_eq": 3, "sb_right_inv": 3, "goe": [3, 4, 5, 6, 7], "henc": [3, 4, 5, 6, 7, 8], "neither": [3, 5, 6], "nor": [3, 5], "sb_inject": 3, "hf": [3, 7, 8], "hg": [3, 7, 8], "a_def": 3, "h_def": 3, "hxeq": 3, "xa": [3, 5], "wlog": 3, "x\u2081a": 3, "resolve_left": 3, "x\u2082a": 3, "not_imp_self": 3, "x\u2082na": 3, "if_po": 3, "if_neg": 3, "x\u2082eq": 3, "hn": [3, 4, 7, 8], "sb_fun": 3, "bring": [3, 4, 7], "tradeoff": 3, "encapsul": [3, 5, 8], "symmetri": [3, 6], "dwell": 3, "succ": [3, 4, 6], "sb_surject": 3, "gya": 3, "xmem": 3, "sweet": 3, "schroeder_bernstein": 3, "substant": 4, "ancient": 4, "fraction": 4, "lowest": 4, "2c": 4, "4c": 4, "factor": [4, 5], "coprim": 4, "smart": 4, "12": 4, "encount": [4, 6], "algebra": [4, 6, 7, 8, 11], "prime_def_lt": 4, "eq_one_or_self_of_dvd": 4, "prime_p": 4, "17": 4, "commonli": [4, 5], "prime_two": 4, "prime_thre": 4, "broader": [4, 8], "irreduc": [4, 5], "coincid": [4, 5, 7], "rise": [4, 6], "dvd_mul": 4, "even_of_even_sqr": 4, "dvd_of_dvd_pow": 4, "proce": [4, 6], "profici": 4, "search": [4, 5, 6], "engin": 4, "hesit": 4, "mul_right_inj": 4, "heart": 4, "irration": 4, "dvd_gcd": 4, "coprime_mn": 4, "sqr_eq": 4, "meq": 4, "dvd_iff_exists_eq_mul_left": 4, "two_l": 4, "le_of_dvd": 4, "approach": [4, 5, 6, 7], "quick": [4, 8], "ne": [4, 5], "occur": 4, "suffici": [4, 7], "permut": 4, "prime_of_mem_factor": 4, "prod_factor": 4, "factors_uniqu": 4, "factorization_mul": 4, "mnez": 4, "nnez": 4, "factorization_pow": 4, "black": [4, 6], "box": 4, "simpa": [4, 8], "nnz": 4, "nsqr_nez": 4, "eq1": 4, "eq2": 4, "add_mul_mod_self_left": 4, "mul_mod_right": 4, "count_factors_mul_of_po": 4, "successor": 4, "succ_ne_zero": 4, "npow_nz": 4, "dvd_sub": 4, "pow_eq": 4, "npowz": 4, "add_sub_cancel": 4, "understood": [4, 7], "quotient": [4, 5, 6, 7], "pictur": [4, 5], "mediat": 4, "headach": 4, "contend": 4, "issu": [4, 5, 6, 7], "th": 4, "topic": [4, 6], "enat": 4, "infin": [4, 7], "appreci": 4, "role": [4, 5, 7], "_section_induction_and_recurs": 4, "writ": 4, "datatyp": 4, "freeli": 4, "translat": [4, 6, 7], "mathematician": [4, 7], "inj": 4, "factori": 4, "fac": 4, "ih": 4, "fac_po": 4, "succ_po": 4, "dvd_fac": 4, "ipo": 4, "il": 4, "of_le_succ": 4, "dvd_mul_of_dvd_right": 4, "crude": 4, "remaind": [4, 5], "pow_two_le_fac": 4, "finset": [4, 5, 7], "bigoper": [4, 5], "prod": [4, 7], "sum_range_zero": 4, "sum_range_succ": 4, "summat": 4, "prod_range_zero": 4, "prod_range_succ": 4, "deserv": 4, "comment": 4, "danger": [4, 5], "ordinarili": [4, 5], "loop": 4, "indefinit": 4, "fix": [4, 6, 7], "placement": 4, "re": [4, 5], "handi": 4, "sum_id": 4, "div_eq_of_eq_mul_right": 4, "succ_eq_add_on": 4, "sum_sqr": 4, "mynat": 4, "thumb": 4, "decid": [4, 7], "preced": 4, "truncat": 4, "exponenti": 4, "cut": 4, "predecessor": 4, "pred": 4, "mul": [4, 5, 6, 7], "succ_add": 4, "succ_mul": 4, "explor": [4, 7], "standard": [4, 5, 6, 7], "formul": [4, 7], "quirki": 4, "among": 4, "annoi": [4, 6], "h0": 4, "succ_le_succ": 4, "zero_l": [4, 5], "interval_cas": 4, "interv": [4, 7], "decis": 4, "procedur": [4, 6], "revert": [4, 5], "minfac": 4, "smallest": [4, 6, 7], "strong_induction_on": 4, "subsum": 4, "exists_prime_factor": 4, "np": 4, "mltn": 4, "mdvdn": 4, "mne1": 4, "mz": 4, "zero_dvd_iff": 4, "mgt2": 4, "pp": 4, "pdvd": 4, "factorial_po": 4, "dvd_factori": 4, "primes_infinit": 4, "refin": [4, 8], "ple": 4, "p_1": 4, "p_n": 4, "prod_": 4, "p_i": [4, 7], "computation": 4, "test": 4, "decidableeq": 4, "abandon": 4, "ourselv": [4, 6], "subset_iff": 4, "mem_int": 4, "mem_sdiff": 4, "tauto": 4, "dispens": 4, "tautologi": 4, "dvd_prod_of_mem": 4, "eq_of_dvd_of_prim": 4, "prime_q": 4, "preserv": [4, 6, 7], "induction_on": 4, "singleton": 4, "prod_empti": 4, "prod_insert": 4, "mem_of_dvd_prod_prim": 4, "mem_insert": 4, "wrote": 4, "filter": [4, 8, 11], "mem_filt": 4, "aim": 4, "prod_po": 4, "_def": 4, "mem_": 4, "id": [4, 6, 7, 8], "bounded_of_ex_finset": 4, "qk": 4, "lt_succ_of_l": 4, "le_sup": 4, "ex_finset_of_bound": 4, "decidablepr": 4, "lt_succ_iff": 4, "congruent": 4, "p_k": 4, "loss": 4, "27": 4, "mod_4_eq_3_or_mod_4_eq_3": 4, "mul_mod": 4, "mod_lt": 4, "hm": [4, 8], "two_le_of_mod_4_eq_3": 4, "neq": 4, "div_dvd_of_dvd": 4, "div_lt_self": 4, "piec": [4, 5, 6, 7], "exists_prime_factor_mod_4_eq_3": 4, "dvd_rfl": 4, "mge2": 4, "mul_div_cancel": 4, "home": [4, 5], "stretch": [4, 5], "remov": [4, 7], "eras": 4, "mem_eras": 4, "readi": [4, 6, 7, 8], "dvd_add_iff_left": 4, "primes_mod_4_eq_3_infinit": 4, "p4": 4, "pltn": 4, "p4eq": 4, "pne3": 4, "seriou": [4, 6, 7], "feat": 4, "modern": 5, "subject": 5, "mysteri": [5, 6], "technic": [5, 6], "consult": 5, "ann": 5, "baanen": 5, "abus": 5, "paramet": [5, 6], "broadest": 5, "possibli": 5, "constraint": [5, 7], "bundl": [5, 6, 7, 8], "tupl": 5, "hy": [5, 6], "hz": [5, 6], "mypoint1": 5, "mypoint2": 5, "mypoint3": 5, "mk": [5, 6, 7], "former": 5, "latter": [5, 7], "quot": [5, 7], "protect": 5, "intern": 5, "add_x": 5, "addalt": 5, "etc": [5, 7], "y\u2081": 5, "z\u2081": 5, "y\u2082": 5, "z\u2082": 5, "addalt_x": 5, "addalt_comm": 5, "ya": 5, "za": 5, "xb": 5, "yb": 5, "zb": 5, "apart": 5, "effici": [5, 7], "scalar": [5, 6, 8], "smul": [5, 6], "smul_distrib": 5, "road": 5, "link": [5, 6], "belong": [5, 6, 7], "simplex": 5, "convinc": 5, "equilater": 5, "interior": [5, 8], "standardtwosimplex": 5, "x_nonneg": 5, "y_nonneg": 5, "z_nonneg": 5, "sum_eq": 5, "swap": 5, "swapxi": 5, "interestingli": [5, 8], "midpoint": 5, "div_nonneg": 5, "weight": 5, "averag": 5, "analogi": [5, 7, 8], "weightedaverag": 5, "lambda_nonneg": 5, "lambda_l": 5, "fin": 5, "standardsimplex": 5, "sum_eq_on": 5, "div_eq_mul_inv": 5, "sum_mul": 5, "sum_add_distrib": 5, "mul_sum": 5, "manipul": [5, 7], "islinear": 5, "is_addit": 5, "preserves_mul": 5, "linf": 5, "subtyp": [5, 6, 7], "preal": 5, "val": 5, "sigma": 5, "wherebi": [5, 7], "stdsimplex": 5, "\u03c3": 5, "fst": [5, 7], "snd": [5, 7], "custom": 5, "robust": [5, 6], "interfac": 5, "redefin": [5, 6], "accessor": 5, "weav": 5, "rich": [5, 6], "interconnect": 5, "hierarchi": [5, 11], "clarifi": 5, "antireflex": 5, "cdot": 5, "topolog": [5, 6, 8, 11], "mathcal": [5, 8], "proxi": 5, "bipartit": 5, "graph": 5, "categori": [5, 7, 8], "morphism": [5, 8, 11], "basi": [5, 7], "discret": [5, 8], "inherit": [5, 6], "polynomi": 5, "coeffici": 5, "dual": [5, 7], "accommod": 5, "almost": [5, 6, 7], "marriag": 5, "heaven": 5, "group\u2081": [5, 6], "inv": [5, 6], "struc": 5, "counterpart": 5, "chosen": 5, "assur": 5, "groupcat": 5, "group\u2081cat": 5, "str": 5, "capit": 5, "roman": 5, "equiv": 5, "tofun": [5, 6], "right_inv": 5, "left_inv": 5, "creativ": 5, "evid": 5, "coercion": [5, 6, 7, 8], "omit": 5, "perm": 5, "under": [5, 6, 7], "orient": 5, "permgroup": 5, "trans_assoc": 5, "trans_refl": 5, "refl_tran": 5, "self_trans_symm": 5, "grouptheori": 5, "g_1": 5, "g_2": 5, "g_3": 5, "tightli": 5, "isomorph": [5, 8], "additivegroup": 5, "Its": [5, 6], "neg": [5, 6, 7], "reproduc": 5, "accompani": 5, "addgroup\u2081": 5, "scheme": 5, "add_group_point": 5, "arrang": 5, "mul_inv_cancel_right": 5, "achiev": [5, 6, 7], "silent": [5, 6], "regist": [5, 6], "grp": 5, "contextu": 5, "cue": 5, "synthes": [5, 6], "whole": 5, "_inst_1": 5, "candid": 5, "group\u2082": 5, "mysquar": 5, "my_squar": 5, "remark": [5, 6], "head": 5, "store": 5, "headi": 5, "hasmulgroup\u2082": 5, "hasonegroup\u2082": 5, "hasinvgroup\u2082": 5, "suppli": 5, "accord": 5, "capabl": 5, "chain": 5, "recent": 5, "prioriti": 5, "bad": [5, 6, 7], "artifici": 5, "addgroup\u2082": 5, "subtl": [5, 7], "configur": 5, "invisibli": [5, 6], "wise": 5, "euclidean": 5, "terminologi": 5, "mid": 5, "imaginari": 5, "gaussint": 5, "im": 5, "pointwis": [5, 7, 8], "root": [5, 6, 11], "ac": 5, "bci": 5, "adi": 5, "bd": 5, "bc": 5, "hasmul": 5, "zero_def": 5, "one_def": 5, "add_def": 5, "neg_def": 5, "mul_def": 5, "zero_r": 5, "zero_im": 5, "one_r": 5, "one_im": 5, "add_r": 5, "add_im": 5, "neg_r": 5, "neg_im": 5, "mul_r": 5, "mul_im": 5, "surprisingli": [5, 6], "concept": [5, 7, 8], "light": 5, "bulb": 5, "skeleton": [5, 7], "scari": 5, "entri": 5, "instcommr": 5, "left_distrib": [5, 6], "right_distrib": [5, 6], "ext_iff": 5, "bq": 5, "archetyp": 5, "int": [5, 6], "ediv_add_emod": 5, "emod_nonneg": 5, "emod_lt": 5, "unit": [5, 6, 7], "algorithm": 5, "conjug": 5, "frac": 5, "nearest": 5, "size": 5, "vi": 5, "multipli": 5, "view": [5, 6, 7], "emb": 5, "forth": 5, "quadrat": 5, "gaussian_int": 5, "stai": 5, "face": [5, 6, 7], "machineri": [5, 6, 7], "adapt": 5, "invest": 5, "pragmat": 5, "seek": 5, "heather": 5, "macbeth": 5, "eleg": 5, "div": 5, "mod": 5, "_add_mod": 5, "abs_mod": 5, "_le": 5, "emod_lt_of_po": 5, "zero_lt_two": 5, "fixm": 5, "_eq": 5, "sq_add_sq_eq_zero": 5, "linearorderedr": 5, "norm_nonneg": [5, 8], "norm_eq_zero": [5, 8], "norm_po": 5, "norm_mul": [5, 8], "conj": 5, "conj_r": 5, "conj_im": 5, "norm_conj": 5, "bespok": 5, "quad": 5, "record": [5, 6], "div_def": 5, "mod_def": 5, "messi": 5, "nicer": [5, 7], "norm_mod_lt": 5, "norm_y_po": 5, "sub_mul": 5, "conv": 5, "lh": 5, "sq_le_sq": 5, "mul_le_mul_of_nonneg_left": 5, "ediv_mul_l": 5, "ediv_nonneg": 5, "le_of_mul_le_mul_right": 5, "ediv_lt_of_lt_mul": 5, "natab": 5, "coe_natabs_norm": 5, "natabs_of_nonneg": 5, "natabs_norm_mod_lt": 5, "ofnat_lt": 5, "coe_natab": 5, "not_norm_mul_left_lt_norm": 5, "natabs_mul": 5, "le_mul_of_one_le_right": 5, "ofnat_l": 5, "add_one_le_of_lt": 5, "euclideandomain": 5, "quotient_mul_add_remainder_eq": 5, "quotient_zero": 5, "r_wellfound": 5, "remainder_lt": 5, "mul_left_not_lt": 5, "payoff": 5, "principalidealr": 5, "irreducible_iff_prim": 5, "studi": [6, 7], "prematur": 6, "technologi": 6, "simpler": 6, "ring\u2081": 6, "gradual": [6, 7], "bottom": [6, 7], "endow": 6, "one\u2081": 6, "heavier": 6, "inferr": 6, "resolut": 6, "ie": [6, 7], "attribut": 6, "ensur": [6, 7], "self": 6, "one\u2082": 6, "usabl": 6, "silli": 6, "affect": 6, "importantli": 6, "habit": 6, "ascript": 6, "messag": 6, "typeclass": 6, "stuck": 6, "metavari": 6, "263": 6, "auto": 6, "sever": [6, 7], "unknown": 6, "collis": 6, "builtin": 6, "\ud835\udfd9": 6, "inherit_doc": 6, "diamond": 6, "dia\u2081": 6, "dia": 6, "infixl": 6, "70": 6, "semigroup": 6, "dia_assoc": 6, "semigroup\u2081": 6, "todia\u2081": 6, "previous": 6, "semigroup\u2082": 6, "hurdl": 6, "neutral": 6, "diaoneclass\u2081": 6, "one_dia": 6, "dia_on": 6, "trace": 6, "info": 6, "ters": 6, "expend": 6, "attempt": 6, "succce": 6, "success": 6, "set_opt": 6, "meta": 6, "synthinst": 6, "monoid\u2081": 6, "hide": [6, 7], "subtleti": 6, "fear": 6, "unrel": 6, "tosemigroup\u2081": 6, "todiaoneclass\u2081": 6, "monoid\u2082": 6, "defect": [6, 7], "toone\u2081": 6, "overlap": 6, "tear": 6, "appart": 6, "signatur": 6, "restor": 6, "optim": 6, "reusabl": 6, "inv\u2081": 6, "postfix": 6, "inv_dia": 6, "weak": 6, "preliminari": 6, "left_inv_eq_right_inv\u2081": 6, "hba": 6, "hac": 6, "export": 6, "inv_eq_of_dia": 6, "dia_inv": 6, "naiv": [6, 7], "duplic": 6, "attibut": 6, "to_addit": 6, "semi": 6, "left_inv_eq_right_inv": 6, "left_neg_eq_right_neg": 6, "wathsnew": [], "addsemigroup\u2083": 6, "add_assoc\u2083": 6, "semigroup\u2083": 6, "mul_assoc\u2083": 6, "addmonoid\u2083": 6, "addzeroclass": 6, "monoid\u2083": 6, "muloneclass": 6, "tomuloneclass": 6, "whatsnew": 6, "addcommsemigroup\u2083": 6, "commsemigroup\u2083": 6, "addcommmonoid\u2083": 6, "commmonoid\u2083": 6, "addgroup\u2083": 6, "neg_add": 6, "group\u2083": 6, "inv_mul": 6, "approri": 6, "inv_eq_of_mul": 6, "propag": 6, "attr": 6, "mul_inv": 6, "mul_left_cancel\u2083": 6, "mul_right_cancel\u2083": 6, "addcommgroup\u2083": 6, "commgroup\u2083": 6, "demonstr": [6, 7], "puprpos": 6, "opposit": [6, 7], "gain": 6, "besid": 6, "parent": 6, "ring\u2083": 6, "toaddgroup\u2083": 6, "mayb": 6, "le\u2081": 6, "50": 6, "\u2081": 6, "preorder\u2081": 6, "partialorder\u2081": 6, "orderedcommmonoid\u2081": 6, "modul": 6, "pretend": 6, "smul\u2083": 6, "infixr": 6, "73": 6, "module\u2081": 6, "zero_smul": 6, "one_smul": 6, "mul_smul": 6, "add_smul": 6, "smul_add": 6, "surpris": 6, "addcommgroup3": 6, "toaddcommgroup\u2083": 6, "inst": 6, "module\u2083": 6, "hunt": 6, "unspecifi": 6, "embark": 6, "main": [6, 7, 8], "quest": 6, "huge": 6, "trap": 6, "refus": [6, 7], "tosmul\u2083": 6, "inst_1": 6, "safe": 6, "selfmodul": 6, "invert": 6, "nsmul\u2081": 6, "zsmul\u2081": 6, "ofnat": 6, "negsucc": 6, "intermedi": [6, 7], "abgrpmodul": 6, "frustat": 6, "failur": 6, "synth": 6, "indirect": 6, "path": 6, "thank": [6, 7], "definitionnali": 6, "offend": 6, "poor": 6, "forget": 6, "inria": 6, "hal": 6, "scienc": 6, "02463336": 6, "modifi": 6, "nsmul": 6, "addmonoid\u2084": 6, "nsmul_zero": 6, "nsmul_succ": 6, "mysmul": 6, "stori": 6, "incorpor": 6, "zsmul": 6, "incorport": 6, "lt\u2081": 6, "comparison": 6, "ismonoidhom\u2081": 6, "unpleas": [6, 7], "conjunct": [6, 11], "chose": 6, "ismonoidhom\u2082": 6, "map_on": 6, "map_mul": 6, "tempt": 6, "succe": [], "diverg": [], "higher": 6, "unif": 6, "psycholog": 6, "rare": 6, "adject": 6, "bare": 6, "noun": 6, "argu": 6, "continuous_id": [6, 7], "primari": 6, "constrast": 6, "monoidhom\u2081": 6, "coefun": 6, "coerc": 6, "coe": 6, "addmonoidhom\u2081": 6, "addmonoid": 6, "map_zero": 6, "map_add": [6, 8], "ringhom\u2081": 6, "minor": [6, 8], "tomonoidhom\u2081": 6, "juggl": 6, "monoidhomclass\u2081": 6, "badinst": 6, "wouldn": 6, "priori": 6, "slightli": [6, 7, 8], "boil": 6, "hopelessli": 6, "checksynthord": 6, "random": 6, "deduc": [6, 7], "outparam": 6, "trigger": 6, "retri": 6, "monoidhomclass\u2082": 6, "promis": [6, 7], "morphim": 6, "map_inv_of_inv": 6, "sight": 6, "got": 6, "presenc": 6, "repeatit": 6, "layer": [6, 7], "funlik": 6, "monoidhomclass": 6, "monoidhomclass\u2083": 6, "coe_inject": 6, "stop": 6, "ringhomclass\u2083": 6, "ringhom": 6, "algebrahom": 6, "ve": [6, 7], "primarili": [6, 7], "unbundl": 6, "mononton": [], "orderpreshom": 6, "le_of_l": 6, "orderpresmonoidhom": 6, "orderpreshomclass": 6, "subgroup": 6, "subr": 6, "reus": 6, "led": 6, "descend": 6, "break": 6, "barrier": 6, "setlik": 6, "wrap": [6, 7], "submonoid\u2081": 6, "submonoid": 6, "mul_mem": 6, "one_mem": 6, "tackl": 6, "setco": 6, "submonoid\u2081monoid": 6, "destructur": 6, "binder": 6, "submonoidclass\u2081": 6, "subgroup\u2081": 6, "subgroupclass\u2081": 6, "subobject": 6, "s\u2081": 6, "s\u2082": 6, "shame": 6, "across": 6, "weird": [6, 7], "distract": 6, "emphas": 6, "anecdot": 6, "devic": 6, "hasquoti": 6, "bewar": 6, "regular": [6, 7], "ascii": 6, "setoid": 6, "commmonoid": 6, "iseqv": 6, "hw": 6, "quotientmonoid": 6, "map\u2082": 6, "calculu": [7, 11], "quantiti": 7, "begun": 7, "paradox": 7, "exot": 7, "x\u2080": [7, 8], "convention": 7, "eight": 7, "varieti": 7, "wish": 7, "64": 7, "y\u2080": 7, "z\u2080": 7, "paragraph": 7, "512": 7, "bourbaki": 7, "spell": 7, "dualli": 7, "arbitrarili": 7, "neighborhood": 7, "at_top": 7, "\ud835\udcdd": [7, 8], "\ud835\udce4": 7, "entourag": 7, "\u03bc": 7, "a_": 7, "univ_set": 7, "sets_of_superset": 7, "inter_set": 7, "blur": 7, "princip": 7, "\ud835\udcdf": 7, "opportun": 7, "x_0": 7, "ioo": [7, 8], "tendsto\u2081": 7, "tendsto": 7, "lim_": 7, "sourc": 7, "abstractli": 7, "salient": 7, "pushforward": 7, "f_": 7, "tendsto\u2082": 7, "via": 7, "leverag": 7, "map_mono": 7, "map_map": 7, "shot": 7, "256": 7, "pullback": 7, "comap": 7, "map_le_iff_le_comap": 7, "contravari": 7, "comap_comap": 7, "plane": 7, "\u1da0": [7, 8], "\u02e2": 7, "nhds_prod_eq": 7, "aforement": 7, "le_inf_iff": 7, "attop": 7, "shouldn": 7, "prohibit": 7, "global": 7, "precondit": 7, "closur": 7, "ne_bot": 7, "tour": [7, 8], "claim": 7, "recaptur": 7, "superfici": 7, "stronger": 7, "famili": [7, 8], "\u03b9": [7, 8], "select": 7, "hasbasi": 7, "nhds_basis_ioo_po": 7, "has_basi": 7, "tendsto_iff": 7, "reformul": 7, "ici": 7, "attop_basi": 7, "knew": 7, "gave": 7, "n_p": 7, "n_q": 7, "tiresom": 7, "superscript": 7, "hp": 7, "hq": 7, "eventually_eq": 7, "tendsto_congr": 7, "review": 7, "eventually_of_foral": 7, "mono": 7, "item": 7, "filter_upward": 7, "hr": 7, "reader": 7, "ae": 7, "aka": 7, "occasion": 7, "frequent": 7, "sophist": 7, "mem_closure_of_tendsto": 7, "cluster_pt": 7, "mem_closure_iff_clusterpt": 7, "le_principal_iff": 7, "nebot_of_l": 7, "hux": 7, "hum": 7, "dist_eq_zero": 7, "emetricspac": 7, "pseudometricspac": 7, "pseudoemetricspac": 7, "journei": 7, "recast": 7, "tendsto_attop": 7, "continuous_iff": 7, "devot": 7, "uncurri": 7, "slow": 7, "continuous_fst": 7, "comp": 7, "assembl": 7, "prod_mk": 7, "continuous_snd": 7, "continuous_dist": 7, "clunki": 7, "crucial": 7, "elabor": 7, "prod_map": 7, "sad": 7, "border": 7, "obfusc": 7, "continuous_pow": 7, "continuousat": 7, "continuousat_iff": 7, "geometr": 7, "closedbal": 7, "radiu": 7, "mem_ball_self": 7, "mem_closedball_self": 7, "isopen": 7, "isopen_iff": 7, "Their": [7, 8], "isclos": [7, 8], "s\u1d9c": 7, "isopen_compl_iff": 7, "hu": [7, 8], "mem_of_tendsto": 7, "mem_closure_iff": 7, "mem_closure_iff_seq_limit": 7, "nhds_basis_bal": 7, "nhds_basis_closedbal": 7, "mem_iff": 7, "segment": 7, "somewher": 7, "continuouson": [7, 8], "minimum": 7, "iscompact": 7, "icc": [7, 8], "iscompact_icc": 7, "\u03c6": 7, "strictmono": 7, "tendsto_subseq": 7, "exists_forall_l": 7, "exists_forall_g": 7, "compactspac": 7, "iscompact_univ": 7, "cauchi": 7, "uniformcontinu": 7, "uniformcontinuous_iff": 7, "clearli": 7, "isclosed_l": 7, "eq_empty_or_nonempti": 7, "attain": 7, "closer": 7, "cauchyseq": 7, "cauchyseq_iff": 7, "completespac": [7, 8], "cauchyseq_tendsto_of_complet": 7, "criterion": 7, "explan": 7, "tendsto_pow_attop_nhds_0_of_lt_1": 7, "dist_le_range_sum_dist": 7, "cauchyseq_of_le_geometric_two": 7, "\u03b5_po": [7, 8], "le_iff_exists_add": 7, "boss": 7, "bair": [7, 8], "exclam": 7, "induct": [7, 11], "rec_on": 7, "ho": 7, "hd": 7, "dens": 7, "densiti": 7, "\u03b4po": 7, "hpo": 7, "hball": 7, "mem_closure_iff_nhds_basi": 7, "recon": 7, "rpo": 7, "rb": 7, "incl": 7, "cdist": 7, "ylim": 7, "yball": 7, "categor": 7, "ignor": 7, "topologicalspac": [7, 8], "isopen_univ": 7, "isopen_empti": 7, "isopen_iunion": 7, "fintyp": 7, "isopen_iint": 7, "continuous_def": 7, "attach": 7, "filteri": 7, "sent": 7, "mem_nhds_iff": 7, "digress": 7, "pure_le_nhd": 7, "eventually_eventually_nhd": 7, "topological_spac": 7, "mk_of_nhd": 7, "nhds_mk_of_nhd": 7, "clean": 7, "fonctori": 7, "induc": 7, "sensibl": 7, "uncount": 7, "relatedli": 7, "coinduc": 7, "t_x": 7, "t_y": 7, "coinduced_le_iff_le_induc": 7, "covari": 7, "coinduced_compos": 7, "induced_compos": 7, "topological_structur": 7, "focus": 7, "nhd": 7, "recov": 7, "foward": 7, "continuous_iff_coinduced_l": 7, "g_": 7, "t_z": 7, "wasn": 7, "\u03c0": [7, 8], "papar": 7, "t_": 7, "x_i": 7, "pi": 7, "functori": 7, "price": 7, "patholog": 7, "t2_space": 7, "hausdorff": 7, "t2space": 7, "tendsto_nhds_uniqu": 7, "regularspac": 7, "closed_nhds_basi": 7, "nhds_basis_open": 7, "denseinduc": 7, "continuousat_extend": 7, "funni": 7, "_in": 7, "nhds_induc": 7, "is_open": 7, "fortiori": 7, "f_cont": 7, "tendsto_right_iff": 7, "firstcountabletopologi": 7, "cluster": 7, "clusterpt": 7, "nebot": 7, "hfx": 7, "push_pul": 7, "of_map": 7, "f_ne": 7, "f_le": 7, "map_eq": 7, "hne": 7, "hle": 7, "huo": 7, "hsu": 7, "elim_finite_subcov": 7, "9": 8, "introductori": 8, "sin": 8, "hasderivat": 8, "hasderivat_sin": 8, "differentiable_at": 8, "differentiableat": 8, "inconveni": 8, "deriv_zero_of_not_differentiableat": 8, "deriv_add": 8, "islocalmin": 8, "deriv_eq_zero": 8, "ev": 8, "roll": 8, "weirder": 8, "hab": 8, "hfc": 8, "hfi": 8, "exists_deriv_eq_zero": 8, "differentiableon": 8, "exists_deriv_eq_slop": 8, "normedaddcommgroup": 8, "norm_add_l": 8, "infer_inst": 8, "normed_spac": 8, "normed_add_group": 8, "stipul": 8, "normedspac": 8, "norm_smul": 8, "banach": 8, "dimension": 8, "finitedimension": 8, "\ud835\udd5c": 8, "nontriviallynormedfield": 8, "normedfield": 8, "exists_one_lt_norm": 8, "nondiscret": 8, "continuouslinearmap": 8, "cont": 8, "map_smul": 8, "le_op_norm": 8, "hmp": 8, "op_norm_le_bound": 8, "steinhau": 8, "bounded": 8, "uniformli": 8, "nonempty_interior_of_union_of_clos": 8, "continuous_linear_map": 8, "op_norm_le_of_shel": 8, "interior_subset": 8, "interior_inter_subset": 8, "is_closed_l": 8, "hc": 8, "h\u03b5": 8, "real_norm_l": 8, "\u03b5k_po": 8, "o": 8, "normedgroup": 8, "isbigowith": 8, "isbigowith_iff": 8, "isbigo_iff_isbigowith": 8, "islittleo_iff_forall_isbigowith": 8, "has_fderiv_at": 8, "fderiv": 8, "fr\u00e9chet": 8, "hasfderivat": 8, "hff": 8, "iter": 8, "multilinear": 8, "with_top": 8, "infti": 8, "cont_diff": 8, "iteratedfderiv": 8, "withtop": 8, "contdiff": 8, "contdiff_iff_continuous_differenti": 8, "stricter": 8, "has_strict_fderiv_at": 8, "\ud835\udd42": 8, "isrorc": 8, "contdiffat": 8, "hasstrictfderivat": 8, "localinvers": 8, "eventually_left_invers": 8, "eventually_right_invers": 8, "to_localinvers": 8, "hasfderivwithinat": 8, "hasfderivatfilt": 8, "overview": 11, "converg": 11, "schr\u00f6der": 11, "bernstein": 11, "irrat": 11, "differenti": 11}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"introduct": 0, "get": 0, "start": 0, "overview": 0, "basic": [1, 6], "calcul": 1, "prove": 1, "ident": 1, "algebra": [1, 5], "structur": [1, 5], "us": 1, "theorem": [1, 3], "lemma": 1, "more": 1, "order": 1, "divis": 1, "fact": 1, "about": 1, "logic": 2, "implic": 2, "univers": 2, "quantifi": 2, "The": [2, 3], "existenti": 2, "negat": 2, "conjunct": 2, "bi": 2, "disjunct": 2, "sequenc": 2, "converg": [2, 7], "set": [3, 7], "function": [3, 7], "schr\u00f6der": 3, "bernstein": 3, "number": 4, "theori": [4, 9], "irrat": 4, "root": 4, "induct": 4, "recurs": 4, "infinit": 4, "mani": 4, "prime": 4, "defin": 5, "build": 5, "gaussian": 5, "integ": 5, "hierarchi": 6, "morphism": 6, "sub": 6, "object": 6, "topologi": 7, "filter": 7, "metric": 7, "space": [7, 8], "continu": [7, 8], "ball": 7, "open": 7, "close": 7, "compact": 7, "uniformli": 7, "complet": 7, "topolog": 7, "fundament": 7, "separ": 7, "countabl": 7, "differenti": 8, "calculu": 8, "elementari": 8, "norm": 8, "linear": 8, "map": 8, "asymptot": 8, "comparison": 8, "integr": 9, "measur": 9, "index": 10, "mathemat": 11, "lean": 11}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"Integration and Measure Theory": [[9, "index-0"]], "Index": [[10, "index"]], "Mathematics in Lean": [[11, "mathematics-in-lean"]], "Introduction": [[0, "introduction"]], "Getting Started": [[0, "getting-started"]], "Overview": [[0, "overview"]], "Basics": [[1, "basics"], [6, "basics"]], "Calculating": [[1, "calculating"]], "Proving Identities in Algebraic Structures": [[1, "proving-identities-in-algebraic-structures"]], "Using Theorems and Lemmas": [[1, "using-theorems-and-lemmas"]], "More on Order and Divisibility": [[1, "more-on-order-and-divisibility"]], "Proving Facts about Algebraic Structures": [[1, "proving-facts-about-algebraic-structures"]], "Logic": [[2, "logic"]], "Implication and the Universal Quantifier": [[2, "implication-and-the-universal-quantifier"]], "The Existential Quantifier": [[2, "the-existential-quantifier"]], "Negation": [[2, "negation"]], "Conjunction and Bi-implication": [[2, "conjunction-and-bi-implication"]], "Disjunction": [[2, "disjunction"]], "Sequences and Convergence": [[2, "sequences-and-convergence"]], "Sets and Functions": [[3, "sets-and-functions"]], "Sets": [[3, "sets"]], "Functions": [[3, "functions"]], "The Schr\u00f6der-Bernstein Theorem": [[3, "the-schroder-bernstein-theorem"]], "Number Theory": [[4, "number-theory"]], "Irrational Roots": [[4, "irrational-roots"]], "Induction and Recursion": [[4, "induction-and-recursion"], [4, "id2"]], "Infinitely Many Primes": [[4, "infinitely-many-primes"]], "Structures": [[5, "structures"]], "Defining structures": [[5, "defining-structures"]], "Algebraic Structures": [[5, "algebraic-structures"]], "Building the Gaussian Integers": [[5, "building-the-gaussian-integers"]], "Hierarchies": [[6, "hierarchies"]], "Morphisms": [[6, "morphisms"]], "Sub-objects": [[6, "sub-objects"]], "Topology": [[7, "index-0"]], "Filters": [[7, "filters"]], "Metric spaces": [[7, "metric-spaces"]], "Convergence and continuity": [[7, "convergence-and-continuity"]], "Balls, open sets and closed sets": [[7, "balls-open-sets-and-closed-sets"]], "Compactness": [[7, "compactness"], [7, "id5"]], "Uniformly continuous functions": [[7, "uniformly-continuous-functions"]], "Completeness": [[7, "completeness"]], "Topological spaces": [[7, "topological-spaces"]], "Fundamentals": [[7, "fundamentals"]], "Separation and countability": [[7, "separation-and-countability"]], "Differential Calculus": [[8, "index-0"]], "Elementary Differential Calculus": [[8, "elementary-differential-calculus"]], "Differential Calculus in Normed Spaces": [[8, "differential-calculus-in-normed-spaces"]], "Normed spaces": [[8, "id3"]], "Continuous linear maps": [[8, "continuous-linear-maps"]], "Asymptotic comparisons": [[8, "asymptotic-comparisons"]], "Differentiability": [[8, "differentiability"]]}, "indexentries": {"check": [[0, "index-0"]], "commands": [[0, "index-0"]], "abel": [[1, "index-14"]], "absolute value": [[1, "index-23"]], "apply": [[1, "index-16"]], "calc": [[1, "index-3"]], "command": [[1, "index-9"]], "commutative ring": [[1, "index-8"]], "definitional equality": [[1, "index-12"]], "divisibility": [[1, "index-24"]], "exact": [[1, "index-5"]], "exponential": [[1, "index-18"]], "gcd": [[1, "index-25"]], "goal": [[1, "index-2"]], "group": [[1, "index-14"]], "group (algebraic structure)": [[1, "index-13"]], "group (tactic)": [[1, "index-14"]], "have": [[1, "index-11"], [2, "index-12"]], "implicit argument": [[1, "index-10"]], "inequalities": [[1, "index-15"]], "lattice": [[1, "index-27"]], "lcm": [[1, "index-25"]], "linarith": [[1, "index-17"]], "local context": [[1, "index-2"]], "logarithm": [[1, "index-18"]], "max": [[1, "index-20"]], "metric space": [[1, "index-28"], [7, "index-2"]], "min": [[1, "index-20"]], "namespace": [[1, "index-9"]], "noncomm_ring": [[1, "index-14"]], "norm_num": [[1, "index-19"]], "open": [[1, "index-9"]], "order relation": [[1, "index-26"]], "partial order": [[1, "index-26"]], "proof state": [[1, "index-2"]], "real numbers": [[1, "index-1"]], "refl and reflexivity": [[1, "index-12"]], "reflexivity": [[1, "index-12"]], "repeat": [[1, "index-22"]], "rewrite": [[1, "index-0"]], "rfl": [[1, "index-12"]], "ring": [[1, "index-6"]], "ring (algebraic structure)": [[1, "index-7"]], "ring (tactic)": [[1, "index-6"]], "rw": [[1, "index-0"], [1, "index-4"]], "rw and rewrite": [[1, "index-0"], [1, "index-4"]], "show": [[1, "index-21"]], "tactics": [[1, "index-0"], [1, "index-11"], [1, "index-12"], [1, "index-14"], [1, "index-16"], [1, "index-17"], [1, "index-19"], [1, "index-21"], [1, "index-22"], [1, "index-3"], [1, "index-4"], [1, "index-5"], [1, "index-6"], [2, "index-0"], [2, "index-12"], [2, "index-13"], [2, "index-14"], [2, "index-15"], [2, "index-16"], [2, "index-17"], [2, "index-18"], [2, "index-19"], [2, "index-2"], [2, "index-20"], [2, "index-21"], [2, "index-23"], [2, "index-24"], [2, "index-25"], [2, "index-26"], [2, "index-4"], [2, "index-6"], [2, "index-8"], [2, "index-9"], [3, "index-1"], [3, "index-2"], [7, "index-3"]], "absurd": [[2, "index-17"]], "anonymous constructor": [[2, "index-7"]], "assumption": [[2, "index-19"]], "by_cases": [[2, "index-23"]], "by_contra": [[2, "index-14"]], "by_contra and by_contradiction": [[2, "index-14"]], "cases": [[2, "index-8"]], "change": [[2, "index-2"]], "congr": [[2, "index-25"]], "constructor": [[2, "index-18"]], "contradiction": [[2, "index-17"]], "contrapose": [[2, "index-16"]], "convert": [[2, "index-26"]], "dsimp": [[2, "index-2"]], "erw": [[2, "index-4"]], "excluded middle": [[2, "index-22"]], "exfalso": [[2, "index-17"]], "ext": [[2, "index-24"]], "extensionality": [[2, "index-24"]], "field_simp": [[2, "index-11"]], "from": [[2, "index-12"]], "injective function": [[2, "index-5"]], "intro": [[2, "index-0"]], "lambda abstraction": [[2, "index-1"]], "left": [[2, "index-21"]], "let": [[2, "index-13"]], "monotone function": [[2, "index-3"]], "push_neg": [[2, "index-15"]], "rcases": [[2, "index-9"]], "right": [[2, "index-21"]], "rintro": [[2, "index-9"]], "simp": [[2, "index-20"], [3, "index-1"]], "surjective function": [[2, "index-10"]], "tactic": [[2, "index-11"]], "this": [[2, "index-12"]], "use": [[2, "index-6"]], "bounded quantifiers": [[3, "index-3"]], "rwa": [[3, "index-2"]], "set operations": [[3, "index-0"]], "filter": [[7, "index-1"]], "continuity": [[7, "index-3"]], "topological space": [[7, "index-4"]], "topology": [[7, "index-0"]], "differential calculus": [[8, "index-0"]], "elementary calculus": [[8, "index-1"]], "normed space": [[8, "index-2"]]}}) Search.setIndex({"docnames": ["C01_Introduction", "C02_Basics", "C03_Logic", "C04_Sets_and_Functions", "C05_Number_Theory", "C06_Structures", "C07_Hierarchies", "C08_Topology", "C09_Differential_Calculus", "C10_Integration_and_Measure_Theory", "genindex", "index"], "filenames": ["C01_Introduction.rst", "C02_Basics.rst", "C03_Logic.rst", "C04_Sets_and_Functions.rst", "C05_Number_Theory.rst", "C06_Structures.rst", "C07_Hierarchies.rst", "C08_Topology.rst", "C09_Differential_Calculus.rst", "C10_Integration_and_Measure_Theory.rst", "genindex.rst", "index.rst"], "titles": ["<span class=\"section-number\">1. </span>Introduction", "<span class=\"section-number\">2. </span>Basics", "<span class=\"section-number\">3. </span>Logic", "<span class=\"section-number\">4. </span>Sets and Functions", "<span class=\"section-number\">5. </span>Number Theory", "<span class=\"section-number\">6. </span>Structures", "<span class=\"section-number\">7. </span>Hierarchies", "<span class=\"section-number\">8. </span>Topology", "<span class=\"section-number\">9. </span>Differential Calculus", "Integration and Measure Theory", "Index", "Mathematics in Lean"], "terms": {"The": [0, 1, 4, 5, 6, 7, 8, 11], "goal": [0, 1, 2, 3, 4, 5, 7], "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8], "book": [0, 7], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8], "teach": 0, "you": [0, 1, 2, 3, 4, 5, 6, 7, 8], "formal": [0, 1, 2, 3, 4, 5, 6, 7, 8], "mathemat": [0, 1, 2, 3, 4, 5, 6, 7], "us": [0, 2, 3, 4, 5, 6, 7, 8, 11], "lean": [0, 1, 2, 3, 4, 5, 6, 7, 8], "4": [0, 1, 2, 4, 5, 7, 8], "interact": [0, 5, 6], "proof": [0, 1, 2, 3, 4, 5, 6, 7, 8], "assist": [0, 5], "It": [0, 1, 2, 3, 4, 5, 6, 7, 8], "assum": [0, 1, 2, 3, 4, 6, 7], "know": [0, 1, 2, 3, 4, 5, 6, 7, 8], "some": [0, 1, 2, 3, 4, 5, 6, 7, 8], "doe": [0, 1, 2, 3, 4, 5, 6, 7, 8], "requir": [0, 1, 2, 3, 4, 5, 6, 7, 8], "much": [0, 2, 4, 6, 7, 8], "although": [0, 3, 4, 5, 6, 7], "we": [0, 1, 2, 3, 4, 5, 6, 7, 8], "cover": [0, 1, 3, 6, 7, 8], "exampl": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rang": [0, 2, 3, 4, 7], "from": [0, 1, 2, 3, 4, 5, 6, 7, 8], "number": [0, 1, 2, 3, 5, 6, 7, 8, 11], "theori": [0, 1, 2, 3, 6, 7, 8, 11], "measur": [0, 5, 7, 8], "analysi": [0, 5, 8], "focu": [0, 1, 7], "elementari": [0, 3, 4, 5, 7, 11], "aspect": [0, 5], "those": [0, 1, 2, 3, 5, 6, 7, 8], "field": [0, 1, 5, 6, 8], "hope": 0, "thei": [0, 1, 2, 3, 4, 5, 6, 7, 8], "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8], "familiar": [0, 1, 4, 5, 7, 8], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8], "pick": [0, 6], "them": [0, 1, 2, 3, 4, 5, 6, 7], "up": [0, 2, 3, 4, 5, 6, 7], "go": [0, 1, 2, 3, 4, 6, 7], "also": [0, 1, 2, 3, 4, 5, 6, 7, 8], "don": [0, 1, 2, 3, 4, 5, 6, 7], "t": [0, 1, 2, 3, 4, 5, 6, 7], "presuppos": 0, "ani": [0, 1, 2, 3, 4, 5, 6, 7, 8], "background": 0, "seen": [0, 1, 2, 4, 5, 6, 7], "kind": [0, 1, 6, 7], "comput": [0, 3, 4, 5, 8], "program": [0, 1], "write": [0, 1, 2, 3, 4, 5, 6, 7, 8], "definit": [0, 1, 2, 3, 4, 5, 6, 7, 8], "theorem": [0, 2, 4, 5, 7, 8, 11], "regiment": 0, "languag": [0, 1, 3], "like": [0, 1, 2, 3, 4, 5, 6, 7], "understand": [0, 2, 3, 4, 5, 6, 7], "In": [0, 1, 2, 3, 4, 5, 6, 7, 8], "return": [0, 2, 3, 4, 5, 7], "provid": [0, 1, 2, 3, 4, 5, 6, 7, 8], "feedback": 0, "inform": [0, 1, 2, 3, 5, 6, 7], "interpret": [0, 1, 4, 5, 7], "express": [0, 1, 2, 3, 4, 5, 6, 7, 8], "guarante": [0, 3, 5], "well": [0, 1, 2, 3, 4, 5, 6, 7], "form": [0, 1, 2, 3, 4, 5, 6, 7], "ultim": 0, "certifi": 0, "correct": [0, 1], "our": [0, 1, 2, 3, 4, 5, 6, 7], "learn": [0, 1, 2, 4, 5], "more": [0, 2, 3, 4, 5, 6, 7, 8, 11], "about": [0, 2, 3, 4, 5, 6, 7, 8, 11], "project": [0, 4, 5, 7], "page": [0, 1, 4], "commun": [0, 4], "web": [0, 1, 4], "tutori": 0, "base": [0, 3, 4, 6, 7, 8], "": [0, 1, 2, 3, 4, 5, 6, 7, 8], "larg": [0, 6, 7], "ever": [0, 7], "grow": [0, 6], "librari": [0, 1, 2, 3, 4, 5, 7, 8], "mathlib": [0, 1, 2, 3, 4, 5, 6, 7, 8], "strongli": 0, "recommend": [0, 1, 3], "take": [0, 1, 2, 3, 4, 5, 6, 7, 8], "look": [0, 1, 2, 3, 4, 6, 7], "zulip": [0, 4], "onlin": 0, "chat": 0, "group": [0, 1, 2, 3, 5, 6, 7, 8], "haven": [0, 2, 6, 7], "alreadi": [0, 1, 2, 3, 4, 5, 6, 7], "ll": [0, 1, 2, 4, 6, 7], "find": [0, 1, 2, 4, 5, 6, 7], "live": [0, 5], "welcom": [0, 1], "enthusiast": 0, "happi": 0, "answer": [0, 5, 7], "question": [0, 4, 6, 7], "offer": [0, 2, 5, 7], "moral": [0, 5], "support": [0, 1, 2, 3, 4, 5, 6, 7], "read": [0, 1, 4, 6, 7], "pdf": 0, "html": 0, "version": [0, 1, 2, 3, 4, 5, 6, 7, 8], "design": [0, 1, 2, 3, 5, 7], "run": 0, "insid": [0, 1, 2, 3], "v": [0, 1, 2, 3, 5, 7], "code": [0, 1, 2, 3, 5, 6], "editor": [0, 1], "To": [0, 1, 2, 3, 4, 5, 6, 7], "instal": [0, 6], "follow": [0, 1, 2, 3, 4, 5, 6, 7, 8], "instruct": [0, 1, 7], "http": [0, 6], "github": [0, 1], "com": 0, "leanprov": 0, "lean4": 0, "blob": 0, "master": [0, 1, 4], "doc": 0, "quickstart": 0, "md": 0, "_": [0, 1, 2, 3, 4, 5, 6, 7, 8], "termin": 0, "navig": 0, "folder": 0, "where": [0, 1, 2, 3, 4, 5, 6, 7, 8], "want": [0, 1, 2, 3, 4, 5, 6, 7, 8], "put": [0, 1, 2, 3, 4, 5, 6, 7], "copi": [0, 3, 4, 6, 7], "repositori": [0, 1], "type": [0, 1, 2, 3, 4, 5, 6, 7, 8], "git": 0, "clone": 0, "mathematics_in_lean": 0, "fetch": 0, "execut": 0, "lake": 0, "ex": [0, 2], "cach": 0, "compil": 0, "open": [0, 1, 2, 3, 4, 5, 8], "altern": [0, 2, 3, 4, 5, 6, 7], "choos": [0, 2, 3, 4, 5, 6, 7], "file": [0, 1, 4, 5, 6, 7], "menu": [0, 1], "Be": [0, 1, 3], "sure": [0, 1, 2, 3, 5, 6], "other": [0, 1, 2, 3, 4, 5, 6, 7], "simultan": 0, "window": [0, 1, 2, 5], "updat": 0, "newer": 0, "ty": 0, "pull": [0, 7], "cloud": 0, "gitpod": 0, "how": [0, 1, 2, 3, 4, 5, 6, 7], "do": [0, 1, 2, 3, 4, 5, 6, 7, 8], "each": [0, 1, 2, 3, 4, 5, 6, 7, 8], "section": [0, 1, 2, 3, 4, 5, 6, 7, 8], "ha": [0, 1, 2, 3, 4, 5, 6, 7, 8], "an": [0, 1, 2, 3, 4, 5, 6, 7, 8], "associ": [0, 1, 2, 4, 5, 6, 7], "exercis": [0, 1, 2, 3, 5, 6, 7, 8], "src": 0, "organ": 0, "chapter": [0, 1, 2, 3, 4, 5, 6, 7, 8], "make": [0, 1, 2, 3, 4, 5, 6, 7, 8], "so": [0, 1, 2, 3, 4, 5, 6, 7, 8], "experi": [0, 1, 7], "while": [0, 1, 2, 6, 7], "leav": [0, 1, 2, 3, 5, 6], "origin": [0, 1, 5], "intact": 0, "text": [0, 3, 5, 6, 7], "often": [0, 1, 2, 3, 4, 5, 6, 7], "includ": [0, 1, 2, 3, 4, 6, 7, 8], "one": [0, 1, 2, 3, 4, 5, 6, 7, 8], "eval": 0, "hello": 0, "world": 0, "should": [0, 1, 2, 3, 4, 5, 6, 7, 8], "abl": [0, 1, 2, 3, 4, 5, 6, 8], "correspond": [0, 1, 2, 3, 4, 5, 6, 7, 8], "If": [0, 1, 2, 3, 4, 5, 6, 7], "click": [0, 1, 3, 4, 5, 6], "line": [0, 1, 2, 3, 4, 6], "show": [0, 1, 2, 3, 4, 5, 6, 7, 8], "hover": [0, 1, 2, 3, 4, 5], "your": [0, 1, 2, 3, 5, 6, 7], "cursor": [0, 1, 2], "over": [0, 1, 2, 3, 4, 5, 6, 7, 8], "command": [0, 1, 2, 3, 4, 5, 6], "respons": [0, 1], "pop": 0, "encourag": [0, 1, 2, 3, 4, 5], "edit": 0, "try": [0, 1, 2, 3, 4, 5, 6, 7], "own": [0, 1, 4, 5, 6], "moreov": [0, 1, 4, 5, 7], "lot": [0, 3, 5, 6, 7], "challeng": [0, 1, 2, 3, 5, 8], "rush": 0, "past": [0, 1], "just": [0, 1, 2, 3, 4, 5, 6, 7], "work": [0, 1, 2, 3, 4, 5, 6, 7, 8], "through": [0, 1, 3, 4, 5, 6, 7], "central": [0, 4], "alwai": [0, 1, 2, 3, 5, 6], "compar": [0, 5, 6, 7], "solut": [0, 1, 4, 6], "ones": [0, 1, 2, 3, 5], "simpli": [0, 1, 2, 3, 4, 5, 6, 7], "tool": [0, 1, 2, 5, 6], "build": [0, 2, 4, 6, 7, 11], "complex": [0, 1, 2, 4, 5, 8], "known": [0, 1, 2, 3, 4, 5, 6, 7, 8], "depend": [0, 2, 3, 4, 5, 6, 7], "everi": [0, 1, 2, 3, 4, 5, 6, 7, 8], "check": [0, 1, 2, 3, 4, 5, 6, 7], "print": [0, 3, 4, 5], "have": [0, 1, 2, 3, 4, 5, 6, 7, 8], "\u2115": [0, 1, 2, 3, 4, 5, 6, 7, 8], "These": [0, 1, 2, 3, 4, 5, 8], "object": [0, 1, 2, 3, 4, 5, 11], "2": [0, 1, 2, 3, 4, 5, 6, 7, 8], "def": [0, 2, 3, 4, 5, 6, 7], "f": [0, 1, 2, 3, 4, 5, 6, 7, 8], "x": [0, 1, 2, 3, 4, 5, 6, 7, 8], "3": [0, 1, 2, 3, 4, 5, 6, 7], "prop": [0, 2, 3, 4, 5, 6, 7], "statement": [0, 1, 2, 3, 4, 5, 6, 7, 8], "fermatlasttheorem": 0, "y": [0, 1, 2, 3, 4, 5, 6, 7, 8], "z": [0, 1, 2, 5, 6, 7, 8], "n": [0, 1, 2, 3, 4, 5, 6, 7, 8], "0": [0, 1, 2, 3, 4, 5, 6, 7, 8], "p": [0, 1, 2, 3, 4, 5, 6, 7], "itself": [0, 3, 5, 6, 7, 8], "Such": [0, 1, 2, 6], "proposit": [0, 2, 3, 4, 5], "easi": [0, 4, 5, 6, 7], "rfl": [0, 1, 2, 3, 4, 5, 6, 7, 8], "hard": [0, 1, 3, 5, 6], "sorri": [0, 1, 2, 3, 4, 5, 6, 7, 8], "manag": [0, 1, 4, 5, 7], "construct": [0, 2, 3, 4, 5, 6, 7], "fermat_last_theorem": 0, "accept": [0, 1, 7], "term": [0, 1, 2, 3, 4, 5, 7], "done": [0, 2, 3, 4, 6, 7], "someth": [0, 1, 2, 4, 6, 7], "veri": [0, 2, 4, 6, 7], "impress": 0, "cheat": [0, 1], "now": [0, 1, 2, 3, 4, 5, 6, 7, 8], "game": [0, 6], "all": [0, 1, 2, 3, 4, 5, 6, 7, 8], "left": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rule": [0, 2, 4, 5, 6, 7], "complementari": 0, "companion": [0, 1], "prove": [0, 2, 3, 4, 5, 6, 7, 8, 11], "which": [0, 1, 2, 3, 4, 5, 6, 7, 8], "thorough": 0, "underli": [0, 1, 5, 6], "logic": [0, 1, 3, 4, 5, 11], "framework": 0, "core": [0, 4, 5], "syntax": [0, 1, 3, 4, 6], "peopl": [0, 1], "who": [0, 7], "prefer": [0, 1, 3], "user": [0, 2, 6], "manual": [0, 3, 4], "befor": [0, 1, 2, 3, 4, 5, 6], "new": [0, 1, 2, 3, 4, 5, 6, 7], "dishwash": 0, "person": 0, "hit": [0, 1], "button": 0, "figur": [0, 1, 2, 5], "out": [0, 1, 2, 3, 4, 5, 6, 7], "activ": 0, "potscrubb": 0, "featur": [0, 2, 4], "later": [0, 1, 2, 4, 5, 6, 7], "sens": [0, 2, 3, 4, 5, 6, 7, 8], "here": [0, 1, 2, 3, 4, 5, 6, 7, 8], "refer": [0, 1, 2, 4, 5, 6, 7, 8], "back": [0, 1, 2, 3, 5, 6, 7], "necessari": [0, 2, 4, 5], "anoth": [0, 1, 2, 3, 4, 5, 6, 7], "thing": [0, 1, 2, 3, 4, 5, 6, 7], "distinguish": [0, 5, 6, 7, 8], "place": [0, 1, 2, 5, 7], "greater": [0, 1, 2, 3, 4, 7], "emphasi": [0, 6], "tactic": [0, 1, 2, 3, 4, 5, 6, 7, 8], "given": [0, 1, 2, 3, 4, 5, 6, 7], "two": [0, 1, 2, 3, 4, 5, 6, 7], "wai": [0, 1, 2, 3, 4, 5, 6, 7], "down": [0, 3, 4, 6, 7], "themselv": [0, 4, 5], "suitabl": [0, 1, 2, 5, 7], "descript": [0, 1, 2, 4, 7], "thereof": 0, "For": [0, 1, 2, 3, 4, 5, 6, 7, 8], "repres": [0, 1, 2, 3, 4, 5, 6, 8], "fact": [0, 2, 3, 4, 5, 6, 7, 8, 11], "even": [0, 1, 2, 3, 4, 5, 6, 7, 8], "m": [0, 1, 2, 4, 6, 7, 8], "nat": [0, 1, 2, 3, 4, 5, 7], "fun": [0, 2, 3, 4, 5, 6, 7, 8], "k": [0, 2, 4, 5, 7, 8], "hk": [0, 8], "hmn": 0, "rw": [0, 1, 2, 3, 4, 5, 6, 7], "mul_add": [0, 1, 4, 6], "l": [0, 1, 8], "compress": [0, 1, 7], "singl": [0, 1, 2, 3, 4, 5, 6, 8], "instead": [0, 1, 2, 3, 4, 5, 6, 7], "style": [0, 1], "same": [0, 1, 2, 3, 4, 5, 6, 7], "sai": [0, 1, 2, 3, 4, 5, 6, 7], "natur": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rintro": [0, 2, 3, 4, 5, 7], "need": [0, 1, 2, 3, 4, 5, 6, 7], "twice": [0, 7], "let": [0, 1, 2, 3, 4, 5, 6, 7, 8], "substitut": [0, 2], "obviou": [0, 4, 5, 6], "ring": [0, 1, 2, 3, 4, 5, 6], "As": [0, 1, 2, 3, 4, 5, 6, 7, 8], "enter": [0, 1, 2, 3, 7], "displai": [0, 2, 6], "state": [0, 1, 2, 3, 4, 6, 7, 8], "separ": [0, 1, 2, 4, 5], "tell": [0, 2, 3, 4, 5, 6], "what": [0, 1, 2, 3, 4, 5, 6, 7], "establish": [0, 1, 2, 3, 4, 5], "task": [0, 2, 4, 5, 6, 7], "remain": [0, 1, 2, 3, 5, 6, 7], "replai": 0, "step": [0, 1, 2, 3, 4, 5, 6], "sinc": [0, 1, 2, 3, 4, 5, 6, 7], "continu": [0, 1, 4, 5, 6], "point": [0, 1, 2, 3, 5, 6, 7, 8], "see": [0, 1, 2, 3, 4, 5, 6, 7, 8], "first": [0, 1, 2, 3, 4, 5, 6, 7, 8], "introduc": [0, 1, 2, 3, 4, 7], "could": [0, 1, 2, 4, 5, 6, 7], "renam": 0, "decompos": [0, 3, 5], "hypothesi": [0, 1, 2, 3, 4], "assumpt": [0, 1, 2, 3, 4, 5, 7, 8], "second": [0, 1, 2, 3, 4, 5, 6, 7], "declar": [0, 1, 4, 5, 6], "next": [0, 1, 2, 3, 4, 5, 6, 7, 8], "rewrit": [0, 1, 2, 3, 4, 5, 6, 7], "replac": [0, 1, 2, 3, 4, 6], "solv": [0, 1, 2, 3, 4, 5, 6, 7], "result": [0, 1, 2, 3, 4, 5, 6, 7], "abil": 0, "small": [0, 4, 5, 7], "increment": [0, 1], "extrem": [0, 6, 7], "power": [0, 2, 3, 4, 5, 6], "reason": [0, 1, 2, 4, 5, 6, 7], "easier": [0, 1, 3, 4, 6, 7], "quicker": 0, "than": [0, 1, 2, 3, 4, 5, 6, 7, 8], "There": [0, 1, 2, 3, 4, 6, 7, 8], "isn": [0, 2, 3, 4, 6], "sharp": 0, "distinct": [0, 2, 3, 4, 5, 7], "between": [0, 1, 2, 3, 4, 5, 6, 7, 8], "insert": [0, 2, 4, 5, 7, 8], "did": [0, 2, 6, 7], "phrase": [0, 1, 2, 4, 5], "mul_left_comm": [0, 4], "abov": [0, 1, 2, 3, 4, 5, 6, 7], "convers": [0, 2, 4, 7], "short": [0, 1, 2, 3, 4, 5], "middl": [0, 1, 2, 7], "That": [0, 4, 5, 6], "said": [0, 2, 4, 5], "reduc": [0, 2, 3, 4, 5], "liner": 0, "carri": [0, 1, 2, 3, 4, 5, 6, 7], "But": [0, 1, 2, 3, 4, 5, 6, 7], "substanti": 0, "autom": [0, 1, 5], "justifi": [0, 1, 2, 7], "longer": [0, 4, 5], "calcul": [0, 2, 4, 5, 11], "bigger": [0, 3, 8], "inferenti": 0, "invok": [0, 1, 7], "simplifi": [0, 2, 3, 4, 5, 7], "specif": [0, 1, 3, 4, 5, 6], "pariti": [0, 4], "automat": [0, 1, 2, 3, 4, 5, 6, 7, 8], "intro": [0, 1, 2, 3, 4, 5, 6, 7], "simp": [0, 2, 3, 4, 5, 6, 7, 8], "parity_simp": 0, "big": [0, 5, 7, 8], "differ": [0, 1, 2, 3, 4, 5, 6, 7, 8], "onli": [0, 1, 2, 3, 4, 5, 6, 7, 8], "its": [0, 1, 2, 3, 4, 5, 6, 7, 8], "built": [0, 2, 6], "wherea": [0, 1, 3, 5, 7], "top": [0, 6, 7, 8], "meant": [0, 2, 6], "contain": [0, 2, 3, 4, 5, 6, 7, 8], "extens": [0, 1, 6, 7, 8], "document": [0, 1, 3, 4, 6], "rather": [0, 1, 2, 4, 5, 6, 7], "think": [0, 1, 2, 3, 4, 5, 6, 7, 8], "comfort": [0, 2], "brows": [0, 1, 4], "frustrat": [0, 6], "curv": 0, "steep": 0, "newcom": 0, "avail": [0, 1, 4, 5, 6], "round": [0, 1, 5], "clock": 0, "doubt": 0, "soon": [0, 2, 6, 7], "enough": [0, 1, 2, 3, 4, 6, 7], "too": [0, 1, 3, 5, 6, 7], "contribut": [0, 3], "develop": [0, 1, 4], "mission": 0, "dive": 0, "come": [0, 1, 2, 3, 4, 5, 6, 7], "forewarn": 0, "fundament": [0, 4, 5, 6], "life": [0, 2], "mai": [0, 1, 2, 3, 5, 6, 7, 8], "never": [0, 6], "acknowledg": 0, "grate": [0, 5], "gabriel": 0, "ebner": 0, "set": [0, 1, 2, 4, 5, 6, 8, 11], "infrastructur": 0, "scott": 0, "morrison": 0, "mario": 0, "carneiro": 0, "help": [0, 1, 2, 3, 4, 5, 6, 7], "port": 0, "bryan": 0, "gin": 0, "ge": [0, 2, 5], "chen": 0, "johan": 0, "commelin": 0, "mathieu": 0, "guai": 0, "paquet": 0, "julian": 0, "k\u00fclshammer": 0, "giovanni": 0, "mascellani": 0, "hunter": 0, "monro": 0, "pietro": 0, "monticon": 0, "bartosz": 0, "piotrowski": 0, "guilherm": 0, "silva": 0, "been": [0, 1, 2, 4, 5, 6, 8], "partial": [0, 1, 2, 3, 5, 6], "hoskinson": 0, "center": [0, 7], "nut": 1, "bolt": 1, "appli": [1, 2, 3, 4, 5, 6, 7, 8], "gener": [1, 2, 3, 4, 5, 6, 7, 8], "without": [1, 2, 4, 5, 6, 7, 8], "when": [1, 2, 3, 4, 5, 6, 7, 8], "u": [1, 2, 3, 4, 5, 6, 7, 8], "net": 1, "hand": [1, 2, 3, 4, 5, 6, 7], "side": [1, 2, 3, 4, 5, 6, 7, 8], "equal": [1, 2, 3, 4, 5, 6, 7], "right": [1, 2, 3, 4, 5, 6, 7, 8], "tantamount": [1, 3], "name": [1, 2, 3, 4, 5, 6, 7, 8], "b": [1, 2, 3, 4, 5, 6, 7, 8], "c": [1, 2, 4, 5, 6, 7, 8], "real": [1, 2, 3, 4, 5, 6, 7, 8], "mul_assoc": [1, 2, 4, 5, 6], "mul_comm": [1, 2, 4, 5, 6], "elimin": 1, "explicitli": [1, 2, 3, 5, 6, 7, 8], "purpos": [1, 2, 3, 4, 5, 6, 7], "illustr": [1, 2, 3, 4, 5], "multipl": [1, 2, 3, 4, 5, 6, 8], "written": [1, 2, 3, 4, 5, 6, 7, 8], "howev": [1, 2, 5, 6, 7, 8], "good": [1, 2, 3, 4, 5, 6, 7], "mind": [1, 2, 5, 6], "notat": [1, 2, 3, 4, 5, 6, 7, 8], "convent": [1, 5], "parenthes": [1, 2, 3, 4], "\u211d": [1, 2, 3, 5, 6, 7, 8], "import": [1, 2, 3, 4, 5, 6, 7], "begin": [1, 2, 3, 4, 5, 6], "sake": [1, 4], "breviti": [1, 5], "suppress": 1, "repeat": [1, 4, 5, 6], "chang": [1, 2, 4, 5, 7], "happen": [1, 6, 7], "charact": [1, 3, 6], "r": [1, 2, 4, 5, 6, 7], "symbol": [1, 2, 5, 6], "doesn": [1, 2, 7], "appear": [1, 2, 5, 6, 7], "until": [1, 2, 4, 5, 6, 7], "space": [1, 3, 5, 6, 11], "tab": [1, 2, 3, 4], "kei": [1, 4, 5, 7], "curiou": [1, 6], "abrevi": 1, "ctrl": [1, 4, 5], "shift": [1, 6, 7], "abbrevi": [1, 2, 3, 5], "get": [1, 2, 3, 4, 6, 7, 8, 11], "access": [1, 3, 5, 6, 7], "keyboard": 1, "easili": [1, 4, 5, 6], "backslash": [1, 3], "lead": [1, 2, 4, 5, 6, 7], "input": [1, 3, 7], "leader": 1, "report": 1, "current": [1, 2, 6], "infoview": 1, "move": [1, 2, 6, 7], "A": [1, 2, 3, 4, 5, 6, 7, 8], "typic": 1, "might": [1, 2, 3, 4, 5], "1": [1, 2, 3, 4, 5, 6, 7, 8], "h\u2081": [1, 2, 3, 4], "prime": [1, 2, 3, 5, 6, 11], "h\u2082": [1, 3, 4], "h\u2083": [1, 3], "denot": [1, 3, 4, 6, 7], "context": [1, 2, 4, 5, 6, 7, 8], "plai": [1, 3, 4, 6, 7], "three": [1, 2, 4, 5, 7], "label": [1, 2], "everyth": [1, 2, 6, 7], "identifi": [1, 2, 4], "subscript": 1, "h": [1, 2, 3, 4, 5, 6, 7, 8], "legal": 1, "would": [1, 2, 3, 4, 5, 6, 7, 8], "h1": [1, 3, 4], "h2": [1, 3], "h3": 1, "foo": [1, 3, 5], "bar": [1, 2], "baz": 1, "last": [1, 2, 3, 4, 5, 6, 7], "sometim": [1, 2, 3, 4, 5, 6, 7], "target": [1, 6, 7], "combin": [1, 2, 5, 6, 7], "practic": [1, 2, 3, 6, 7], "intend": [1, 2, 5], "mean": [1, 2, 3, 4, 5, 6, 7, 8], "usual": [1, 2, 3, 4, 5, 7], "clear": [1, 2, 4, 5, 6], "case": [1, 2, 3, 4, 5, 6, 7], "With": [1, 3, 4, 6, 7], "arrow": [1, 2, 6, 7], "revers": [1, 2, 3, 5, 7], "note": [1, 2, 4, 5, 6, 7], "noth": [1, 2, 3, 4, 5, 6], "argument": [1, 2, 3, 4, 5, 6, 7], "tri": [1, 2, 4, 6], "match": [1, 2, 5], "pattern": [1, 2, 3, 5, 6], "local": [1, 2, 6, 7, 8], "d": [1, 2, 4, 5, 8], "e": [1, 2, 3, 4, 5, 6, 7, 8], "sub_self": [1, 2], "hyp": 1, "list": [1, 2, 3, 4, 5], "relev": [1, 2, 4, 5, 6, 7], "comma": 1, "squar": [1, 2, 4, 5, 6], "bracket": [1, 2, 5, 6], "still": [1, 2, 3, 4, 5, 6, 7], "progress": [1, 5], "after": [1, 2, 4, 6, 7, 8], "trick": [1, 2, 4, 6, 8], "variabl": [1, 2, 3, 4, 5, 6, 7, 8], "onc": [1, 2, 3, 4, 5, 6, 7], "outsid": [1, 4], "g": [1, 2, 3, 5, 6, 7, 8], "inspect": 1, "reveal": 1, "inde": [1, 5, 6, 7, 8], "delimit": 1, "scope": [1, 2, 3, 5], "end": [1, 2, 3, 4, 5, 6, 7, 8], "block": [1, 4], "final": [1, 2, 3, 5, 7], "recal": [1, 2, 4, 5, 7], "introduct": [1, 2, 7, 11], "determin": [1, 5, 7], "both": [1, 2, 3, 4, 5, 6, 7, 8], "expect": [1, 2, 3, 4, 5, 6, 7], "rais": [1, 4], "error": [1, 2, 3, 6], "explain": [1, 2, 3, 4, 5, 6, 7], "output": 1, "meanwhil": [1, 4], "two_mul": [1, 5], "add_mul": [1, 6], "distribut": [1, 4, 5, 6], "addit": [1, 2, 4, 5, 6, 7, 8], "add_assoc": [1, 4, 5, 6], "precis": [1, 3, 7, 8], "possibl": [1, 2, 3, 4, 5, 7], "calc": [1, 2, 3, 7], "keyword": [1, 2, 4, 5], "notic": [1, 2, 3, 4, 5, 7], "finicki": 1, "dot": [1, 7], "underscir": 1, "justif": [1, 2], "format": 1, "indic": [1, 2, 3, 5, 6], "indent": 1, "One": [1, 2, 3, 4, 5, 6, 7], "outlin": [1, 2, 4, 7], "modulo": [1, 4, 5], "individu": 1, "pure": [1, 7], "littl": [1, 2, 7, 8], "underneath": [1, 3], "pow_two": [1, 4, 5], "mul_sub": 1, "add_sub": 1, "sub_sub": 1, "add_zero": [1, 5, 6], "perform": [1, 2, 3], "exact": [1, 2, 3, 4, 5, 7], "becaus": [1, 2, 3, 4, 5, 6, 7, 8], "exactli": [1, 2, 3, 5, 6, 7], "close": [1, 2, 3, 6, 8], "bit": [1, 4, 6, 7], "commut": [1, 2, 3, 4, 5, 6, 8], "long": [1, 2, 3, 5, 6, 8], "axiom": [1, 3, 5, 6, 7], "indirectli": 1, "data": [1, 2, 4, 5, 6, 7], "similar": [1, 2, 3, 5, 6, 7], "common": [1, 2, 3, 4, 5, 7], "variat": [1, 3, 4, 5, 7, 8], "call": [1, 2, 3, 4, 5, 6, 7, 8], "nth_rewrit": 1, "allow": [1, 2, 3, 4, 5, 6, 7, 8], "particular": [1, 2, 5, 6, 7], "instanc": [1, 2, 3, 4, 5, 6, 7, 8], "enumer": [1, 2], "start": [1, 2, 3, 4, 6, 7, 8, 11], "zero": [1, 2, 3, 4, 5, 6, 7, 8], "occurr": 1, "nth_rw": 1, "consist": [1, 3, 5, 6, 7, 8], "collect": [1, 3, 5, 7], "oper": [1, 2, 3, 4, 5, 6, 7, 8], "time": [1, 4, 5, 6, 7, 8], "constant": [1, 2], "mapsto": [1, 5], "abelian": [1, 5, 6], "negat": [1, 5, 11], "invers": [1, 3, 5, 6, 8], "add_comm": [1, 4, 5, 6], "zero_add": [1, 4, 5, 6], "add_left_neg": [1, 5], "mul_on": [1, 5, 6], "one_mul": [1, 2, 5, 6], "being": [1, 3, 5, 7, 8], "suffic": [1, 2, 3, 7], "give": [1, 2, 3, 4, 6, 7], "element": [1, 2, 3, 4, 5, 6, 7, 8], "concret": [1, 2, 4, 5, 6, 7], "integ": [1, 2, 4, 6, 11], "abstract": [1, 2, 5, 6, 7], "character": [1, 3, 4, 7, 8], "axiomat": [1, 2, 3, 5], "train": [1, 6], "recogn": [1, 2, 4, 5, 6, 7], "appropri": [1, 2, 3, 5], "\u2124": [1, 4, 5, 6], "ration": [1, 2, 4, 7], "\u211a": [1, 4, 7], "\u2102": [1, 5, 8], "extend": [1, 3, 4, 5, 6, 7], "Not": [1, 5, 7], "properti": [1, 2, 3, 4, 5, 6, 7, 8], "hold": [1, 2, 3, 4, 5, 7], "arbitrari": [1, 2, 3, 4, 5], "taken": [1, 2], "cours": [1, 2, 4, 6, 7, 8], "linear": [1, 2, 5, 7], "matric": [1, 5], "fail": [1, 2, 3, 4, 5, 6, 7], "commr": [1, 2, 5], "unchang": [1, 2], "linarith": [1, 2, 4, 5], "permiss": 1, "strike": [1, 2], "balanc": 1, "concis": [1, 5], "readabl": [1, 2, 3, 4, 7], "strengthen": [1, 2, 4], "skill": [1, 2, 3, 4], "deriv": [1, 2, 4, 8], "most": [1, 2, 3, 4, 5, 6, 7], "content": [1, 4, 7], "organiz": 1, "mechan": [1, 2, 5], "namespac": [1, 2, 3, 4, 5, 7], "full": [1, 3, 4, 5, 6, 7], "shorter": [1, 3, 4, 7], "avoid": [1, 3, 4, 5, 6, 8], "due": [1, 3, 6], "clash": 1, "myre": 1, "add_right_neg": 1, "effect": [1, 3, 6, 7], "temporarili": [1, 2], "reprov": 1, "care": [1, 2, 3, 5], "earlier": 1, "pai": [1, 2, 6, 7], "attent": [1, 2, 4, 6, 7], "curli": [1, 2], "implicit": [1, 2, 5, 6, 7, 8], "moment": [1, 2, 5], "worri": [1, 3, 4, 5], "neg_add_cancel_left": 1, "add_neg_cancel_right": 1, "add_left_cancel": 1, "add_right_cancel": 1, "plan": [1, 6, 7], "brace": 1, "imagin": 1, "situat": [1, 3, 6, 7], "draw": [1, 5, 6], "conclus": [1, 2, 4], "hypothes": [1, 2, 3, 4, 5], "redund": [1, 5, 7], "few": [1, 2, 3, 4, 7], "extra": [1, 2, 3, 5, 6, 7], "oner": 1, "complic": [1, 2, 6], "tediou": [1, 2, 6], "mark": [1, 2, 6, 7], "suppos": [1, 2, 3, 4, 5, 7], "infer": [1, 2, 3, 5, 6], "mul_zero": [1, 5, 6], "serv": [1, 3, 4, 5], "therefor": [1, 4, 5, 7], "promot": 1, "modular": 1, "subproof": 1, "wa": [1, 3], "except": [1, 5], "ad": [1, 2, 3, 4, 5, 6, 7], "free": [1, 7], "At": [1, 2, 4, 5, 6], "rememb": [1, 2, 3, 4, 5, 6, 7], "zero_mul": [1, 2, 4, 5, 6], "By": [1, 3, 5, 6], "neg_eq_of_add_eq_zero": 1, "eq_neg_of_add_eq_zero": 1, "neg_zero": 1, "neg_neg": 1, "had": [1, 6], "annot": [1, 3, 4, 5, 6], "third": [1, 2, 3, 5, 7], "specifi": [1, 2, 3, 4, 5, 7, 8], "imposs": 1, "default": [1, 2, 3, 4, 5, 6, 8], "subtract": [1, 4, 5], "provabl": [1, 3, 6, 7], "sub_eq_add_neg": [1, 5], "On": [1, 2, 3, 5, 6, 7], "defin": [1, 2, 3, 4, 6, 7, 8, 11], "reflex": [1, 2], "present": [1, 2, 4, 7], "forc": [1, 2, 3], "unfold": [1, 2, 3, 4, 5, 7], "refl": [1, 2, 3, 5, 6], "deal": [1, 2, 3, 4, 5, 7], "equat": [1, 2, 3, 4, 5], "interchang": 1, "self_sub": 1, "either": [1, 2, 3, 5, 6, 7], "effort": [1, 4], "one_add_one_eq_two": 1, "norm_num": [1, 2, 4, 5], "strength": 1, "weaker": [1, 2], "notion": [1, 2, 3, 4, 5, 7, 8], "addgroup": 1, "otherwis": [1, 2, 3, 4, 5], "variant": [1, 2, 7], "addcommgroup": 1, "commgroup": 1, "mul_left_inv": [1, 5], "\u00b9": [1, 3, 5, 6, 7], "feel": [1, 2, 6, 7], "cocki": 1, "helper": 1, "along": [1, 4, 7], "hint": [1, 2], "mul_right_inv": [1, 5], "mul_inv_rev": 1, "non": [1, 3, 6, 7, 8], "abel": 1, "noncomm_r": 1, "seem": [1, 2, 4, 6, 7, 8], "odd": [1, 2, 3, 4], "partli": [1, 6], "histor": 1, "conveni": [1, 2, 3, 5, 6, 7], "great": [1, 5], "sort": [1, 3, 4], "inequ": [1, 2, 6, 7], "le": [1, 5, 6], "whenev": [1, 2, 4, 5], "consid": [1, 2, 3, 4, 5, 6, 7, 8], "le_refl": [1, 2], "le_tran": [1, 2, 5], "detail": [1, 2, 3, 4, 5, 6], "unless": [1, 2, 5], "realli": [1, 2, 3, 4, 6, 7], "insist": [1, 6], "discuss": [1, 2, 4, 5, 6, 7, 8], "implic": [1, 7, 11], "h\u2080": [1, 2, 3, 4, 7], "creat": [1, 6], "option": [1, 2, 4, 5, 6, 7], "within": [1, 2, 7], "visibl": 1, "must": [1, 5, 6, 7], "complet": [1, 2, 3, 4, 6, 8], "decreas": [1, 5], "fourth": [1, 2], "mode": [1, 2, 5], "entir": [1, 3, 5, 7, 8], "lt_of_le_of_lt": [1, 2, 5], "lt_of_lt_of_l": 1, "lt_tran": [1, 2], "togeth": [1, 2, 3, 4, 5, 7], "handl": [1, 3, 4, 6], "arithmet": 1, "5": [1, 2, 5, 7, 8], "pass": [1, 5], "exp_le_exp": 1, "mpr": [1, 2, 5, 7], "exp": [1, 3], "applic": [1, 2, 4, 5], "function": [1, 2, 4, 5, 6, 8, 11], "compound": [1, 2, 7], "pars": [1, 3], "exp_lt_exp": 1, "log_le_log": 1, "log": [1, 3], "log_lt_log": 1, "add_le_add": [1, 2, 5], "add_le_add_left": 1, "add_le_add_right": 1, "add_lt_add_of_le_of_lt": 1, "add_lt_add_of_lt_of_l": 1, "add_lt_add_left": 1, "add_lt_add_right": 1, "add_nonneg": [1, 5], "add_po": 1, "add_pos_of_pos_of_nonneg": 1, "exp_po": [1, 3], "bi": [1, 5, 11], "lr": 1, "iff": [1, 3, 7, 8], "connect": [1, 3, 5, 7], "equival": [1, 2, 3, 4, 5, 7, 8], "mp": [1, 2, 3, 4, 7], "forward": [1, 2, 5, 7], "direct": [1, 2, 3, 6, 7, 8], "stand": [1, 2, 5, 7, 8], "modu": 1, "ponen": 1, "respect": [1, 2, 3, 4, 5, 7], "thu": [1, 3, 4, 5, 7], "again": [1, 2, 3, 4, 5, 6, 7], "numer": [1, 4, 5], "constitut": 1, "part": [1, 2, 3, 4, 5, 6, 7], "strategi": [1, 2, 4], "api": 1, "reli": [1, 2, 3, 5, 7], "guess": [1, 2, 3, 4, 5], "a_of_b_of_c": 1, "approxim": 1, "loud": 1, "probabl": [1, 5, 6, 7], "add_l": 1, "choic": [1, 2, 3, 5, 7], "exist": [1, 2, 3, 6, 7], "jump": [1, 4, 5, 7], "nearbi": [1, 4], "library_search": [1, 4], "sq_nonneg": 1, "delet": [1, 2, 3, 4], "uncom": 1, "previou": [1, 2, 3, 5, 6, 7, 8], "suggest": [1, 2, 4, 5, 7], "better": [1, 3, 4, 5, 6, 7], "confirm": [1, 2, 3, 4], "finish": [1, 2, 3, 4], "job": 1, "pow_two_nonneg": [1, 2], "tend": [1, 7], "around": [1, 3, 6, 7], "binari": [1, 2, 4, 5, 6], "increas": 1, "worth": [1, 2, 5], "definition": [1, 4, 5, 7], "principl": [1, 2, 3, 4, 6, 8], "favor": [1, 2, 5], "timesav": 1, "clever": 1, "involv": [1, 2, 4, 5, 6, 7], "nice": [1, 2, 4, 6, 7], "idea": [1, 2, 3, 5, 6, 7], "abs_l": [1, 5], "ab": [1, 2, 5], "congratul": [1, 2, 4], "becom": [1, 4, 5, 6, 7], "min": [1, 2, 7], "uniqu": [1, 2, 3, 4, 5, 7], "min_le_left": 1, "min_le_right": 1, "le_min": 1, "max": [1, 2, 6, 7], "pair": [1, 2, 4, 5, 7], "act": 1, "curri": 1, "logician": 1, "haskel": 1, "bind": [1, 3], "tighter": [1, 3], "infix": [1, 6], "le_antisymm": [1, 2], "less": [1, 2, 3, 4, 5, 6, 7], "usag": 1, "inconsist": 1, "outer": 1, "level": [1, 2, 6], "nest": [1, 2], "maintain": 1, "bother": [1, 3], "repetit": 1, "foreshadow": 1, "univers": [1, 3, 5, 7, 11], "quantifi": [1, 3, 4, 5, 7, 11], "desir": [1, 3, 6, 7], "implicitli": [1, 2], "mani": [1, 2, 3, 5, 6, 7, 8, 11], "whether": [1, 2, 3, 4, 6, 7], "Of": [1, 2, 4, 6, 7, 8], "interest": [1, 2, 3, 5, 6, 7], "vice": [1, 3], "versa": [1, 3], "word": [1, 2, 3, 4, 5, 7], "switch": [1, 6], "transit": [1, 2, 5, 7], "total": 1, "satisfi": [1, 3, 4, 5, 6, 7, 8], "disjunct": [1, 3, 11], "stick": [1, 2, 7, 8], "split": [1, 2, 3, 4], "aux": [1, 2, 4, 7], "valu": [1, 2, 3, 4, 5, 6, 7, 8], "yield": [1, 2, 3, 4, 5, 7], "made": [1, 2, 3, 5, 7], "manifest": [1, 7], "triangl": [1, 2, 5], "abs_add": [1, 2], "sub_add_cancel": [1, 5], "relat": [1, 2, 3, 5, 6, 7, 8], "ordinari": [1, 2, 4, 5, 7], "unicod": [1, 3, 6], "obtain": [1, 2, 4, 5, 7, 8], "dvd": 1, "dvd_tran": 1, "dvd_mul_of_dvd_left": 1, "dvd_mul_left": 1, "expon": 1, "expand": [1, 2, 3, 4, 5], "w": [1, 6], "greatest": [1, 5, 7], "divisor": [1, 2, 4, 5], "gcd": [1, 2, 4], "least": [1, 5, 6, 7], "lcm": 1, "analog": [1, 2, 3, 4, 7], "divid": [1, 2, 4, 5], "gcd_zero_right": 1, "gcd_zero_left": 1, "lcm_zero_right": 1, "lcm_zero_left": 1, "similarli": [1, 2, 3, 4, 5], "prefix": [1, 4, 6], "dvd_antisymm": 1, "complain": 1, "ambigu": [1, 5], "_root_": [1, 4], "saw": [1, 5, 6, 7], "govern": [1, 5], "class": [1, 4, 5, 6, 7, 8], "describ": [1, 2, 3, 4, 5, 6, 7], "\u03b1": [1, 2, 3, 4, 5, 6, 7, 8], "partialord": [1, 2], "adopt": 1, "letter": [1, 5, 8], "\u03b2": [1, 2, 3, 5, 6, 7], "\u03b3": [1, 2, 5, 7], "greek": [1, 4], "especi": [1, 5, 6, 7], "strict": [1, 2], "somewhat": [1, 3, 7], "lt_irrefl": [1, 2], "lt_iff_le_and_n": 1, "lattic": [1, 5, 6, 7], "inf_le_left": [1, 7], "inf_le_right": 1, "le_inf": 1, "le_sup_left": 1, "le_sup_right": 1, "sup_l": 1, "lower": [1, 2, 4], "bound": [1, 2, 3, 4, 5, 7, 8], "upper": [1, 2], "glb": 1, "lub": 1, "infimum": [1, 6, 7], "supremum": [1, 4, 6], "inf": [1, 6, 7], "sup": [1, 4, 7], "further": [1, 7], "matter": [1, 2], "meet": [1, 2, 3, 5], "join": [1, 5], "keep": [1, 5, 6], "dictionari": 1, "subset": [1, 2, 3, 5, 7, 8], "domain": [1, 2, 3, 4, 5, 7], "boolean": 1, "truth": [1, 4], "fals": [1, 2, 3, 4, 6], "true": [1, 2, 3, 6, 7], "posit": [1, 3, 4, 5, 7], "subspac": [1, 6], "vector": [1, 3, 6, 8], "intersect": [1, 3, 5, 6, 7], "sum": [1, 2, 4, 5, 6, 7], "inclus": [1, 3, 7], "topologi": [1, 5, 6, 8, 11], "union": [1, 3, 4, 5, 6, 8], "inf_comm": 1, "inf_assoc": 1, "sup_comm": 1, "sup_assoc": 1, "absorpt": 1, "law": 1, "absorb1": 1, "absorb2": 1, "found": [1, 5, 8], "inf_sup_self": 1, "sup_inf_self": 1, "distriblattic": 1, "inf_sup_left": 1, "inf_sup_right": 1, "sup_inf_left": 1, "sup_inf_right": 1, "shown": [1, 5, 8], "explicit": [1, 2, 5, 6, 7], "nondistribut": 1, "finit": [1, 3, 4, 5, 7, 8], "impli": [1, 2, 3, 4, 5, 7], "larger": [1, 7], "carrier": [1, 5, 6], "compat": [1, 7], "strictorderedr": 1, "mul_po": [1, 4], "mul_nonneg": 1, "coupl": [1, 2, 6, 7], "metric": [1, 5, 8, 11], "equip": [1, 3, 5, 6, 7, 8], "distanc": [1, 2, 7, 8], "dist": [1, 7], "map": [1, 2, 3, 5, 6, 7], "metricspac": [1, 7, 8], "dist_self": 1, "dist_comm": [1, 7], "dist_triangl": [1, 7], "nonneg": [1, 5], "nonneg_of_mul_nonneg_left": 1, "dist_nonneg": [1, 7], "dealt": 2, "basic": [2, 4, 5, 7, 11], "simpl": [2, 4, 5, 6, 8], "absolut": 2, "\u03b5": [2, 7, 8], "though": [2, 3, 4, 5], "treat": [2, 3, 5, 6, 7, 8], "my_lemma": 2, "\u03b4": [2, 7], "hb": [2, 7], "subsequ": [2, 4, 7], "lemma": [2, 4, 5, 6, 7, 8, 11], "mention": [2, 3, 5, 6, 7], "my_lemma2": 2, "stage": [2, 5, 6], "my_lemma3": 2, "epo": 2, "ele1": 2, "xlt": 2, "ylt": 2, "essenti": [2, 3, 5, 7], "colon": 2, "why": [2, 4, 6, 7], "off": [2, 3, 4], "my_lemma4": 2, "abs_mul": 2, "mul_le_mul": 2, "abs_nonneg": 2, "mul_lt_mul_right": 2, "extract": [2, 7], "hidden": 2, "expos": [2, 7], "predic": [2, 3, 4, 6, 7, 8], "fn_ub": 2, "fn_lb": 2, "fnub": 2, "fnlb": 2, "hfa": 2, "hgb": 2, "dsimp": [2, 3, 4, 5], "simplif": [2, 3, 4], "contract": 2, "anyhow": 2, "control": 2, "transform": [2, 3], "rest": [2, 3, 5, 7], "routin": 2, "nnf": 2, "nng": 2, "hfb": 2, "nna": 2, "order": [2, 3, 4, 5, 6, 7, 8, 11], "codomain": [2, 4, 7], "structur": [2, 4, 6, 7, 8, 11], "monoid": [2, 3, 4, 6], "fn_ub_add": 2, "orderedcanceladdcommmonoid": 2, "high": 2, "monoton": [2, 6, 7], "nondecreas": [2, 4], "placehold": 2, "Or": [2, 3], "backward": [2, 7], "subgoal": 2, "mf": 2, "mg": 2, "aleb": 2, "lambda": [2, 5], "underscor": [2, 3], "flag": [2, 3], "squiggli": 2, "marker": 2, "nnc": 2, "bbb": [2, 5], "fneven": 2, "fnodd": 2, "ef": 2, "eg": 2, "og": 2, "shorten": 2, "rid": 2, "won": [2, 4, 6, 7], "cannot": [2, 3, 4, 5, 6, 7], "contrari": 2, "syntact": 2, "reduct": [2, 3], "erw": 2, "harder": 2, "spot": 2, "rudimentari": 2, "foundat": [2, 3, 4, 5], "impos": 2, "restrict": [2, 3, 4, 7], "talk": [2, 4, 7, 8], "assert": [2, 3, 6], "ask": [2, 4, 5, 6, 7], "tran": [2, 4, 5, 6], "setub": 2, "inject": [2, 3, 4, 6, 7], "x_1": [2, 3], "x_2": [2, 3], "x\u2081": [2, 3, 5, 7], "x\u2082": [2, 3, 5], "add": [2, 4, 5, 6, 7, 8], "nonzero": [2, 4, 5], "add_left_inj": 2, "composit": [2, 3, 5, 6, 7], "injg": 2, "injf": [2, 3], "canon": [2, 3, 4, 5], "exhibit": [2, 7], "anonym": [2, 3, 4, 5], "constructor": [2, 3, 4, 5, 6], "angl": 2, "whatev": [2, 4], "certain": [2, 6, 7], "fnhasub": 2, "fnhaslb": 2, "fnub_add": 2, "gun": 2, "ubf": 2, "ubg": 2, "ubfa": 2, "ubfb": 2, "unpack": [2, 3], "claus": [2, 6], "whose": [2, 4, 5, 6, 7, 8], "els": [2, 3, 4], "turn": [2, 3, 4, 5, 6, 7, 8], "directli": [2, 4, 5, 6, 7], "lbf": 2, "lbg": 2, "cousin": 2, "rcase": [2, 3, 4, 5, 7], "flexibl": [2, 7], "recurs": [2, 3, 5, 11], "harm": [2, 3], "swiss": 2, "armi": 2, "knive": 2, "wide": 2, "old": [2, 5, 6], "chestnut": 2, "product": [2, 4, 5, 6, 7], "magic": [2, 5, 6], "verifi": 2, "sumofsquar": 2, "sumofsquares_mul": 2, "sosx": 2, "sosi": 2, "xeq": [2, 3], "yeq": 2, "insight": 2, "motiv": 2, "gaussian": [2, 11], "sqrt": [2, 3, 4, 5], "norm": [2, 5, 7, 11], "reflect": 2, "di": [2, 5], "xy": [2, 5], "cryptic": 2, "easiest": [2, 4], "perspicu": 2, "divis": [2, 4, 5, 6, 11], "divab": 2, "divbc": 2, "beq": 2, "ceq": 2, "And": [2, 4, 6, 7], "pretti": [2, 6, 7], "Then": [2, 3, 5, 6, 7], "divac": 2, "alpha": [2, 3], "beta": [2, 3], "surject": [2, 3, 7], "yourself": [2, 5], "field_simp": [2, 5], "denomin": [2, 4, 5], "div_mul_cancel": 2, "hx": [2, 3, 5, 6, 8], "method": [2, 3, 4, 5], "surjg": 2, "surjf": [2, 3], "strictli": [2, 8], "contradict": [2, 3, 4], "speak": [2, 5, 7], "irreflex": 2, "asymmetri": 2, "lt_asymm": 2, "sugar": 2, "eventu": [2, 3, 7], "fnuba": 2, "not_le_of_gt": 2, "not_lt_of_g": [2, 4, 5], "lt_of_not_g": 2, "le_of_not_gt": 2, "snippet": [2, 4, 5], "counterexampl": [2, 8], "monof": 2, "four": [2, 5], "valid": 2, "far": [2, 3, 6, 7], "q": [2, 4, 5, 6, 7], "straightforward": [2, 6], "difficult": [2, 6], "conclud": [2, 8], "nonexist": 2, "contradictori": 2, "classic": [2, 3, 4], "by_contra": [2, 4], "not_not": 2, "front": 2, "push": [2, 4, 7], "inward": 2, "facilit": [2, 7], "push_neg": [2, 3, 4], "restat": [2, 6], "contrapos": [2, 3, 4], "yet": [2, 3, 4, 5, 6, 7], "semicolon": [2, 4], "falso": 2, "anyth": [2, 5, 7], "elim": 2, "strang": [2, 4], "fairli": 2, "reach": [2, 6], "37": 2, "exfalso": 2, "absurd": [2, 4], "slick": 2, "drop": 2, "manner": [2, 5], "contrast": [2, 3, 5, 7], "compon": [2, 3, 5, 7], "techniqu": [2, 7], "variou": [2, 3, 5, 6], "xltz": 2, "zlty": 2, "10": 2, "7": [2, 4], "behav": [2, 3, 6, 7], "roughli": [2, 3, 4], "friend": [2, 5], "were": [2, 4, 5, 7], "inscrut": [2, 3], "gadget": [2, 7], "auxiliari": [2, 7], "pow_eq_zero": [2, 4], "doubl": [2, 3], "symmetr": [2, 3], "abs_lt": 2, "dvd_gcd_iff": 2, "8": [2, 4, 7], "6": [2, 4, 5, 6, 7, 8], "15": 2, "below": [2, 3, 4, 5, 6, 7, 8], "not_monotone_iff": 2, "antisymmetr": 2, "aris": 2, "preorder": [2, 6, 7], "pre": 2, "lt_iff_le_not_l": 2, "beyond": [2, 6, 8], "repeatedli": [2, 7], "instanti": [2, 5, 6, 7], "inl": [2, 3], "inr": [2, 3], "produc": [2, 8], "branch": [2, 3, 6], "le_or_gt": 2, "abs_of_nonneg": [2, 5], "abs_of_neg": 2, "immedi": [2, 3, 5, 6], "myab": 2, "le_abs_self": [2, 5], "neg_le_abs_self": 2, "enjoi": [2, 3, 4, 7], "pun": 2, "lt_ab": 2, "genuin": 2, "vertic": [2, 5], "lt_trichotomi": 2, "xgt": 2, "dvd_mul_right": [2, 4], "eq_zero_or_eq_zero_of_mul_eq_zero": 2, "nontrivi": [2, 3, 4, 5, 7], "integr": [2, 8], "isdomain": 2, "em": [2, 3], "exclud": [2, 4], "by_cas": [2, 3, 4], "dispos": 2, "s_0": [2, 3], "s_1": 2, "s_2": 2, "ldot": [2, 3, 4], "varepsilon": [2, 7], "s_n": [2, 3], "render": [2, 4], "convergesto": 2, "ext": [2, 3, 4, 5, 6], "enabl": [2, 3, 4, 5], "actual": [2, 3, 4, 6, 7], "congr": 2, "reconcil": 2, "peel": 2, "convert": [2, 4], "quit": [2, 6, 7], "zero_lt_on": [2, 4], "fill": [2, 3, 4, 5], "convergesto_const": 2, "\u03b5po": [2, 7], "nge": 2, "abs_zero": 2, "save": [2, 3], "troubl": [2, 3, 5], "pen": 2, "paper": [2, 3, 5, 7], "nt": 2, "maximum": [2, 4, 7], "implement": [2, 5, 6, 8], "convergesto_add": 2, "ct": 2, "\u03b52po": 2, "ht": 2, "le_of_max_le_left": 2, "le_of_max_le_right": 2, "tricki": [2, 3, 4, 6], "convergesto_mul_const": 2, "mulzeroclass": [2, 6], "acpo": 2, "abs_po": 2, "independ": [2, 3, 5], "exists_abs_le_of_convergesto": 2, "strong": [2, 4], "n\u2080": 2, "bpo": [2, 7], "pos\u2080": 2, "div_po": 2, "n\u2081": 2, "convergesto_mul": 2, "sketch": [2, 3, 4, 7], "limit": [2, 6, 7], "bold": 2, "scratch": 2, "convergesto_uniqu": 2, "sa": 2, "sb": 2, "abn": 2, "na": 2, "hna": 2, "nb": 2, "hnb": 2, "absa": 2, "absb": 2, "observ": [2, 4, 7], "everywher": [2, 3, 6, 7], "linearord": 2, "vastli": 2, "awai": [2, 5], "vocabulari": 3, "uniform": [3, 7, 8], "primit": 3, "conceptu": 3, "advantag": [3, 4, 5, 8], "overload": 3, "verbos": 3, "system": [3, 4, 5, 6], "wrong": 3, "theoret": [3, 7], "ss": 3, "sub": [3, 7, 11], "cap": 3, "un": 3, "cup": 3, "univ": [3, 7, 8], "empti": [3, 4, 5, 7], "member": [3, 7], "membership": [3, 4, 6], "mem": 3, "notin": 3, "ident": [3, 4, 5, 6, 7, 11], "databas": [3, 4, 6, 7], "unlik": [3, 4], "existenti": [3, 11], "subset_def": 3, "inter_def": 3, "xu": 3, "mem_inter_iff": 3, "xsu": 3, "phenomenon": 3, "quirk": 3, "process": 3, "pitfal": 3, "heavili": [3, 7], "fall": 3, "union_def": 3, "mem_union": [3, 4], "xtu": 3, "xt": 3, "unnecessari": 3, "clearer": [3, 5], "correctli": 3, "special": [3, 4, 5, 6, 7], "rewritten": 3, "diff_eq": 3, "mem_diff": 3, "xstu": 3, "xnt": 3, "xnu": 3, "extension": [3, 5], "unsurprisingli": 3, "dollar": 3, "sign": [3, 7], "and_comm": 3, "antisymm": 3, "hood": [3, 5], "builder": 3, "trivial": [3, 4, 7], "eq_two_or_odd": 3, "even_iff": 3, "confus": [3, 4, 6, 7], "fortun": 3, "agre": 3, "prime_iff": 3, "symm": [3, 4, 5, 6, 7, 8], "rwa": [3, 4, 5], "signific": 3, "ball": [3, 8], "bex": 3, "bex_def": 3, "prime_x": 3, "slight": 3, "ssubt": 3, "index": [3, 6, 7], "model": [3, 7], "sequenc": [3, 6, 7, 8, 11], "a_0": 3, "a_1": 3, "a_2": 3, "mem_iunion": 3, "xai": 3, "mem_iint": 3, "mem_union\u2082": 3, "mem_inter\u2082": 3, "mem_iunion\u2082": 3, "exists_prime_and_dvd": 3, "eq_univ": 3, "eq_univ_of_foral": 3, "exists_infinite_prim": 3, "\u2080": 3, "sunion": 3, "sinter": 3, "relationship": [3, 4], "mem_iinter\u2082": 3, "sunion_eq_biunion": 3, "sinter_eq_biint": 3, "preimag": [3, 7], "imag": [3, 4, 6, 7], "tripl": 3, "tag": [3, 6], "mem_image_of_mem": 3, "galoi": [3, 5, 7], "image_subset_iff": 3, "represent": [3, 4, 5], "asid": 3, "raini": 3, "dai": 3, "behavior": [3, 6, 7], "nonempti": [3, 7], "condit": [3, 4, 6, 7, 8], "fxeq": 3, "ai": 3, "fx": 3, "eq": [3, 5], "injon": 3, "theme": 3, "rel": [3, 5], "relativ": 3, "xpo": 3, "ypo": 3, "exp_log": 3, "ingredi": [3, 5, 7, 8], "assign": [3, 5, 6], "inhabit": [3, 5, 7], "appeal": [3, 6], "choose_spec": 3, "some_spec": 3, "noncomput": [3, 5], "inverse_spec": 3, "dif_po": 3, "dif_neg": 3, "fulli": [3, 7], "alon": 3, "leftinvers": 3, "rightinvers": 3, "hack": 3, "half": 3, "dozen": 3, "condens": 3, "cantor": 3, "famou": 3, "miss": [3, 4], "j": [3, 5], "intuit": [3, 7], "cardin": 3, "biject": [3, 5], "nineteenth": 3, "centuri": 3, "infinit": [3, 7, 11], "dedekind": 3, "quickli": 3, "behind": 3, "problem": [3, 4, 5, 6, 7], "shade": 3, "region": 3, "diagram": 3, "circ": [3, 5], "scale": 3, "inner": 3, "smaller": [3, 4, 7], "concentr": 3, "unshad": 3, "compos": [3, 5, 7], "disjoint": 3, "sound": [3, 5, 6], "plausibl": 3, "delic": 3, "improv": [3, 4], "confid": 3, "invfun": [3, 5], "leftinverse_invfun": 3, "invfun_eq": 3, "sbaux": 3, "sbset": 3, "sb_aux": 3, "s_": 3, "sb_set": 3, "bigcup_": 3, "mathbb": [3, 4, 5], "sbfun": 3, "complement": [3, 7], "outermost": 3, "setminu": 3, "inv_fun": 3, "inv_fun_eq": 3, "sb_right_inv": 3, "goe": [3, 4, 5, 6, 7], "henc": [3, 4, 5, 6, 7, 8], "neither": [3, 5, 6], "nor": [3, 5], "sb_inject": 3, "hf": [3, 7, 8], "hg": [3, 7, 8], "a_def": 3, "h_def": 3, "hxeq": 3, "xa": [3, 5], "wlog": 3, "x\u2081a": 3, "resolve_left": 3, "x\u2082a": 3, "not_imp_self": 3, "x\u2082na": 3, "if_po": 3, "if_neg": 3, "x\u2082eq": 3, "hn": [3, 4, 7, 8], "sb_fun": 3, "bring": [3, 4, 7], "tradeoff": 3, "encapsul": [3, 5, 8], "symmetri": [3, 6], "dwell": 3, "succ": [3, 4, 6], "sb_surject": 3, "gya": 3, "xmem": 3, "sweet": 3, "schroeder_bernstein": 3, "substant": 4, "ancient": 4, "fraction": 4, "lowest": 4, "2c": 4, "4c": 4, "factor": [4, 5], "coprim": 4, "smart": 4, "12": 4, "encount": [4, 6], "algebra": [4, 6, 7, 8, 11], "prime_def_lt": 4, "eq_one_or_self_of_dvd": 4, "prime_p": 4, "17": 4, "commonli": [4, 5], "prime_two": 4, "prime_thre": 4, "broader": [4, 8], "irreduc": [4, 5], "coincid": [4, 5, 7], "rise": [4, 6], "dvd_mul": 4, "even_of_even_sqr": 4, "dvd_of_dvd_pow": 4, "proce": [4, 6], "profici": 4, "search": [4, 5, 6], "engin": 4, "hesit": 4, "mul_right_inj": 4, "heart": 4, "irration": 4, "dvd_gcd": 4, "coprime_mn": 4, "sqr_eq": 4, "meq": 4, "dvd_iff_exists_eq_mul_left": 4, "two_l": 4, "le_of_dvd": 4, "approach": [4, 5, 6, 7], "quick": [4, 8], "ne": [4, 5], "occur": 4, "suffici": [4, 7], "permut": 4, "prime_of_mem_factor": 4, "prod_factor": 4, "factors_uniqu": 4, "factorization_mul": 4, "mnez": 4, "nnez": 4, "factorization_pow": 4, "black": [4, 6], "box": 4, "simpa": [4, 8], "nnz": 4, "nsqr_nez": 4, "eq1": 4, "eq2": 4, "add_mul_mod_self_left": 4, "mul_mod_right": 4, "count_factors_mul_of_po": 4, "successor": 4, "succ_ne_zero": 4, "npow_nz": 4, "dvd_sub": 4, "pow_eq": 4, "npowz": 4, "add_sub_cancel": 4, "understood": [4, 7], "quotient": [4, 5, 6, 7], "pictur": [4, 5], "mediat": 4, "headach": 4, "contend": 4, "issu": [4, 5, 6, 7], "th": 4, "topic": [4, 6], "enat": 4, "infin": [4, 7], "appreci": 4, "role": [4, 5, 7], "_section_induction_and_recurs": 4, "writ": 4, "datatyp": 4, "freeli": 4, "translat": [4, 6, 7], "mathematician": [4, 7], "inj": 4, "factori": 4, "fac": 4, "ih": 4, "fac_po": 4, "succ_po": 4, "dvd_fac": 4, "ipo": 4, "il": 4, "of_le_succ": 4, "dvd_mul_of_dvd_right": 4, "crude": 4, "remaind": [4, 5], "pow_two_le_fac": 4, "finset": [4, 5, 7], "bigoper": [4, 5], "prod": [4, 7], "sum_range_zero": 4, "sum_range_succ": 4, "summat": 4, "prod_range_zero": 4, "prod_range_succ": 4, "deserv": 4, "comment": 4, "danger": [4, 5], "ordinarili": [4, 5], "loop": 4, "indefinit": 4, "fix": [4, 6, 7], "placement": 4, "re": [4, 5], "handi": 4, "sum_id": 4, "div_eq_of_eq_mul_right": 4, "succ_eq_add_on": 4, "sum_sqr": 4, "mynat": 4, "thumb": 4, "decid": [4, 7], "preced": 4, "truncat": 4, "exponenti": 4, "cut": 4, "predecessor": 4, "pred": 4, "mul": [4, 5, 6, 7], "succ_add": 4, "succ_mul": 4, "explor": [4, 7], "standard": [4, 5, 6, 7], "formul": [4, 7], "quirki": 4, "among": 4, "annoi": [4, 6], "h0": 4, "succ_le_succ": 4, "zero_l": [4, 5], "interval_cas": 4, "interv": [4, 7], "decis": 4, "procedur": [4, 6], "revert": [4, 5], "minfac": 4, "smallest": [4, 6, 7], "strong_induction_on": 4, "subsum": 4, "exists_prime_factor": 4, "np": 4, "mltn": 4, "mdvdn": 4, "mne1": 4, "mz": 4, "zero_dvd_iff": 4, "mgt2": 4, "pp": 4, "pdvd": 4, "factorial_po": 4, "dvd_factori": 4, "primes_infinit": 4, "refin": [4, 8], "ple": 4, "p_1": 4, "p_n": 4, "prod_": 4, "p_i": [4, 7], "computation": 4, "test": 4, "decidableeq": 4, "abandon": 4, "ourselv": [4, 6], "subset_iff": 4, "mem_int": 4, "mem_sdiff": 4, "tauto": 4, "dispens": 4, "tautologi": 4, "dvd_prod_of_mem": 4, "eq_of_dvd_of_prim": 4, "prime_q": 4, "preserv": [4, 6, 7], "induction_on": 4, "singleton": 4, "prod_empti": 4, "prod_insert": 4, "mem_of_dvd_prod_prim": 4, "mem_insert": 4, "wrote": 4, "filter": [4, 8, 11], "mem_filt": 4, "aim": 4, "prod_po": 4, "_def": 4, "mem_": 4, "id": [4, 6, 7, 8], "bounded_of_ex_finset": 4, "qk": 4, "lt_succ_of_l": 4, "le_sup": 4, "ex_finset_of_bound": 4, "decidablepr": 4, "lt_succ_iff": 4, "congruent": 4, "p_k": 4, "loss": 4, "27": 4, "mod_4_eq_3_or_mod_4_eq_3": 4, "mul_mod": 4, "mod_lt": 4, "hm": [4, 8], "two_le_of_mod_4_eq_3": 4, "neq": 4, "div_dvd_of_dvd": 4, "div_lt_self": 4, "piec": [4, 5, 6, 7], "exists_prime_factor_mod_4_eq_3": 4, "dvd_rfl": 4, "mge2": 4, "mul_div_cancel": 4, "home": [4, 5], "stretch": [4, 5], "remov": [4, 7], "eras": 4, "mem_eras": 4, "readi": [4, 6, 7, 8], "dvd_add_iff_left": 4, "primes_mod_4_eq_3_infinit": 4, "p4": 4, "pltn": 4, "p4eq": 4, "pne3": 4, "seriou": [4, 6, 7], "feat": 4, "modern": 5, "subject": 5, "mysteri": [5, 6], "technic": [5, 6], "consult": 5, "ann": 5, "baanen": 5, "abus": 5, "paramet": [5, 6], "broadest": 5, "possibli": 5, "constraint": [5, 7], "bundl": [5, 6, 7, 8], "tupl": 5, "hy": [5, 6], "hz": [5, 6], "mypoint1": 5, "mypoint2": 5, "mypoint3": 5, "mk": [5, 6, 7], "former": 5, "latter": [5, 7], "quot": [5, 7], "protect": 5, "intern": 5, "add_x": 5, "addalt": 5, "etc": [5, 7], "y\u2081": 5, "z\u2081": 5, "y\u2082": 5, "z\u2082": 5, "addalt_x": 5, "addalt_comm": 5, "ya": 5, "za": 5, "xb": 5, "yb": 5, "zb": 5, "apart": 5, "effici": [5, 7], "scalar": [5, 6, 8], "smul": [5, 6], "smul_distrib": 5, "road": 5, "link": [5, 6], "belong": [5, 6, 7], "simplex": 5, "convinc": 5, "equilater": 5, "interior": [5, 8], "standardtwosimplex": 5, "x_nonneg": 5, "y_nonneg": 5, "z_nonneg": 5, "sum_eq": 5, "swap": 5, "swapxi": 5, "interestingli": [5, 8], "midpoint": 5, "div_nonneg": 5, "weight": 5, "averag": 5, "analogi": [5, 7, 8], "weightedaverag": 5, "lambda_nonneg": 5, "lambda_l": 5, "fin": 5, "standardsimplex": 5, "sum_eq_on": 5, "div_eq_mul_inv": 5, "sum_mul": 5, "sum_add_distrib": 5, "mul_sum": 5, "manipul": [5, 7], "islinear": 5, "is_addit": 5, "preserves_mul": 5, "linf": 5, "subtyp": [5, 6, 7], "preal": 5, "val": 5, "sigma": 5, "wherebi": [5, 7], "stdsimplex": 5, "\u03c3": 5, "fst": [5, 7], "snd": [5, 7], "custom": 5, "robust": [5, 6], "interfac": 5, "redefin": [5, 6], "accessor": 5, "weav": 5, "rich": [5, 6], "interconnect": 5, "hierarchi": [5, 11], "clarifi": 5, "antireflex": 5, "cdot": 5, "topolog": [5, 6, 8, 11], "mathcal": [5, 8], "proxi": 5, "bipartit": 5, "graph": 5, "categori": [5, 7, 8], "morphism": [5, 8, 11], "basi": [5, 7], "discret": [5, 8], "inherit": [5, 6], "polynomi": 5, "coeffici": 5, "dual": [5, 7], "accommod": 5, "almost": [5, 6, 7], "marriag": 5, "heaven": 5, "group\u2081": [5, 6], "inv": [5, 6], "struc": 5, "counterpart": 5, "chosen": 5, "assur": 5, "groupcat": 5, "group\u2081cat": 5, "str": 5, "capit": 5, "roman": 5, "equiv": 5, "tofun": [5, 6], "right_inv": 5, "left_inv": 5, "creativ": 5, "evid": 5, "coercion": [5, 6, 7, 8], "omit": 5, "perm": 5, "under": [5, 6, 7], "orient": 5, "permgroup": 5, "trans_assoc": 5, "trans_refl": 5, "refl_tran": 5, "self_trans_symm": 5, "grouptheori": 5, "g_1": 5, "g_2": 5, "g_3": 5, "tightli": 5, "isomorph": [5, 8], "additivegroup": 5, "Its": [5, 6], "neg": [5, 6, 7], "reproduc": 5, "accompani": 5, "addgroup\u2081": 5, "scheme": 5, "add_group_point": 5, "arrang": 5, "mul_inv_cancel_right": 5, "achiev": [5, 6, 7], "silent": [5, 6], "regist": [5, 6], "grp": 5, "contextu": 5, "cue": 5, "synthes": [5, 6], "whole": 5, "_inst_1": 5, "candid": 5, "group\u2082": 5, "mysquar": 5, "my_squar": 5, "remark": [5, 6], "head": 5, "store": 5, "headi": 5, "hasmulgroup\u2082": 5, "hasonegroup\u2082": 5, "hasinvgroup\u2082": 5, "suppli": 5, "accord": 5, "capabl": 5, "chain": 5, "recent": 5, "prioriti": 5, "bad": [5, 6, 7], "artifici": 5, "addgroup\u2082": 5, "subtl": [5, 7], "configur": 5, "invisibli": [5, 6], "wise": 5, "euclidean": 5, "terminologi": 5, "mid": 5, "imaginari": 5, "gaussint": 5, "im": 5, "pointwis": [5, 7, 8], "root": [5, 6, 11], "ac": 5, "bci": 5, "adi": 5, "bd": 5, "bc": 5, "hasmul": 5, "zero_def": 5, "one_def": 5, "add_def": 5, "neg_def": 5, "mul_def": 5, "zero_r": 5, "zero_im": 5, "one_r": 5, "one_im": 5, "add_r": 5, "add_im": 5, "neg_r": 5, "neg_im": 5, "mul_r": 5, "mul_im": 5, "surprisingli": [5, 6], "concept": [5, 7, 8], "light": 5, "bulb": 5, "skeleton": [5, 7], "scari": 5, "entri": 5, "instcommr": 5, "left_distrib": [5, 6], "right_distrib": [5, 6], "ext_iff": 5, "bq": 5, "archetyp": 5, "int": [5, 6], "ediv_add_emod": 5, "emod_nonneg": 5, "emod_lt": 5, "unit": [5, 6, 7], "algorithm": 5, "conjug": 5, "frac": 5, "nearest": 5, "size": 5, "vi": 5, "multipli": 5, "view": [5, 6, 7], "emb": 5, "forth": 5, "quadrat": 5, "gaussian_int": 5, "stai": 5, "face": [5, 6, 7], "machineri": [5, 6, 7], "adapt": 5, "invest": 5, "pragmat": 5, "seek": 5, "heather": 5, "macbeth": 5, "eleg": 5, "div": 5, "mod": 5, "_add_mod": 5, "abs_mod": 5, "_le": 5, "emod_lt_of_po": 5, "zero_lt_two": 5, "fixm": 5, "_eq": 5, "sq_add_sq_eq_zero": 5, "linearorderedr": 5, "norm_nonneg": [5, 8], "norm_eq_zero": [5, 8], "norm_po": 5, "norm_mul": [5, 8], "conj": 5, "conj_r": 5, "conj_im": 5, "norm_conj": 5, "bespok": 5, "quad": 5, "record": [5, 6], "div_def": 5, "mod_def": 5, "messi": 5, "nicer": [5, 7], "norm_mod_lt": 5, "norm_y_po": 5, "sub_mul": 5, "conv": 5, "lh": 5, "sq_le_sq": 5, "mul_le_mul_of_nonneg_left": 5, "ediv_mul_l": 5, "ediv_nonneg": 5, "le_of_mul_le_mul_right": 5, "ediv_lt_of_lt_mul": 5, "natab": 5, "coe_natabs_norm": 5, "natabs_of_nonneg": 5, "natabs_norm_mod_lt": 5, "ofnat_lt": 5, "coe_natab": 5, "not_norm_mul_left_lt_norm": 5, "natabs_mul": 5, "le_mul_of_one_le_right": 5, "ofnat_l": 5, "add_one_le_of_lt": 5, "euclideandomain": 5, "quotient_mul_add_remainder_eq": 5, "quotient_zero": 5, "r_wellfound": 5, "remainder_lt": 5, "mul_left_not_lt": 5, "payoff": 5, "principalidealr": 5, "irreducible_iff_prim": 5, "studi": [6, 7], "prematur": 6, "technologi": 6, "simpler": 6, "ring\u2081": 6, "gradual": [6, 7], "bottom": [6, 7], "endow": 6, "one\u2081": 6, "heavier": 6, "inferr": 6, "resolut": 6, "ie": [6, 7], "attribut": 6, "ensur": [6, 7], "self": 6, "one\u2082": 6, "usabl": 6, "silli": 6, "affect": 6, "importantli": 6, "habit": 6, "ascript": 6, "messag": 6, "typeclass": 6, "stuck": 6, "metavari": 6, "263": 6, "auto": 6, "sever": [6, 7], "unknown": 6, "collis": 6, "builtin": 6, "\ud835\udfd9": 6, "inherit_doc": 6, "diamond": 6, "dia\u2081": 6, "dia": 6, "infixl": 6, "70": 6, "semigroup": 6, "dia_assoc": 6, "semigroup\u2081": 6, "todia\u2081": 6, "previous": 6, "semigroup\u2082": 6, "hurdl": 6, "neutral": 6, "diaoneclass\u2081": 6, "one_dia": 6, "dia_on": 6, "trace": 6, "info": 6, "ters": 6, "expend": 6, "attempt": 6, "succce": 6, "success": 6, "set_opt": 6, "meta": 6, "synthinst": 6, "monoid\u2081": 6, "hide": [6, 7], "subtleti": 6, "fear": 6, "unrel": 6, "tosemigroup\u2081": 6, "todiaoneclass\u2081": 6, "monoid\u2082": 6, "defect": [6, 7], "toone\u2081": 6, "overlap": 6, "tear": 6, "appart": 6, "signatur": 6, "restor": 6, "optim": 6, "reusabl": 6, "inv\u2081": 6, "postfix": 6, "inv_dia": 6, "weak": 6, "preliminari": 6, "left_inv_eq_right_inv\u2081": 6, "hba": 6, "hac": 6, "export": 6, "inv_eq_of_dia": 6, "dia_inv": 6, "naiv": [6, 7], "duplic": 6, "attibut": 6, "to_addit": 6, "semi": 6, "left_inv_eq_right_inv": 6, "left_neg_eq_right_neg": 6, "whatsnew": 6, "addsemigroup\u2083": 6, "add_assoc\u2083": 6, "semigroup\u2083": 6, "mul_assoc\u2083": 6, "addmonoid\u2083": 6, "addzeroclass": 6, "monoid\u2083": 6, "muloneclass": 6, "tomuloneclass": 6, "addcommsemigroup\u2083": 6, "commsemigroup\u2083": 6, "addcommmonoid\u2083": 6, "commmonoid\u2083": 6, "addgroup\u2083": 6, "neg_add": 6, "group\u2083": 6, "inv_mul": 6, "approri": 6, "inv_eq_of_mul": 6, "propag": 6, "attr": 6, "mul_inv": 6, "mul_left_cancel\u2083": 6, "mul_right_cancel\u2083": 6, "addcommgroup\u2083": 6, "commgroup\u2083": 6, "demonstr": [6, 7], "puprpos": 6, "opposit": [6, 7], "gain": 6, "besid": 6, "parent": 6, "ring\u2083": 6, "toaddgroup\u2083": 6, "mayb": 6, "le\u2081": 6, "50": 6, "\u2081": 6, "preorder\u2081": 6, "partialorder\u2081": 6, "orderedcommmonoid\u2081": 6, "modul": 6, "pretend": 6, "smul\u2083": 6, "infixr": 6, "73": 6, "module\u2081": 6, "zero_smul": 6, "one_smul": 6, "mul_smul": 6, "add_smul": 6, "smul_add": 6, "surpris": 6, "addcommgroup3": 6, "toaddcommgroup\u2083": 6, "inst": 6, "module\u2083": 6, "hunt": 6, "unspecifi": 6, "embark": 6, "main": [6, 7, 8], "quest": 6, "huge": 6, "trap": 6, "refus": [6, 7], "tosmul\u2083": 6, "inst_1": 6, "safe": 6, "selfmodul": 6, "invert": 6, "nsmul\u2081": 6, "zsmul\u2081": 6, "ofnat": 6, "negsucc": 6, "intermedi": [6, 7], "abgrpmodul": 6, "frustat": 6, "failur": 6, "synth": 6, "indirect": 6, "path": 6, "thank": [6, 7], "definitionnali": 6, "offend": 6, "poor": 6, "forget": 6, "inria": 6, "hal": 6, "scienc": 6, "02463336": 6, "modifi": 6, "nsmul": 6, "addmonoid\u2084": 6, "nsmul_zero": 6, "nsmul_succ": 6, "mysmul": 6, "stori": 6, "incorpor": 6, "zsmul": 6, "incorport": 6, "lt\u2081": 6, "comparison": 6, "ismonoidhom\u2081": 6, "unpleas": [6, 7], "conjunct": [6, 11], "chose": 6, "ismonoidhom\u2082": 6, "map_on": 6, "map_mul": 6, "tempt": 6, "higher": 6, "unif": 6, "psycholog": 6, "rare": 6, "adject": 6, "bare": 6, "noun": 6, "argu": 6, "continuous_id": [6, 7], "primari": 6, "constrast": 6, "monoidhom\u2081": 6, "coefun": 6, "coerc": 6, "coe": 6, "addmonoidhom\u2081": 6, "addmonoid": 6, "map_zero": 6, "map_add": [6, 8], "ringhom\u2081": 6, "minor": [6, 8], "tomonoidhom\u2081": 6, "juggl": 6, "monoidhomclass\u2081": 6, "badinst": 6, "wouldn": 6, "priori": 6, "slightli": [6, 7, 8], "boil": 6, "hopelessli": 6, "checksynthord": 6, "random": 6, "deduc": [6, 7], "outparam": 6, "trigger": 6, "retri": 6, "monoidhomclass\u2082": 6, "promis": [6, 7], "morphim": 6, "map_inv_of_inv": 6, "sight": 6, "got": 6, "presenc": 6, "repeatit": 6, "layer": [6, 7], "funlik": 6, "monoidhomclass": 6, "monoidhomclass\u2083": 6, "coe_inject": 6, "stop": 6, "ringhomclass\u2083": 6, "ringhom": 6, "algebrahom": 6, "ve": [6, 7], "primarili": [6, 7], "unbundl": 6, "orderpreshom": 6, "le_of_l": 6, "orderpresmonoidhom": 6, "orderpreshomclass": 6, "subgroup": 6, "subr": 6, "reus": 6, "led": 6, "descend": 6, "break": 6, "barrier": 6, "setlik": 6, "wrap": [6, 7], "submonoid\u2081": 6, "submonoid": 6, "mul_mem": 6, "one_mem": 6, "tackl": 6, "setco": 6, "submonoid\u2081monoid": 6, "destructur": 6, "binder": 6, "submonoidclass\u2081": 6, "subgroup\u2081": 6, "subgroupclass\u2081": 6, "subobject": 6, "s\u2081": 6, "s\u2082": 6, "shame": 6, "across": 6, "weird": [6, 7], "distract": 6, "emphas": 6, "anecdot": 6, "devic": 6, "hasquoti": 6, "bewar": 6, "regular": [6, 7], "ascii": 6, "setoid": 6, "commmonoid": 6, "iseqv": 6, "hw": 6, "quotientmonoid": 6, "map\u2082": 6, "calculu": [7, 11], "quantiti": 7, "begun": 7, "paradox": 7, "exot": 7, "x\u2080": [7, 8], "convention": 7, "eight": 7, "varieti": 7, "wish": 7, "64": 7, "y\u2080": 7, "z\u2080": 7, "paragraph": 7, "512": 7, "bourbaki": 7, "spell": 7, "dualli": 7, "arbitrarili": 7, "neighborhood": 7, "at_top": 7, "\ud835\udcdd": [7, 8], "\ud835\udce4": 7, "entourag": 7, "\u03bc": 7, "a_": 7, "univ_set": 7, "sets_of_superset": 7, "inter_set": 7, "blur": 7, "princip": 7, "\ud835\udcdf": 7, "opportun": 7, "x_0": 7, "ioo": [7, 8], "tendsto\u2081": 7, "tendsto": 7, "lim_": 7, "sourc": 7, "abstractli": 7, "salient": 7, "pushforward": 7, "f_": 7, "tendsto\u2082": 7, "via": 7, "leverag": 7, "map_mono": 7, "map_map": 7, "shot": 7, "256": 7, "pullback": 7, "comap": 7, "map_le_iff_le_comap": 7, "contravari": 7, "comap_comap": 7, "plane": 7, "\u1da0": [7, 8], "\u02e2": 7, "nhds_prod_eq": 7, "aforement": 7, "le_inf_iff": 7, "attop": 7, "shouldn": 7, "prohibit": 7, "global": 7, "precondit": 7, "closur": 7, "ne_bot": 7, "tour": [7, 8], "claim": 7, "recaptur": 7, "superfici": 7, "stronger": 7, "famili": [7, 8], "\u03b9": [7, 8], "select": 7, "hasbasi": 7, "nhds_basis_ioo_po": 7, "has_basi": 7, "tendsto_iff": 7, "reformul": 7, "ici": 7, "attop_basi": 7, "knew": 7, "gave": 7, "n_p": 7, "n_q": 7, "tiresom": 7, "superscript": 7, "hp": 7, "hq": 7, "eventually_eq": 7, "tendsto_congr": 7, "review": 7, "eventually_of_foral": 7, "mono": 7, "item": 7, "filter_upward": 7, "hr": 7, "reader": 7, "ae": 7, "aka": 7, "occasion": 7, "frequent": 7, "sophist": 7, "mem_closure_of_tendsto": 7, "cluster_pt": 7, "mem_closure_iff_clusterpt": 7, "le_principal_iff": 7, "nebot_of_l": 7, "hux": 7, "hum": 7, "dist_eq_zero": 7, "emetricspac": 7, "pseudometricspac": 7, "pseudoemetricspac": 7, "journei": 7, "recast": 7, "tendsto_attop": 7, "continuous_iff": 7, "devot": 7, "uncurri": 7, "slow": 7, "continuous_fst": 7, "comp": 7, "assembl": 7, "prod_mk": 7, "continuous_snd": 7, "continuous_dist": 7, "clunki": 7, "crucial": 7, "elabor": 7, "prod_map": 7, "sad": 7, "border": 7, "obfusc": 7, "continuous_pow": 7, "continuousat": 7, "continuousat_iff": 7, "geometr": 7, "closedbal": 7, "radiu": 7, "mem_ball_self": 7, "mem_closedball_self": 7, "isopen": 7, "isopen_iff": 7, "Their": [7, 8], "isclos": [7, 8], "s\u1d9c": 7, "isopen_compl_iff": 7, "hu": [7, 8], "mem_of_tendsto": 7, "mem_closure_iff": 7, "mem_closure_iff_seq_limit": 7, "nhds_basis_bal": 7, "nhds_basis_closedbal": 7, "mem_iff": 7, "segment": 7, "somewher": 7, "continuouson": [7, 8], "minimum": 7, "iscompact": 7, "icc": [7, 8], "iscompact_icc": 7, "\u03c6": 7, "strictmono": 7, "tendsto_subseq": 7, "exists_forall_l": 7, "exists_forall_g": 7, "compactspac": 7, "iscompact_univ": 7, "cauchi": 7, "uniformcontinu": 7, "uniformcontinuous_iff": 7, "clearli": 7, "isclosed_l": 7, "eq_empty_or_nonempti": 7, "attain": 7, "closer": 7, "cauchyseq": 7, "cauchyseq_iff": 7, "completespac": [7, 8], "cauchyseq_tendsto_of_complet": 7, "criterion": 7, "explan": 7, "tendsto_pow_attop_nhds_0_of_lt_1": 7, "dist_le_range_sum_dist": 7, "cauchyseq_of_le_geometric_two": 7, "\u03b5_po": [7, 8], "le_iff_exists_add": 7, "boss": 7, "bair": [7, 8], "exclam": 7, "induct": [7, 11], "rec_on": 7, "ho": 7, "hd": 7, "dens": 7, "densiti": 7, "\u03b4po": 7, "hpo": 7, "hball": 7, "mem_closure_iff_nhds_basi": 7, "recon": 7, "rpo": 7, "rb": 7, "incl": 7, "cdist": 7, "ylim": 7, "yball": 7, "categor": 7, "ignor": 7, "topologicalspac": [7, 8], "isopen_univ": 7, "isopen_empti": 7, "isopen_iunion": 7, "fintyp": 7, "isopen_iint": 7, "continuous_def": 7, "attach": 7, "filteri": 7, "sent": 7, "mem_nhds_iff": 7, "digress": 7, "pure_le_nhd": 7, "eventually_eventually_nhd": 7, "topological_spac": 7, "mk_of_nhd": 7, "nhds_mk_of_nhd": 7, "clean": 7, "fonctori": 7, "induc": 7, "sensibl": 7, "uncount": 7, "relatedli": 7, "coinduc": 7, "t_x": 7, "t_y": 7, "coinduced_le_iff_le_induc": 7, "covari": 7, "coinduced_compos": 7, "induced_compos": 7, "topological_structur": 7, "focus": 7, "nhd": 7, "recov": 7, "foward": 7, "continuous_iff_coinduced_l": 7, "g_": 7, "t_z": 7, "wasn": 7, "\u03c0": [7, 8], "papar": 7, "t_": 7, "x_i": 7, "pi": 7, "functori": 7, "price": 7, "patholog": 7, "t2_space": 7, "hausdorff": 7, "t2space": 7, "tendsto_nhds_uniqu": 7, "regularspac": 7, "closed_nhds_basi": 7, "nhds_basis_open": 7, "denseinduc": 7, "continuousat_extend": 7, "funni": 7, "_in": 7, "nhds_induc": 7, "is_open": 7, "fortiori": 7, "f_cont": 7, "tendsto_right_iff": 7, "firstcountabletopologi": 7, "cluster": 7, "clusterpt": 7, "nebot": 7, "hfx": 7, "push_pul": 7, "of_map": 7, "f_ne": 7, "f_le": 7, "map_eq": 7, "hne": 7, "hle": 7, "huo": 7, "hsu": 7, "elim_finite_subcov": 7, "9": 8, "introductori": 8, "sin": 8, "hasderivat": 8, "hasderivat_sin": 8, "differentiable_at": 8, "differentiableat": 8, "inconveni": 8, "deriv_zero_of_not_differentiableat": 8, "deriv_add": 8, "islocalmin": 8, "deriv_eq_zero": 8, "ev": 8, "roll": 8, "weirder": 8, "hab": 8, "hfc": 8, "hfi": 8, "exists_deriv_eq_zero": 8, "differentiableon": 8, "exists_deriv_eq_slop": 8, "normedaddcommgroup": 8, "norm_add_l": 8, "infer_inst": 8, "normed_spac": 8, "normed_add_group": 8, "stipul": 8, "normedspac": 8, "norm_smul": 8, "banach": 8, "dimension": 8, "finitedimension": 8, "\ud835\udd5c": 8, "nontriviallynormedfield": 8, "normedfield": 8, "exists_one_lt_norm": 8, "nondiscret": 8, "continuouslinearmap": 8, "cont": 8, "map_smul": 8, "le_op_norm": 8, "hmp": 8, "op_norm_le_bound": 8, "steinhau": 8, "bounded": 8, "uniformli": 8, "nonempty_interior_of_union_of_clos": 8, "continuous_linear_map": 8, "op_norm_le_of_shel": 8, "interior_subset": 8, "interior_inter_subset": 8, "is_closed_l": 8, "hc": 8, "h\u03b5": 8, "real_norm_l": 8, "\u03b5k_po": 8, "o": 8, "normedgroup": 8, "isbigowith": 8, "isbigowith_iff": 8, "isbigo_iff_isbigowith": 8, "islittleo_iff_forall_isbigowith": 8, "has_fderiv_at": 8, "fderiv": 8, "fr\u00e9chet": 8, "hasfderivat": 8, "hff": 8, "iter": 8, "multilinear": 8, "with_top": 8, "infti": 8, "cont_diff": 8, "iteratedfderiv": 8, "withtop": 8, "contdiff": 8, "contdiff_iff_continuous_differenti": 8, "stricter": 8, "has_strict_fderiv_at": 8, "\ud835\udd42": 8, "isrorc": 8, "contdiffat": 8, "hasstrictfderivat": 8, "localinvers": 8, "eventually_left_invers": 8, "eventually_right_invers": 8, "to_localinvers": 8, "hasfderivwithinat": 8, "hasfderivatfilt": 8, "overview": 11, "converg": 11, "schr\u00f6der": 11, "bernstein": 11, "irrat": 11, "differenti": 11}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"introduct": 0, "get": 0, "start": 0, "overview": 0, "basic": [1, 6], "calcul": 1, "prove": 1, "ident": 1, "algebra": [1, 5], "structur": [1, 5], "us": 1, "theorem": [1, 3], "lemma": 1, "more": 1, "order": 1, "divis": 1, "fact": 1, "about": 1, "logic": 2, "implic": 2, "univers": 2, "quantifi": 2, "The": [2, 3], "existenti": 2, "negat": 2, "conjunct": 2, "bi": 2, "disjunct": 2, "sequenc": 2, "converg": [2, 7], "set": [3, 7], "function": [3, 7], "schr\u00f6der": 3, "bernstein": 3, "number": 4, "theori": [4, 9], "irrat": 4, "root": 4, "induct": 4, "recurs": 4, "infinit": 4, "mani": 4, "prime": 4, "defin": 5, "build": 5, "gaussian": 5, "integ": 5, "hierarchi": 6, "morphism": 6, "sub": 6, "object": 6, "topologi": 7, "filter": 7, "metric": 7, "space": [7, 8], "continu": [7, 8], "ball": 7, "open": 7, "close": 7, "compact": 7, "uniformli": 7, "complet": 7, "topolog": 7, "fundament": 7, "separ": 7, "countabl": 7, "differenti": 8, "calculu": 8, "elementari": 8, "norm": 8, "linear": 8, "map": 8, "asymptot": 8, "comparison": 8, "integr": 9, "measur": 9, "index": 10, "mathemat": 11, "lean": 11}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"Introduction": [[0, "introduction"]], "Getting Started": [[0, "getting-started"]], "Overview": [[0, "overview"]], "Basics": [[1, "basics"], [6, "basics"]], "Calculating": [[1, "calculating"]], "Proving Identities in Algebraic Structures": [[1, "proving-identities-in-algebraic-structures"]], "Using Theorems and Lemmas": [[1, "using-theorems-and-lemmas"]], "More on Order and Divisibility": [[1, "more-on-order-and-divisibility"]], "Proving Facts about Algebraic Structures": [[1, "proving-facts-about-algebraic-structures"]], "Logic": [[2, "logic"]], "Implication and the Universal Quantifier": [[2, "implication-and-the-universal-quantifier"]], "The Existential Quantifier": [[2, "the-existential-quantifier"]], "Negation": [[2, "negation"]], "Conjunction and Bi-implication": [[2, "conjunction-and-bi-implication"]], "Disjunction": [[2, "disjunction"]], "Sequences and Convergence": [[2, "sequences-and-convergence"]], "Sets and Functions": [[3, "sets-and-functions"]], "Sets": [[3, "sets"]], "Functions": [[3, "functions"]], "The Schr\u00f6der-Bernstein Theorem": [[3, "the-schroder-bernstein-theorem"]], "Number Theory": [[4, "number-theory"]], "Irrational Roots": [[4, "irrational-roots"]], "Induction and Recursion": [[4, "induction-and-recursion"], [4, "id2"]], "Infinitely Many Primes": [[4, "infinitely-many-primes"]], "Structures": [[5, "structures"]], "Defining structures": [[5, "defining-structures"]], "Algebraic Structures": [[5, "algebraic-structures"]], "Building the Gaussian Integers": [[5, "building-the-gaussian-integers"]], "Hierarchies": [[6, "hierarchies"]], "Morphisms": [[6, "morphisms"]], "Sub-objects": [[6, "sub-objects"]], "Topology": [[7, "index-0"]], "Filters": [[7, "filters"]], "Metric spaces": [[7, "metric-spaces"]], "Convergence and continuity": [[7, "convergence-and-continuity"]], "Balls, open sets and closed sets": [[7, "balls-open-sets-and-closed-sets"]], "Compactness": [[7, "compactness"], [7, "id5"]], "Uniformly continuous functions": [[7, "uniformly-continuous-functions"]], "Completeness": [[7, "completeness"]], "Topological spaces": [[7, "topological-spaces"]], "Fundamentals": [[7, "fundamentals"]], "Separation and countability": [[7, "separation-and-countability"]], "Differential Calculus": [[8, "index-0"]], "Elementary Differential Calculus": [[8, "elementary-differential-calculus"]], "Differential Calculus in Normed Spaces": [[8, "differential-calculus-in-normed-spaces"]], "Normed spaces": [[8, "id3"]], "Continuous linear maps": [[8, "continuous-linear-maps"]], "Asymptotic comparisons": [[8, "asymptotic-comparisons"]], "Differentiability": [[8, "differentiability"]], "Integration and Measure Theory": [[9, "index-0"]], "Index": [[10, "index"]], "Mathematics in Lean": [[11, "mathematics-in-lean"]]}, "indexentries": {"check": [[0, "index-0"]], "commands": [[0, "index-0"]], "abel": [[1, "index-14"]], "absolute value": [[1, "index-23"]], "apply": [[1, "index-16"]], "calc": [[1, "index-3"]], "command": [[1, "index-9"]], "commutative ring": [[1, "index-8"]], "definitional equality": [[1, "index-12"]], "divisibility": [[1, "index-24"]], "exact": [[1, "index-5"]], "exponential": [[1, "index-18"]], "gcd": [[1, "index-25"]], "goal": [[1, "index-2"]], "group": [[1, "index-14"]], "group (algebraic structure)": [[1, "index-13"]], "group (tactic)": [[1, "index-14"]], "have": [[1, "index-11"], [2, "index-12"]], "implicit argument": [[1, "index-10"]], "inequalities": [[1, "index-15"]], "lattice": [[1, "index-27"]], "lcm": [[1, "index-25"]], "linarith": [[1, "index-17"]], "local context": [[1, "index-2"]], "logarithm": [[1, "index-18"]], "max": [[1, "index-20"]], "metric space": [[1, "index-28"], [7, "index-2"]], "min": [[1, "index-20"]], "namespace": [[1, "index-9"]], "noncomm_ring": [[1, "index-14"]], "norm_num": [[1, "index-19"]], "open": [[1, "index-9"]], "order relation": [[1, "index-26"]], "partial order": [[1, "index-26"]], "proof state": [[1, "index-2"]], "real numbers": [[1, "index-1"]], "refl and reflexivity": [[1, "index-12"]], "reflexivity": [[1, "index-12"]], "repeat": [[1, "index-22"]], "rewrite": [[1, "index-0"]], "rfl": [[1, "index-12"]], "ring": [[1, "index-6"]], "ring (algebraic structure)": [[1, "index-7"]], "ring (tactic)": [[1, "index-6"]], "rw": [[1, "index-0"], [1, "index-4"]], "rw and rewrite": [[1, "index-0"], [1, "index-4"]], "show": [[1, "index-21"]], "tactics": [[1, "index-0"], [1, "index-11"], [1, "index-12"], [1, "index-14"], [1, "index-16"], [1, "index-17"], [1, "index-19"], [1, "index-21"], [1, "index-22"], [1, "index-3"], [1, "index-4"], [1, "index-5"], [1, "index-6"], [2, "index-0"], [2, "index-12"], [2, "index-13"], [2, "index-14"], [2, "index-15"], [2, "index-16"], [2, "index-17"], [2, "index-18"], [2, "index-19"], [2, "index-2"], [2, "index-20"], [2, "index-21"], [2, "index-23"], [2, "index-24"], [2, "index-25"], [2, "index-26"], [2, "index-4"], [2, "index-6"], [2, "index-8"], [2, "index-9"], [3, "index-1"], [3, "index-2"], [7, "index-3"]], "absurd": [[2, "index-17"]], "anonymous constructor": [[2, "index-7"]], "assumption": [[2, "index-19"]], "by_cases": [[2, "index-23"]], "by_contra": [[2, "index-14"]], "by_contra and by_contradiction": [[2, "index-14"]], "cases": [[2, "index-8"]], "change": [[2, "index-2"]], "congr": [[2, "index-25"]], "constructor": [[2, "index-18"]], "contradiction": [[2, "index-17"]], "contrapose": [[2, "index-16"]], "convert": [[2, "index-26"]], "dsimp": [[2, "index-2"]], "erw": [[2, "index-4"]], "excluded middle": [[2, "index-22"]], "exfalso": [[2, "index-17"]], "ext": [[2, "index-24"]], "extensionality": [[2, "index-24"]], "field_simp": [[2, "index-11"]], "from": [[2, "index-12"]], "injective function": [[2, "index-5"]], "intro": [[2, "index-0"]], "lambda abstraction": [[2, "index-1"]], "left": [[2, "index-21"]], "let": [[2, "index-13"]], "monotone function": [[2, "index-3"]], "push_neg": [[2, "index-15"]], "rcases": [[2, "index-9"]], "right": [[2, "index-21"]], "rintro": [[2, "index-9"]], "simp": [[2, "index-20"], [3, "index-1"]], "surjective function": [[2, "index-10"]], "tactic": [[2, "index-11"]], "this": [[2, "index-12"]], "use": [[2, "index-6"]], "bounded quantifiers": [[3, "index-3"]], "rwa": [[3, "index-2"]], "set operations": [[3, "index-0"]], "filter": [[7, "index-1"]], "continuity": [[7, "index-3"]], "topological space": [[7, "index-4"]], "topology": [[7, "index-0"]], "differential calculus": [[8, "index-0"]], "elementary calculus": [[8, "index-1"]], "normed space": [[8, "index-2"]], "integration": [[9, "index-0"]]}})
-
-
-
@@ -4,7 +4,7 @@[{"git": {"url": "https://github.com/leanprover-community/mathlib4", "subDir?": null, "rev": "311c241339518f68f44f2c7ecb3df0e7bdc64853", "rev": "2db7650f98b1ea3543e48b6b02aa9112e33bb68b", "name": "mathlib", "inputRev?": "master"}}, {"git":
-
-
lake-packages/Qq (deleted)
-
@@ -1,1 +0,0 @@Subproject commit c71f94e34c1cda52eef5c93dc9da409ab2727420
-
-
lake-packages/aesop (deleted)
-
@@ -1,1 +0,0 @@Subproject commit 38bcf8b9e564d23bad55cbfa3c770f135f926d98
-
-
lake-packages/mathlib (deleted)
-
@@ -1,1 +0,0 @@Subproject commit 52d71ad9606cf755e2437cfedfbcc89ce8f2b86a
-
-
lake-packages/std (deleted)
-
@@ -1,1 +0,0 @@Subproject commit b886042255d5e93b8d0adb780d49b1c8f3482fbb
-
-
-
-
@@ -184,3 +184,9 @@ endend example (a b c : ℕ) (h : a + b = c) : (a + b) * (a + b) = a * c + b * c := begin nth_rewrite 1 h, rw add_mul end
-
-
-
@@ -0,0 +1,194 @@import data.int.basic import ring_theory.principal_ideal_domain import tactic @[ext] structure gaussint := (re : ℤ) (im : ℤ) namespace gaussint instance : has_zero gaussint := ⟨⟨0, 0⟩⟩ instance : has_one gaussint := ⟨⟨1, 0⟩⟩ instance : has_add gaussint := ⟨λ x y, ⟨x.re + y.re, x.im + y.im⟩⟩ instance : has_neg gaussint := ⟨λ x, ⟨-x.re, -x.im⟩⟩ instance : has_mul gaussint := ⟨λ x y, ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussint) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussint) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussint) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussint) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussint) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussint).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussint).im = 0 := rfl @[simp] theorem one_re : (1 : gaussint).re = 1 := rfl @[simp] theorem one_im : (1 : gaussint).im = 0 := rfl @[simp] theorem add_re (x y : gaussint) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussint) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussint) : (-x).re = - x.re := rfl @[simp] theorem neg_im (x : gaussint) : (-x).im = - x.im := rfl @[simp] theorem mul_re (x y : gaussint) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussint) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance : comm_ring gaussint := { zero := 0, one := 1, add := (+), neg := λ x, -x, mul := (*), add_assoc := by { intros, ext; simp; ring }, zero_add := by { intros, ext; simp }, add_zero := by { intros, ext; simp }, add_left_neg := by { intros, ext; simp }, add_comm := by { intros, ext; simp; ring }, mul_assoc := by { intros, ext; simp; ring }, one_mul := by { intros, ext; simp }, mul_one := by { intros, ext; simp }, left_distrib := by { intros, ext; simp; ring }, right_distrib := by { intros, ext; simp; ring }, mul_comm := by { intros, ext; simp; ring } } instance : nontrivial gaussint := by { use [0, 1], rw [ne, gaussint.ext_iff], simp } end gaussint example (a b : ℤ) : a = b * (a / b) + a % b := eq.symm $ int.div_add_mod a b example (a b : ℤ) : b ≠ 0 → 0 ≤ a % b := int.mod_nonneg a example (a b : ℤ) : b ≠ 0 → a % b < abs b := int.mod_lt a namespace int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := begin rw [div', mod'], linarith [int.div_add_mod (a + b / 2) b], end theorem abs_mod'_le (a b : ℤ) (h : 0 < b): abs (mod' a b) ≤ b / 2 := begin rw [mod', abs_le], split, { linarith [int.mod_nonneg (a + b / 2) h.ne'] }, have := int.mod_lt_of_pos (a + b / 2) h, have := int.div_add_mod b 2, have := int.mod_lt_of_pos b zero_lt_two, linarith end theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end int theorem sq_add_sq_eq_zero {α : Type*} [linear_ordered_ring α] (x y : α) : x^2 + y^2 = 0 ↔ x = 0 ∧ y = 0 := sorry namespace gaussint def norm (x : gaussint) := x.re^2 + x.im^2 @[simp] theorem norm_nonneg (x : gaussint) : 0 ≤ norm x := sorry theorem norm_eq_zero (x : gaussint) : norm x = 0 ↔ x = 0 := sorry theorem norm_pos (x : gaussint) : 0 < norm x ↔ x ≠ 0 := sorry theorem norm_mul (x y : gaussint) : norm (x * y) = norm x * norm y := sorry def conj (x : gaussint) : gaussint := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussint) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussint) : (conj x).im = - x.im := rfl theorem norm_conj (x : gaussint) : norm (conj x) = norm x := by { simp [norm] } instance : has_div gaussint := ⟨λ x y, ⟨int.div' (x * conj y).re (norm y), int.div' (x * conj y).im (norm y)⟩⟩ instance : has_mod gaussint := ⟨λ x y, x - y * (x / y)⟩ theorem div_def (x y : gaussint) : x / y = ⟨int.div' (x * conj y).re (norm y), int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussint) : x % y = x - y * (x / y) := rfl lemma norm_mod_lt (x : gaussint) {y : gaussint} (hy : y ≠ 0) : (x % y).norm < y.norm := begin have norm_y_pos : 0 < norm y, by rwa [norm_pos], have : (x % y) * conj y = ⟨int.mod' (x * conj y).re (norm y), int.mod' (x * conj y).im (norm y)⟩, { rw [mod_def, sub_mul, int.mod'_eq, int.mod'_eq, sub_eq_add_neg, norm, div_def], ext; simp; ring }, have : norm (x % y) * norm y ≤ (norm y / 2) * norm y, { conv { to_lhs, rw [←norm_conj y, ←norm_mul, this, norm] }, simp, transitivity 2 * (y.norm / 2)^2, { rw [two_mul], apply add_le_add; { rw [sq_le_sq], apply le_trans (int.abs_mod'_le _ _ norm_y_pos), apply le_abs_self } }, rw [pow_two, ←mul_assoc, mul_comm, mul_comm (2 : ℤ)], apply mul_le_mul_of_nonneg_left _ _, { apply int.div_mul_le, norm_num }, apply int.div_nonneg (norm_nonneg y), norm_num }, have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos, apply lt_of_le_of_lt this, apply int.div_lt_of_lt_mul, { norm_num }, linarith end lemma coe_nat_abs_norm (x : gaussint) : (x.norm.nat_abs : ℤ) = x.norm := int.nat_abs_of_nonneg (norm_nonneg _) lemma nat_abs_norm_mod_lt (x y : gaussint) (hy : y ≠ 0) : (x % y).norm.nat_abs < y.norm.nat_abs := begin apply int.coe_nat_lt.1, simp, exact int.nat_abs_lt_nat_abs_of_nonneg_of_lt (norm_nonneg _) (norm_mod_lt x hy) end lemma not_norm_mul_left_lt_norm (x : gaussint) {y : gaussint} (hy : y ≠ 0) : ¬ (norm (x * y)).nat_abs < (norm x).nat_abs := begin apply not_lt_of_ge, rw [norm_mul, int.nat_abs_mul], apply le_mul_of_one_le_right (nat.zero_le _), apply int.coe_nat_le.1, rw [coe_nat_abs_norm], exact int.add_one_le_of_lt ((norm_pos _).mpr hy) end instance : euclidean_domain gaussint := { quotient := (/), remainder := (%), quotient_mul_add_remainder_eq := λ x y, by {rw [mod_def, add_comm, sub_add_cancel] }, quotient_zero := λ x, by { simp [div_def, norm, int.div'], refl }, r := measure (int.nat_abs ∘ norm), r_well_founded := measure_wf (int.nat_abs ∘ norm), remainder_lt := nat_abs_norm_mod_lt, mul_left_not_lt := not_norm_mul_left_lt_norm, .. gaussint.comm_ring } example (x : gaussint) : irreducible x ↔ prime x := principal_ideal_ring.irreducible_iff_prime end gaussint
-
-
-
@@ -0,0 +1,206 @@import data.int.basic import ring_theory.principal_ideal_domain import tactic @[ext] structure gaussint := (re : ℤ) (im : ℤ) namespace gaussint instance : has_zero gaussint := ⟨⟨0, 0⟩⟩ instance : has_one gaussint := ⟨⟨1, 0⟩⟩ instance : has_add gaussint := ⟨λ x y, ⟨x.re + y.re, x.im + y.im⟩⟩ instance : has_neg gaussint := ⟨λ x, ⟨-x.re, -x.im⟩⟩ instance : has_mul gaussint := ⟨λ x y, ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussint) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussint) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussint) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussint) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussint) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussint).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussint).im = 0 := rfl @[simp] theorem one_re : (1 : gaussint).re = 1 := rfl @[simp] theorem one_im : (1 : gaussint).im = 0 := rfl @[simp] theorem add_re (x y : gaussint) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussint) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussint) : (-x).re = - x.re := rfl @[simp] theorem neg_im (x : gaussint) : (-x).im = - x.im := rfl @[simp] theorem mul_re (x y : gaussint) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussint) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance : comm_ring gaussint := { zero := 0, one := 1, add := (+), neg := λ x, -x, mul := (*), add_assoc := by { intros, ext; simp; ring }, zero_add := by { intros, ext; simp }, add_zero := by { intros, ext; simp }, add_left_neg := by { intros, ext; simp }, add_comm := by { intros, ext; simp; ring }, mul_assoc := by { intros, ext; simp; ring }, one_mul := by { intros, ext; simp }, mul_one := by { intros, ext; simp }, left_distrib := by { intros, ext; simp; ring }, right_distrib := by { intros, ext; simp; ring }, mul_comm := by { intros, ext; simp; ring } } instance : nontrivial gaussint := by { use [0, 1], rw [ne, gaussint.ext_iff], simp } end gaussint namespace int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := begin rw [div', mod'], linarith [int.div_add_mod (a + b / 2) b], end theorem abs_mod'_le (a b : ℤ) (h : 0 < b): abs (mod' a b) ≤ b / 2 := begin rw [mod', abs_le], split, { linarith [int.mod_nonneg (a + b / 2) h.ne'] }, have := int.mod_lt_of_pos (a + b / 2) h, have := int.div_add_mod b 2, have := int.mod_lt_of_pos b zero_lt_two, linarith end theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end int private theorem aux {α : Type*} [linear_ordered_ring α] {x y : α} (h : x^2 + y^2 = 0) : x = 0 := begin have h' : x^2 = 0, { apply le_antisymm _ (sq_nonneg x), rw ←h, apply le_add_of_nonneg_right (sq_nonneg y) }, exact pow_eq_zero h' end theorem sq_add_sq_eq_zero {α : Type*} [linear_ordered_ring α] (x y : α) : x^2 + y^2 = 0 ↔ x = 0 ∧ y = 0 := begin split, { intro h, split, { exact aux h }, rw add_comm at h, exact aux h }, rintros ⟨rfl, rfl⟩, norm_num end namespace gaussint def norm (x : gaussint) := x.re^2 + x.im^2 @[simp] theorem norm_nonneg (x : gaussint) : 0 ≤ norm x := by { apply add_nonneg; apply sq_nonneg } theorem norm_eq_zero (x : gaussint) : norm x = 0 ↔ x = 0 := by { rw [norm, sq_add_sq_eq_zero, gaussint.ext_iff], refl } theorem norm_pos (x : gaussint) : 0 < norm x ↔ x ≠ 0 := by { rw [lt_iff_le_and_ne, ne_comm, ne, norm_eq_zero], simp [norm_nonneg] } theorem norm_mul (x y : gaussint) : norm (x * y) = norm x * norm y := by { simp [norm], ring } def conj (x : gaussint) : gaussint := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussint) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussint) : (conj x).im = - x.im := rfl theorem norm_conj (x : gaussint) : norm (conj x) = norm x := by { simp [norm] } instance : has_div gaussint := ⟨λ x y, ⟨int.div' (x * conj y).re (norm y), int.div' (x * conj y).im (norm y)⟩⟩ instance : has_mod gaussint := ⟨λ x y, x - y * (x / y)⟩ theorem div_def (x y : gaussint) : x / y = ⟨int.div' (x * conj y).re (norm y), int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussint) : x % y = x - y * (x / y) := rfl lemma norm_mod_lt (x : gaussint) {y : gaussint} (hy : y ≠ 0) : (x % y).norm < y.norm := begin have norm_y_pos : 0 < norm y, by rwa [norm_pos], have : (x % y) * conj y = ⟨int.mod' (x * conj y).re (norm y), int.mod' (x * conj y).im (norm y)⟩, { rw [mod_def, sub_mul, int.mod'_eq, int.mod'_eq, sub_eq_add_neg, norm, div_def], ext; simp; ring }, have : norm (x % y) * norm y ≤ (norm y / 2) * norm y, { conv { to_lhs, rw [←norm_conj y, ←norm_mul, this, norm] }, simp, transitivity 2 * (y.norm / 2)^2, { rw [two_mul], apply add_le_add; { rw [sq_le_sq], apply le_trans (int.abs_mod'_le _ _ norm_y_pos), apply le_abs_self } }, rw [pow_two, ←mul_assoc, mul_comm, mul_comm (2 : ℤ)], apply mul_le_mul_of_nonneg_left _ _, { apply int.div_mul_le, norm_num }, apply int.div_nonneg (norm_nonneg y), norm_num }, have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos, apply lt_of_le_of_lt this, apply int.div_lt_of_lt_mul, { norm_num }, linarith end lemma coe_nat_abs_norm (x : gaussint) : (x.norm.nat_abs : ℤ) = x.norm := int.nat_abs_of_nonneg (norm_nonneg _) lemma nat_abs_norm_mod_lt (x y : gaussint) (hy : y ≠ 0) : (x % y).norm.nat_abs < y.norm.nat_abs := begin apply int.coe_nat_lt.1, simp, exact int.nat_abs_lt_nat_abs_of_nonneg_of_lt (norm_nonneg _) (norm_mod_lt x hy) end lemma not_norm_mul_left_lt_norm (x : gaussint) {y : gaussint} (hy : y ≠ 0) : ¬ (norm (x * y)).nat_abs < (norm x).nat_abs := begin apply not_lt_of_ge, rw [norm_mul, int.nat_abs_mul], apply le_mul_of_one_le_right (nat.zero_le _), apply int.coe_nat_le.1, rw [coe_nat_abs_norm], exact int.add_one_le_of_lt ((norm_pos _).mpr hy) end instance : euclidean_domain gaussint := { quotient := (/), remainder := (%), quotient_mul_add_remainder_eq := λ x y, by {rw [mod_def, add_comm, sub_add_cancel] }, quotient_zero := λ x, by { simp [div_def, norm, int.div'], refl }, r := measure (int.nat_abs ∘ norm), r_well_founded := measure_wf (int.nat_abs ∘ norm), remainder_lt := nat_abs_norm_mod_lt, mul_left_not_lt := not_norm_mul_left_lt_norm, .. gaussint.comm_ring } example (x : gaussint) : irreducible x ↔ prime x := principal_ideal_ring.irreducible_iff_prime end gaussint
-
-
-
@@ -164,36 +164,6 @@ example {X : Type*} [metric_space X] [compact_space X] {Y : Type*} [metric_spacesorry -- SOLUTIONs: example {X : Type*} [metric_space X] [compact_space X] {Y : Type*} [metric_space Y] {f : X → Y} (hf : continuous f) : uniform_continuous f := begin rw metric.uniform_continuous_iff, intros ε ε_pos, let φ : X × X → ℝ := λ p, dist (f p.1) (f p.2), have φ_cont : continuous φ := hf.fst'.dist hf.snd', let K := { p : X × X | ε ≤ φ p }, have K_closed : is_closed K := is_closed_le continuous_const φ_cont, have K_cpct : is_compact K := K_closed.is_compact, cases eq_empty_or_nonempty K with hK hK, { use [1, by norm_num], intros x y hxy, have : (x, y) ∉ K, by simp [hK], simpa [K] }, { rcases K_cpct.exists_forall_le hK continuous_dist.continuous_on with ⟨⟨x₀, x₁⟩, xx_in, H⟩, use dist x₀ x₁, split, { change _ < _, rw dist_pos, intro h, have : ε ≤ 0, by simpa [*] using xx_in, linarith }, { intros x x', contrapose!, intros hxx', exact H (x, x') hxx' } }, end example (u : ℕ → X) : cauchy_seq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε :=
-
-
-
@@ -0,0 +1,200 @@import topology.instances.real import analysis.normed_space.banach_steinhaus open set filter open_locale topological_space filter section variables {X : Type*} [topological_space X] example : is_open (univ : set X) := is_open_univ example : is_open (∅ : set X) := is_open_empty example {ι : Type*} {s : ι → set X} (hs : ∀ i, is_open $ s i) : is_open (⋃ i, s i) := is_open_Union hs example {ι : Type*} [fintype ι] {s : ι → set X} (hs : ∀ i, is_open $ s i) : is_open (⋂ i, s i) := is_open_Inter hs variables {Y : Type*} [topological_space Y] example {f : X → Y} : continuous f ↔ ∀ s, is_open s → is_open (f ⁻¹' s) := continuous_def example {f : X → Y} {x : X} : continuous_at f x ↔ map f (𝓝 x) ≤ 𝓝 (f x) := iff.rfl example {f : X → Y} {x : X} : continuous_at f x ↔ ∀ U ∈ 𝓝 (f x), ∀ᶠ x in 𝓝 x, f x ∈ U := iff.rfl example {x : X} {s : set X} : s ∈ 𝓝 x ↔ ∃ t ⊆ s, is_open t ∧ x ∈ t := mem_nhds_iff example (x : X) : pure x ≤ 𝓝 x := pure_le_nhds x example (x : X) (P : X → Prop) (h : ∀ᶠ y in 𝓝 x, P y) : P x := pure_le_nhds x h example {P : X → Prop} {x : X} (h : ∀ᶠ y in 𝓝 x, P y) : ∀ᶠ y in 𝓝 x, ∀ᶠ z in 𝓝 y, P z := eventually_eventually_nhds.mpr h #check topological_space.mk_of_nhds #check topological_space.nhds_mk_of_nhds. example {α : Type*} (n : α → filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → (∀ᶠ y in n a, ∀ᶠ x in n y, p x)) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := sorry end -- BOTH. variables {X Y : Type*} example (f : X → Y) : topological_space X → topological_space Y := topological_space.coinduced f example (f : X → Y) : topological_space Y → topological_space X := topological_space.induced f example (f : X → Y) (T_X : topological_space X) (T_Y : topological_space Y) : topological_space.coinduced f T_X ≤ T_Y ↔ T_X ≤ topological_space.induced f T_Y := coinduced_le_iff_le_induced #check coinduced_compose #check induced_compose. example {T T' : topological_space X} : T ≤ T' ↔ ∀ s, T'.is_open s → T.is_open s := iff.rfl example (T_X : topological_space X) (T_Y : topological_space Y) (f : X → Y) : continuous f ↔ topological_space.coinduced f T_X ≤ T_Y := continuous_iff_coinduced_le example {Z : Type*} (f : X → Y) (T_X : topological_space X) (T_Z : topological_space Z) (g : Y → Z) : @continuous Y Z (topological_space.coinduced f T_X) T_Z g ↔ @continuous X Z T_X T_Z (g ∘ f) := by rw [continuous_iff_coinduced_le, coinduced_compose, continuous_iff_coinduced_le] example (ι : Type*) (X : ι → Type*) (T_X : Π i, topological_space $ X i) : (Pi.topological_space : topological_space (Π i, X i)) = ⨅ i, topological_space.induced (λ x, x i) (T_X i) := rfl example [topological_space X] [t2_space X] {u : ℕ → X} {a b : X} (ha : tendsto u at_top (𝓝 a)) (hb : tendsto u at_top (𝓝 b)) : a = b := tendsto_nhds_unique ha hb example [topological_space X] [regular_space X] (a : X) : (𝓝 a).has_basis (λ (s : set X), s ∈ 𝓝 a ∧ is_closed s) id := closed_nhds_basis a example [topological_space X] {x : X} : (𝓝 x).has_basis (λ t : set X, t ∈ 𝓝 x ∧ is_open t) id := nhds_basis_opens' x lemma aux {X Y A : Type*} [topological_space X] {c : A → X} {f : A → Y} {x : X} {F : filter Y} (h : tendsto f (comap c (𝓝 x)) F) {V' : set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, is_open V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := sorry example [topological_space X] [topological_space Y] [regular_space Y] {A : set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : continuous f) (hf : ∀ x : X, ∃ c : Y, tendsto f (comap coe $ 𝓝 x) $ 𝓝 c) : ∃ φ : X → Y, continuous φ ∧ ∀ a : A, φ a = f a := sorry example [topological_space X] [topological_space.first_countable_topology X] {s : set X} {a : X} : a ∈ closure s ↔ ∃ (u : ℕ → X), (∀ n, u n ∈ s) ∧ tendsto u at_top (𝓝 a) := mem_closure_iff_seq_limit variables [topological_space X] example {F : filter X} {x : X} : cluster_pt x F ↔ ne_bot (𝓝 x ⊓ F) := iff.rfl example {s : set X} : is_compact s ↔ ∀ (F : filter X) [ne_bot F], F ≤ 𝓟 s → ∃ a ∈ s, cluster_pt a F := iff.rfl example [topological_space.first_countable_topology X] {s : set X} {u : ℕ → X} (hs : is_compact s) (hu : ∀ n, u n ∈ s) : ∃ (a ∈ s) (φ : ℕ → ℕ), strict_mono φ ∧ tendsto (u ∘ φ) at_top (𝓝 a) := hs.tendsto_subseq hu variables [topological_space Y] example {x : X} {F : filter X} {G : filter Y} (H : cluster_pt x F) {f : X → Y} (hfx : continuous_at f x) (hf : tendsto f F G) : cluster_pt (f x) G := cluster_pt.map H hfx hf example [topological_space Y] {f : X → Y} (hf : continuous f) {s : set X} (hs : is_compact s) : is_compact (f '' s) := begin intros F F_ne F_le, have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F, { sorry }, haveI Hne : (𝓟 s ⊓ comap f F).ne_bot, { sorry }, have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s, from inf_le_left, sorry end example {ι : Type*} {s : set X} (hs : is_compact s) (U : ι → set X) (hUo : ∀ i, is_open (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : finset ι, s ⊆ ⋃ i ∈ t, U i := hs.elim_finite_subcover U hUo hsU example [compact_space X] : is_compact (univ : set X) := compact_univ
-
-
-
@@ -4,10 +4,120 @@ import analysis.normed_space.banach_steinhausopen set filter open_locale topological_space filter variables {X : Type*} [metric_space X] (a b c : X) #check (dist a b : ℝ) #check (dist_nonneg : 0 ≤ dist a b) #check (dist_eq_zero : dist a b = 0 ↔ a = b) #check (dist_comm a b : dist a b = dist b a) #check (dist_triangle a b c : dist a c ≤ dist a b + dist b c) -- Note the next three lines are not quoted, their purpose is to make sure those things don't get renamed while we're looking elsewhere. #check emetric_space #check pseudo_metric_space #check pseudo_emetric_space example {u : ℕ → X} {a : X} : tendsto u at_top (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) a < ε := metric.tendsto_at_top example {X Y : Type*} [metric_space X] [metric_space Y] {f : X → Y} : continuous f ↔ ∀ x : X, ∀ ε > 0, ∃ δ > 0, ∀ x', dist x' x < δ → dist (f x') (f x) < ε := metric.continuous_iff example {X Y : Type*} [metric_space X] [metric_space Y] {f : X → Y} (hf : continuous f) : continuous (λ p : X × X, dist (f p.1) (f p.2)) := by continuity example {X Y : Type*} [metric_space X] [metric_space Y] {f : X → Y} (hf : continuous f) : continuous (λ p : X × X, dist (f p.1) (f p.2)) := continuous_dist.comp ((hf.comp continuous_fst).prod_mk (hf.comp continuous_snd)) example {X Y : Type*} [metric_space X] [metric_space Y] {f : X → Y} (hf : continuous f) : continuous (λ p : X × X, dist (f p.1) (f p.2)) := begin apply continuous.dist, exact hf.comp continuous_fst, exact hf.comp continuous_snd end example {X Y : Type*} [metric_space X] [metric_space Y] {f : X → Y} (hf : continuous f) : continuous (λ p : X × X, dist (f p.1) (f p.2)) := (hf.comp continuous_fst).dist (hf.comp continuous_snd) example {X Y : Type*} [metric_space X] [metric_space Y] {f : X → Y} (hf : continuous f) : continuous (λ p : X × X, dist (f p.1) (f p.2)) := hf.fst'.dist hf.snd' example {f : ℝ → X} (hf : continuous f) : continuous (λ x : ℝ, f (x^2 + x)) := sorry example {f : ℝ → X} (hf : continuous f) : continuous (λ x : ℝ, f (x^2 + x)) := hf.comp $ (continuous_pow 2).add continuous_id example {X Y : Type*} [metric_space X] [metric_space Y] (f : X → Y) (a : X) : continuous_at f a ↔ ∀ ε > 0, ∃ δ > 0, ∀ {x}, dist x a < δ → dist (f x) (f a) < ε := metric.continuous_at_iff variables r : ℝ example : metric.ball a r = {b | dist b a < r} := rfl example : metric.closed_ball a r = {b | dist b a ≤ r} := rfl example (hr : 0 < r) : a ∈ metric.ball a r := metric.mem_ball_self hr example (hr : 0 ≤ r) : a ∈ metric.closed_ball a r := metric.mem_closed_ball_self hr example (s : set X) : is_open s ↔ ∀ x ∈ s, ∃ ε > 0, metric.ball x ε ⊆ s := metric.is_open_iff example {s : set X} : is_closed s ↔ is_open sᶜ := is_open_compl_iff.symm example {s : set X} (hs : is_closed s) {u : ℕ → X} (hu : tendsto u at_top (𝓝 a)) (hus : ∀ n, u n ∈ s) : a ∈ s := hs.mem_of_tendsto hu (eventually_of_forall hus) example {s : set X} : a ∈ closure s ↔ ∀ ε > 0, ∃ b ∈ s, a ∈ metric.ball b ε := metric.mem_closure_iff example {u : ℕ → X} (hu : tendsto u at_top (𝓝 a)) {s : set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := sorry example {u : ℕ → X} (hu : tendsto u at_top (𝓝 a)) {s : set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := begin
-
@@ -21,6 +131,121 @@ beginend example {x : X} {s : set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, metric.ball x ε ⊆ s := metric.nhds_basis_ball.mem_iff example {x : X} {s : set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, metric.closed_ball x ε ⊆ s := metric.nhds_basis_closed_ball.mem_iff example : is_compact (set.Icc 0 1 : set ℝ) := is_compact_Icc example {s : set X} (hs : is_compact s) {u : ℕ → X} (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, strict_mono φ ∧ tendsto (u ∘ φ) at_top (𝓝 a) := hs.tendsto_subseq hu example {s : set X} (hs : is_compact s) (hs' : s.nonempty) {f : X → ℝ} (hfs : continuous_on f s) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y := hs.exists_forall_le hs' hfs example {s : set X} (hs : is_compact s) (hs' : s.nonempty) {f : X → ℝ} (hfs : continuous_on f s) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x := hs.exists_forall_ge hs' hfs example {s : set X} (hs : is_compact s) : is_closed s := hs.is_closed example {X : Type*} [metric_space X] [compact_space X] : is_compact (univ : set X) := compact_univ #check is_compact.is_closed example {X : Type*} [metric_space X] {Y : Type*} [metric_space Y] {f : X → Y} : uniform_continuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : X}, dist a b < δ → dist (f a) (f b) < ε := metric.uniform_continuous_iff example {X : Type*} [metric_space X] [compact_space X] {Y : Type*} [metric_space Y] {f : X → Y} (hf : continuous f) : uniform_continuous f := sorry example {X : Type*} [metric_space X] [compact_space X] {Y : Type*} [metric_space Y] {f : X → Y} (hf : continuous f) : uniform_continuous f := begin rw metric.uniform_continuous_iff, intros ε ε_pos, let φ : X × X → ℝ := λ p, dist (f p.1) (f p.2), have φ_cont : continuous φ := hf.fst'.dist hf.snd', let K := { p : X × X | ε ≤ φ p }, have K_closed : is_closed K := is_closed_le continuous_const φ_cont, have K_cpct : is_compact K := K_closed.is_compact, cases eq_empty_or_nonempty K with hK hK, { use [1, by norm_num], intros x y hxy, have : (x, y) ∉ K, by simp [hK], simpa [K] }, { rcases K_cpct.exists_forall_le hK continuous_dist.continuous_on with ⟨⟨x₀, x₁⟩, xx_in, H⟩, use dist x₀ x₁, split, { change _ < _, rw dist_pos, intro h, have : ε ≤ 0, by simpa [*] using xx_in, linarith }, { intros x x', contrapose!, intros hxx', exact H (x, x') hxx' } }, end example (u : ℕ → X) : cauchy_seq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := metric.cauchy_seq_iff example (u : ℕ → X) : cauchy_seq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, dist (u n) (u N) < ε := metric.cauchy_seq_iff' example [complete_space X] (u : ℕ → X) (hu : cauchy_seq u) : ∃ x, tendsto u at_top (𝓝 x) := cauchy_seq_tendsto_of_complete hu open_locale big_operators open finset lemma cauchy_seq_of_le_geometric_two' {u : ℕ → X} (hu : ∀ (n : ℕ), dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : cauchy_seq u := begin rw metric.cauchy_seq_iff', intros ε ε_pos, obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε, { sorry }, use N, intros n hn, obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn, calc dist (u (N + k)) (u N) = dist (u (N+0)) (u (N + k)) : sorry ... ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) : sorry ... ≤ ∑ i in range k, (1/2 : ℝ)^(N+i) : sorry ... = 1/2^N*∑ i in range k, (1 / 2) ^ i : sorry ... ≤ 1/2^N*2 : sorry ... < ε : sorry end example {u : ℕ → X} (hu : ∀ (n : ℕ), dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : cauchy_seq u := begin
-
@@ -46,6 +271,55 @@ begin... < ε : hN end open metric example [complete_space X] (f : ℕ → set X) (ho : ∀ n, is_open (f n)) (hd : ∀ n, dense (f n)) : dense (⋂n, f n) := begin let B : ℕ → ℝ := λ n, (1/2)^n, have Bpos : ∀ n, 0 < B n, sorry, /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closed_ball center radius` is included both in `f n` and in `closed_ball x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X) (δ > 0), ∃ (y : X) (r > 0), r ≤ B (n+1) ∧ closed_ball y r ⊆ (closed_ball x δ) ∩ f n, { sorry }, choose! center radius Hpos HB Hball using this, intros x, rw mem_closure_iff_nhds_basis nhds_basis_closed_ball, intros ε εpos, /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closed_ball (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → (X × ℝ) := λn, nat.rec_on n (prod.mk x (min ε (B 0))) (λn p, prod.mk (center n p.1 p.2) (radius n p.1 p.2)), let c : ℕ → X := λ n, (F n).1, let r : ℕ → ℝ := λ n, (F n).2, have rpos : ∀ n, 0 < r n, { sorry }, have rB : ∀n, r n ≤ B n, { sorry }, have incl : ∀n, closed_ball (c (n+1)) (r (n+1)) ⊆ (closed_ball (c n) (r n)) ∩ (f n), { sorry }, have cdist : ∀ n, dist (c n) (c (n+1)) ≤ B n, { sorry }, have : cauchy_seq c, from cauchy_seq_of_le_geometric_two' cdist, -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchy_seq_tendsto_of_complete this with ⟨y, ylim⟩, -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y, have I : ∀n, ∀ m ≥ n, closed_ball (c m) (r m) ⊆ closed_ball (c n) (r n), { sorry }, have yball : ∀n, y ∈ closed_ball (c n) (r n), { sorry }, sorry end example [complete_space X] (f : ℕ → set X) (ho : ∀ n, is_open (f n)) (hd : ∀ n, dense (f n)) : dense (⋂n, f n) := begin let B : ℕ → ℝ := λ n, (1/2)^n,
-
@@ -133,3 +407,4 @@ begin... ≤ ε : min_le_left _ _, end
-
-
-
@@ -0,0 +1,263 @@import topology.instances.real import analysis.normed_space.banach_steinhaus open set filter open_locale topological_space filter section variables {X : Type*} [topological_space X] example : is_open (univ : set X) := is_open_univ example : is_open (∅ : set X) := is_open_empty example {ι : Type*} {s : ι → set X} (hs : ∀ i, is_open $ s i) : is_open (⋃ i, s i) := is_open_Union hs example {ι : Type*} [fintype ι] {s : ι → set X} (hs : ∀ i, is_open $ s i) : is_open (⋂ i, s i) := is_open_Inter hs variables {Y : Type*} [topological_space Y] example {f : X → Y} : continuous f ↔ ∀ s, is_open s → is_open (f ⁻¹' s) := continuous_def example {f : X → Y} {x : X} : continuous_at f x ↔ map f (𝓝 x) ≤ 𝓝 (f x) := iff.rfl example {f : X → Y} {x : X} : continuous_at f x ↔ ∀ U ∈ 𝓝 (f x), ∀ᶠ x in 𝓝 x, f x ∈ U := iff.rfl example {x : X} {s : set X} : s ∈ 𝓝 x ↔ ∃ t ⊆ s, is_open t ∧ x ∈ t := mem_nhds_iff example (x : X) : pure x ≤ 𝓝 x := pure_le_nhds x example (x : X) (P : X → Prop) (h : ∀ᶠ y in 𝓝 x, P y) : P x := pure_le_nhds x h example {P : X → Prop} {x : X} (h : ∀ᶠ y in 𝓝 x, P y) : ∀ᶠ y in 𝓝 x, ∀ᶠ z in 𝓝 y, P z := eventually_eventually_nhds.mpr h #check topological_space.mk_of_nhds #check topological_space.nhds_mk_of_nhds. example {α : Type*} (n : α → filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → (∀ᶠ y in n a, ∀ᶠ x in n y, p x)) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := sorry example {α : Type*} (n : α → filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → (∀ᶠ y in n a, ∀ᶠ x in n y, p x)) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := begin intros a s s_in, refine ⟨{y | s ∈ n y}, H a (λ x, x ∈ s) s_in, _, by tauto⟩, rintros y (hy : s ∈ n y), exact H₀ y hy end end -- BOTH. variables {X Y : Type*} example (f : X → Y) : topological_space X → topological_space Y := topological_space.coinduced f example (f : X → Y) : topological_space Y → topological_space X := topological_space.induced f example (f : X → Y) (T_X : topological_space X) (T_Y : topological_space Y) : topological_space.coinduced f T_X ≤ T_Y ↔ T_X ≤ topological_space.induced f T_Y := coinduced_le_iff_le_induced #check coinduced_compose #check induced_compose. example {T T' : topological_space X} : T ≤ T' ↔ ∀ s, T'.is_open s → T.is_open s := iff.rfl example (T_X : topological_space X) (T_Y : topological_space Y) (f : X → Y) : continuous f ↔ topological_space.coinduced f T_X ≤ T_Y := continuous_iff_coinduced_le example {Z : Type*} (f : X → Y) (T_X : topological_space X) (T_Z : topological_space Z) (g : Y → Z) : @continuous Y Z (topological_space.coinduced f T_X) T_Z g ↔ @continuous X Z T_X T_Z (g ∘ f) := by rw [continuous_iff_coinduced_le, coinduced_compose, continuous_iff_coinduced_le] example (ι : Type*) (X : ι → Type*) (T_X : Π i, topological_space $ X i) : (Pi.topological_space : topological_space (Π i, X i)) = ⨅ i, topological_space.induced (λ x, x i) (T_X i) := rfl example [topological_space X] [t2_space X] {u : ℕ → X} {a b : X} (ha : tendsto u at_top (𝓝 a)) (hb : tendsto u at_top (𝓝 b)) : a = b := tendsto_nhds_unique ha hb example [topological_space X] [regular_space X] (a : X) : (𝓝 a).has_basis (λ (s : set X), s ∈ 𝓝 a ∧ is_closed s) id := closed_nhds_basis a example [topological_space X] {x : X} : (𝓝 x).has_basis (λ t : set X, t ∈ 𝓝 x ∧ is_open t) id := nhds_basis_opens' x lemma aux {X Y A : Type*} [topological_space X] {c : A → X} {f : A → Y} {x : X} {F : filter Y} (h : tendsto f (comap c (𝓝 x)) F) {V' : set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, is_open V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := sorry example {X Y A : Type*} [topological_space X] {c : A → X} {f : A → Y} {x : X} {F : filter Y} (h : tendsto f (comap c (𝓝 x)) F) {V' : set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, is_open V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := begin simpa [and_assoc] using ((nhds_basis_opens' x).comap c).tendsto_left_iff.mp h V' V'_in end example [topological_space X] [topological_space Y] [regular_space Y] {A : set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : continuous f) (hf : ∀ x : X, ∃ c : Y, tendsto f (comap coe $ 𝓝 x) $ 𝓝 c) : ∃ φ : X → Y, continuous φ ∧ ∀ a : A, φ a = f a := sorry example [topological_space X] [topological_space Y] [regular_space Y] {A : set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : continuous f) (hf : ∀ x : X, ∃ c : Y, tendsto f (comap coe $ 𝓝 x) $ 𝓝 c) : ∃ φ : X → Y, continuous φ ∧ ∀ a : A, φ a = f a := begin choose φ hφ using hf, use φ, split, { rw continuous_iff_continuous_at, intros x, suffices : ∀ V' ∈ 𝓝 (φ x), is_closed V' → φ ⁻¹' V' ∈ 𝓝 x, by simpa [continuous_at, (closed_nhds_basis _).tendsto_right_iff], intros V' V'_in V'_closed, obtain ⟨V, V_in, V_op, hV⟩ : ∃ V ∈ 𝓝 x, is_open V ∧ coe ⁻¹' V ⊆ f ⁻¹' V', { exact aux (hφ x) V'_in }, suffices : ∀ y ∈ V, φ y ∈ V', from mem_of_superset V_in this, intros y y_in, have hVx : V ∈ 𝓝 y := V_op.mem_nhds y_in, haveI : (comap (coe : A → X) (𝓝 y)).ne_bot := by simpa [mem_closure_iff_comap_ne_bot] using hA y, apply V'_closed.mem_of_tendsto (hφ y), exact mem_of_superset (preimage_mem_comap hVx) hV }, { intros a, have lim : tendsto f (𝓝 a) (𝓝 $ φ a), by simpa [nhds_induced] using hφ a, exact tendsto_nhds_unique lim f_cont.continuous_at }, end example [topological_space X] [topological_space.first_countable_topology X] {s : set X} {a : X} : a ∈ closure s ↔ ∃ (u : ℕ → X), (∀ n, u n ∈ s) ∧ tendsto u at_top (𝓝 a) := mem_closure_iff_seq_limit variables [topological_space X] example {F : filter X} {x : X} : cluster_pt x F ↔ ne_bot (𝓝 x ⊓ F) := iff.rfl example {s : set X} : is_compact s ↔ ∀ (F : filter X) [ne_bot F], F ≤ 𝓟 s → ∃ a ∈ s, cluster_pt a F := iff.rfl example [topological_space.first_countable_topology X] {s : set X} {u : ℕ → X} (hs : is_compact s) (hu : ∀ n, u n ∈ s) : ∃ (a ∈ s) (φ : ℕ → ℕ), strict_mono φ ∧ tendsto (u ∘ φ) at_top (𝓝 a) := hs.tendsto_subseq hu variables [topological_space Y] example {x : X} {F : filter X} {G : filter Y} (H : cluster_pt x F) {f : X → Y} (hfx : continuous_at f x) (hf : tendsto f F G) : cluster_pt (f x) G := cluster_pt.map H hfx hf example [topological_space Y] {f : X → Y} (hf : continuous f) {s : set X} (hs : is_compact s) : is_compact (f '' s) := begin intros F F_ne F_le, have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F, { sorry }, haveI Hne : (𝓟 s ⊓ comap f F).ne_bot, { sorry }, have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s, from inf_le_left, sorry end example [topological_space Y] {f : X → Y} (hf : continuous f) {s : set X} (hs : is_compact s) : is_compact (f '' s) := begin intros F F_ne F_le, have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F, { rw [filter.push_pull, map_principal] }, haveI Hne : (𝓟 s ⊓ comap f F).ne_bot, { apply ne_bot.of_map, rwa [map_eq, inf_of_le_right F_le] }, have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s, from inf_le_left, rcases hs Hle with ⟨x, x_in, hx⟩, refine ⟨f x, mem_image_of_mem f x_in, _⟩, apply hx.map hf.continuous_at, rw [tendsto, map_eq], exact inf_le_right end example {ι : Type*} {s : set X} (hs : is_compact s) (U : ι → set X) (hUo : ∀ i, is_open (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : finset ι, s ⊆ ⋃ i ∈ t, U i := hs.elim_finite_subcover U hUo hsU example [compact_space X] : is_compact (univ : set X) := compact_univ
-
-
-
@@ -0,0 +1,61 @@import analysis.special_functions.trigonometric.deriv import analysis.calculus.mean_value open set filter open_locale topological_space filter classical real noncomputable theory open real /-- The sin function has derivative 1 at 0. -/ example : has_deriv_at sin 1 0 := by simpa using has_deriv_at_sin 0 example (x : ℝ) : differentiable_at ℝ sin x := (has_deriv_at_sin x).differentiable_at example {f : ℝ → ℝ} {x a : ℝ} (h : has_deriv_at f a x) : deriv f x = a := h.deriv example {f : ℝ → ℝ} {x : ℝ} (h : ¬ differentiable_at ℝ f x) : deriv f x = 0 := deriv_zero_of_not_differentiable_at h example {f g : ℝ → ℝ} {x : ℝ} (hf : differentiable_at ℝ f x) (hg : differentiable_at ℝ g x) : deriv (f + g) x = deriv f x + deriv g x := deriv_add hf hg example {f : ℝ → ℝ} {a : ℝ} (h : is_local_min f a) : deriv f a = 0 := h.deriv_eq_zero example {f : ℝ → ℝ} {a b : ℝ} (hab : a < b) (hfc : continuous_on f (Icc a b)) (hfI : f a = f b) : ∃ c ∈ Ioo a b, deriv f c = 0 := exists_deriv_eq_zero f hab hfc hfI example (f : ℝ → ℝ) {a b : ℝ} (hab : a < b) (hf : continuous_on f (Icc a b)) (hf' : differentiable_on ℝ f (Ioo a b)) : ∃ c ∈ Ioo a b, deriv f c = (f b - f a) / (b - a) := exists_deriv_eq_slope f hab hf hf' example : deriv (λ x : ℝ, x^5) 6 = 5 * 6^4 := by simp example (x₀ : ℝ) (h₀ : x₀ ≠ 0) : deriv (λ x : ℝ, 1 / x) x₀ = -(x₀^2)⁻¹ := by simp example : deriv sin π = -1 := by simp example (x₀ : ℝ) (h : x₀ ≠ 0) : deriv (λ x : ℝ, exp(x^2) / x^5) x₀ = (2 * x₀^2 - 5) * exp (x₀^2) / x₀^6 := begin have : x₀^5 ≠ 0, { exact pow_ne_zero 5 h, }, field_simp, ring, end example (y : ℝ) : has_deriv_at (λ x : ℝ, 2 * x + 5) 2 y := begin have := ((has_deriv_at_id y).const_mul 2).add_const 5, rwa [mul_one] at this, end example (y : ℝ) : deriv (λ x : ℝ, 2 * x + 5) y = 2 := by simp
-
-
-
@@ -0,0 +1,193 @@import analysis.normed_space.banach_steinhaus import analysis.normed_space.finite_dimension import analysis.calculus.inverse open set filter open_locale topological_space filter noncomputable theory section variables {E : Type*} [normed_group E] example (x : E) : 0 ≤ ∥x∥ := norm_nonneg x example {x : E} : ∥x∥ = 0 ↔ x = 0 := norm_eq_zero example (x y : E) : ∥x + y∥ ≤ ∥x∥ + ∥y∥ := norm_add_le x y example : metric_space E := by apply_instance example {X : Type*} [topological_space X] {f : X → E} (hf : continuous f) : continuous (λ x, ∥f x∥) := hf.norm variables [normed_space ℝ E] example (a : ℝ) (x : E) : ∥a • x∥ = |a| * ∥x∥ := norm_smul a x example [finite_dimensional ℝ E] : complete_space E := by apply_instance example (𝕜 : Type*) [nondiscrete_normed_field 𝕜] (x y : 𝕜) : ∥x * y∥ = ∥x∥ * ∥y∥ := norm_mul x y example (𝕜 : Type*) [nondiscrete_normed_field 𝕜] : ∃ x : 𝕜, 1 < ∥x∥ := normed_field.exists_one_lt_norm 𝕜 example (𝕜 : Type*) [nondiscrete_normed_field 𝕜] (E : Type*) [normed_group E] [normed_space 𝕜 E] [complete_space 𝕜] [finite_dimensional 𝕜 E] : complete_space E := finite_dimensional.complete 𝕜 E end section variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜] {E : Type*} [normed_group E] [normed_space 𝕜 E] {F : Type*} [normed_group F] [normed_space 𝕜 F] example : E →L[𝕜] E := continuous_linear_map.id 𝕜 E example (f : E →L[𝕜] F) : E → F := f example (f : E →L[𝕜] F) : continuous f := f.cont example (f : E →L[𝕜] F) (x y : E) : f (x + y) = f x + f y := f.map_add x y example (f : E →L[𝕜] F) (a : 𝕜) (x : E) : f (a • x) = a • f x := f.map_smul a x variables (f : E →L[𝕜] F) example (x : E) : ∥f x∥ ≤ ∥f∥ * ∥x∥ := f.le_op_norm x example {M : ℝ} (hMp: 0 ≤ M) (hM : ∀ x, ∥f x∥ ≤ M * ∥x∥) : ∥f∥ ≤ M := f.op_norm_le_bound hMp hM end section variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜] {E : Type*} [normed_group E] [normed_space 𝕜 E] {F : Type*} [normed_group F] [normed_space 𝕜 F] open metric example {ι : Type*} [complete_space E] {g : ι → E →L[𝕜] F} (h : ∀ x, ∃ C, ∀ i, ∥g i x∥ ≤ C) : ∃ C', ∀ i, ∥g i∥ ≤ C' := begin /- sequence of subsets consisting of those `x : E` with norms `∥g i x∥` bounded by `n` -/ let e : ℕ → set E := λ n, ⋂ i : ι, { x : E | ∥g i x∥ ≤ n }, /- each of these sets is closed -/ have hc : ∀ n : ℕ, is_closed (e n), sorry, /- the union is the entire space; this is where we use `h` -/ have hU : (⋃ n : ℕ, e n) = univ, sorry, /- apply the Baire category theorem to conclude that for some `m : ℕ`, `e m` contains some `x` -/ obtain ⟨m, x, hx⟩ : ∃ m, ∃ x, x ∈ interior (e m) := sorry, obtain ⟨ε, ε_pos, hε⟩ : ∃ ε > 0, ball x ε ⊆ interior (e m) := sorry, obtain ⟨k, hk⟩ : ∃ k : 𝕜, 1 < ∥k∥ := sorry, /- show all elements in the ball have norm bounded by `m` after applying any `g i` -/ have real_norm_le : ∀ (z ∈ ball x ε) (i : ι), ∥g i z∥ ≤ m, sorry, have εk_pos : 0 < ε / ∥k∥ := sorry, refine ⟨(m + m : ℕ) / (ε / ∥k∥), λ i, continuous_linear_map.op_norm_le_of_shell ε_pos _ hk _⟩, sorry, sorry end end open asymptotics open_locale asymptotics example {α : Type*} {E : Type*} [normed_group E] {F : Type*} [normed_group F] (c : ℝ) (l : filter α) (f : α → E) (g : α → F) : is_O_with c l f g ↔ ∀ᶠ x in l, ∥ f x ∥ ≤ c * ∥ g x ∥ := is_O_with_iff example {α : Type*} {E : Type*} [normed_group E] {F : Type*} [normed_group F] (c : ℝ) (l : filter α) (f : α → E) (g : α → F) : f =O[l] g ↔ ∃ C, is_O_with C l f g := is_O_iff_is_O_with example {α : Type*} {E : Type*} [normed_group E] {F : Type*} [normed_group F] (c : ℝ) (l : filter α) (f : α → E) (g : α → F) : f =o[l] g ↔ ∀ C > 0, is_O_with C l f g := is_o_iff_forall_is_O_with example {α : Type*} {E : Type*} [normed_group E] (c : ℝ) (l : filter α) (f g : α → E) : f ~[l] g ↔ (f - g) =o[l] g := iff.rfl section variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜] {E : Type*} [normed_group E] [normed_space 𝕜 E] {F : Type*} [normed_group F] [normed_space 𝕜 F] example (f : E → F) (f' : E →L[𝕜] F) (x₀ : E) : has_fderiv_at f f' x₀ ↔ (λ x, f x - f x₀ - f' (x - x₀)) =o[𝓝 x₀] (λ x, x - x₀) := iff.rfl example (f : E → F) (f' : E →L[𝕜] F) (x₀ : E) (hff' : has_fderiv_at f f' x₀) : fderiv 𝕜 f x₀ = f' := hff'.fderiv example (n : ℕ) (f : E → F) : E → (E [×n]→L[𝕜] F) := iterated_fderiv 𝕜 n f example (n : with_top ℕ) {f : E → F} : cont_diff 𝕜 n f ↔ (∀ (m : ℕ), (m : with_top ℕ) ≤ n → continuous (λ x, iterated_fderiv 𝕜 m f x)) ∧ (∀ (m : ℕ), (m : with_top ℕ) < n → differentiable 𝕜 (λ x, iterated_fderiv 𝕜 m f x)) := cont_diff_iff_continuous_differentiable example {𝕂 : Type*} [is_R_or_C 𝕂] {E : Type*} [normed_group E] [normed_space 𝕂 E] {F : Type*} [normed_group F] [normed_space 𝕂 F] {f : E → F} {x : E} {n : with_top ℕ} (hf : cont_diff_at 𝕂 n f x) (hn : 1 ≤ n) : has_strict_fderiv_at f (fderiv 𝕂 f x) x := hf.has_strict_fderiv_at hn section local_inverse variables [complete_space E] {f : E → F} {f' : E ≃L[𝕜] F} {a : E} example (hf : has_strict_fderiv_at f ↑f' a) : F → E := has_strict_fderiv_at.local_inverse f f' a hf example (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : ∀ᶠ x in 𝓝 a, hf.local_inverse f f' a (f x) = x := hf.eventually_left_inverse example (hf : has_strict_fderiv_at f (f' : E →L[𝕜] F) a) : ∀ᶠ x in 𝓝 (f a), f (hf.local_inverse f f' a x) = x := hf.eventually_right_inverse example [complete_space E] {f : E → F} {f' : E ≃L[𝕜] F} {a : E} (hf : has_strict_fderiv_at f ↑f' a) : has_strict_fderiv_at (has_strict_fderiv_at.local_inverse f f' a hf) (f'.symm : F →L[𝕜] E) (f a) := has_strict_fderiv_at.to_local_inverse hf end local_inverse #check has_fderiv_within_at #check has_fderiv_at_filter end
-
-
-
@@ -0,0 +1,8 @@import analysis.special_functions.trigonometric.deriv import analysis.calculus.mean_value open set filter open_locale topological_space filter classical real noncomputable theory
-
-
src/08_Differential_Calculus/solutions/solutions_02_Differential_Calculus_in_Normed_Spaces.lean (new)
-
@@ -0,0 +1,61 @@import analysis.normed_space.banach_steinhaus import analysis.normed_space.finite_dimension import analysis.calculus.inverse open set filter open_locale topological_space filter noncomputable theory section variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜] {E : Type*} [normed_group E] [normed_space 𝕜 E] {F : Type*} [normed_group F] [normed_space 𝕜 F] open metric example {ι : Type*} [complete_space E] {g : ι → E →L[𝕜] F} (h : ∀ x, ∃ C, ∀ i, ∥g i x∥ ≤ C) : ∃ C', ∀ i, ∥g i∥ ≤ C' := begin /- sequence of subsets consisting of those `x : E` with norms `∥g i x∥` bounded by `n` -/ let e : ℕ → set E := λ n, ⋂ i : ι, { x : E | ∥g i x∥ ≤ n }, /- each of these sets is closed -/ have hc : ∀ n : ℕ, is_closed (e n), from λ i, is_closed_Inter (λ i, is_closed_le (g i).cont.norm continuous_const), /- the union is the entire space; this is where we use `h` -/ have hU : (⋃ n : ℕ, e n) = univ, { refine eq_univ_of_forall (λ x, _), cases h x with C hC, obtain ⟨m, hm⟩ := exists_nat_ge C, exact ⟨e m, mem_range_self m, mem_Inter.mpr (λ i, le_trans (hC i) hm)⟩ }, /- apply the Baire category theorem to conclude that for some `m : ℕ`, `e m` contains some `x` -/ obtain ⟨m : ℕ, x : E, hx : x ∈ interior (e m)⟩ := nonempty_interior_of_Union_of_closed hc hU, obtain ⟨ε, ε_pos, hε : ball x ε ⊆ interior (e m)⟩ := is_open_iff.mp is_open_interior x hx, obtain ⟨k : 𝕜, hk : 1 < ∥k∥⟩ := normed_field.exists_one_lt_norm 𝕜, /- show all elements in the ball have norm bounded by `m` after applying any `g i` -/ have real_norm_le : ∀ (z ∈ ball x ε) (i : ι), ∥g i z∥ ≤ m, { intros z hz i, replace hz := mem_Inter.mp (interior_Inter_subset _ (hε hz)) i, apply interior_subset hz }, have εk_pos : 0 < ε / ∥k∥ := div_pos ε_pos (zero_lt_one.trans hk), refine ⟨(m + m : ℕ) / (ε / ∥k∥), λ i, continuous_linear_map.op_norm_le_of_shell ε_pos _ hk _⟩, { exact div_nonneg (nat.cast_nonneg _) εk_pos.le }, intros y le_y y_lt, calc ∥g i y∥ = ∥g i (y + x) - g i x∥ : by rw [(g i).map_add, add_sub_cancel] ... ≤ ∥g i (y + x)∥ + ∥g i x∥ : norm_sub_le _ _ ... ≤ m + m : add_le_add (real_norm_le (y + x) (by rwa [add_comm, add_mem_ball_iff_norm]) i) (real_norm_le x (mem_ball_self ε_pos) i) ... = (m + m : ℕ) : by norm_cast ... ≤ (m + m : ℕ) * (∥y∥ / (ε / ∥k∥)) : le_mul_of_one_le_right (nat.cast_nonneg _) ((one_le_div $ div_pos ε_pos (zero_lt_one.trans hk)).2 le_y) ... = (m + m : ℕ) / (ε / ∥k∥) * ∥y∥ : (mul_comm_div _ _ _).symm, end end
-
-
-
@@ -0,0 +1,35 @@import measure_theory.integral.interval_integral import analysis.special_functions.integrals import analysis.convolution open set filter open_locale topological_space filter noncomputable theory open measure_theory interval_integral open_locale interval -- this introduces the notation [a, b] example (a b : ℝ): ∫ x in a..b, x = (b ^ 2 - a ^ 2) / 2 := integral_id example {a b : ℝ} (h : (0:ℝ) ∉ [a, b]) : ∫ x in a..b, 1/x = real.log (b / a) := integral_one_div h example (f : ℝ → ℝ) (hf : continuous f) (a b : ℝ) : deriv (λ u, ∫ (x : ℝ) in a..u, f x) b = f b := (integral_has_strict_deriv_at_right (hf.interval_integrable _ _) (hf.strongly_measurable_at_filter _ _) hf.continuous_at).has_deriv_at.deriv example {f : ℝ → ℝ} {a b : ℝ} {f' : ℝ → ℝ} (h : ∀ x ∈ [a, b], has_deriv_at f (f' x) x) (h' : interval_integrable f' volume a b) : ∫ y in a..b, f' y = f b - f a := integral_eq_sub_of_has_deriv_at h h' open_locale convolution example (f : ℝ → ℝ) (g : ℝ → ℝ) : f ⋆ g = λ x, ∫ t, (f t) * (g (x - t)) := rfl
-
-
-
@@ -0,0 +1,52 @@import analysis.normed_space.finite_dimension import analysis.convolution import measure_theory.function.jacobian import measure_theory.integral.bochner import measure_theory.measure.lebesgue open set filter open_locale topological_space filter ennreal noncomputable theory variables {α : Type*} [measurable_space α] example : measurable_set (∅ : set α) := measurable_set.empty example : measurable_set (univ : set α) := measurable_set.univ example {s : set α} (hs : measurable_set s) : measurable_set sᶜ := hs.compl example : encodable ℕ := by apply_instance example (n : ℕ) : encodable (fin n) := by apply_instance variables {ι : Type*} [encodable ι] example {f : ι → set α} (h : ∀ b, measurable_set (f b)) : measurable_set (⋃ b, f b) := measurable_set.Union h example {f : ι → set α} (h : ∀ b, measurable_set (f b)) : measurable_set (⋂ b, f b) := measurable_set.Inter h open measure_theory variables {μ : measure α} example (s : set α) : μ s = ⨅ t (st : s ⊆ t) (ht : measurable_set t), μ t := measure_eq_infi s example (s : ι → set α) : μ (⋃ i, s i) ≤ ∑' i, μ (s i) := measure_Union_le s example {f : ℕ → set α} (hmeas : ∀ i, measurable_set (f i)) (hdis : pairwise (disjoint on f)) : μ (⋃ i, f i) = ∑' i, μ (f i) := μ.m_Union hmeas hdis example {P : α → Prop} : (∀ᵐ x ∂μ, P x) ↔ ∀ᶠ x in μ.ae, P x := iff.rfl
-
-
-
@@ -0,0 +1,68 @@import analysis.normed_space.finite_dimension import analysis.convolution import measure_theory.function.jacobian import measure_theory.integral.bochner import measure_theory.measure.lebesgue open set filter open_locale topological_space filter ennreal open measure_theory noncomputable theory variables {α : Type*} [measurable_space α] variables {μ : measure α} section variables {E : Type*} [normed_group E] [normed_space ℝ E] [complete_space E] {f : α → E} example {f g : α → E} (hf : integrable f μ) (hg : integrable g μ) : ∫ a, f a + g a ∂μ = ∫ a, f a ∂μ + ∫ a, g a ∂μ := integral_add hf hg example {s : set α} (c : E) : ∫ x in s, c ∂μ = (μ s).to_real • c := set_integral_const c example {F : ℕ → α → E} {f : α → E} (bound : α → ℝ) (hmeas : ∀ n, ae_strongly_measurable (F n) μ) (hint : integrable bound μ) (hbound : ∀ n, ∀ᵐ a ∂μ, ∥F n a∥ ≤ bound a) (hlim : ∀ᵐ a ∂μ, tendsto (λ (n : ℕ), F n a) at_top (𝓝 (f a))) : tendsto (λ n, ∫ a, F n a ∂μ) at_top (𝓝 (∫ a, f a ∂μ)) := tendsto_integral_of_dominated_convergence bound hmeas hint hbound hlim example {α : Type*} [measurable_space α] {μ : measure α} [sigma_finite μ] {β : Type*} [measurable_space β] {ν : measure β} [sigma_finite ν] (f : α × β → E) (hf : integrable f (μ.prod ν)) : ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := integral_prod f hf end section open_locale convolution variables {𝕜 : Type*} {G : Type*} {E : Type*} {E' : Type*} {F : Type*} [normed_group E] [normed_group E'] [normed_group F] [nondiscrete_normed_field 𝕜] [normed_space 𝕜 E] [normed_space 𝕜 E'] [normed_space 𝕜 F] [measurable_space G] [normed_space ℝ F] [complete_space F] [has_sub G] example (f : G → E) (g : G → E') (L : E →L[𝕜] E' →L[𝕜] F) (μ : measure G) : f ⋆[L, μ] g = λ x, ∫ t, L (f t) (g (x - t)) ∂μ := rfl end example {E : Type*} [normed_group E] [normed_space ℝ E] [finite_dimensional ℝ E] [measurable_space E] [borel_space E] (μ : measure E) [μ.is_add_haar_measure] {F : Type*}[normed_group F] [normed_space ℝ F] [complete_space F] {s : set E} {f : E → E} {f' : E → (E →L[ℝ] E)} (hs : measurable_set s) (hf : ∀ (x : E), x ∈ s → has_fderiv_within_at f (f' x) s x) (h_inj : inj_on f s) (g : E → F) : ∫ x in f '' s, g x ∂μ = ∫ x in s, |(f' x).det| • g (f x) ∂μ := integral_image_eq_integral_abs_det_fderiv_smul μ hs hf h_inj g
-
-
-
@@ -0,0 +1,9 @@import measure_theory.integral.interval_integral import analysis.special_functions.integrals import analysis.convolution open set filter open_locale topological_space filter noncomputable theory
-
-
-
@@ -0,0 +1,18 @@import analysis.normed_space.finite_dimension import analysis.convolution import measure_theory.function.jacobian import measure_theory.integral.bochner import measure_theory.measure.lebesgue open set filter open_locale topological_space filter ennreal noncomputable theory variables {α : Type*} [measurable_space α] variables {ι : Type*} [encodable ι] open measure_theory variables {μ : measure α}
-
-
-
@@ -0,0 +1,15 @@import analysis.normed_space.finite_dimension import analysis.convolution import measure_theory.function.jacobian import measure_theory.integral.bochner import measure_theory.measure.lebesgue open set filter open_locale topological_space filter ennreal open measure_theory noncomputable theory variables {α : Type*} [measurable_space α] variables {μ : measure α}
-
-
-
@@ -1,224 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic namespace C06S01 noncomputable section @[ext] structure Point where x : ℝ y : ℝ z : ℝ #check Point.ext example (a b : Point) (hx : a.x = b.x) (hy : a.y = b.y) (hz : a.z = b.z) : a = b := by ext repeat' assumption def myPoint1 : Point where x := 2 y := -1 z := 4 def myPoint2 : Point := ⟨2, -1, 4⟩ def myPoint3 := Point.mk 2 (-1) 4 structure Point' where build :: x : ℝ y : ℝ z : ℝ #check Point'.build 2 (-1) 4 namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def add' (a b : Point) : Point where x := a.x + b.x y := a.y + b.y z := a.z + b.z #check add myPoint1 myPoint2 #check myPoint1.add myPoint2 end Point #check Point.add myPoint1 myPoint2 #check myPoint1.add myPoint2 namespace Point protected theorem add_comm (a b : Point) : add a b = add b a := by rw [add, add] ext <;> dsimp repeat' apply add_comm example (a b : Point) : add a b = add b a := by simp [add, add_comm] theorem add_x (a b : Point) : (a.add b).x = a.x + b.x := rfl def addAlt : Point → Point → Point | Point.mk x₁ y₁ z₁, Point.mk x₂ y₂ z₂ => ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩ def addAlt' : Point → Point → Point | ⟨x₁, y₁, z₁⟩, ⟨x₂, y₂, z₂⟩ => ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩ theorem addAlt_x (a b : Point) : (a.addAlt b).x = a.x + b.x := by cases a cases b rfl theorem addAlt_comm (a b : Point) : addAlt a b = addAlt b a := by rcases a with ⟨xa, ya, za⟩ rcases b with ⟨xb, yb, zb⟩ rw [addAlt, addAlt] ext <;> dsimp apply add_comm repeat' apply add_comm example (a b : Point) : addAlt a b = addAlt b a := by rcases a with ⟨xa, ya, za⟩ rcases b with ⟨xb, yb, zb⟩ simp [addAlt, add_comm] example : ∀ a b : Point, addAlt a b = addAlt b a := by rintro ⟨xa, ya, za⟩ ⟨xb, yb, zb⟩ simp [addAlt, add_comm] example : ∀ a b : Point, add a b = add b a := fun ⟨xa, ya, za⟩ ⟨xb, yb, zb⟩ => by simp [add, add_comm] protected theorem add_assoc (a b c : Point) : (a.add b).add c = a.add (b.add c) := by sorry def smul (r : ℝ) (a : Point) : Point := sorry theorem smul_distrib (r : ℝ) (a b : Point) : (smul r a).add (smul r b) = smul r (a.add b) := by sorry end Point structure StandardTwoSimplex where x : ℝ y : ℝ z : ℝ x_nonneg : 0 ≤ x y_nonneg : 0 ≤ y z_nonneg : 0 ≤ z sum_eq : x + y + z = 1 namespace StandardTwoSimplex def swapXy (a : StandardTwoSimplex) : StandardTwoSimplex where x := a.y y := a.x z := a.z x_nonneg := a.y_nonneg y_nonneg := a.x_nonneg z_nonneg := a.z_nonneg sum_eq := by rw [add_comm a.y a.x, a.sum_eq] noncomputable section def midpoint (a b : StandardTwoSimplex) : StandardTwoSimplex where x := (a.x + b.x) / 2 y := (a.y + b.y) / 2 z := (a.z + b.z) / 2 x_nonneg := div_nonneg (add_nonneg a.x_nonneg b.x_nonneg) (by norm_num) y_nonneg := div_nonneg (add_nonneg a.y_nonneg b.y_nonneg) (by norm_num) z_nonneg := div_nonneg (add_nonneg a.z_nonneg b.z_nonneg) (by norm_num) sum_eq := by field_simp; linarith [a.sum_eq, b.sum_eq] def weightedAverage (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardTwoSimplex) : StandardTwoSimplex := sorry end end StandardTwoSimplex open BigOperators structure StandardSimplex (n : ℕ) where V : Fin n → ℝ NonNeg : ∀ i : Fin n, 0 ≤ V i sum_eq_one : (∑ i, V i) = 1 namespace StandardSimplex def midpoint (n : ℕ) (a b : StandardSimplex n) : StandardSimplex n where V i := (a.V i + b.V i) / 2 NonNeg := by intro i apply div_nonneg · linarith [a.NonNeg i, b.NonNeg i] norm_num sum_eq_one := by simp [div_eq_mul_inv, ← Finset.sum_mul, Finset.sum_add_distrib, a.sum_eq_one, b.sum_eq_one] field_simp end StandardSimplex structure IsLinear (f : ℝ → ℝ) where is_additive : ∀ x y, f (x + y) = f x + f y preserves_mul : ∀ x c, f (c * x) = c * f x section variable (f : ℝ → ℝ) (linf : IsLinear f) #check linf.is_additive #check linf.preserves_mul end def Point'' := ℝ × ℝ × ℝ def IsLinear' (f : ℝ → ℝ) := (∀ x y, f (x + y) = f x + f y) ∧ ∀ x c, f (c * x) = c * f x def PReal := { y : ℝ // 0 < y } section variable (x : PReal) #check x.val #check x.property #check x.1 #check x.2 end def StandardTwoSimplex' := { p : ℝ × ℝ × ℝ // 0 ≤ p.1 ∧ 0 ≤ p.2.1 ∧ 0 ≤ p.2.2 ∧ p.1 + p.2.1 + p.2.2 = 1 } def StandardSimplex' (n : ℕ) := { v : Fin n → ℝ // (∀ i : Fin n, 0 ≤ v i) ∧ (∑ i, v i) = 1 } def StdSimplex := Σ n : ℕ, StandardSimplex n section variable (s : StdSimplex) #check s.fst #check s.snd #check s.1 #check s.2 end
-
-
-
@@ -1,171 +0,0 @@import Mathlib.Data.Real.Basic namespace C06S02 structure Group₁ (α : Type _) where mul : α → α → α one : α inv : α → α mul_assoc : ∀ x y z : α, mul (mul x y) z = mul x (mul y z) mul_one : ∀ x : α, mul x one = x one_mul : ∀ x : α, mul one x = x mul_left_inv : ∀ x : α, mul (inv x) x = one structure Group₁Cat where α : Type _ str : Group₁ α section variable (α β γ : Type _) variable (f : α ≃ β) (g : β ≃ γ) #check Equiv α β #check (f.toFun : α → β) #check (f.invFun : β → α) #check (f.right_inv : ∀ x : β, f (f.invFun x) = x) #check (f.left_inv : ∀ x : α, f.invFun (f x) = x) #check (Equiv.refl α : α ≃ α) #check (f.symm : β ≃ α) #check (f.trans g : α ≃ γ) example (x : α) : (f.trans g).toFun x = g.toFun (f.toFun x) := rfl example (x : α) : (f.trans g) x = g (f x) := rfl example : (f.trans g : α → γ) = g ∘ f := rfl end example (α : Type _) : Equiv.Perm α = (α ≃ α) := rfl def permGroup {α : Type _} : Group₁ (Equiv.Perm α) where mul f g := Equiv.trans g f one := Equiv.refl α inv := Equiv.symm mul_assoc f g h := (Equiv.trans_assoc _ _ _).symm one_mul := Equiv.trans_refl mul_one := Equiv.refl_trans mul_left_inv := Equiv.self_trans_symm structure AddGroup₁ (α : Type _) where (add : α → α → α) -- fill in the rest @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def neg (a : Point) : Point := sorry def zero : Point := sorry def add_group_point : AddGroup₁ point := sorry end Point section variable {α : Type _} (f g : Equiv.Perm α) (n : ℕ) #check f * g #check mul_assoc f g g⁻¹ -- group power, defined for any group #check g ^ n example : f * g * g⁻¹ = f := by rw [mul_assoc, mul_right_inv, mul_one] example : f * g * g⁻¹ = f := mul_inv_cancel_right f g example {α : Type _} (f g : Equiv.Perm α) : g.symm.trans (g.trans f) = f := mul_inv_cancel_right f g end class Group₂ (α : Type _) where mul : α → α → α one : α inv : α → α mul_assoc : ∀ x y z : α, mul (mul x y) z = mul x (mul y z) mul_one : ∀ x : α, mul x one = x one_mul : ∀ x : α, mul one x = x mul_left_inv : ∀ x : α, mul (inv x) x = one instance {α : Type _} : Group₂ (Equiv.Perm α) where mul f g := Equiv.trans g f one := Equiv.refl α inv := Equiv.symm mul_assoc f g h := (Equiv.trans_assoc _ _ _).symm one_mul := Equiv.trans_refl mul_one := Equiv.refl_trans mul_left_inv := Equiv.self_trans_symm #check @Group₂.mul def mySquare {α : Type _} [Group₂ α] (x : α) := Group₂.mul x x #check @mySquare section variable {β : Type _} (f g : Equiv.Perm β) example : Group₂.mul f g = g.trans f := rfl example : mySquare f = f.trans f := rfl end instance : Inhabited Point where default := ⟨0, 0, 0⟩ #check (default : Point) example : ([] : List Point).headI = default := rfl instance : Add Point where add := Point.add section variable (x y : Point) #check x + y example : x + y = Point.add x y := rfl end instance hasMulGroup₂ {α : Type _} [Group₂ α] : Mul α := ⟨Group₂.mul⟩ instance hasOneGroup₂ {α : Type _} [Group₂ α] : One α := ⟨Group₂.one⟩ instance hasInvGroup₂ {α : Type _} [Group₂ α] : Inv α := ⟨Group₂.inv⟩ section variable {α : Type _} (f g : Equiv.Perm α) #check f * 1 * g⁻¹ def foo : f * 1 * g⁻¹ = g.symm.trans ((Equiv.refl α).trans f) := rfl end class AddGroup₂ (α : Type _) where add : α → α → α -- fill in the rest
-
-
-
@@ -1,276 +0,0 @@import Mathlib.Data.Int.Basic import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Tactic @[ext] structure gaussInt where re : ℤ im : ℤ namespace gaussInt instance : Zero gaussInt := ⟨⟨0, 0⟩⟩ instance : One gaussInt := ⟨⟨1, 0⟩⟩ instance : Add gaussInt := ⟨fun x y => ⟨x.re + y.re, x.im + y.im⟩⟩ instance : Neg gaussInt := ⟨fun x => ⟨-x.re, -x.im⟩⟩ instance : Mul gaussInt := ⟨fun x y => ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussInt) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussInt) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussInt) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussInt) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussInt) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussInt).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussInt).im = 0 := rfl @[simp] theorem one_re : (1 : gaussInt).re = 1 := rfl @[simp] theorem one_im : (1 : gaussInt).im = 0 := rfl @[simp] theorem add_re (x y : gaussInt) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussInt) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussInt) : (-x).re = -x.re := rfl @[simp] theorem neg_im (x : gaussInt) : (-x).im = -x.im := rfl @[simp] theorem mul_re (x y : gaussInt) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussInt) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance instCommRing : CommRing gaussInt where zero := 0 one := 1 add := (· + ·) neg x := -x mul := (· * ·) add_assoc := by intros ext <;> simp <;> ring zero_add := by intro ext <;> simp add_zero := by intro ext <;> simp add_left_neg := by intro ext <;> simp add_comm := by intros ext <;> simp <;> ring mul_assoc := by intros ext <;> simp <;> ring one_mul := by intro ext <;> simp mul_one := by intro ext <;> simp left_distrib := by intros ext <;> simp <;> ring right_distrib := by intros ext <;> simp <;> ring mul_comm := by intros ext <;> simp <;> ring zero_mul := sorry mul_zero := sorry instance : Nontrivial gaussInt := by use 0, 1 rw [Ne, gaussInt.ext_iff] simp end gaussInt example (a b : ℤ) : a = b * (a / b) + a % b := Eq.symm <| Int.ediv_add_emod a b example (a b : ℤ) : b ≠ 0 → 0 ≤ a % b := Int.emod_nonneg a example (a b : ℤ) : b ≠ 0 → a % b < abs b := Int.emod_lt a namespace Int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := by rw [div', mod'] linarith [Int.ediv_add_emod (a + b / 2) b] theorem abs_mod'_le (a b : ℤ) (h : 0 < b) : abs (mod' a b) ≤ b / 2 := by rw [mod', abs_le] constructor · linarith [Int.emod_nonneg (a + b / 2) h.ne'] have := Int.emod_lt_of_pos (a + b / 2) h have := Int.ediv_add_emod b 2 have := Int.emod_lt_of_pos b zero_lt_two revert this; intro this -- FIXME, this should not be needed linarith theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end Int theorem sq_add_sq_eq_zero {α : Type _} [LinearOrderedRing α] (x y : α) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by sorry namespace gaussInt def norm (x : gaussInt) := x.re ^ 2 + x.im ^ 2 @[simp] theorem norm_nonneg (x : gaussInt) : 0 ≤ norm x := by sorry theorem norm_eq_zero (x : gaussInt) : norm x = 0 ↔ x = 0 := by sorry theorem norm_pos (x : gaussInt) : 0 < norm x ↔ x ≠ 0 := by sorry theorem norm_mul (x y : gaussInt) : norm (x * y) = norm x * norm y := by sorry def conj (x : gaussInt) : gaussInt := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussInt) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussInt) : (conj x).im = -x.im := rfl theorem norm_conj (x : gaussInt) : norm (conj x) = norm x := by simp [norm] instance : Div gaussInt := ⟨fun x y => ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩⟩ instance : Mod gaussInt := ⟨fun x y => x - y * (x / y)⟩ theorem div_def (x y : gaussInt) : x / y = ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussInt) : x % y = x - y * (x / y) := rfl theorem norm_mod_lt (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : (x % y).norm < y.norm := by have norm_y_pos : 0 < norm y := by rwa [norm_pos] have : x % y * conj y = ⟨Int.mod' (x * conj y).re (norm y), Int.mod' (x * conj y).im (norm y)⟩ := by rw [mod_def, sub_mul, Int.mod'_eq, Int.mod'_eq, sub_eq_add_neg, div_def, norm] ext <;> simp <;> ring have : norm (x % y) * norm y ≤ norm y / 2 * norm y := by conv => lhs rw [← norm_conj y, ← norm_mul, this, norm] simp trans 2 * (y.norm / 2) ^ 2 · rw [two_mul] apply add_le_add <;> · rw [sq_le_sq] apply le_trans (Int.abs_mod'_le _ _ norm_y_pos) apply le_abs_self rw [pow_two, ← mul_assoc, mul_comm, mul_comm (2 : ℤ)] apply mul_le_mul_of_nonneg_left · apply Int.ediv_mul_le norm_num apply Int.ediv_nonneg (norm_nonneg y) norm_num have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos apply lt_of_le_of_lt this apply Int.ediv_lt_of_lt_mul · norm_num linarith theorem coe_natAbs_norm (x : gaussInt) : (x.norm.natAbs : ℤ) = x.norm := Int.natAbs_of_nonneg (norm_nonneg _) theorem natAbs_norm_mod_lt (x y : gaussInt) (hy : y ≠ 0) : (x % y).norm.natAbs < y.norm.natAbs := by apply Int.ofNat_lt.1 simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg] apply norm_mod_lt x hy theorem not_norm_mul_left_lt_norm (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : ¬(norm (x * y)).natAbs < (norm x).natAbs := by apply not_lt_of_ge rw [norm_mul, Int.natAbs_mul] apply le_mul_of_one_le_right (Nat.zero_le _) apply Int.ofNat_le.1 rw [coe_natAbs_norm] exact Int.add_one_le_of_lt ((norm_pos _).mpr hy) instance : EuclideanDomain gaussInt := { gaussInt.instCommRing with quotient := (· / ·) remainder := (· % ·) quotient_mul_add_remainder_eq := fun x y => by simp only; rw [mod_def, add_comm, sub_add_cancel] quotient_zero := fun x => by simp [div_def, norm, Int.div'] rfl r := Measure (Int.natAbs ∘ norm) r_wellFounded := (measure (Int.natAbs ∘ norm)).2 remainder_lt := natAbs_norm_mod_lt mul_left_not_lt := not_norm_mul_left_lt_norm } example (x : gaussInt) : Irreducible x ↔ Prime x := PrincipalIdealRing.irreducible_iff_prime end gaussInt
-
-
-
@@ -1,99 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic namespace C06S01 noncomputable section @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ protected theorem add_assoc (a b c : Point) : (a.add b).add c = a.add (b.add c) := by simp [add, add_assoc] def smul (r : ℝ) (a : Point) : Point := ⟨r * a.x, r * a.y, r * a.z⟩ theorem smul_distrib (r : ℝ) (a b : Point) : (smul r a).add (smul r b) = smul r (a.add b) := by simp [add, smul, mul_add] end Point structure StandardTwoSimplex where x : ℝ y : ℝ z : ℝ x_nonneg : 0 ≤ x y_nonneg : 0 ≤ y z_nonneg : 0 ≤ z sum_eq : x + y + z = 1 namespace StandardTwoSimplex noncomputable section def weightedAverage (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardTwoSimplex) : StandardTwoSimplex where x := lambda * a.x + (1 - lambda) * b.x y := lambda * a.y + (1 - lambda) * b.y z := lambda * a.z + (1 - lambda) * b.z x_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.x_nonneg) (mul_nonneg (by linarith) b.x_nonneg) y_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.y_nonneg) (mul_nonneg (by linarith) b.y_nonneg) z_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.z_nonneg) (mul_nonneg (by linarith) b.z_nonneg) sum_eq := by trans (a.x + a.y + a.z) * lambda + (b.x + b.y + b.z) * (1 - lambda) · ring simp [a.sum_eq, b.sum_eq] end end StandardTwoSimplex open BigOperators structure StandardSimplex (n : ℕ) where V : Fin n → ℝ NonNeg : ∀ i : Fin n, 0 ≤ V i sum_eq_one : (∑ i, V i) = 1 namespace StandardSimplex def midpoint (n : ℕ) (a b : StandardSimplex n) : StandardSimplex n where V i := (a.V i + b.V i) / 2 NonNeg := by intro i apply div_nonneg · linarith [a.NonNeg i, b.NonNeg i] norm_num sum_eq_one := by simp [div_eq_mul_inv, ← Finset.sum_mul, Finset.sum_add_distrib, a.sum_eq_one, b.sum_eq_one] field_simp end StandardSimplex namespace StandardSimplex def weightedAverage {n : ℕ} (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardSimplex n) : StandardSimplex n where V i := lambda * a.V i + (1 - lambda) * b.V i NonNeg i := add_nonneg (mul_nonneg lambda_nonneg (a.NonNeg i)) (mul_nonneg (by linarith) (b.NonNeg i)) sum_eq_one := by trans (lambda * ∑ i, a.V i) + (1 - lambda) * ∑ i, b.V i · rw [Finset.sum_add_distrib, Finset.mul_sum, Finset.mul_sum] simp [a.sum_eq_one, b.sum_eq_one] end StandardSimplex
-
-
-
@@ -1,74 +0,0 @@import Mathlib.Data.Real.Basic namespace C06S02 structure AddGroup₁ (α : Type _) where add : α → α → α zero : α neg : α → α add_assoc : ∀ x y z : α, add (add x y) z = add x (add y z) add_zero : ∀ x : α, add x zero = x zero_add : ∀ x : α, add x zero = x add_left_neg : ∀ x : α, add (neg x) x = zero @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def neg (a : Point) : Point := ⟨-a.x, -a.y, -a.z⟩ def zero : Point := ⟨0, 0, 0⟩ def addGroupPoint : AddGroup₁ Point where add := Point.add zero := Point.zero neg := Point.neg add_assoc := by simp [Point.add, add_assoc] add_zero := by simp [Point.add, Point.zero] zero_add := by simp [Point.add, Point.zero] add_left_neg := by simp [Point.add, Point.neg, Point.zero] end Point class AddGroup₂ (α : Type _) where add : α → α → α zero : α neg : α → α add_assoc : ∀ x y z : α, add (add x y) z = add x (add y z) add_zero : ∀ x : α, add x zero = x zero_add : ∀ x : α, add x zero = x add_left_neg : ∀ x : α, add (neg x) x = zero instance hasAddAddGroup₂ {α : Type _} [AddGroup₂ α] : Add α := ⟨AddGroup₂.add⟩ instance hasZeroAddGroup₂ {α : Type _} [AddGroup₂ α] : Zero α := ⟨AddGroup₂.zero⟩ instance hasNegAddGroup₂ {α : Type _} [AddGroup₂ α] : Neg α := ⟨AddGroup₂.neg⟩ instance : AddGroup₂ Point where add := Point.add zero := Point.zero neg := Point.neg add_assoc := by simp [Point.add, add_assoc] add_zero := by simp [Point.add, Point.zero] zero_add := by simp [Point.add, Point.zero] add_left_neg := by simp [Point.add, Point.neg, Point.zero] section variable (x y : Point) #check x + -y + 0 end
-
-
-
@@ -1,290 +0,0 @@import Mathlib.Data.Int.Basic import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Tactic @[ext] structure gaussInt where re : ℤ im : ℤ namespace gaussInt instance : Zero gaussInt := ⟨⟨0, 0⟩⟩ instance : One gaussInt := ⟨⟨1, 0⟩⟩ instance : Add gaussInt := ⟨fun x y => ⟨x.re + y.re, x.im + y.im⟩⟩ instance : Neg gaussInt := ⟨fun x => ⟨-x.re, -x.im⟩⟩ instance : Mul gaussInt := ⟨fun x y => ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussInt) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussInt) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussInt) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussInt) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussInt) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussInt).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussInt).im = 0 := rfl @[simp] theorem one_re : (1 : gaussInt).re = 1 := rfl @[simp] theorem one_im : (1 : gaussInt).im = 0 := rfl @[simp] theorem add_re (x y : gaussInt) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussInt) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussInt) : (-x).re = -x.re := rfl @[simp] theorem neg_im (x : gaussInt) : (-x).im = -x.im := rfl @[simp] theorem mul_re (x y : gaussInt) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussInt) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance instCommRing : CommRing gaussInt where zero := 0 one := 1 add := (· + ·) neg x := -x mul := (· * ·) add_assoc := by intros ext <;> simp <;> ring zero_add := by intro ext <;> simp add_zero := by intro ext <;> simp add_left_neg := by intro ext <;> simp add_comm := by intros ext <;> simp <;> ring mul_assoc := by intros ext <;> simp <;> ring one_mul := by intro ext <;> simp mul_one := by intro ext <;> simp left_distrib := by intros ext <;> simp <;> ring right_distrib := by intros ext <;> simp <;> ring mul_comm := by intros ext <;> simp <;> ring zero_mul := sorry mul_zero := sorry instance : Nontrivial gaussInt := by use 0, 1 rw [Ne, gaussInt.ext_iff] simp end gaussInt namespace Int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := by rw [div', mod'] linarith [Int.ediv_add_emod (a + b / 2) b] theorem abs_mod'_le (a b : ℤ) (h : 0 < b) : abs (mod' a b) ≤ b / 2 := by rw [mod', abs_le] constructor · linarith [Int.emod_nonneg (a + b / 2) h.ne'] have := Int.emod_lt_of_pos (a + b / 2) h have := Int.ediv_add_emod b 2 have := Int.emod_lt_of_pos b zero_lt_two revert this; intro this -- FIXME, this should not be needed linarith theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end Int private theorem aux {α : Type _} [LinearOrderedRing α] {x y : α} (h : x ^ 2 + y ^ 2 = 0) : x = 0 := haveI h' : x ^ 2 = 0 := by apply le_antisymm _ (sq_nonneg x) rw [← h] apply le_add_of_nonneg_right (sq_nonneg y) pow_eq_zero h' theorem sq_add_sq_eq_zero {α : Type _} [LinearOrderedRing α] (x y : α) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by constructor · intro h constructor · exact aux h rw [add_comm] at h exact aux h rintro ⟨rfl, rfl⟩ norm_num namespace gaussInt def norm (x : gaussInt) := x.re ^ 2 + x.im ^ 2 @[simp] theorem norm_nonneg (x : gaussInt) : 0 ≤ norm x := by apply add_nonneg <;> apply sq_nonneg theorem norm_eq_zero (x : gaussInt) : norm x = 0 ↔ x = 0 := by rw [norm, sq_add_sq_eq_zero, gaussInt.ext_iff] rfl theorem norm_pos (x : gaussInt) : 0 < norm x ↔ x ≠ 0 := by rw [lt_iff_le_and_ne, ne_comm, Ne, norm_eq_zero] simp [norm_nonneg] theorem norm_mul (x y : gaussInt) : norm (x * y) = norm x * norm y := by simp [norm] ring def conj (x : gaussInt) : gaussInt := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussInt) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussInt) : (conj x).im = -x.im := rfl theorem norm_conj (x : gaussInt) : norm (conj x) = norm x := by simp [norm] instance : Div gaussInt := ⟨fun x y => ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩⟩ instance : Mod gaussInt := ⟨fun x y => x - y * (x / y)⟩ theorem div_def (x y : gaussInt) : x / y = ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussInt) : x % y = x - y * (x / y) := rfl theorem norm_mod_lt (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : (x % y).norm < y.norm := by have norm_y_pos : 0 < norm y := by rwa [norm_pos] have : x % y * conj y = ⟨Int.mod' (x * conj y).re (norm y), Int.mod' (x * conj y).im (norm y)⟩ := by rw [mod_def, sub_mul, Int.mod'_eq, Int.mod'_eq, sub_eq_add_neg, div_def, norm] ext <;> simp <;> ring have : norm (x % y) * norm y ≤ norm y / 2 * norm y := by conv => lhs rw [← norm_conj y, ← norm_mul, this, norm] simp trans 2 * (y.norm / 2) ^ 2 · rw [two_mul] apply add_le_add <;> · rw [sq_le_sq] apply le_trans (Int.abs_mod'_le _ _ norm_y_pos) apply le_abs_self rw [pow_two, ← mul_assoc, mul_comm, mul_comm (2 : ℤ)] apply mul_le_mul_of_nonneg_left · apply Int.ediv_mul_le norm_num apply Int.ediv_nonneg (norm_nonneg y) norm_num have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos apply lt_of_le_of_lt this apply Int.ediv_lt_of_lt_mul · norm_num linarith theorem coe_natAbs_norm (x : gaussInt) : (x.norm.natAbs : ℤ) = x.norm := Int.natAbs_of_nonneg (norm_nonneg _) theorem natAbs_norm_mod_lt (x y : gaussInt) (hy : y ≠ 0) : (x % y).norm.natAbs < y.norm.natAbs := by apply Int.ofNat_lt.1 simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg] apply norm_mod_lt x hy theorem not_norm_mul_left_lt_norm (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : ¬(norm (x * y)).natAbs < (norm x).natAbs := by apply not_lt_of_ge rw [norm_mul, Int.natAbs_mul] apply le_mul_of_one_le_right (Nat.zero_le _) apply Int.ofNat_le.1 rw [coe_natAbs_norm] exact Int.add_one_le_of_lt ((norm_pos _).mpr hy) instance : EuclideanDomain gaussInt := { gaussInt.instCommRing with quotient := (· / ·) remainder := (· % ·) quotient_mul_add_remainder_eq := fun x y => by simp only; rw [mod_def, add_comm, sub_add_cancel] quotient_zero := fun x => by simp [div_def, norm, Int.div'] rfl r := Measure (Int.natAbs ∘ norm) r_wellFounded := (measure (Int.natAbs ∘ norm)).2 remainder_lt := natAbs_norm_mod_lt mul_left_not_lt := not_norm_mul_left_lt_norm } example (x : gaussInt) : Irreducible x ↔ Prime x := PrincipalIdealRing.irreducible_iff_prime end gaussInt
-
-
src/C07_Topology/S01_Filters.lean (deleted)
-
@@ -1,105 +0,0 @@import Mathlib.Topology.Instances.Real open Set Filter Topology def principal {α : Type _} (s : Set α) : Filter α where sets := { t | s ⊆ t } univ_sets := sorry sets_of_superset := sorry inter_sets := sorry example : Filter ℕ := { sets := { s | ∃ a, ∀ b, a ≤ b → b ∈ s } univ_sets := sorry sets_of_superset := sorry inter_sets := sorry } def Tendsto₁ {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) := ∀ V ∈ G, f ⁻¹' V ∈ F def Tendsto₂ {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) := map f F ≤ G example {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) : Tendsto₂ f F G ↔ Tendsto₁ f F G := Iff.rfl #check (@Filter.map_mono : ∀ {α β} {m : α → β}, Monotone (map m)) #check (@Filter.map_map : ∀ {α β γ} {f : Filter α} {m : α → β} {m' : β → γ}, map m' (map m f) = map (m' ∘ m) f) example {X Y Z : Type _} {F : Filter X} {G : Filter Y} {H : Filter Z} {f : X → Y} {g : Y → Z} (hf : Tendsto₁ f F G) (hg : Tendsto₁ g G H) : Tendsto₁ (g ∘ f) F H := sorry variable (f : ℝ → ℝ) (x₀ y₀ : ℝ) #check comap ((↑) : ℚ → ℝ) (𝓝 x₀) #check Tendsto (f ∘ (↑)) (comap ((↑) : ℚ → ℝ) (𝓝 x₀)) (𝓝 y₀) section variable {α β γ : Type _} (F : Filter α) {m : γ → β} {n : β → α} #check (comap_comap : comap m (comap n F) = comap (n ∘ m) F) end example : 𝓝 (x₀, y₀) = 𝓝 x₀ ×ˢ 𝓝 y₀ := nhds_prod_eq #check le_inf_iff example (f : ℕ → ℝ × ℝ) (x₀ y₀ : ℝ) : Tendsto f atTop (𝓝 (x₀, y₀)) ↔ Tendsto (Prod.fst ∘ f) atTop (𝓝 x₀) ∧ Tendsto (Prod.snd ∘ f) atTop (𝓝 y₀) := sorry example (x₀ : ℝ) : HasBasis (𝓝 x₀) (fun ε : ℝ => 0 < ε) fun ε => Ioo (x₀ - ε) (x₀ + ε) := nhds_basis_Ioo_pos x₀ example (u : ℕ → ℝ) (x₀ : ℝ) : Tendsto u atTop (𝓝 x₀) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, u n ∈ Ioo (x₀ - ε) (x₀ + ε) := by have : atTop.HasBasis (fun _ : ℕ => True) Ici := atTop_basis rw [this.tendsto_iff (nhds_basis_Ioo_pos x₀)] simp example (P Q : ℕ → Prop) (hP : ∀ᶠ n in atTop, P n) (hQ : ∀ᶠ n in atTop, Q n) : ∀ᶠ n in atTop, P n ∧ Q n := hP.and hQ example (u v : ℕ → ℝ) (h : ∀ᶠ n in atTop, u n = v n) (x₀ : ℝ) : Tendsto u atTop (𝓝 x₀) ↔ Tendsto v atTop (𝓝 x₀) := tendsto_congr' h example (u v : ℕ → ℝ) (h : u =ᶠ[atTop] v) (x₀ : ℝ) : Tendsto u atTop (𝓝 x₀) ↔ Tendsto v atTop (𝓝 x₀) := tendsto_congr' h #check @eventually_of_forall #check @Eventually.mono #check @Eventually.and example (P Q R : ℕ → Prop) (hP : ∀ᶠ n in atTop, P n) (hQ : ∀ᶠ n in atTop, Q n) (hR : ∀ᶠ n in atTop, P n ∧ Q n → R n) : ∀ᶠ n in atTop, R n := by apply (hP.and (hQ.and hR)).mono rintro n ⟨h, h', h''⟩ exact h'' ⟨h, h'⟩ example (P Q R : ℕ → Prop) (hP : ∀ᶠ n in atTop, P n) (hQ : ∀ᶠ n in atTop, Q n) (hR : ∀ᶠ n in atTop, P n ∧ Q n → R n) : ∀ᶠ n in atTop, R n := by filter_upwards [hP, hQ, hR] intro n h h' h'' exact h'' ⟨h, h'⟩ #check mem_closure_iff_clusterPt #check le_principal_iff #check neBot_of_le example (u : ℕ → ℝ) (M : Set ℝ) (x : ℝ) (hux : Tendsto u atTop (𝓝 x)) (huM : ∀ᶠ n in atTop, u n ∈ M) : x ∈ closure M := sorry
-
-
src/C07_Topology/S02_Metric_Spaces.lean (deleted)
-
@@ -1,206 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter open Topology Filter variable {X : Type _} [MetricSpace X] (a b c : X) #check (dist a b : ℝ) #check (dist_nonneg : 0 ≤ dist a b) #check (dist_eq_zero : dist a b = 0 ↔ a = b) #check (dist_comm a b : dist a b = dist b a) #check (dist_triangle a b c : dist a c ≤ dist a b + dist b c) -- Note the next three lines are not quoted, their purpose is to make sure those things don't get renamed while we're looking elsewhere. #check EMetricSpace #check PseudoMetricSpace #check PseudoEMetricSpace example {u : ℕ → X} {a : X} : Tendsto u atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) a < ε := Metric.tendsto_atTop example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} : Continuous f ↔ ∀ x : X, ∀ ε > 0, ∃ δ > 0, ∀ x', dist x' x < δ → dist (f x') (f x) < ε := Metric.continuous_iff example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by continuity example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := continuous_dist.comp ((hf.comp continuous_fst).prod_mk (hf.comp continuous_snd)) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by apply Continuous.dist exact hf.comp continuous_fst exact hf.comp continuous_snd example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := (hf.comp continuous_fst).dist (hf.comp continuous_snd) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := hf.fst'.dist hf.snd' example {f : ℝ → X} (hf : Continuous f) : Continuous fun x : ℝ => f (x ^ 2 + x) := sorry example {X Y : Type _} [MetricSpace X] [MetricSpace Y] (f : X → Y) (a : X) : ContinuousAt f a ↔ ∀ ε > 0, ∃ δ > 0, ∀ {x}, dist x a < δ → dist (f x) (f a) < ε := Metric.continuousAt_iff variable (r : ℝ) example : Metric.ball a r = { b | dist b a < r } := rfl example : Metric.closedBall a r = { b | dist b a ≤ r } := rfl example (hr : 0 < r) : a ∈ Metric.ball a r := Metric.mem_ball_self hr example (hr : 0 ≤ r) : a ∈ Metric.closedBall a r := Metric.mem_closedBall_self hr example (s : Set X) : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.isOpen_iff example {s : Set X} : IsClosed s ↔ IsOpen (sᶜ) := isOpen_compl_iff.symm example {s : Set X} (hs : IsClosed s) {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) (hus : ∀ n, u n ∈ s) : a ∈ s := hs.mem_of_tendsto hu (eventually_of_forall hus) example {s : Set X} : a ∈ closure s ↔ ∀ ε > 0, ∃ b ∈ s, a ∈ Metric.ball b ε := Metric.mem_closure_iff example {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) {s : Set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := sorry example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.nhds_basis_ball.mem_iff example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.closedBall x ε ⊆ s := Metric.nhds_basis_closedBall.mem_iff example : IsCompact (Set.Icc 0 1 : Set ℝ) := isCompact_Icc example {s : Set X} (hs : IsCompact s) {u : ℕ → X} (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y := hs.exists_forall_le hs' hfs example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x := hs.exists_forall_ge hs' hfs example {s : Set X} (hs : IsCompact s) : IsClosed s := hs.isClosed example {X : Type _} [MetricSpace X] [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ #check IsCompact.isClosed example {X : Type _} [MetricSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} : UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : X}, dist a b < δ → dist (f a) (f b) < ε := Metric.uniformContinuous_iff example {X : Type _} [MetricSpace X] [CompactSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} (hf : Continuous f) : UniformContinuous f := sorry example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := Metric.cauchySeq_iff example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, dist (u n) (u N) < ε := Metric.cauchySeq_iff' example [CompleteSpace X] (u : ℕ → X) (hu : CauchySeq u) : ∃ x, Tendsto u atTop (𝓝 x) := cauchySeq_tendsto_of_complete hu open BigOperators open Finset theorem cauchySeq_of_le_geometric_two' {u : ℕ → X} (hu : ∀ n : ℕ, dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : CauchySeq u := by rw [Metric.cauchySeq_iff'] intro ε ε_pos obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε := by sorry use N intro n hn obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn calc dist (u (N + k)) (u N) = dist (u (N + 0)) (u (N + k)) := sorry _ ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) := sorry _ ≤ ∑ i in range k, (1 / 2 : ℝ) ^ (N + i) := sorry _ = 1 / 2 ^ N * ∑ i in range k, (1 / 2) ^ i := sorry _ ≤ 1 / 2 ^ N * 2 := sorry _ < ε := sorry open Metric example [CompleteSpace X] (f : ℕ → Set X) (ho : ∀ n, IsOpen (f n)) (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := by let B : ℕ → ℝ := fun n => (1 / 2) ^ n have Bpos : ∀ n, 0 < B n sorry /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closedBall center radius` is included both in `f n` and in `closedBall x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X), ∀ δ > 0, ∃ y : X, ∃ r > 0, r ≤ B (n + 1) ∧ closedBall y r ⊆ closedBall x δ ∩ f n := by sorry choose! center radius Hpos HB Hball using this intro x rw [mem_closure_iff_nhds_basis nhds_basis_closedBall] intro ε εpos /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closedBall (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → X × ℝ := fun n => Nat.recOn n (Prod.mk x (min ε (B 0))) fun n p => Prod.mk (center n p.1 p.2) (radius n p.1 p.2) let c : ℕ → X := fun n => (F n).1 let r : ℕ → ℝ := fun n => (F n).2 have rpos : ∀ n, 0 < r n := by sorry have rB : ∀ n, r n ≤ B n := by sorry have incl : ∀ n, closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) ∩ f n := by sorry have cdist : ∀ n, dist (c n) (c (n + 1)) ≤ B n := by sorry have : CauchySeq c := cauchySeq_of_le_geometric_two' cdist -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchySeq_tendsto_of_complete this with ⟨y, ylim⟩ -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y have I : ∀ n, ∀ m ≥ n, closedBall (c m) (r m) ⊆ closedBall (c n) (r n) := by sorry have yball : ∀ n, y ∈ closedBall (c n) (r n) := by sorry sorry
-
-
-
@@ -1,155 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter Topology section variable {X : Type _} [TopologicalSpace X] example : IsOpen (univ : Set X) := isOpen_univ example : IsOpen (∅ : Set X) := isOpen_empty example {ι : Type _} {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋃ i, s i) := isOpen_iUnion hs example {ι : Type _} [Fintype ι] {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋂ i, s i) := isOpen_iInter hs variable {Y : Type _} [TopologicalSpace Y] example {f : X → Y} : Continuous f ↔ ∀ s, IsOpen s → IsOpen (f ⁻¹' s) := continuous_def example {f : X → Y} {x : X} : ContinuousAt f x ↔ map f (𝓝 x) ≤ 𝓝 (f x) := Iff.rfl example {f : X → Y} {x : X} : ContinuousAt f x ↔ ∀ U ∈ 𝓝 (f x), ∀ᶠ x in 𝓝 x, f x ∈ U := Iff.rfl example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ t, t ⊆ s ∧ IsOpen t ∧ x ∈ t := mem_nhds_iff example (x : X) : pure x ≤ 𝓝 x := pure_le_nhds x example (x : X) (P : X → Prop) (h : ∀ᶠ y in 𝓝 x, P y) : P x := pure_le_nhds x h example {P : X → Prop} {x : X} (h : ∀ᶠ y in 𝓝 x, P y) : ∀ᶠ y in 𝓝 x, ∀ᶠ z in 𝓝 y, P z := eventually_eventually_nhds.mpr h #check TopologicalSpace.mkOfNhds #check TopologicalSpace.nhds_mkOfNhds example {α : Type _} (n : α → Filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → ∀ᶠ y in n a, ∀ᶠ x in n y, p x) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := sorry end -- BOTH. variable {X Y : Type _} example (f : X → Y) : TopologicalSpace X → TopologicalSpace Y := TopologicalSpace.coinduced f example (f : X → Y) : TopologicalSpace Y → TopologicalSpace X := TopologicalSpace.induced f example (f : X → Y) (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) : TopologicalSpace.coinduced f T_X ≤ T_Y ↔ T_X ≤ TopologicalSpace.induced f T_Y := coinduced_le_iff_le_induced #check coinduced_compose #check induced_compose example {T T' : TopologicalSpace X} : T ≤ T' ↔ ∀ s, T'.IsOpen s → T.IsOpen s := Iff.rfl example (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) (f : X → Y) : Continuous f ↔ TopologicalSpace.coinduced f T_X ≤ T_Y := continuous_iff_coinduced_le example {Z : Type _} (f : X → Y) (T_X : TopologicalSpace X) (T_Z : TopologicalSpace Z) (g : Y → Z) : @Continuous Y Z (TopologicalSpace.coinduced f T_X) T_Z g ↔ @Continuous X Z T_X T_Z (g ∘ f) := by rw [continuous_iff_coinduced_le, coinduced_compose, continuous_iff_coinduced_le] example (ι : Type _) (X : ι → Type _) (T_X : ∀ i, TopologicalSpace <| X i) : (Pi.topologicalSpace : TopologicalSpace (∀ i, X i)) = ⨅ i, TopologicalSpace.induced (fun x => x i) (T_X i) := rfl example [TopologicalSpace X] [T2Space X] {u : ℕ → X} {a b : X} (ha : Tendsto u atTop (𝓝 a)) (hb : Tendsto u atTop (𝓝 b)) : a = b := tendsto_nhds_unique ha hb example [TopologicalSpace X] [RegularSpace X] (a : X) : (𝓝 a).HasBasis (fun s : Set X => s ∈ 𝓝 a ∧ IsClosed s) id := closed_nhds_basis a example [TopologicalSpace X] {x : X} : (𝓝 x).HasBasis (fun t : Set X => t ∈ 𝓝 x ∧ IsOpen t) id := nhds_basis_opens' x theorem aux {X Y A : Type _} [TopologicalSpace X] {c : A → X} {f : A → Y} {x : X} {F : Filter Y} (h : Tendsto f (comap c (𝓝 x)) F) {V' : Set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, IsOpen V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := sorry example [TopologicalSpace X] [TopologicalSpace Y] [RegularSpace Y] {A : Set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : Continuous f) (hf : ∀ x : X, ∃ c : Y, Tendsto f (comap (↑) <| 𝓝 x) <| 𝓝 c) : ∃ φ : X → Y, Continuous φ ∧ ∀ a : A, φ a = f a := sorry #check @HasBasis.tendsto_right_iff example [TopologicalSpace X] [TopologicalSpace.FirstCountableTopology X] {s : Set X} {a : X} : a ∈ closure s ↔ ∃ u : ℕ → X, (∀ n, u n ∈ s) ∧ Tendsto u atTop (𝓝 a) := mem_closure_iff_seq_limit variable [TopologicalSpace X] example {F : Filter X} {x : X} : ClusterPt x F ↔ NeBot (𝓝 x ⊓ F) := Iff.rfl example {s : Set X} : IsCompact s ↔ ∀ (F : Filter X) [NeBot F], F ≤ 𝓟 s → ∃ a ∈ s, ClusterPt a F := Iff.rfl example [TopologicalSpace.FirstCountableTopology X] {s : Set X} {u : ℕ → X} (hs : IsCompact s) (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu variable [TopologicalSpace Y] example {x : X} {F : Filter X} {G : Filter Y} (H : ClusterPt x F) {f : X → Y} (hfx : ContinuousAt f x) (hf : Tendsto f F G) : ClusterPt (f x) G := ClusterPt.map H hfx hf example [TopologicalSpace Y] {f : X → Y} (hf : Continuous f) {s : Set X} (hs : IsCompact s) : IsCompact (f '' s) := by intro F F_ne F_le have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F := by sorry have Hne : (𝓟 s ⊓ comap f F).NeBot := by sorry have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s := inf_le_left sorry example {ι : Type _} {s : Set X} (hs : IsCompact s) (U : ι → Set X) (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i := hs.elim_finite_subcover U hUo hsU example [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ
-
-
-
@@ -1,71 +0,0 @@import Mathlib.Topology.Instances.Real open Set Filter Topology -- In the next example we could use `tauto` in each proof instead of knowing the lemmas example {α : Type _} (s : Set α) : Filter α := { sets := { t | s ⊆ t } univ_sets := subset_univ s sets_of_superset := fun hU hUV => Subset.trans hU hUV inter_sets := fun hU hV => subset_inter hU hV } example : Filter ℕ := { sets := { s | ∃ a, ∀ b, a ≤ b → b ∈ s } univ_sets := by use 42 simp sets_of_superset := by rintro U V ⟨N, hN⟩ hUV use N tauto inter_sets := by rintro U V ⟨N, hN⟩ ⟨N', hN'⟩ use max N N' intro b hb rw [max_le_iff] at hb constructor <;> tauto } def Tendsto₁ {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) := ∀ V ∈ G, f ⁻¹' V ∈ F example {X Y Z : Type _} {F : Filter X} {G : Filter Y} {H : Filter Z} {f : X → Y} {g : Y → Z} (hf : Tendsto₁ f F G) (hg : Tendsto₁ g G H) : Tendsto₁ (g ∘ f) F H := calc map (g ∘ f) F = map g (map f F) := by rw [map_map] _ ≤ map g G := (map_mono hf) _ ≤ H := hg example {X Y Z : Type _} {F : Filter X} {G : Filter Y} {H : Filter Z} {f : X → Y} {g : Y → Z} (hf : Tendsto₁ f F G) (hg : Tendsto₁ g G H) : Tendsto₁ (g ∘ f) F H := by intro V hV rw [preimage_comp] apply hf apply hg exact hV example (f : ℕ → ℝ × ℝ) (x₀ y₀ : ℝ) : Tendsto f atTop (𝓝 (x₀, y₀)) ↔ Tendsto (Prod.fst ∘ f) atTop (𝓝 x₀) ∧ Tendsto (Prod.snd ∘ f) atTop (𝓝 y₀) := calc Tendsto f atTop (𝓝 (x₀, y₀)) ↔ map f atTop ≤ 𝓝 (x₀, y₀) := Iff.rfl _ ↔ map f atTop ≤ 𝓝 x₀ ×ˢ 𝓝 y₀ := by rw [nhds_prod_eq] _ ↔ map f atTop ≤ comap Prod.fst (𝓝 x₀) ⊓ comap Prod.snd (𝓝 y₀) := Iff.rfl _ ↔ map f atTop ≤ comap Prod.fst (𝓝 x₀) ∧ map f atTop ≤ comap Prod.snd (𝓝 y₀) := le_inf_iff _ ↔ map Prod.fst (map f atTop) ≤ 𝓝 x₀ ∧ map Prod.snd (map f atTop) ≤ 𝓝 y₀ := by rw [← map_le_iff_le_comap, ← map_le_iff_le_comap] _ ↔ map (Prod.fst ∘ f) atTop ≤ 𝓝 x₀ ∧ map (Prod.snd ∘ f) atTop ≤ 𝓝 y₀ := by rw [map_map, map_map] -- an alternative solution example (f : ℕ → ℝ × ℝ) (x₀ y₀ : ℝ) : Tendsto f atTop (𝓝 (x₀, y₀)) ↔ Tendsto (Prod.fst ∘ f) atTop (𝓝 x₀) ∧ Tendsto (Prod.snd ∘ f) atTop (𝓝 y₀) := by rw [nhds_prod_eq] unfold Tendsto SProd.sprod Filter.instSProd Filter.prod erw [le_inf_iff, ← map_le_iff_le_comap, map_map, ← map_le_iff_le_comap, map_map] example (u : ℕ → ℝ) (M : Set ℝ) (x : ℝ) (hux : Tendsto u atTop (𝓝 x)) (huM : ∀ᶠ n in atTop, u n ∈ M) : x ∈ closure M := mem_closure_iff_clusterPt.mpr (neBot_of_le <| le_inf hux <| le_principal_iff.mpr huM)
-
-
-
@@ -1,371 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter open Topology Filter variable {X : Type _} [MetricSpace X] (a b c : X) #check (dist a b : ℝ) #check (dist_nonneg : 0 ≤ dist a b) #check (dist_eq_zero : dist a b = 0 ↔ a = b) #check (dist_comm a b : dist a b = dist b a) #check (dist_triangle a b c : dist a c ≤ dist a b + dist b c) -- Note the next three lines are not quoted, their purpose is to make sure those things don't get renamed while we're looking elsewhere. #check EMetricSpace #check PseudoMetricSpace #check PseudoEMetricSpace example {u : ℕ → X} {a : X} : Tendsto u atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) a < ε := Metric.tendsto_atTop example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} : Continuous f ↔ ∀ x : X, ∀ ε > 0, ∃ δ > 0, ∀ x', dist x' x < δ → dist (f x') (f x) < ε := Metric.continuous_iff example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by continuity example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := continuous_dist.comp ((hf.comp continuous_fst).prod_mk (hf.comp continuous_snd)) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by apply Continuous.dist exact hf.comp continuous_fst exact hf.comp continuous_snd example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := (hf.comp continuous_fst).dist (hf.comp continuous_snd) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := hf.fst'.dist hf.snd' example {f : ℝ → X} (hf : Continuous f) : Continuous fun x : ℝ => f (x ^ 2 + x) := sorry example {f : ℝ → X} (hf : Continuous f) : Continuous fun x : ℝ => f (x ^ 2 + x) := hf.comp <| (continuous_pow 2).add continuous_id example {X Y : Type _} [MetricSpace X] [MetricSpace Y] (f : X → Y) (a : X) : ContinuousAt f a ↔ ∀ ε > 0, ∃ δ > 0, ∀ {x}, dist x a < δ → dist (f x) (f a) < ε := Metric.continuousAt_iff variable (r : ℝ) example : Metric.ball a r = { b | dist b a < r } := rfl example : Metric.closedBall a r = { b | dist b a ≤ r } := rfl example (hr : 0 < r) : a ∈ Metric.ball a r := Metric.mem_ball_self hr example (hr : 0 ≤ r) : a ∈ Metric.closedBall a r := Metric.mem_closedBall_self hr example (s : Set X) : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.isOpen_iff example {s : Set X} : IsClosed s ↔ IsOpen (sᶜ) := isOpen_compl_iff.symm example {s : Set X} (hs : IsClosed s) {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) (hus : ∀ n, u n ∈ s) : a ∈ s := hs.mem_of_tendsto hu (eventually_of_forall hus) example {s : Set X} : a ∈ closure s ↔ ∀ ε > 0, ∃ b ∈ s, a ∈ Metric.ball b ε := Metric.mem_closure_iff example {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) {s : Set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := sorry example {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) {s : Set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := by rw [Metric.tendsto_atTop] at hu rw [Metric.mem_closure_iff] intro ε ε_pos rcases hu ε ε_pos with ⟨N, hN⟩ refine' ⟨u N, hs _, _⟩ rw [dist_comm] exact hN N le_rfl example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.nhds_basis_ball.mem_iff example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.closedBall x ε ⊆ s := Metric.nhds_basis_closedBall.mem_iff example : IsCompact (Set.Icc 0 1 : Set ℝ) := isCompact_Icc example {s : Set X} (hs : IsCompact s) {u : ℕ → X} (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y := hs.exists_forall_le hs' hfs example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x := hs.exists_forall_ge hs' hfs example {s : Set X} (hs : IsCompact s) : IsClosed s := hs.isClosed example {X : Type _} [MetricSpace X] [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ #check IsCompact.isClosed example {X : Type _} [MetricSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} : UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : X}, dist a b < δ → dist (f a) (f b) < ε := Metric.uniformContinuous_iff example {X : Type _} [MetricSpace X] [CompactSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} (hf : Continuous f) : UniformContinuous f := sorry example {X : Type _} [MetricSpace X] [CompactSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} (hf : Continuous f) : UniformContinuous f := by rw [Metric.uniformContinuous_iff] intro ε ε_pos let φ : X × X → ℝ := fun p => dist (f p.1) (f p.2) have φ_cont : Continuous φ := hf.fst'.dist hf.snd' let K := { p : X × X | ε ≤ φ p } have K_closed : IsClosed K := isClosed_le continuous_const φ_cont have K_cpct : IsCompact K := K_closed.isCompact cases' eq_empty_or_nonempty K with hK hK · use 1, by norm_num intro x y _ have : (x, y) ∉ K := by simp [hK] simpa using this · rcases K_cpct.exists_forall_le hK continuous_dist.continuousOn with ⟨⟨x₀, x₁⟩, xx_in, H⟩ use dist x₀ x₁ constructor · change _ < _ rw [dist_pos] intro h have : ε ≤ 0 := by simpa [*] using xx_in linarith · intro x x' contrapose! intro hxx' exact H (x, x') hxx' example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := Metric.cauchySeq_iff example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, dist (u n) (u N) < ε := Metric.cauchySeq_iff' example [CompleteSpace X] (u : ℕ → X) (hu : CauchySeq u) : ∃ x, Tendsto u atTop (𝓝 x) := cauchySeq_tendsto_of_complete hu open BigOperators open Finset theorem cauchySeq_of_le_geometric_two' {u : ℕ → X} (hu : ∀ n : ℕ, dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : CauchySeq u := by rw [Metric.cauchySeq_iff'] intro ε ε_pos obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε := by sorry use N intro n hn obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn calc dist (u (N + k)) (u N) = dist (u (N + 0)) (u (N + k)) := sorry _ ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) := sorry _ ≤ ∑ i in range k, (1 / 2 : ℝ) ^ (N + i) := sorry _ = 1 / 2 ^ N * ∑ i in range k, (1 / 2) ^ i := sorry _ ≤ 1 / 2 ^ N * 2 := sorry _ < ε := sorry example {u : ℕ → X} (hu : ∀ n : ℕ, dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : CauchySeq u := by rw [Metric.cauchySeq_iff'] intro ε ε_pos obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε := by have : Tendsto (fun N : ℕ => (1 / 2 ^ N * 2 : ℝ)) atTop (𝓝 0) := by rw [← MulZeroClass.zero_mul (2 : ℝ)] apply Tendsto.mul simp_rw [← one_div_pow (2 : ℝ)] apply tendsto_pow_atTop_nhds_0_of_lt_1 <;> linarith exact tendsto_const_nhds rcases(atTop_basis.tendsto_iff (nhds_basis_Ioo_pos (0 : ℝ))).mp this ε ε_pos with ⟨N, _, hN⟩ exact ⟨N, by simpa using (hN N left_mem_Ici).2⟩ use N intro n hn obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn calc dist (u (N + k)) (u N) = dist (u (N + 0)) (u (N + k)) := by rw [dist_comm, add_zero] _ ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) := (dist_le_range_sum_dist (fun i => u (N + i)) k) _ ≤ ∑ i in range k, (1 / 2 : ℝ) ^ (N + i) := (sum_le_sum fun i _ => hu <| N + i) _ = 1 / 2 ^ N * ∑ i in range k, (1 / 2 : ℝ) ^ i := by simp_rw [← one_div_pow, pow_add, ← mul_sum] _ ≤ 1 / 2 ^ N * 2 := (mul_le_mul_of_nonneg_left (sum_geometric_two_le _) (one_div_nonneg.mpr (pow_nonneg (zero_le_two : (0 : ℝ) ≤ 2) _))) _ < ε := hN open Metric example [CompleteSpace X] (f : ℕ → Set X) (ho : ∀ n, IsOpen (f n)) (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := by let B : ℕ → ℝ := fun n => (1 / 2) ^ n have Bpos : ∀ n, 0 < B n sorry /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closedBall center radius` is included both in `f n` and in `closedBall x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X), ∀ δ > 0, ∃ y : X, ∃ r > 0, r ≤ B (n + 1) ∧ closedBall y r ⊆ closedBall x δ ∩ f n := by sorry choose! center radius Hpos HB Hball using this intro x rw [mem_closure_iff_nhds_basis nhds_basis_closedBall] intro ε εpos /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closedBall (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → X × ℝ := fun n => Nat.recOn n (Prod.mk x (min ε (B 0))) fun n p => Prod.mk (center n p.1 p.2) (radius n p.1 p.2) let c : ℕ → X := fun n => (F n).1 let r : ℕ → ℝ := fun n => (F n).2 have rpos : ∀ n, 0 < r n := by sorry have rB : ∀ n, r n ≤ B n := by sorry have incl : ∀ n, closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) ∩ f n := by sorry have cdist : ∀ n, dist (c n) (c (n + 1)) ≤ B n := by sorry have : CauchySeq c := cauchySeq_of_le_geometric_two' cdist -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchySeq_tendsto_of_complete this with ⟨y, ylim⟩ -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y have I : ∀ n, ∀ m ≥ n, closedBall (c m) (r m) ⊆ closedBall (c n) (r n) := by sorry have yball : ∀ n, y ∈ closedBall (c n) (r n) := by sorry sorry example [CompleteSpace X] (f : ℕ → Set X) (ho : ∀ n, IsOpen (f n)) (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := by let B : ℕ → ℝ := fun n => (1 / 2) ^ n have Bpos : ∀ n, 0 < B n := fun n => pow_pos sorry n /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closedBall center radius` is included both in `f n` and in `closedBall x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X), ∀ δ > 0, ∃ y : X, ∃ r > 0, r ≤ B (n + 1) ∧ closedBall y r ⊆ closedBall x δ ∩ f n := by intro n x δ δpos have : x ∈ closure (f n) := hd n x rcases Metric.mem_closure_iff.1 this (δ / 2) (half_pos δpos) with ⟨y, ys, xy⟩ rw [dist_comm] at xy obtain ⟨r, rpos, hr⟩ : ∃ r > 0, closedBall y r ⊆ f n := nhds_basis_closedBall.mem_iff.1 (isOpen_iff_mem_nhds.1 (ho n) y ys) refine' ⟨y, min (min (δ / 2) r) (B (n + 1)), _, _, fun z hz => ⟨_, _⟩⟩ show 0 < min (min (δ / 2) r) (B (n + 1)) exact lt_min (lt_min (half_pos δpos) rpos) (Bpos (n + 1)) show min (min (δ / 2) r) (B (n + 1)) ≤ B (n + 1) exact min_le_right _ _ show z ∈ closedBall x δ exact calc dist z x ≤ dist z y + dist y x := dist_triangle _ _ _ _ ≤ min (min (δ / 2) r) (B (n + 1)) + δ / 2 := (add_le_add hz xy.le) _ ≤ δ / 2 + δ / 2 := (add_le_add_right ((min_le_left _ _).trans (min_le_left _ _)) _) _ = δ := add_halves δ show z ∈ f n exact hr (calc dist z y ≤ min (min (δ / 2) r) (B (n + 1)) := hz _ ≤ r := (min_le_left _ _).trans (min_le_right _ _) ) choose! center radius Hpos HB Hball using this refine' fun x => (mem_closure_iff_nhds_basis nhds_basis_closedBall).2 fun ε εpos => _ /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closedBall (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → X × ℝ := fun n => Nat.recOn n (Prod.mk x (min ε (B 0))) fun n p => Prod.mk (center n p.1 p.2) (radius n p.1 p.2) let c : ℕ → X := fun n => (F n).1 let r : ℕ → ℝ := fun n => (F n).2 have rpos : ∀ n, 0 < r n := by intro n induction' n with n hn exact lt_min εpos (Bpos 0) exact Hpos n (c n) (r n) hn have rB : ∀ n, r n ≤ B n := by intro n induction' n with n hn exact min_le_right _ _ exact HB n (c n) (r n) (rpos n) have incl : ∀ n, closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) ∩ f n := fun n => Hball n (c n) (r n) (rpos n) have cdist : ∀ n, dist (c n) (c (n + 1)) ≤ B n := by intro n rw [dist_comm] have A : c (n + 1) ∈ closedBall (c (n + 1)) (r (n + 1)) := mem_closedBall_self (rpos <| n + 1).le have I := calc closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) := (incl n).trans (inter_subset_left _ _) _ ⊆ closedBall (c n) (B n) := closedBall_subset_closedBall (rB n) exact I A have : CauchySeq c := cauchySeq_of_le_geometric_two' cdist -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchySeq_tendsto_of_complete this with ⟨y, ylim⟩ -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y have I : ∀ n, ∀ m ≥ n, closedBall (c m) (r m) ⊆ closedBall (c n) (r n) := by intro n refine' Nat.le_induction _ fun m hnm h => _ · exact Subset.rfl · exact (incl m).trans ((Set.inter_subset_left _ _).trans h) have yball : ∀ n, y ∈ closedBall (c n) (r n) := by intro n refine' isClosed_ball.mem_of_tendsto ylim _ refine' (Filter.eventually_ge_atTop n).mono fun m hm => _ exact I n m hm (mem_closedBall_self (rpos _).le) constructor · suffices ∀ n, y ∈ f n by rwa [Set.mem_iInter] intro n have : closedBall (c (n + 1)) (r (n + 1)) ⊆ f n := Subset.trans (incl n) (inter_subset_right _ _) exact this (yball (n + 1)) calc dist y x ≤ r 0 := yball 0 _ ≤ ε := min_le_left _ _
-
-
-
@@ -1,207 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter Topology section variable {X : Type _} [TopologicalSpace X] example : IsOpen (univ : Set X) := isOpen_univ example : IsOpen (∅ : Set X) := isOpen_empty example {ι : Type _} {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋃ i, s i) := isOpen_iUnion hs example {ι : Type _} [Fintype ι] {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋂ i, s i) := isOpen_iInter hs variable {Y : Type _} [TopologicalSpace Y] example {f : X → Y} : Continuous f ↔ ∀ s, IsOpen s → IsOpen (f ⁻¹' s) := continuous_def example {f : X → Y} {x : X} : ContinuousAt f x ↔ map f (𝓝 x) ≤ 𝓝 (f x) := Iff.rfl example {f : X → Y} {x : X} : ContinuousAt f x ↔ ∀ U ∈ 𝓝 (f x), ∀ᶠ x in 𝓝 x, f x ∈ U := Iff.rfl example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ t, t ⊆ s ∧ IsOpen t ∧ x ∈ t := mem_nhds_iff example (x : X) : pure x ≤ 𝓝 x := pure_le_nhds x example (x : X) (P : X → Prop) (h : ∀ᶠ y in 𝓝 x, P y) : P x := pure_le_nhds x h example {P : X → Prop} {x : X} (h : ∀ᶠ y in 𝓝 x, P y) : ∀ᶠ y in 𝓝 x, ∀ᶠ z in 𝓝 y, P z := eventually_eventually_nhds.mpr h #check TopologicalSpace.mkOfNhds #check TopologicalSpace.nhds_mkOfNhds example {α : Type _} (n : α → Filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → ∀ᶠ y in n a, ∀ᶠ x in n y, p x) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := sorry example {α : Type _} (n : α → Filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → ∀ᶠ y in n a, ∀ᶠ x in n y, p x) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := by intro a s s_in refine' ⟨{ y | s ∈ n y }, H a (fun x => x ∈ s) s_in, _, by tauto⟩ rintro y (hy : s ∈ n y) exact H₀ y hy end -- BOTH. variable {X Y : Type _} example (f : X → Y) : TopologicalSpace X → TopologicalSpace Y := TopologicalSpace.coinduced f example (f : X → Y) : TopologicalSpace Y → TopologicalSpace X := TopologicalSpace.induced f example (f : X → Y) (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) : TopologicalSpace.coinduced f T_X ≤ T_Y ↔ T_X ≤ TopologicalSpace.induced f T_Y := coinduced_le_iff_le_induced #check coinduced_compose #check induced_compose example {T T' : TopologicalSpace X} : T ≤ T' ↔ ∀ s, T'.IsOpen s → T.IsOpen s := Iff.rfl example (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) (f : X → Y) : Continuous f ↔ TopologicalSpace.coinduced f T_X ≤ T_Y := continuous_iff_coinduced_le example {Z : Type _} (f : X → Y) (T_X : TopologicalSpace X) (T_Z : TopologicalSpace Z) (g : Y → Z) : @Continuous Y Z (TopologicalSpace.coinduced f T_X) T_Z g ↔ @Continuous X Z T_X T_Z (g ∘ f) := by rw [continuous_iff_coinduced_le, coinduced_compose, continuous_iff_coinduced_le] example (ι : Type _) (X : ι → Type _) (T_X : ∀ i, TopologicalSpace <| X i) : (Pi.topologicalSpace : TopologicalSpace (∀ i, X i)) = ⨅ i, TopologicalSpace.induced (fun x => x i) (T_X i) := rfl example [TopologicalSpace X] [T2Space X] {u : ℕ → X} {a b : X} (ha : Tendsto u atTop (𝓝 a)) (hb : Tendsto u atTop (𝓝 b)) : a = b := tendsto_nhds_unique ha hb example [TopologicalSpace X] [RegularSpace X] (a : X) : (𝓝 a).HasBasis (fun s : Set X => s ∈ 𝓝 a ∧ IsClosed s) id := closed_nhds_basis a example [TopologicalSpace X] {x : X} : (𝓝 x).HasBasis (fun t : Set X => t ∈ 𝓝 x ∧ IsOpen t) id := nhds_basis_opens' x theorem aux {X Y A : Type _} [TopologicalSpace X] {c : A → X} {f : A → Y} {x : X} {F : Filter Y} (h : Tendsto f (comap c (𝓝 x)) F) {V' : Set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, IsOpen V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := sorry example {X Y A : Type _} [TopologicalSpace X] {c : A → X} {f : A → Y} {x : X} {F : Filter Y} (h : Tendsto f (comap c (𝓝 x)) F) {V' : Set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, IsOpen V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := by simpa [and_assoc] using ((nhds_basis_opens' x).comap c).tendsto_left_iff.mp h V' V'_in example [TopologicalSpace X] [TopologicalSpace Y] [RegularSpace Y] {A : Set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : Continuous f) (hf : ∀ x : X, ∃ c : Y, Tendsto f (comap (↑) <| 𝓝 x) <| 𝓝 c) : ∃ φ : X → Y, Continuous φ ∧ ∀ a : A, φ a = f a := sorry #check @HasBasis.tendsto_right_iff example [TopologicalSpace X] [TopologicalSpace Y] [T3Space Y] {A : Set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : Continuous f) (hf : ∀ x : X, ∃ c : Y, Tendsto f (comap (↑) <| 𝓝 x) <| 𝓝 c) : ∃ φ : X → Y, Continuous φ ∧ ∀ a : A, φ a = f a := by choose φ hφ using hf use φ constructor · rw [continuous_iff_continuousAt] intro x suffices ∀ V' ∈ 𝓝 (φ x), IsClosed V' → φ ⁻¹' V' ∈ 𝓝 x by simpa [ContinuousAt, (closed_nhds_basis (φ x)).tendsto_right_iff] intro V' V'_in V'_closed obtain ⟨V, V_in, V_op, hV⟩ : ∃ V ∈ 𝓝 x, IsOpen V ∧ (↑) ⁻¹' V ⊆ f ⁻¹' V' := aux (hφ x) V'_in suffices : ∀ y ∈ V, φ y ∈ V' exact mem_of_superset V_in this intro y y_in have hVx : V ∈ 𝓝 y := V_op.mem_nhds y_in haveI : (comap ((↑) : A → X) (𝓝 y)).NeBot := by simpa [mem_closure_iff_comap_neBot] using hA y apply V'_closed.mem_of_tendsto (hφ y) exact mem_of_superset (preimage_mem_comap hVx) hV · intro a have lim : Tendsto f (𝓝 a) (𝓝 <| φ a) := by simpa [nhds_induced] using hφ a exact tendsto_nhds_unique lim f_cont.continuousAt example [TopologicalSpace X] [TopologicalSpace.FirstCountableTopology X] {s : Set X} {a : X} : a ∈ closure s ↔ ∃ u : ℕ → X, (∀ n, u n ∈ s) ∧ Tendsto u atTop (𝓝 a) := mem_closure_iff_seq_limit variable [TopologicalSpace X] example {F : Filter X} {x : X} : ClusterPt x F ↔ NeBot (𝓝 x ⊓ F) := Iff.rfl example {s : Set X} : IsCompact s ↔ ∀ (F : Filter X) [NeBot F], F ≤ 𝓟 s → ∃ a ∈ s, ClusterPt a F := Iff.rfl example [TopologicalSpace.FirstCountableTopology X] {s : Set X} {u : ℕ → X} (hs : IsCompact s) (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu variable [TopologicalSpace Y] example {x : X} {F : Filter X} {G : Filter Y} (H : ClusterPt x F) {f : X → Y} (hfx : ContinuousAt f x) (hf : Tendsto f F G) : ClusterPt (f x) G := ClusterPt.map H hfx hf example [TopologicalSpace Y] {f : X → Y} (hf : Continuous f) {s : Set X} (hs : IsCompact s) : IsCompact (f '' s) := by intro F F_ne F_le have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F := by sorry have Hne : (𝓟 s ⊓ comap f F).NeBot := by sorry have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s := inf_le_left sorry example [TopologicalSpace Y] {f : X → Y} (hf : Continuous f) {s : Set X} (hs : IsCompact s) : IsCompact (f '' s) := by intro F F_ne F_le have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F := by rw [Filter.push_pull, map_principal] have Hne : (𝓟 s ⊓ comap f F).NeBot := by apply NeBot.of_map rwa [map_eq, inf_of_le_right F_le] have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s := inf_le_left rcases hs Hle with ⟨x, x_in, hx⟩ refine' ⟨f x, mem_image_of_mem f x_in, _⟩ apply hx.map hf.continuousAt rw [Tendsto, map_eq] exact inf_le_right example {ι : Type _} {s : Set X} (hs : IsCompact s) (U : ι → Set X) (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i := hs.elim_finite_subcover U hUo hsU example [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ
-
-
-
@@ -1,227 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic noncomputable section @[ext] structure Point where x : ℝ y : ℝ z : ℝ #check Point.ext example (a b : Point) (hx : a.x = b.x) (hy : a.y = b.y) (hz : a.z = b.z) : a = b := by ext repeat' assumption def myPoint1 : Point where x := 2 y := -1 z := 4 def myPoint2 : Point := ⟨2, -1, 4⟩ def myPoint3 := Point.mk 2 (-1) 4 structure Point' where build :: x : ℝ y : ℝ z : ℝ #check Point'.build 2 (-1) 4 namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def add' (a b : Point) : Point where x := a.x + b.x y := a.y + b.y z := a.z + b.z #check add myPoint1 myPoint2 #check myPoint1.add myPoint2 end Point #check Point.add myPoint1 myPoint2 #check myPoint1.add myPoint2 namespace Point protected theorem add_comm (a b : Point) : add a b = add b a := by rw [add, add] ext <;> dsimp repeat' apply add_comm example (a b : Point) : add a b = add b a := by simp [add, add_comm] theorem add_x (a b : Point) : (a.add b).x = a.x + b.x := rfl def addAlt : Point → Point → Point | Point.mk x₁ y₁ z₁, Point.mk x₂ y₂ z₂ => ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩ def addAlt' : Point → Point → Point | ⟨x₁, y₁, z₁⟩, ⟨x₂, y₂, z₂⟩ => ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩ theorem addAlt_x (a b : Point) : (a.addAlt b).x = a.x + b.x := by cases a cases b rfl theorem addAlt_comm (a b : Point) : addAlt a b = addAlt b a := by rcases a with ⟨xa, ya, za⟩ rcases b with ⟨xb, yb, zb⟩ rw [addAlt, addAlt] ext <;> dsimp apply add_comm repeat' apply add_comm example (a b : Point) : addAlt a b = addAlt b a := by rcases a with ⟨xa, ya, za⟩ rcases b with ⟨xb, yb, zb⟩ simp [addAlt, add_comm] example : ∀ a b : Point, addAlt a b = addAlt b a := by rintro ⟨xa, ya, za⟩ ⟨xb, yb, zb⟩ simp [addAlt, add_comm] example : ∀ a b : Point, add a b = add b a := fun ⟨xa, ya, za⟩ ⟨xb, yb, zb⟩ => by simp [add, add_comm] protected theorem add_assoc (a b c : Point) : (a.add b).add c = a.add (b.add c) := by sorry def smul (r : ℝ) (a : Point) : Point := sorry theorem smul_distrib (r : ℝ) (a b : Point) : (smul r a).add (smul r b) = smul r (a.add b) := by sorry end Point structure StandardTwoSimplex where x : ℝ y : ℝ z : ℝ x_nonneg : 0 ≤ x y_nonneg : 0 ≤ y z_nonneg : 0 ≤ z sum_eq : x + y + z = 1 namespace StandardTwoSimplex def swapXy (a : StandardTwoSimplex) : StandardTwoSimplex where x := a.y y := a.x z := a.z x_nonneg := a.y_nonneg y_nonneg := a.x_nonneg z_nonneg := a.z_nonneg sum_eq := by rw [add_comm a.y a.x, a.sum_eq] noncomputable section def midpoint (a b : StandardTwoSimplex) : StandardTwoSimplex where x := (a.x + b.x) / 2 y := (a.y + b.y) / 2 z := (a.z + b.z) / 2 x_nonneg := div_nonneg (add_nonneg a.x_nonneg b.x_nonneg) (by norm_num) y_nonneg := div_nonneg (add_nonneg a.y_nonneg b.y_nonneg) (by norm_num) z_nonneg := div_nonneg (add_nonneg a.z_nonneg b.z_nonneg) (by norm_num) sum_eq := by field_simp; linarith [a.sum_eq, b.sum_eq] def weightedAverage (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardTwoSimplex) : StandardTwoSimplex where sorry end end StandardTwoSimplex open BigOperators structure StandardSimplex (n : ℕ) where V : Fin n → ℝ NonNeg : ∀ i : Fin n, 0 ≤ V i sum_eq_one : (∑ i, V i) = 1 namespace StandardSimplex def midpoint (n : ℕ) (a b : StandardSimplex n) : StandardSimplex n where V i := (a.V i + b.V i) / 2 NonNeg := by intro i apply div_nonneg · linarith [a.NonNeg i, b.NonNeg i] norm_num sum_eq_one := by simp [div_eq_mul_inv, ← Finset.sum_mul, Finset.sum_add_distrib, a.sum_eq_one, b.sum_eq_one] field_simp end StandardSimplex structure IsLinear (f : ℝ → ℝ) where is_additive : ∀ x y, f (x + y) = f x + f y preserves_mul : ∀ x c, f (c * x) = c * f x section variable (f : ℝ → ℝ) (linf : IsLinear f) #check linf.is_additive #check linf.preserves_mul end def Point'' := ℝ × ℝ × ℝ def IsLinear' (f : ℝ → ℝ) := (∀ x y, f (x + y) = f x + f y) ∧ ∀ x c, f (c * x) = c * f x def PReal := { y : ℝ // 0 < y } section variable (x : PReal) #check x.val #check x.property #check x.1 #check x.2 end def StandardTwoSimplex' := { p : ℝ × ℝ × ℝ // 0 ≤ p.1 ∧ 0 ≤ p.2.1 ∧ 0 ≤ p.2.2 ∧ p.1 + p.2.1 + p.2.2 = 1 } def StandardSimplex' (n : ℕ) := { v : Fin n → ℝ // (∀ i : Fin n, 0 ≤ v i) ∧ (∑ i, v i) = 1 } def StdSimplex := Σ n : ℕ, StandardSimplex n section variable (s : StdSimplex) #check s.fst #check s.snd #check s.1 #check s.2 end
-
-
-
@@ -1,172 +0,0 @@import Mathlib.Data.Real.Basic structure Group₁ (α : Type _) where mul : α → α → α one : α inv : α → α mul_assoc : ∀ x y z : α, mul (mul x y) z = mul x (mul y z) mul_one : ∀ x : α, mul x one = x one_mul : ∀ x : α, mul one x = x mul_left_inv : ∀ x : α, mul (inv x) x = one structure Group₁Cat where α : Type _ str : Group₁ α section variable (α β γ : Type _) variable (f : α ≃ β) (g : β ≃ γ) #check Equiv α β #check (f.toFun : α → β) #check (f.invFun : β → α) #check (f.right_inv : ∀ x : β, f (f.invFun x) = x) #check (f.left_inv : ∀ x : α, f.invFun (f x) = x) #check (Equiv.refl α : α ≃ α) #check (f.symm : β ≃ α) #check (f.trans g : α ≃ γ) example (x : α) : (f.trans g).toFun x = g.toFun (f.toFun x) := rfl example (x : α) : (f.trans g) x = g (f x) := rfl example : (f.trans g : α → γ) = g ∘ f := rfl end example (α : Type _) : Equiv.Perm α = (α ≃ α) := rfl def permGroup {α : Type _} : Group₁ (Equiv.Perm α) where mul f g := Equiv.trans g f one := Equiv.refl α inv := Equiv.symm mul_assoc f g h := (Equiv.trans_assoc _ _ _).symm one_mul := Equiv.trans_refl mul_one := Equiv.refl_trans mul_left_inv := Equiv.self_trans_symm structure AddGroup₁ (α : Type _) where (add : α → α → α) -- fill in the rest @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def neg (a : point) : point := sorry def zero : point := sorry def add_group_point : add_group₁ point := sorry end Point section variable {α : Type _} (f g : Equiv.Perm α) (n : ℕ) #check f * g #check mul_assoc f g g⁻¹ -- group power, defined for any group #check g ^ n example : f * g * g⁻¹ = f := by rw [mul_assoc, mul_right_inv, mul_one] example : f * g * g⁻¹ = f := mul_inv_cancel_right f g example {α : Type _} (f g : Equiv.Perm α) : g.symm.trans (g.trans f) = f := mul_inv_cancel_right f g end class Group₂ (α : Type _) where mul : α → α → α one : α inv : α → α mul_assoc : ∀ x y z : α, mul (mul x y) z = mul x (mul y z) mul_one : ∀ x : α, mul x one = x one_mul : ∀ x : α, mul one x = x mul_left_inv : ∀ x : α, mul (inv x) x = one instance {α : Type _} : Group₂ (Equiv.Perm α) where mul f g := Equiv.trans g f one := Equiv.refl α inv := Equiv.symm mul_assoc f g h := (Equiv.trans_assoc _ _ _).symm one_mul := Equiv.trans_refl mul_one := Equiv.refl_trans mul_left_inv := Equiv.self_trans_symm #check @Group₂.mul def mySquare {α : Type _} [Group₂ α] (x : α) := Group₂.mul x x #check @mySquare section variable {β : Type _} (f g : Equiv.Perm β) example : Group₂.mul f g = g.trans f := rfl example : mySquare f = f.trans f := rfl end instance : Inhabited Point where default := ⟨0, 0, 0⟩ #check (default : Point) example : ([] : List Point).headI = default := rfl instance : Add Point where add := Point.add section variable (x y : Point) #check x + y example : x + y = Point.add x y := rfl end instance hasMulGroup₂ {α : Type _} [Group₂ α] : Mul α := ⟨Group₂.mul⟩ instance hasOneGroup₂ {α : Type _} [Group₂ α] : One α := ⟨Group₂.one⟩ instance hasInvGroup₂ {α : Type _} [Group₂ α] : Inv α := ⟨Group₂.inv⟩ section variable {α : Type _} (f g : Equiv.Perm α) #check f * 1 * g⁻¹ def foo : f * 1 * g⁻¹ = g.symm.trans ((Equiv.refl α).trans f) := rfl end class AddGroup₂ (α : Type _) where add : α → α → α -- fill in the rest
-
-
-
@@ -1,271 +0,0 @@import Mathlib.Data.Int.Basic import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Tactic @[ext] structure gaussInt where re : ℤ im : ℤ namespace gaussInt instance : Zero gaussInt := ⟨⟨0, 0⟩⟩ instance : One gaussInt := ⟨⟨1, 0⟩⟩ instance : Add gaussInt := ⟨fun x y => ⟨x.re + y.re, x.im + y.im⟩⟩ instance : Neg gaussInt := ⟨fun x => ⟨-x.re, -x.im⟩⟩ instance : Mul gaussInt := ⟨fun x y => ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussInt) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussInt) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussInt) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussInt) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussInt) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussInt).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussInt).im = 0 := rfl @[simp] theorem one_re : (1 : gaussInt).re = 1 := rfl @[simp] theorem one_im : (1 : gaussInt).im = 0 := rfl @[simp] theorem add_re (x y : gaussInt) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussInt) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussInt) : (-x).re = -x.re := rfl @[simp] theorem neg_im (x : gaussInt) : (-x).im = -x.im := rfl @[simp] theorem mul_re (x y : gaussInt) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussInt) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance instCommRing : CommRing gaussInt where zero := 0 one := 1 add := (· + ·) neg x := -x mul := (· * ·) add_assoc := by intros ext <;> simp <;> ring zero_add := by intros ext <;> simp add_zero := by intros ext <;> simp add_left_neg := by intros ext <;> simp add_comm := by intros ext <;> simp <;> ring mul_assoc := by intros ext <;> simp <;> ring one_mul := by intros ext <;> simp mul_one := by intros ext <;> simp left_distrib := by intros ext <;> simp <;> ring right_distrib := by intros ext <;> simp <;> ring mul_comm := by intros ext <;> simp <;> ring zero_mul := sorry mul_zero := sorry instance : Nontrivial gaussInt := by use 0, 1 rw [Ne, gaussInt.ext_iff] simp end gaussInt example (a b : ℤ) : a = b * (a / b) + a % b := Eq.symm <| Int.ediv_add_emod a b example (a b : ℤ) : b ≠ 0 → 0 ≤ a % b := Int.emod_nonneg a example (a b : ℤ) : b ≠ 0 → a % b < abs b := Int.emod_lt a namespace Int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := by rw [div', mod'] linarith [Int.ediv_add_emod (a + b / 2) b] theorem abs_mod'_le (a b : ℤ) (h : 0 < b) : abs (mod' a b) ≤ b / 2 := by rw [mod', abs_le] constructor · linarith [Int.emod_nonneg (a + b / 2) h.ne'] have := Int.emod_lt_of_pos (a + b / 2) h have := Int.ediv_add_emod b 2 have := Int.emod_lt_of_pos b zero_lt_two revert this; intro this -- FIXME, this should not be needed linarith theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end Int theorem sq_add_sq_eq_zero {α : Type _} [LinearOrderedRing α] (x y : α) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by sorry namespace gaussInt def norm (x : gaussInt) := x.re ^ 2 + x.im ^ 2 @[simp] theorem norm_nonneg (x : gaussInt) : 0 ≤ norm x := by sorry theorem norm_eq_zero (x : gaussInt) : norm x = 0 ↔ x = 0 := by sorry theorem norm_pos (x : gaussInt) : 0 < norm x ↔ x ≠ 0 := by sorry theorem norm_mul (x y : gaussInt) : norm (x * y) = norm x * norm y := by sorry def conj (x : gaussInt) : gaussInt := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussInt) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussInt) : (conj x).im = -x.im := rfl theorem norm_conj (x : gaussInt) : norm (conj x) = norm x := by simp [norm] instance : Div gaussInt := ⟨fun x y => ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩⟩ instance : Mod gaussInt := ⟨fun x y => x - y * (x / y)⟩ theorem div_def (x y : gaussInt) : x / y = ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussInt) : x % y = x - y * (x / y) := rfl theorem norm_mod_lt (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : (x % y).norm < y.norm := by have norm_y_pos : 0 < norm y := by rwa [norm_pos] have : x % y * conj y = ⟨Int.mod' (x * conj y).re (norm y), Int.mod' (x * conj y).im (norm y)⟩ := by rw [mod_def, sub_mul, Int.mod'_eq, Int.mod'_eq, sub_eq_add_neg, div_def, norm] ext <;> simp <;> ring have : norm (x % y) * norm y ≤ norm y / 2 * norm y := by conv => lhs rw [← norm_conj y, ← norm_mul, this, norm] simp trans 2 * (y.norm / 2) ^ 2 · rw [two_mul] apply add_le_add <;> · rw [sq_le_sq] apply le_trans (Int.abs_mod'_le _ _ norm_y_pos) apply le_abs_self rw [pow_two, ← mul_assoc, mul_comm, mul_comm (2 : ℤ)] apply mul_le_mul_of_nonneg_left · apply Int.ediv_mul_le norm_num apply Int.ediv_nonneg (norm_nonneg y) norm_num have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos apply lt_of_le_of_lt this apply Int.ediv_lt_of_lt_mul · norm_num linarith theorem coe_natAbs_norm (x : gaussInt) : (x.norm.natAbs : ℤ) = x.norm := Int.natAbs_of_nonneg (norm_nonneg _) theorem natAbs_norm_mod_lt (x y : gaussInt) (hy : y ≠ 0) : (x % y).norm.natAbs < y.norm.natAbs := by apply Int.ofNat_lt.1 simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg] apply norm_mod_lt x hy theorem not_norm_mul_left_lt_norm (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : ¬(norm (x * y)).natAbs < (norm x).natAbs := by apply not_lt_of_ge rw [norm_mul, Int.natAbs_mul] apply le_mul_of_one_le_right (Nat.zero_le _) apply Int.ofNat_le.1 rw [coe_natAbs_norm] exact Int.add_one_le_of_lt ((norm_pos _).mpr hy) instance : EuclideanDomain gaussInt := { gaussInt.instCommRing with quotient := (· / ·) remainder := (· % ·) quotient_mul_add_remainder_eq := fun x y => by simp only; rw [mod_def, add_comm, sub_add_cancel] quotient_zero := fun x => by simp [div_def, norm, Int.div'] rfl r := Measure (Int.natAbs ∘ norm) r_wellFounded := (measure (Int.natAbs ∘ norm)).2 remainder_lt := natAbs_norm_mod_lt mul_left_not_lt := not_norm_mul_left_lt_norm } example (x : gaussInt) : Irreducible x ↔ Prime x := PrincipalIdealRing.irreducible_iff_prime end gaussInt
-
-
-
@@ -1,96 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic noncomputable section @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ protected theorem add_assoc (a b c : Point) : (a.add b).add c = a.add (b.add c) := by simp [add, add_assoc] def smul (r : ℝ) (a : Point) : Point := ⟨r * a.x, r * a.y, r * a.z⟩ theorem smul_distrib (r : ℝ) (a b : Point) : (smul r a).add (smul r b) = smul r (a.add b) := by simp [add, smul, mul_add] end Point structure StandardTwoSimplex where x : ℝ y : ℝ z : ℝ x_nonneg : 0 ≤ x y_nonneg : 0 ≤ y z_nonneg : 0 ≤ z sum_eq : x + y + z = 1 namespace StandardTwoSimplex noncomputable section def weightedAverage (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardTwoSimplex) : StandardTwoSimplex where x := lambda * a.x + (1 - lambda) * b.x y := lambda * a.y + (1 - lambda) * b.y z := lambda * a.z + (1 - lambda) * b.z x_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.x_nonneg) (mul_nonneg (by linarith) b.x_nonneg) y_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.y_nonneg) (mul_nonneg (by linarith) b.y_nonneg) z_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.z_nonneg) (mul_nonneg (by linarith) b.z_nonneg) sum_eq := by trans (a.x + a.y + a.z) * lambda + (b.x + b.y + b.z) * (1 - lambda) · ring simp [a.sum_eq, b.sum_eq] end end StandardTwoSimplex open BigOperators structure StandardSimplex (n : ℕ) where V : Fin n → ℝ NonNeg : ∀ i : Fin n, 0 ≤ V i sum_eq_one : (∑ i, V i) = 1 namespace StandardSimplex def midpoint (n : ℕ) (a b : StandardSimplex n) : StandardSimplex n where V i := (a.V i + b.V i) / 2 NonNeg := by intro i apply div_nonneg · linarith [a.NonNeg i, b.NonNeg i] norm_num sum_eq_one := by simp [div_eq_mul_inv, ← Finset.sum_mul, Finset.sum_add_distrib, a.sum_eq_one, b.sum_eq_one] field_simp end StandardSimplex namespace StandardSimplex def weightedAverage {n : ℕ} (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardSimplex n) : StandardSimplex n where V i := lambda * a.V i + (1 - lambda) * b.V i NonNeg i := add_nonneg (mul_nonneg lambda_nonneg (a.NonNeg i)) (mul_nonneg (by linarith) (b.NonNeg i)) sum_eq_one := by trans (lambda * ∑ i, a.V i) + (1 - lambda) * ∑ i, b.V i · rw [Finset.sum_add_distrib, Finset.mul_sum, Finset.mul_sum] simp [a.sum_eq_one, b.sum_eq_one] end StandardSimplex
-
-
-
@@ -1,73 +0,0 @@import Mathlib.Data.Real.Basic structure AddGroup₁ (α : Type _) where add : α → α → α zero : α neg : α → α add_assoc : ∀ x y z : α, add (add x y) z = add x (add y z) add_zero : ∀ x : α, add x zero = x zero_add : ∀ x : α, add x zero = x add_left_neg : ∀ x : α, add (neg x) x = zero @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def neg (a : Point) : Point := ⟨-a.x, -a.y, -a.z⟩ def zero : Point := ⟨0, 0, 0⟩ def addGroupPoint : AddGroup₁ Point where add := Point.add zero := Point.zero neg := Point.neg add_assoc := by simp [Point.add, add_assoc] add_zero := by simp [Point.add, Point.zero] zero_add := by simp [Point.add, Point.zero] add_left_neg := by simp [Point.add, Point.neg, Point.zero] end Point class AddGroup₂ (α : Type _) where add : α → α → α zero : α neg : α → α add_assoc : ∀ x y z : α, add (add x y) z = add x (add y z) add_zero : ∀ x : α, add x zero = x zero_add : ∀ x : α, add x zero = x add_left_neg : ∀ x : α, add (neg x) x = zero instance hasAddAddGroup₂ {α : Type _} [AddGroup₂ α] : Add α := ⟨AddGroup₂.add⟩ instance hasZeroAddGroup₂ {α : Type _} [AddGroup₂ α] : Zero α := ⟨AddGroup₂.zero⟩ instance hasNegAddGroup₂ {α : Type _} [AddGroup₂ α] : Neg α := ⟨AddGroup₂.neg⟩ instance : AddGroup₂ Point where add := Point.add zero := Point.zero neg := Point.neg add_assoc := by simp [Point.add, add_assoc] add_zero := by simp [Point.add, Point.zero] zero_add := by simp [Point.add, Point.zero] add_left_neg := by simp [Point.add, Point.neg, Point.zero] section variable (x y : Point) #check x + -y + 0 end
-
-
-
@@ -1,285 +0,0 @@import Mathlib.Data.Int.Basic import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Tactic @[ext] structure gaussInt where re : ℤ im : ℤ namespace gaussInt instance : Zero gaussInt := ⟨⟨0, 0⟩⟩ instance : One gaussInt := ⟨⟨1, 0⟩⟩ instance : Add gaussInt := ⟨fun x y => ⟨x.re + y.re, x.im + y.im⟩⟩ instance : Neg gaussInt := ⟨fun x => ⟨-x.re, -x.im⟩⟩ instance : Mul gaussInt := ⟨fun x y => ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussInt) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussInt) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussInt) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussInt) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussInt) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussInt).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussInt).im = 0 := rfl @[simp] theorem one_re : (1 : gaussInt).re = 1 := rfl @[simp] theorem one_im : (1 : gaussInt).im = 0 := rfl @[simp] theorem add_re (x y : gaussInt) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussInt) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussInt) : (-x).re = -x.re := rfl @[simp] theorem neg_im (x : gaussInt) : (-x).im = -x.im := rfl @[simp] theorem mul_re (x y : gaussInt) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussInt) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance instCommRing : CommRing gaussInt where zero := 0 one := 1 add := (· + ·) neg x := -x mul := (· * ·) add_assoc := by intros ext <;> simp <;> ring zero_add := by intros ext <;> simp add_zero := by intros ext <;> simp add_left_neg := by intros ext <;> simp add_comm := by intros ext <;> simp <;> ring mul_assoc := by intros ext <;> simp <;> ring one_mul := by intros ext <;> simp mul_one := by intros ext <;> simp left_distrib := by intros ext <;> simp <;> ring right_distrib := by intros ext <;> simp <;> ring mul_comm := by intros ext <;> simp <;> ring zero_mul := sorry mul_zero := sorry instance : Nontrivial gaussInt := by use 0, 1 rw [Ne, gaussInt.ext_iff] simp end gaussInt namespace Int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := by rw [div', mod'] linarith [Int.ediv_add_emod (a + b / 2) b] theorem abs_mod'_le (a b : ℤ) (h : 0 < b) : abs (mod' a b) ≤ b / 2 := by rw [mod', abs_le] constructor · linarith [Int.emod_nonneg (a + b / 2) h.ne'] have := Int.emod_lt_of_pos (a + b / 2) h have := Int.ediv_add_emod b 2 have := Int.emod_lt_of_pos b zero_lt_two revert this; intro this -- FIXME, this should not be needed linarith theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end Int private theorem aux {α : Type _} [LinearOrderedRing α] {x y : α} (h : x ^ 2 + y ^ 2 = 0) : x = 0 := haveI h' : x ^ 2 = 0 := by apply le_antisymm _ (sq_nonneg x) rw [← h] apply le_add_of_nonneg_right (sq_nonneg y) pow_eq_zero h' theorem sq_add_sq_eq_zero {α : Type _} [LinearOrderedRing α] (x y : α) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by constructor · intro h constructor · exact aux h rw [add_comm] at h exact aux h rintro ⟨rfl, rfl⟩ norm_num namespace gaussInt def norm (x : gaussInt) := x.re ^ 2 + x.im ^ 2 @[simp] theorem norm_nonneg (x : gaussInt) : 0 ≤ norm x := by apply add_nonneg <;> apply sq_nonneg theorem norm_eq_zero (x : gaussInt) : norm x = 0 ↔ x = 0 := by rw [norm, sq_add_sq_eq_zero, gaussInt.ext_iff] rfl theorem norm_pos (x : gaussInt) : 0 < norm x ↔ x ≠ 0 := by rw [lt_iff_le_and_ne, ne_comm, Ne, norm_eq_zero] simp [norm_nonneg] theorem norm_mul (x y : gaussInt) : norm (x * y) = norm x * norm y := by simp [norm] ring def conj (x : gaussInt) : gaussInt := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussInt) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussInt) : (conj x).im = -x.im := rfl theorem norm_conj (x : gaussInt) : norm (conj x) = norm x := by simp [norm] instance : Div gaussInt := ⟨fun x y => ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩⟩ instance : Mod gaussInt := ⟨fun x y => x - y * (x / y)⟩ theorem div_def (x y : gaussInt) : x / y = ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussInt) : x % y = x - y * (x / y) := rfl theorem norm_mod_lt (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : (x % y).norm < y.norm := by have norm_y_pos : 0 < norm y := by rwa [norm_pos] have : x % y * conj y = ⟨Int.mod' (x * conj y).re (norm y), Int.mod' (x * conj y).im (norm y)⟩ := by rw [mod_def, sub_mul, Int.mod'_eq, Int.mod'_eq, sub_eq_add_neg, div_def, norm] ext <;> simp <;> ring have : norm (x % y) * norm y ≤ norm y / 2 * norm y := by conv => lhs rw [← norm_conj y, ← norm_mul, this, norm] simp trans 2 * (y.norm / 2) ^ 2 · rw [two_mul] apply add_le_add <;> · rw [sq_le_sq] apply le_trans (Int.abs_mod'_le _ _ norm_y_pos) apply le_abs_self rw [pow_two, ← mul_assoc, mul_comm, mul_comm (2 : ℤ)] apply mul_le_mul_of_nonneg_left · apply Int.ediv_mul_le norm_num apply Int.ediv_nonneg (norm_nonneg y) norm_num have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos apply lt_of_le_of_lt this apply Int.ediv_lt_of_lt_mul · norm_num linarith theorem coe_natAbs_norm (x : gaussInt) : (x.norm.natAbs : ℤ) = x.norm := Int.natAbs_of_nonneg (norm_nonneg _) theorem natAbs_norm_mod_lt (x y : gaussInt) (hy : y ≠ 0) : (x % y).norm.natAbs < y.norm.natAbs := by apply Int.ofNat_lt.1 simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg] apply norm_mod_lt x hy theorem not_norm_mul_left_lt_norm (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : ¬(norm (x * y)).natAbs < (norm x).natAbs := by apply not_lt_of_ge rw [norm_mul, Int.natAbs_mul] apply le_mul_of_one_le_right (Nat.zero_le _) apply Int.ofNat_le.1 rw [coe_natAbs_norm] exact Int.add_one_le_of_lt ((norm_pos _).mpr hy) instance : EuclideanDomain gaussInt := { gaussInt.instCommRing with quotient := (· / ·) remainder := (· % ·) quotient_mul_add_remainder_eq := fun x y => by simp only; rw [mod_def, add_comm, sub_add_cancel] quotient_zero := fun x => by simp [div_def, norm, Int.div'] rfl r := Measure (Int.natAbs ∘ norm) r_wellFounded := (measure (Int.natAbs ∘ norm)).2 remainder_lt := natAbs_norm_mod_lt mul_left_not_lt := not_norm_mul_left_lt_norm } example (x : gaussInt) : Irreducible x ↔ Prime x := PrincipalIdealRing.irreducible_iff_prime end gaussInt
-
-
src/C_Basics/S01_Calculating.lean (deleted)
-
@@ -1,164 +0,0 @@import Mathlib.Data.Real.Basic import Mathlib.Data.Real.Basic -- An example. example (a b c : ℝ) : a * b * c = b * (a * c) := by rw [mul_comm a b] rw [mul_assoc b a c] -- Try these. example (a b c : ℝ) : c * b * a = b * (a * c) := by sorry example (a b c : ℝ) : a * (b * c) = b * (a * c) := by sorry -- An example. example (a b c : ℝ) : a * b * c = b * c * a := by rw [mul_assoc] rw [mul_comm] /- Try doing the first of these without providing any arguments at all, and the second with only one argument. -/ example (a b c : ℝ) : a * (b * c) = b * (c * a) := by sorry example (a b c : ℝ) : a * (b * c) = b * (a * c) := by sorry -- Using facts from the local context. example (a b c d e f : ℝ) (h : a * b = c * d) (h' : e = f) : a * (b * e) = c * (d * f) := by rw [h'] rw [← mul_assoc] rw [h] rw [mul_assoc] -- Try these. For the second one, use the theorem `sub_self`. example (a b c d e f : ℝ) (h : b * c = e * f) : a * b * c * d = a * e * f * d := by sorry example (a b c d : ℝ) (hyp : c = b * a - d) (hyp' : d = a * b) : c = 0 := by sorry -- Examples. example (a b c d e f : ℝ) (h : a * b = c * d) (h' : e = f) : a * (b * e) = c * (d * f) := by rw [h', ← mul_assoc, h, mul_assoc] section variable (a b c d e f g : ℝ) example (h : a * b = c * d) (h' : e = f) : a * (b * e) = c * (d * f) := by rw [h', ← mul_assoc, h, mul_assoc] end section variable (a b c : ℝ) #check a #check a + b #check (a : ℝ) #check mul_comm a b #check (mul_comm a b : a * b = b * a) #check mul_assoc c a b #check mul_comm a #check mul_comm #check @mul_comm end section variable (a b : ℝ) example : (a + b) * (a + b) = a * a + 2 * (a * b) + b * b := by rw [mul_add, add_mul, add_mul] rw [← add_assoc, add_assoc (a * a)] rw [mul_comm b a, ← two_mul] example : (a + b) * (a + b) = a * a + 2 * (a * b) + b * b := calc (a + b) * (a + b) = a * a + b * a + (a * b + b * b) := by rw [mul_add, add_mul, add_mul] _ = a * a + (b * a + a * b) + b * b := by rw [← add_assoc, add_assoc (a * a)] _ = a * a + 2 * (a * b) + b * b := by rw [mul_comm b a, ← two_mul] example : (a + b) * (a + b) = a * a + 2 * (a * b) + b * b := calc (a + b) * (a + b) = a * a + b * a + (a * b + b * b) := by sorry _ = a * a + (b * a + a * b) + b * b := by sorry _ = a * a + 2 * (a * b) + b * b := by sorry end -- Try these. For the second, use the theorems listed underneath. section variable (a b c d : ℝ) example : (a + b) * (c + d) = a * c + a * d + b * c + b * d := by sorry example (a b : ℝ) : (a + b) * (a - b) = a ^ 2 - b ^ 2 := by sorry #check pow_two a #check mul_sub a b c #check add_mul a b c #check add_sub a b c #check sub_sub a b c #check add_zero a end -- Examples. section variable (a b c d : ℝ) example (a b c d : ℝ) (hyp : c = d * a + b) (hyp' : b = a * d) : c = 2 * a * d := by rw [hyp'] at hyp rw [mul_comm d a] at hyp rw [← two_mul (a * d)] at hyp rw [← mul_assoc 2 a d] at hyp exact hyp example : c * b * a = b * (a * c) := by ring example : (a + b) * (a + b) = a * a + 2 * (a * b) + b * b := by ring example : (a + b) * (a - b) = a ^ 2 - b ^ 2 := by ring example (hyp : c = d * a + b) (hyp' : b = a * d) : c = 2 * a * d := by rw [hyp, hyp'] ring end example (a b c : ℕ) (h : a + b = c) : (a + b) * (a + b) = a * c + b * c := by nth_rw 2 [h] rw [add_mul]
-
-
-
@@ -1,168 +0,0 @@import Mathlib.Algebra.Ring.Defs import Mathlib.Data.Real.Basic import Mathlib.Tactic section variable (R : Type _) [Ring R] #check (add_assoc : ∀ a b c : R, a + b + c = a + (b + c)) #check (add_comm : ∀ a b : R, a + b = b + a) #check (zero_add : ∀ a : R, 0 + a = a) #check (add_left_neg : ∀ a : R, -a + a = 0) #check (mul_assoc : ∀ a b c : R, a * b * c = a * (b * c)) #check (mul_one : ∀ a : R, a * 1 = a) #check (one_mul : ∀ a : R, 1 * a = a) #check (mul_add : ∀ a b c : R, a * (b + c) = a * b + a * c) #check (add_mul : ∀ a b c : R, (a + b) * c = a * c + b * c) end section variable (R : Type _) [CommRing R] variable (a b c d : R) example : c * b * a = b * (a * c) := by ring example : (a + b) * (a + b) = a * a + 2 * (a * b) + b * b := by ring example : (a + b) * (a - b) = a ^ 2 - b ^ 2 := by ring example (hyp : c = d * a + b) (hyp' : b = a * d) : c = 2 * a * d := by rw [hyp, hyp'] ring end namespace MyRing variable {R : Type _} [Ring R] theorem add_zero (a : R) : a + 0 = a := by rw [add_comm, zero_add] theorem add_right_neg (a : R) : a + -a = 0 := by rw [add_comm, add_left_neg] #check @MyRing.add_zero #check @add_zero end MyRing namespace MyRing variable {R : Type _} [Ring R] theorem neg_add_cancel_left (a b : R) : -a + (a + b) = b := by rw [← add_assoc, add_left_neg, zero_add] -- Prove these: theorem add_neg_cancel_right (a b : R) : a + b + -b = a := by sorry theorem add_left_cancel {a b c : R} (h : a + b = a + c) : b = c := by sorry theorem add_right_cancel {a b c : R} (h : a + b = c + b) : a = c := by sorry theorem mul_zero (a : R) : a * 0 = 0 := by have h : a * 0 + a * 0 = a * 0 + 0 := by rw [← mul_add, add_zero, add_zero] rw [add_left_cancel h] theorem zero_mul (a : R) : 0 * a = 0 := by sorry theorem neg_eq_of_add_eq_zero {a b : R} (h : a + b = 0) : -a = b := by sorry theorem eq_neg_of_add_eq_zero {a b : R} (h : a + b = 0) : a = -b := by sorry theorem neg_zero : (-0 : R) = 0 := by apply neg_eq_of_add_eq_zero rw [add_zero] theorem neg_neg (a : R) : - -a = a := by sorry end MyRing -- Examples. section variable {R : Type _} [Ring R] example (a b : R) : a - b = a + -b := sub_eq_add_neg a b end example (a b : ℝ) : a - b = a + -b := rfl example (a b : ℝ) : a - b = a + -b := by rfl namespace MyRing variable {R : Type _} [Ring R] theorem self_sub (a : R) : a - a = 0 := sorry theorem one_add_one_eq_two : 1 + 1 = (2 : R) := by norm_num theorem two_mul (a : R) : 2 * a = a + a := sorry end MyRing section variable (A : Type _) [AddGroup A] #check (add_assoc : ∀ a b c : A, a + b + c = a + (b + c)) #check (zero_add : ∀ a : A, 0 + a = a) #check (add_left_neg : ∀ a : A, -a + a = 0) end section variable {G : Type _} [Group G] #check (mul_assoc : ∀ a b c : G, a * b * c = a * (b * c)) #check (one_mul : ∀ a : G, 1 * a = a) #check (mul_left_inv : ∀ a : G, a⁻¹ * a = 1) namespace MyGroup theorem mul_right_inv (a : G) : a * a⁻¹ = 1 := by sorry theorem mul_one (a : G) : a * 1 = a := by sorry theorem mul_inv_rev (a b : G) : (a * b)⁻¹ = b⁻¹ * a⁻¹ := by sorry end MyGroup end
-
-
-
@@ -1,156 +0,0 @@import Mathlib.Analysis.SpecialFunctions.Log.Basic import Mathlib.Tactic variable (a b c d e : ℝ) open Real #check (le_refl : ∀ a : ℝ, a ≤ a) #check (le_trans : a ≤ b → b ≤ c → a ≤ c) section variable (h : a ≤ b) (h' : b ≤ c) #check (le_refl : ∀ a : Real, a ≤ a) #check (le_refl a : a ≤ a) #check (le_trans : a ≤ b → b ≤ c → a ≤ c) #check (le_trans h : b ≤ c → a ≤ c) #check (le_trans h h' : a ≤ c) end example (x y z : ℝ) (h₀ : x ≤ y) (h₁ : y ≤ z) : x ≤ z := by apply le_trans · apply h₀ . apply h₁ example (x y z : ℝ) (h₀ : x ≤ y) (h₁ : y ≤ z) : x ≤ z := by apply le_trans h₀ apply h₁ example (x y z : ℝ) (h₀ : x ≤ y) (h₁ : y ≤ z) : x ≤ z := le_trans h₀ h₁ example (x : ℝ) : x ≤ x := by apply le_refl example (x : ℝ) : x ≤ x := le_refl x #check (le_refl : ∀ a, a ≤ a) #check (le_trans : a ≤ b → b ≤ c → a ≤ c) #check (lt_of_le_of_lt : a ≤ b → b < c → a < c) #check (lt_of_lt_of_le : a < b → b ≤ c → a < c) #check (lt_trans : a < b → b < c → a < c) -- Try this. example (h₀ : a ≤ b) (h₁ : b < c) (h₂ : c ≤ d) (h₃ : d < e) : a < e := by sorry example (h₀ : a ≤ b) (h₁ : b < c) (h₂ : c ≤ d) (h₃ : d < e) : a < e := by linarith section example (h : 2 * a ≤ 3 * b) (h' : 1 ≤ a) (h'' : d = 2) : d + a ≤ 5 * b := by linarith end example (h : 1 ≤ a) (h' : b ≤ c) : 2 + a + exp b ≤ 3 * a + exp c := by linarith [exp_le_exp.mpr h'] #check (exp_le_exp : exp a ≤ exp b ↔ a ≤ b) #check (exp_lt_exp : exp a < exp b ↔ a < b) #check (log_le_log : 0 < a → 0 < b → (log a ≤ log b ↔ a ≤ b)) #check (log_lt_log : 0 < a → a < b → log a < log b) #check (add_le_add : a ≤ b → c ≤ d → a + c ≤ b + d) #check (add_le_add_left : a ≤ b → ∀ c, c + a ≤ c + b) #check (add_le_add_right : a ≤ b → ∀ c, a + c ≤ b + c) #check (add_lt_add_of_le_of_lt : a ≤ b → c < d → a + c < b + d) #check (add_lt_add_of_lt_of_le : a < b → c ≤ d → a + c < b + d) #check (add_lt_add_left : a < b → ∀ c, c + a < c + b) #check (add_lt_add_right : a < b → ∀ c, a + c < b + c) #check (add_nonneg : 0 ≤ a → 0 ≤ b → 0 ≤ a + b) #check (add_pos : 0 < a → 0 < b → 0 < a + b) #check (add_pos_of_pos_of_nonneg : 0 < a → 0 ≤ b → 0 < a + b) #check (exp_pos : ∀ a, 0 < exp a) #check @add_le_add_left example (h : a ≤ b) : exp a ≤ exp b := by rw [exp_le_exp] exact h example (h₀ : a ≤ b) (h₁ : c < d) : a + exp c + e < b + exp d + e := by apply add_lt_add_of_lt_of_le · apply add_lt_add_of_le_of_lt h₀ apply exp_lt_exp.mpr h₁ apply le_refl example (h₀ : d ≤ e) : c + exp (a + d) ≤ c + exp (a + e) := by sorry example : (0 : ℝ) < 1 := by norm_num example (h : a ≤ b) : log (1 + exp a) ≤ log (1 + exp b) := by have h₀ : 0 < 1 + exp a := by sorry have h₁ : 0 < 1 + exp b := by sorry apply (log_le_log h₀ h₁).mpr sorry example : 0 ≤ a ^ 2 := by -- library_search exact sq_nonneg a example (h : a ≤ b) : c - exp b ≤ c - exp a := by sorry example : 2 * a * b ≤ a ^ 2 + b ^ 2 := by have h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 calc a ^ 2 - 2 * a * b + b ^ 2 = (a - b) ^ 2 := by ring _ ≥ 0 := by apply pow_two_nonneg calc 2 * a * b = 2 * a * b + 0 := by ring _ ≤ 2 * a * b + (a ^ 2 - 2 * a * b + b ^ 2) := add_le_add (le_refl _) h _ = a ^ 2 + b ^ 2 := by ring example : 2 * a * b ≤ a ^ 2 + b ^ 2 := by have h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 calc a ^ 2 - 2 * a * b + b ^ 2 = (a - b) ^ 2 := by ring _ ≥ 0 := by apply pow_two_nonneg linarith example : abs (a * b) ≤ (a ^ 2 + b ^ 2) / 2 := by sorry #check abs_le'.mpr
-
-
-
@@ -1,98 +0,0 @@import Mathlib.Data.Real.Basic section variable (a b c d : ℝ) #check (min_le_left a b : min a b ≤ a) #check (min_le_right a b : min a b ≤ b) #check (le_min : c ≤ a → c ≤ b → c ≤ min a b) example : min a b = min b a := by apply le_antisymm · show min a b ≤ min b a apply le_min · apply min_le_right apply min_le_left · show min b a ≤ min a b apply le_min · apply min_le_right apply min_le_left example : min a b = min b a := by have h : ∀ x y : ℝ, min x y ≤ min y x := by intro x y apply le_min apply min_le_right apply min_le_left apply le_antisymm apply h apply h example : min a b = min b a := by apply le_antisymm repeat apply le_min apply min_le_right apply min_le_left example : max a b = max b a := by sorry example : min (min a b) c = min a (min b c) := by sorry theorem aux : min a b + c ≤ min (a + c) (b + c) := by sorry example : min a b + c = min (a + c) (b + c) := by sorry #check (abs_add : ∀ a b : ℝ, abs (a + b) ≤ abs a + abs b) example : abs a - abs b ≤ abs (a - b) := sorry end section variable (w x y z : ℕ) example (h₀ : x ∣ y) (h₁ : y ∣ z) : x ∣ z := dvd_trans h₀ h₁ example : x ∣ y * x * z := by apply dvd_mul_of_dvd_left apply dvd_mul_left example : x ∣ x ^ 2 := by apply dvd_mul_left example (h : x ∣ w) : x ∣ y * (x * z) + x ^ 2 + w ^ 2 := by sorry end section variable (m n : ℕ) open Nat #check (gcd_zero_right n : gcd n 0 = n) #check (gcd_zero_left n : gcd 0 n = n) #check (lcm_zero_right n : lcm n 0 = 0) #check (lcm_zero_left n : lcm 0 n = 0) example : gcd m n = gcd n m := by sorry end
-
-
-
@@ -1,141 +0,0 @@import Mathlib.Topology.MetricSpace.Basic section variable {α : Type _} [PartialOrder α] variable (x y z : α) #check x ≤ y #check (le_refl x : x ≤ x) #check (le_trans : x ≤ y → y ≤ z → x ≤ z) #check x < y #check (lt_irrefl x : ¬x < x) #check (lt_trans : x < y → y < z → x < z) #check (lt_of_le_of_lt : x ≤ y → y < z → x < z) #check (lt_of_lt_of_le : x < y → y ≤ z → x < z) example : x < y ↔ x ≤ y ∧ x ≠ y := lt_iff_le_and_ne end section variable {α : Type _} [Lattice α] variable (x y z : α) #check x ⊓ y #check (inf_le_left : x ⊓ y ≤ x) #check (inf_le_right : x ⊓ y ≤ y) #check (le_inf : z ≤ x → z ≤ y → z ≤ x ⊓ y) #check x ⊔ y #check (le_sup_left : x ≤ x ⊔ y) #check (le_sup_right : y ≤ x ⊔ y) #check (sup_le : x ≤ z → y ≤ z → x ⊔ y ≤ z) example : x ⊓ y = y ⊓ x := by sorry example : x ⊓ y ⊓ z = x ⊓ (y ⊓ z) := by sorry example : x ⊔ y = y ⊔ x := by sorry example : x ⊔ y ⊔ z = x ⊔ (y ⊔ z) := by sorry theorem absorb1 : x ⊓ (x ⊔ y) = x := by sorry theorem absorb2 : x ⊔ x ⊓ y = x := by sorry end section variable {α : Type _} [DistribLattice α] variable (x y z : α) #check (inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z) #check (inf_sup_right : (x ⊔ y) ⊓ z = x ⊓ z ⊔ y ⊓ z) #check (sup_inf_left : x ⊔ y ⊓ z = (x ⊔ y) ⊓ (x ⊔ z)) #check (sup_inf_right : x ⊓ y ⊔ z = (x ⊔ z) ⊓ (y ⊔ z)) end section variable {α : Type _} [Lattice α] variable (a b c : α) example (h : ∀ x y z : α, x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z) : a ⊔ b ⊓ c = (a ⊔ b) ⊓ (a ⊔ c) := by sorry example (h : ∀ x y z : α, x ⊔ y ⊓ z = (x ⊔ y) ⊓ (x ⊔ z)) : a ⊓ (b ⊔ c) = a ⊓ b ⊔ a ⊓ c := by sorry end section variable {R : Type _} [StrictOrderedRing R] variable (a b c : R) #check (add_le_add_left : a ≤ b → ∀ c, c + a ≤ c + b) #check (mul_pos : 0 < a → 0 < b → 0 < a * b) #check (mul_nonneg : 0 ≤ a → 0 ≤ b → 0 ≤ a * b) example : a ≤ b → 0 ≤ b - a := by sorry example : 0 ≤ b - a → a ≤ b := by sorry example (h : a ≤ b) (h' : 0 ≤ c) : a * c ≤ b * c := by sorry end section variable {X : Type _} [MetricSpace X] variable (x y z : X) #check (dist_self x : dist x x = 0) #check (dist_comm x y : dist x y = dist y x) #check (dist_triangle x y z : dist x z ≤ dist x y + dist y z) example (x y : X) : 0 ≤ dist x y := by sorry end
-
-
-
@@ -1,33 +0,0 @@import Mathlib.Data.Real.Basic import Mathlib.Data.Real.Basic example (a b c : ℝ) : c * b * a = b * (a * c) := by rw [mul_comm c b] rw [mul_assoc b c a] rw [mul_comm c a] example (a b c : ℝ) : a * (b * c) = b * (a * c) := by rw [← mul_assoc a b c] rw [mul_comm a b] rw [mul_assoc b a c] example (a b c : ℝ) : a * (b * c) = b * (c * a) := by rw [mul_comm] rw [mul_assoc] example (a b c : ℝ) : a * (b * c) = b * (a * c) := by rw [← mul_assoc] rw [mul_comm a] rw [mul_assoc] example (a b c d e f : ℝ) (h : b * c = e * f) : a * b * c * d = a * e * f * d := by rw [mul_assoc a] rw [h] rw [← mul_assoc] example (a b c d : ℝ) (hyp : c = b * a - d) (hyp' : d = a * b) : c = 0 := by rw [hyp] rw [hyp'] rw [mul_comm] rw [sub_self]
-
-
-
@@ -1,76 +0,0 @@import Mathlib.Algebra.Ring.Defs import Mathlib.Data.Real.Basic import Mathlib.Tactic namespace MyRing variable {R : Type _} [Ring R] theorem add_neg_cancel_right (a b : R) : a + b + -b = a := by rw [add_assoc, add_right_neg, add_zero] theorem add_left_cancel {a b c : R} (h : a + b = a + c) : b = c := by rw [← neg_add_cancel_left a b, h, neg_add_cancel_left] theorem add_right_cancel {a b c : R} (h : a + b = c + b) : a = c := by rw [← add_neg_cancel_right a b, h, add_neg_cancel_right] theorem zero_mul (a : R) : 0 * a = 0 := by have h : 0 * a + 0 * a = 0 * a + 0 := by rw [← add_mul, add_zero, add_zero] rw [add_left_cancel h] theorem neg_eq_of_add_eq_zero {a b : R} (h : a + b = 0) : -a = b := by rw [← neg_add_cancel_left a b, h, add_zero] theorem eq_neg_of_add_eq_zero {a b : R} (h : a + b = 0) : a = -b := by symm apply neg_eq_of_add_eq_zero rw [add_comm, h] theorem neg_zero : (-0 : R) = 0 := by apply neg_eq_of_add_eq_zero rw [add_zero] theorem neg_neg (a : R) : - -a = a := by apply neg_eq_of_add_eq_zero rw [add_left_neg] end MyRing namespace MyRing variable {R : Type _} [Ring R] theorem self_sub (a : R) : a - a = 0 := by rw [sub_eq_add_neg, add_right_neg] theorem one_add_one_eq_two : 1 + 1 = (2 : R) := by norm_num theorem two_mul (a : R) : 2 * a = a + a := by rw [← one_add_one_eq_two, add_mul, one_mul] end MyRing section variable {G : Type _} [Group G] namespace MyGroup theorem mul_right_inv (a : G) : a * a⁻¹ = 1 := by have h : (a * a⁻¹)⁻¹ * (a * a⁻¹ * (a * a⁻¹)) = 1 := by rw [mul_assoc, ← mul_assoc a⁻¹ a, mul_left_inv, one_mul, mul_left_inv] rw [← h, ← mul_assoc, mul_left_inv, one_mul] theorem mul_one (a : G) : a * 1 = a := by rw [← mul_left_inv a, ← mul_assoc, mul_right_inv, one_mul] theorem mul_inv_rev (a b : G) : (a * b)⁻¹ = b⁻¹ * a⁻¹ := by rw [← one_mul (b⁻¹ * a⁻¹), ← mul_left_inv (a * b), mul_assoc, mul_assoc, ← mul_assoc b b⁻¹, mul_right_inv, one_mul, mul_right_inv, mul_one] end MyGroup end
-
-
-
@@ -1,62 +0,0 @@import Mathlib.Analysis.SpecialFunctions.Log.Basic import Mathlib.Tactic variable (a b c d e : ℝ) open Real example (h₀ : a ≤ b) (h₁ : b < c) (h₂ : c ≤ d) (h₃ : d < e) : a < e := by apply lt_of_le_of_lt h₀ apply lt_trans h₁ exact lt_of_le_of_lt h₂ h₃ example (h₀ : d ≤ e) : c + exp (a + d) ≤ c + exp (a + e) := by apply add_le_add_left rw [exp_le_exp] apply add_le_add_left h₀ -- an alternative using `linarith`. example (h₀ : d ≤ e) : c + exp (a + d) ≤ c + exp (a + e) := by have : exp (a + d) ≤ exp (a + e) := by rw [exp_le_exp] linarith linarith [this] example (h : a ≤ b) : log (1 + exp a) ≤ log (1 + exp b) := by have h₀ : 0 < 1 + exp a := by linarith [exp_pos a] have h₁ : 0 < 1 + exp b := by linarith [exp_pos b] apply (log_le_log h₀ h₁).mpr apply add_le_add_left (exp_le_exp.mpr h) -- SOLUTION. example (h : a ≤ b) : c - exp b ≤ c - exp a := by apply sub_le_sub_left exact exp_le_exp.mpr h -- alternatively: example (h : a ≤ b) : c - exp b ≤ c - exp a := by linarith [exp_le_exp.mpr h] theorem fact1 : a * b * 2 ≤ a ^ 2 + b ^ 2 := by have h : 0 ≤ a ^ 2 - 2 * a * b + b ^ 2 calc a ^ 2 - 2 * a * b + b ^ 2 = (a - b) ^ 2 := by ring _ ≥ 0 := by apply pow_two_nonneg linarith theorem fact2 : -(a * b) * 2 ≤ a ^ 2 + b ^ 2 := by have h : 0 ≤ a ^ 2 + 2 * a * b + b ^ 2 calc a ^ 2 + 2 * a * b + b ^ 2 = (a + b) ^ 2 := by ring _ ≥ 0 := by apply pow_two_nonneg linarith example : abs (a * b) ≤ (a ^ 2 + b ^ 2) / 2 := by have h : (0 : ℝ) < 2 := by norm_num apply abs_le'.mpr constructor · rw [le_div_iff h] apply fact1 rw [le_div_iff h] apply fact2
-
-
-
@@ -1,124 +0,0 @@import Mathlib.Data.Real.Basic section variable (a b c d : ℝ) #check (min_le_left a b : min a b ≤ a) #check (min_le_right a b : min a b ≤ b) #check (le_min : c ≤ a → c ≤ b → c ≤ min a b) example : max a b = max b a := by apply le_antisymm repeat' apply max_le apply le_max_right apply le_max_left example : min (min a b) c = min a (min b c) := by apply le_antisymm · apply le_min · apply le_trans apply min_le_left apply min_le_left apply le_min · apply le_trans apply min_le_left apply min_le_right apply min_le_right apply le_min · apply le_min · apply min_le_left apply le_trans apply min_le_right apply min_le_left apply le_trans apply min_le_right apply min_le_right theorem aux : min a b + c ≤ min (a + c) (b + c) := by apply le_min · apply add_le_add_right apply min_le_left apply add_le_add_right apply min_le_right example : min a b + c = min (a + c) (b + c) := by apply le_antisymm · apply aux have h : min (a + c) (b + c) = min (a + c) (b + c) - c + c := by rw [sub_add_cancel] rw [h] apply add_le_add_right rw [sub_eq_add_neg] apply le_trans apply aux rw [add_neg_cancel_right, add_neg_cancel_right] example : abs a - abs b ≤ abs (a - b) := calc abs a - abs b = abs (a - b + b) - abs b := by rw [sub_add_cancel] _ ≤ abs (a - b) + abs b - abs b := by apply sub_le_sub_right apply abs_add _ ≤ abs (a - b) := by rw [add_sub_cancel] -- alternatively example : abs a - abs b ≤ abs (a - b) := by have h := abs_add (a - b) b rw [sub_add_cancel] at h linarith end section variable (w x y z : ℕ) example (h₀ : x ∣ y) (h₁ : y ∣ z) : x ∣ z := dvd_trans h₀ h₁ example : x ∣ y * x * z := by apply dvd_mul_of_dvd_left apply dvd_mul_left example : x ∣ x ^ 2 := by apply dvd_mul_left example (h : x ∣ w) : x ∣ y * (x * z) + x ^ 2 + w ^ 2 := by apply dvd_add · apply dvd_add · apply dvd_mul_of_dvd_right apply dvd_mul_right apply dvd_mul_left rw [pow_two] apply dvd_mul_of_dvd_right exact h end section variable (m n : ℕ) open Nat #check (gcd_zero_right n : gcd n 0 = n) #check (gcd_zero_left n : gcd 0 n = n) #check (lcm_zero_right n : lcm n 0 = 0) #check (lcm_zero_left n : lcm 0 n = 0) example : gcd m n = gcd n m := by apply _root_.dvd_antisymm repeat' apply dvd_gcd apply gcd_dvd_right apply gcd_dvd_left end
-
-
-
@@ -1,149 +0,0 @@import Mathlib.Topology.MetricSpace.Basic section variable {α : Type _} [Lattice α] variable (x y z : α) example : x ⊓ y = y ⊓ x := by apply le_antisymm repeat' apply le_inf · apply inf_le_right apply inf_le_left example : x ⊓ y ⊓ z = x ⊓ (y ⊓ z) := by apply le_antisymm · apply le_inf · apply le_trans apply inf_le_left apply inf_le_left apply le_inf · apply le_trans apply inf_le_left apply inf_le_right apply inf_le_right apply le_inf · apply le_inf · apply inf_le_left apply le_trans apply inf_le_right apply inf_le_left apply le_trans apply inf_le_right apply inf_le_right example : x ⊔ y = y ⊔ x := by apply le_antisymm repeat' apply sup_le · apply le_sup_right apply le_sup_left example : x ⊔ y ⊔ z = x ⊔ (y ⊔ z) := by apply le_antisymm · apply sup_le · apply sup_le apply le_sup_left · apply le_trans apply @le_sup_left _ _ y z apply le_sup_right apply le_trans apply @le_sup_right _ _ y z apply le_sup_right apply sup_le · apply le_trans apply @le_sup_left _ _ x y apply le_sup_left apply sup_le · apply le_trans apply @le_sup_right _ _ x y apply le_sup_left apply le_sup_right theorem absorb1 : x ⊓ (x ⊔ y) = x := by apply le_antisymm · apply inf_le_left apply le_inf · apply le_refl apply le_sup_left theorem absorb2 : x ⊔ x ⊓ y = x := by apply le_antisymm · apply sup_le · apply le_refl apply inf_le_left apply le_sup_left end section variable {α : Type _} [DistribLattice α] variable (x y z : α) #check (inf_sup_left : x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z) #check (inf_sup_right : (x ⊔ y) ⊓ z = x ⊓ z ⊔ y ⊓ z) #check (sup_inf_left : x ⊔ y ⊓ z = (x ⊔ y) ⊓ (x ⊔ z)) #check (sup_inf_right : x ⊓ y ⊔ z = (x ⊔ z) ⊓ (y ⊔ z)) end section variable {α : Type _} [Lattice α] variable (a b c : α) example (h : ∀ x y z : α, x ⊓ (y ⊔ z) = x ⊓ y ⊔ x ⊓ z) : a ⊔ b ⊓ c = (a ⊔ b) ⊓ (a ⊔ c) := by rw [h, @inf_comm _ _ (a ⊔ b), absorb1, @inf_comm _ _ (a ⊔ b), h, ← sup_assoc, @inf_comm _ _ c a, absorb2, inf_comm] example (h : ∀ x y z : α, x ⊔ y ⊓ z = (x ⊔ y) ⊓ (x ⊔ z)) : a ⊓ (b ⊔ c) = a ⊓ b ⊔ a ⊓ c := by rw [h, @sup_comm _ _ (a ⊓ b), absorb2, @sup_comm _ _ (a ⊓ b), h, ← inf_assoc, @sup_comm _ _ c a, absorb1, sup_comm] end section variable {R : Type _} [StrictOrderedRing R] variable (a b c : R) theorem aux1 : a ≤ b → 0 ≤ b - a := by intro h rw [← sub_self a, sub_eq_add_neg, sub_eq_add_neg, add_comm, add_comm b] apply add_le_add_left h theorem aux2 : 0 ≤ b - a → a ≤ b := by intro h rw [← add_zero a, ← sub_add_cancel b a, add_comm (b - a)] apply add_le_add_left h example (h : a ≤ b) (h' : 0 ≤ c) : a * c ≤ b * c := by have h1 : 0 ≤ (b - a) * c := mul_nonneg (aux1 _ _ h) h' rw [sub_mul] at h1 exact aux2 _ _ h1 end section variable {X : Type _} [MetricSpace X] variable (x y z : X) example (x y : X) : 0 ≤ dist x y :=by have : 0 ≤ dist x y + dist y x := by rw [← dist_self x] apply dist_triangle linarith [dist_comm x y] end
-
-
src/C_Hierarchies/S01_Basics.lean (deleted)
-
@@ -1,308 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic class One₁ (α : Type) where /-- The element one -/ one : α #check One₁.one -- One₁.one {α : Type} [self : One₁ α] : α @[class] structure One₂ (α : Type) where /-- The element one -/ one : α #check One₂.one example (α : Type) [One₁ α] : α := One₁.one example (α : Type) [One₁ α] := (One₁.one : α) @[inherit_doc] notation "𝟙" => One₁.one example {α : Type} [One₁ α] : α := 𝟙 example {α : Type} [One₁ α] : (𝟙 : α) = 𝟙 := rfl class Dia₁ (α : Type) where dia : α → α → α infixl:70 " ⋄ " => Dia₁.dia class Semigroup₁ (α : Type) where toDia₁ : Dia₁ α /-- Diamond is associative -/ dia_assoc : ∀ a b c : α, a ⋄ b ⋄ c = a ⋄ (b ⋄ c) attribute [instance] Semigroup₁.toDia₁ example {α : Type} [Semigroup₁ α] (a b : α) : α := a ⋄ b class Semigroup₂ (α : Type) extends Dia₁ α where /-- Diamond is associative -/ dia_assoc : ∀ a b c : α, a ⋄ b ⋄ c = a ⋄ (b ⋄ c) example {α : Type} [Semigroup₂ α] (a b : α) : α := a ⋄ b class DiaOneClass₁ (α : Type) extends One₁ α, Dia₁ α where /-- One is a left neutral element for diamond. -/ one_dia : ∀ a : α, 𝟙 ⋄ a = a /-- One is a right neutral element for diamond -/ dia_one : ∀ a : α, a ⋄ 𝟙 = a set_option trace.Meta.synthInstance true in example {α : Type} [DiaOneClass₁ α] (a b : α) : Prop := a ⋄ b = 𝟙 class Monoid₁ (α : Type) extends Semigroup₁ α, DiaOneClass₁ α class Monoid₂ (α : Type) where toSemigroup₁ : Semigroup₁ α toDiaOneClass₁ : DiaOneClass₁ α example {α : Type} [Monoid₁ α] : (Monoid₁.toSemigroup₁.toDia₁.dia : α → α → α) = Monoid₁.toDiaOneClass₁.toDia₁.dia := rfl /- Monoid₂.mk {α : Type} (toSemigroup₁ : Semigroup₁ α) (toDiaOneClass₁ : DiaOneClass₁ α) : Monoid₂ α -/ #check Monoid₂.mk /- Monoid₁.mk {α : Type} [toSemigroup₁ : Semigroup₁ α] [toOne₁ : One₁ α] (one_dia : ∀ (a : α), 𝟙 ⋄ a = a) (dia_one : ∀ (a : α), a ⋄ 𝟙 = a) : Monoid₁ α -/ #check Monoid₁.mk #check Monoid₁.toSemigroup₁ #check Monoid₁.toDiaOneClass₁ class Inv₁ (α : Type) where /-- The inversion function -/ inv : α → α @[inherit_doc] postfix:max "⁻¹" => Inv₁.inv class Group₁ (G : Type) extends Monoid₁ G, Inv G where inv_dia : ∀ a : G, a⁻¹ ⋄ a = 𝟙 lemma left_inv_eq_right_inv₁ {M : Type} [Monoid₁ M] {a b c : M} (hba : b ⋄ a = 𝟙) (hac : a ⋄ c = 𝟙) : b = c := by rw [← DiaOneClass₁.one_dia c, ← hba, Semigroup₁.dia_assoc, hac, DiaOneClass₁.dia_one b] export DiaOneClass₁ (one_dia dia_one) export Semigroup₁ (dia_assoc) export Group₁ (inv_dia) example {M : Type} [Monoid₁ M] {a b c : M} (hba : b ⋄ a = 𝟙) (hac : a ⋄ c = 𝟙) : b = c := by rw [← one_dia c, ← hba, dia_assoc, hac, dia_one b] lemma inv_eq_of_dia [Group₁ G] {a b : G} (h : a ⋄ b = 𝟙) : a⁻¹ = b := sorry lemma dia_inv [Group₁ G] (a : G) : a ⋄ a⁻¹ = 𝟙 := sorry class AddSemigroup₃ (α : Type) extends Add α where /-- Multiplication is associative -/ add_assoc₃ : ∀ a b c : α, a + b + c = a + (b + c) @[to_additive AddSemigroup₃] class Semigroup₃ (α : Type) extends Mul α where /-- Multiplication is associative -/ mul_assoc₃ : ∀ a b c : α, a * b * c = a * (b * c) class AddMonoid₃ (α : Type) extends AddSemigroup₃ α, AddZeroClass α @[to_additive AddMonoid₃] class Monoid₃ (α : Type) extends Semigroup₃ α, MulOneClass α attribute [to_additive existing] Monoid₃.toMulOneClass export Semigroup₃ (mul_assoc₃) export AddSemigroup₃ (add_assoc₃) whatsnew in @[to_additive] lemma left_inv_eq_right_inv' {M : Type} [Monoid₃ M] {a b c : M} (hba : b * a = 1) (hac : a * c = 1) : b = c := by rw [← one_mul c, ← hba, mul_assoc₃, hac, mul_one b] #check left_neg_eq_right_neg' class AddCommSemigroup₃ (α : Type) extends AddSemigroup₃ α where add_comm : ∀ a b : α, a + b = b + a @[to_additive AddCommSemigroup₃] class CommSemigroup₃ (α : Type) extends Semigroup₃ α where mul_comm : ∀ a b : α, a * b = b * a class AddCommMonoid₃ (α : Type) extends AddMonoid₃ α, AddCommSemigroup₃ α @[to_additive AddCommMonoid₃] class CommMonoid₃ (α : Type) extends Monoid₃ α, CommSemigroup₃ α class AddGroup₃ (G : Type) extends AddMonoid₃ G, Neg G where neg_add : ∀ a : G, -a + a = 0 @[to_additive AddGroup₃] class Group₃ (G : Type) extends Monoid₃ G, Inv G where inv_mul : ∀ a : G, a⁻¹ * a = 1 attribute [simp] Group₃.inv_mul AddGroup₃.neg_add @[to_additive] lemma inv_eq_of_mul [Group₃ G] {a b : G} (h : a * b = 1) : a⁻¹ = b := sorry @[to_additive (attr := simp)] lemma Group₃.mul_inv {G : Type} [Group₃ G] {a : G} : a * a⁻¹ = 1 := by sorry @[to_additive] lemma mul_left_cancel₃ {G : Type} [Group₃ G] {a b c : G} (h : a * b = a * c) : b = c := by sorry @[to_additive] lemma mul_right_cancel₃ {G : Type} [Group₃ G] {a b c : G} (h : b*a = c*a) : b = c := by sorry class AddCommGroup₃ (G : Type) extends AddGroup₃ G, AddCommMonoid₃ G @[to_additive AddCommGroup₃] class CommGroup₃ (G : Type) extends Group₃ G, CommMonoid₃ G class Ring₃ (R : Type) extends AddGroup₃ R, Monoid₃ R, MulZeroClass R where /-- Multiplication is left distributive over addition -/ left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c /-- Multiplication is right distributive over addition -/ right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c instance {R : Type} [Ring₃ R] : AddCommGroup₃ R := { Ring₃.toAddGroup₃ with add_comm := by sorry } instance : Ring₃ ℤ where add := (· + ·) add_assoc₃ := add_assoc zero := 0 zero_add := by simp add_zero := by simp neg := (- ·) neg_add := by simp mul := (· * ·) mul_assoc₃ := mul_assoc one := 1 one_mul := by simp mul_one := by simp zero_mul := by simp mul_zero := by simp left_distrib := Int.mul_add right_distrib := Int.add_mul class LE₁ (α : Type) where /-- The Less-or-Equal relation. -/ le : α → α → Prop @[inherit_doc] infix:50 " ≤₁ " => LE₁.le class Preorder₁ (α : Type) class PartialOrder₁ (α : Type) class OrderedCommMonoid₁ (α : Type) instance : OrderedCommMonoid₁ ℕ where class SMul₃ (α : Type) (β : Type) where /-- Scalar multiplication -/ smul : α → β → β infixr:73 " • " => SMul₃.smul class Module₁ (R : Type) [Ring₃ R] (M : Type) [AddCommGroup₃ M] extends SMul₃ R M where zero_smul : ∀ m : M, (0 : R) • m = 0 one_smul : ∀ m : M, (1 : R) • m = m mul_smul : ∀ (a b : R) (m : M), (a * b) • m = a • b • m add_smul : ∀ (a b : R) (m : M), (a + b) • m = a • m + b • m smul_add : ∀ (a : R) (m n : M), a • (m + n) = a • m + a • n instance selfModule (R : Type) [Ring₃ R] : Module₁ R R where smul := fun r s ↦ r*s zero_smul := zero_mul one_smul := one_mul mul_smul := mul_assoc₃ add_smul := Ring₃.right_distrib smul_add := Ring₃.left_distrib def nsmul₁ [Zero M] [Add M] : ℕ → M → M | 0, _ => 0 | n + 1, a => a + nsmul₁ n a def zsmul₁ {M : Type _} [Zero M] [Add M] [Neg M] : ℤ → M → M | Int.ofNat n, a => nsmul₁ n a | Int.negSucc n, a => -nsmul₁ n.succ a instance abGrpModule (A : Type) [AddCommGroup₃ A] : Module₁ ℤ A where smul := zsmul₁ zero_smul := sorry one_smul := sorry mul_smul := sorry add_smul := sorry smul_add := sorry #synth Module₁ ℤ ℤ -- abGrpModule ℤ class AddMonoid₄ (M : Type) extends AddSemigroup₃ M, AddZeroClass M where /-- Multiplication by a natural number. -/ nsmul : ℕ → M → M := nsmul₁ /-- Multiplication by `(0 : ℕ)` gives `0`. -/ nsmul_zero : ∀ x, nsmul 0 x = 0 := by intros; rfl /-- Multiplication by `(n + 1 : ℕ)` behaves as expected. -/ nsmul_succ : ∀ (n : ℕ) (x), nsmul (n + 1) x = x + nsmul n x := by intros; rfl instance mySMul {M : Type} [AddMonoid₄ M] : SMul ℕ M := ⟨AddMonoid₄.nsmul⟩ instance (M N : Type) [AddMonoid₄ M] [AddMonoid₄ N] : AddMonoid₄ (M × N) where add := fun p q ↦ (p.1 + q.1, p.2 + q.2) add_assoc₃ := fun a b c ↦ by ext <;> apply add_assoc₃ zero := (0, 0) zero_add := fun a ↦ by ext <;> apply zero_add add_zero := fun a ↦ by ext <;> apply add_zero instance : AddMonoid₄ ℤ where add := (· + ·) add_assoc₃ := Int.add_assoc zero := 0 zero_add := Int.zero_add add_zero := Int.add_zero nsmul := fun n m ↦ (n : ℤ) * m nsmul_zero := Int.zero_mul nsmul_succ := fun n m ↦ show (n + 1 : ℤ) * m = m + n * m by rw [Int.add_mul, Int.add_comm, Int.one_mul] example (n : ℕ) (m : ℤ) : SMul.smul (self := mySMul) n m = n * m := rfl
-
-
src/C_Hierarchies/S02_Morphisms.lean (deleted)
-
@@ -1,114 +0,0 @@import Mathlib.Topology.Instances.Real def isMonoidHom₁ [Monoid G] [Monoid H] (f : G → H) : Prop := f 1 = 1 ∧ ∀ g g', f (g * g') = f g * f g' structure isMonoidHom₂ [Monoid G] [Monoid H] (f : G → H) : Prop where map_one : f 1 = 1 map_mul : ∀ g g', f (g * g') = f g * f g' example : Continuous (id : ℝ → ℝ) := continuous_id @[ext] structure MonoidHom₁ (G H : Type) [Monoid G] [Monoid H] where toFun : G → H map_one : toFun 1 = 1 map_mul : ∀ g g', toFun (g * g') = toFun g * toFun g' instance [Monoid G] [Monoid H] : CoeFun (MonoidHom₁ G H) (fun _ ↦ G → H) where coe := MonoidHom₁.toFun attribute [coe] MonoidHom₁.toFun example [Monoid G] [Monoid H] (f : MonoidHom₁ G H) : f 1 = 1 := f.map_one @[ext] structure AddMonoidHom₁ (G H : Type) [AddMonoid G] [AddMonoid H] where toFun : G → H map_zero : toFun 0 = 0 map_add : ∀ g g', toFun (g + g') = toFun g + toFun g' instance [AddMonoid G] [AddMonoid H] : CoeFun (AddMonoidHom₁ G H) (fun _ ↦ G → H) where coe := AddMonoidHom₁.toFun attribute [coe] AddMonoidHom₁.toFun @[ext] structure RingHom₁ (R S : Type) [Ring R] [Ring S] extends MonoidHom₁ R S, AddMonoidHom₁ R S class MonoidHomClass₁ (F : Type) (M N : Type) [Monoid M] [Monoid N] where toFun : F → M → N map_one : ∀ f : F, toFun f 1 = 1 map_mul : ∀ f g g', toFun f (g * g') = toFun f g * toFun f g' def badInst [Monoid M] [Monoid N] [MonoidHomClass₁ F M N] : CoeFun F (fun _ ↦ M → N) where coe := MonoidHomClass₁.toFun class MonoidHomClass₂ (F : Type) (M N : outParam Type) [Monoid M] [Monoid N] where toFun : F → M → N map_one : ∀ f : F, toFun f 1 = 1 map_mul : ∀ f g g', toFun f (g * g') = toFun f g * toFun f g' instance [Monoid M] [Monoid N] [MonoidHomClass₂ F M N] : CoeFun F (fun _ ↦ M → N) where coe := MonoidHomClass₂.toFun attribute [coe] MonoidHomClass₂.toFun instance (M N : Type) [Monoid M] [Monoid N] : MonoidHomClass₂ (MonoidHom₁ M N) M N where toFun := MonoidHom₁.toFun map_one := fun f ↦ f.map_one map_mul := fun f ↦ f.map_mul instance (R S : Type) [Ring R] [Ring S] : MonoidHomClass₂ (RingHom₁ R S) R S where toFun := fun f ↦ f.toMonoidHom₁.toFun map_one := fun f ↦ f.toMonoidHom₁.map_one map_mul := fun f ↦ f.toMonoidHom₁.map_mul lemma map_inv_of_inv [Monoid M] [Monoid N] [MonoidHomClass₂ F M N] (f : F) {m m' : M} (h : m*m' = 1) : f m * f m' = 1 := by rw [← MonoidHomClass₂.map_mul, h, MonoidHomClass₂.map_one] example [Monoid M] [Monoid N] (f : MonoidHom₁ M N) {m m' : M} (h : m*m' = 1) : f m * f m' = 1 := map_inv_of_inv f h example [Ring R] [Ring S] (f : RingHom₁ R S) {r r' : R} (h : r*r' = 1) : f r * f r' = 1 := map_inv_of_inv f h class MonoidHomClass₃ (F : Type) (M N : outParam Type) [Monoid M] [Monoid N] extends FunLike F M (fun _ ↦ N) where map_one : ∀ f : F, f 1 = 1 map_mul : ∀ (f : F) g g', f (g * g') = f g * f g' instance (M N : Type) [Monoid M] [Monoid N] : MonoidHomClass₃ (MonoidHom₁ M N) M N where coe := MonoidHom₁.toFun coe_injective' := MonoidHom₁.ext map_one := MonoidHom₁.map_one map_mul := MonoidHom₁.map_mul @[ext] structure OrderPresHom (α β : Type) [LE α] [LE β] where toFun : α → β le_of_le : ∀ a a', a ≤ a' → toFun a ≤ toFun a' @[ext] structure OrderPresMonoidHom (M N : Type) [Monoid M] [LE M] [Monoid N] [LE N] extends MonoidHom₁ M N, OrderPresHom M N class OrderPresHomClass (F : Type) (α β : outParam Type) [LE α] [LE β] instance (α β : Type) [LE α] [LE β] : OrderPresHomClass (OrderPresHom α β) α β where instance (α β : Type) [LE α] [Monoid α] [LE β] [Monoid β] : OrderPresHomClass (OrderPresMonoidHom α β) α β where instance (α β : Type) [LE α] [Monoid α] [LE β] [Monoid β] : MonoidHomClass₃ (OrderPresMonoidHom α β) α β := sorry
-
-
src/C_Hierarchies/S03_Subobjects.lean (deleted)
-
@@ -1,88 +0,0 @@import Mathlib.GroupTheory.QuotientGroup @[ext] structure Submonoid₁ (M : Type) [Monoid M] where /-- The carrier of a submonoid. -/ carrier : Set M /-- The product of two elements of a submonoid belongs to the submonoid. -/ mul_mem {a b} : a ∈ carrier → b ∈ carrier → a * b ∈ carrier /-- The unit element belongs to the submonoid. -/ one_mem : 1 ∈ carrier /-- Submonoids in `M` can be seen as sets in `M`. -/ instance [Monoid M] : SetLike (Submonoid₁ M) M where coe := Submonoid₁.carrier coe_injective' := Submonoid₁.ext example [Monoid M] (N : Submonoid₁ M) : 1 ∈ N := N.one_mem example [Monoid M] (N : Submonoid₁ M) (α : Type) (f : M → α) := f '' N example [Monoid M] (N : Submonoid₁ M) (x : N) : (x : M) ∈ N := x.property instance SubMonoid₁Monoid [Monoid M] (N : Submonoid₁ M) : Monoid N where mul := fun x y ↦ ⟨x*y, N.mul_mem x.property y.property⟩ mul_assoc := fun x y z ↦ SetCoe.ext (mul_assoc (x : M) y z) one := ⟨1, N.one_mem⟩ one_mul := fun x ↦ SetCoe.ext (one_mul (x : M)) mul_one := fun x ↦ SetCoe.ext (mul_one (x : M)) example [Monoid M] (N : Submonoid₁ M) : Monoid N where mul := fun ⟨x, hx⟩ ⟨y, hy⟩ ↦ ⟨x*y, N.mul_mem hx hy⟩ mul_assoc := fun ⟨x, _⟩ ⟨y, _⟩ ⟨z, _⟩ ↦ SetCoe.ext (mul_assoc x y z) one := ⟨1, N.one_mem⟩ one_mul := fun ⟨x, _⟩ ↦ SetCoe.ext (one_mul x) mul_one := fun ⟨x, _⟩ ↦ SetCoe.ext (mul_one x) class SubmonoidClass₁ (S : Type) (M : Type) [Monoid M] [SetLike S M] : Prop where mul_mem : ∀ (s : S) {a b : M}, a ∈ s → b ∈ s → a * b ∈ s one_mem : ∀ s : S, 1 ∈ s instance [Monoid M] : SubmonoidClass₁ (Submonoid₁ M) M where mul_mem := Submonoid₁.mul_mem one_mem := Submonoid₁.one_mem instance [Monoid M] : Inf (Submonoid₁ M) := ⟨fun S₁ S₂ => { carrier := S₁ ∩ S₂ one_mem := ⟨S₁.one_mem, S₂.one_mem⟩ mul_mem := fun ⟨hx, hx'⟩ ⟨hy, hy'⟩ ↦ ⟨S₁.mul_mem hx hy, S₂.mul_mem hx' hy'⟩ }⟩ example [Monoid M] (N P : Submonoid₁ M) : Submonoid₁ M := N ⊓ P def Submonoid.Setoid [CommMonoid M] (N : Submonoid M) : Setoid M where r := fun x y ↦ ∃ w ∈ N, ∃ z ∈ N, x*w = y*z iseqv := { refl := fun x ↦ ⟨1, N.one_mem, 1, N.one_mem, rfl⟩ symm := fun ⟨w, hw, z, hz, h⟩ ↦ ⟨z, hz, w, hw, h.symm⟩ trans := by sorry } instance [CommMonoid M] : HasQuotient M (Submonoid M) where quotient' := fun N ↦ Quotient N.Setoid def QuotientMonoid.mk [CommMonoid M] (N : Submonoid M) : M → M ⧸ N := Quotient.mk N.Setoid instance [CommMonoid M] (N : Submonoid M) : Monoid (M ⧸ N) where mul := Quotient.map₂' (· * ·) (by sorry ) mul_assoc := by sorry one := QuotientMonoid.mk N 1 one_mul := by sorry mul_one := by sorry
-
-
-
@@ -1,348 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic class One₁ (α : Type) where /-- The element one -/ one : α #check One₁.one -- One₁.one {α : Type} [self : One₁ α] : α @[class] structure One₂ (α : Type) where /-- The element one -/ one : α #check One₂.one example (α : Type) [One₁ α] : α := One₁.one example (α : Type) [One₁ α] := (One₁.one : α) @[inherit_doc] notation "𝟙" => One₁.one example {α : Type} [One₁ α] : α := 𝟙 example {α : Type} [One₁ α] : (𝟙 : α) = 𝟙 := rfl class Dia₁ (α : Type) where dia : α → α → α infixl:70 " ⋄ " => Dia₁.dia class Semigroup₁ (α : Type) where toDia₁ : Dia₁ α /-- Diamond is associative -/ dia_assoc : ∀ a b c : α, a ⋄ b ⋄ c = a ⋄ (b ⋄ c) attribute [instance] Semigroup₁.toDia₁ example {α : Type} [Semigroup₁ α] (a b : α) : α := a ⋄ b class Semigroup₂ (α : Type) extends Dia₁ α where /-- Diamond is associative -/ dia_assoc : ∀ a b c : α, a ⋄ b ⋄ c = a ⋄ (b ⋄ c) example {α : Type} [Semigroup₂ α] (a b : α) : α := a ⋄ b class DiaOneClass₁ (α : Type) extends One₁ α, Dia₁ α where /-- One is a left neutral element for diamond. -/ one_dia : ∀ a : α, 𝟙 ⋄ a = a /-- One is a right neutral element for diamond -/ dia_one : ∀ a : α, a ⋄ 𝟙 = a set_option trace.Meta.synthInstance true in example {α : Type} [DiaOneClass₁ α] (a b : α) : Prop := a ⋄ b = 𝟙 class Monoid₁ (α : Type) extends Semigroup₁ α, DiaOneClass₁ α class Monoid₂ (α : Type) where toSemigroup₁ : Semigroup₁ α toDiaOneClass₁ : DiaOneClass₁ α example {α : Type} [Monoid₁ α] : (Monoid₁.toSemigroup₁.toDia₁.dia : α → α → α) = Monoid₁.toDiaOneClass₁.toDia₁.dia := rfl /- Monoid₂.mk {α : Type} (toSemigroup₁ : Semigroup₁ α) (toDiaOneClass₁ : DiaOneClass₁ α) : Monoid₂ α -/ #check Monoid₂.mk /- Monoid₁.mk {α : Type} [toSemigroup₁ : Semigroup₁ α] [toOne₁ : One₁ α] (one_dia : ∀ (a : α), 𝟙 ⋄ a = a) (dia_one : ∀ (a : α), a ⋄ 𝟙 = a) : Monoid₁ α -/ #check Monoid₁.mk #check Monoid₁.toSemigroup₁ #check Monoid₁.toDiaOneClass₁ class Inv₁ (α : Type) where /-- The inversion function -/ inv : α → α @[inherit_doc] postfix:max "⁻¹" => Inv₁.inv class Group₁ (G : Type) extends Monoid₁ G, Inv G where inv_dia : ∀ a : G, a⁻¹ ⋄ a = 𝟙 lemma left_inv_eq_right_inv₁ {M : Type} [Monoid₁ M] {a b c : M} (hba : b ⋄ a = 𝟙) (hac : a ⋄ c = 𝟙) : b = c := by rw [← DiaOneClass₁.one_dia c, ← hba, Semigroup₁.dia_assoc, hac, DiaOneClass₁.dia_one b] export DiaOneClass₁ (one_dia dia_one) export Semigroup₁ (dia_assoc) export Group₁ (inv_dia) example {M : Type} [Monoid₁ M] {a b c : M} (hba : b ⋄ a = 𝟙) (hac : a ⋄ c = 𝟙) : b = c := by rw [← one_dia c, ← hba, dia_assoc, hac, dia_one b] lemma inv_eq_of_dia [Group₁ G] {a b : G} (h : a ⋄ b = 𝟙) : a⁻¹ = b := left_inv_eq_right_inv₁ (inv_dia a) h lemma dia_inv [Group₁ G] (a : G) : a ⋄ a⁻¹ = 𝟙 := by rw [← inv_dia a⁻¹, inv_eq_of_dia (inv_dia a)] class AddSemigroup₃ (α : Type) extends Add α where /-- Multiplication is associative -/ add_assoc₃ : ∀ a b c : α, a + b + c = a + (b + c) @[to_additive AddSemigroup₃] class Semigroup₃ (α : Type) extends Mul α where /-- Multiplication is associative -/ mul_assoc₃ : ∀ a b c : α, a * b * c = a * (b * c) class AddMonoid₃ (α : Type) extends AddSemigroup₃ α, AddZeroClass α @[to_additive AddMonoid₃] class Monoid₃ (α : Type) extends Semigroup₃ α, MulOneClass α attribute [to_additive existing] Monoid₃.toMulOneClass export Semigroup₃ (mul_assoc₃) export AddSemigroup₃ (add_assoc₃) whatsnew in @[to_additive] lemma left_inv_eq_right_inv' {M : Type} [Monoid₃ M] {a b c : M} (hba : b * a = 1) (hac : a * c = 1) : b = c := by rw [← one_mul c, ← hba, mul_assoc₃, hac, mul_one b] #check left_neg_eq_right_neg' class AddCommSemigroup₃ (α : Type) extends AddSemigroup₃ α where add_comm : ∀ a b : α, a + b = b + a @[to_additive AddCommSemigroup₃] class CommSemigroup₃ (α : Type) extends Semigroup₃ α where mul_comm : ∀ a b : α, a * b = b * a class AddCommMonoid₃ (α : Type) extends AddMonoid₃ α, AddCommSemigroup₃ α @[to_additive AddCommMonoid₃] class CommMonoid₃ (α : Type) extends Monoid₃ α, CommSemigroup₃ α class AddGroup₃ (G : Type) extends AddMonoid₃ G, Neg G where neg_add : ∀ a : G, -a + a = 0 @[to_additive AddGroup₃] class Group₃ (G : Type) extends Monoid₃ G, Inv G where inv_mul : ∀ a : G, a⁻¹ * a = 1 attribute [simp] Group₃.inv_mul AddGroup₃.neg_add @[to_additive] lemma inv_eq_of_mul [Group₃ G] {a b : G} (h : a * b = 1) : a⁻¹ = b := left_inv_eq_right_inv' (Group₃.inv_mul a) h @[to_additive (attr := simp)] lemma Group₃.mul_inv {G : Type} [Group₃ G] {a : G} : a * a⁻¹ = 1 := by rw [← inv_mul a⁻¹, inv_eq_of_mul (inv_mul a)] @[to_additive] lemma mul_left_cancel₃ {G : Type} [Group₃ G] {a b c : G} (h : a * b = a * c) : b = c := by simpa [← mul_assoc₃] using congr_arg (a⁻¹ * ·) h @[to_additive] lemma mul_right_cancel₃ {G : Type} [Group₃ G] {a b c : G} (h : b*a = c*a) : b = c := by simpa [mul_assoc₃] using congr_arg (· * a⁻¹) h class AddCommGroup₃ (G : Type) extends AddGroup₃ G, AddCommMonoid₃ G @[to_additive AddCommGroup₃] class CommGroup₃ (G : Type) extends Group₃ G, CommMonoid₃ G class Ring₃ (R : Type) extends AddGroup₃ R, Monoid₃ R, MulZeroClass R where /-- Multiplication is left distributive over addition -/ left_distrib : ∀ a b c : R, a * (b + c) = a * b + a * c /-- Multiplication is right distributive over addition -/ right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c instance {R : Type} [Ring₃ R] : AddCommGroup₃ R := { Ring₃.toAddGroup₃ with add_comm := by intro a b have : a + (a + b + b) = a + (b + a + b) := calc a + (a + b + b) = (a + a) + (b + b) := by simp [add_assoc₃, add_assoc₃] _ = (1 * a + 1 * a) + (1 * b + 1 * b) := by simp _ = (1 + 1) * a + (1 + 1) * b := by simp [Ring₃.right_distrib] _ = (1 + 1) * (a + b) := by simp [Ring₃.left_distrib] _ = 1 * (a + b) + 1 * (a + b) := by simp [Ring₃.right_distrib] _ = (a + b) + (a + b) := by simp _ = a + (b + a + b) := by simp [add_assoc₃] exact add_right_cancel₃ (add_left_cancel₃ this) } instance : Ring₃ ℤ where add := (· + ·) add_assoc₃ := add_assoc zero := 0 zero_add := by simp add_zero := by simp neg := (- ·) neg_add := by simp mul := (· * ·) mul_assoc₃ := mul_assoc one := 1 one_mul := by simp mul_one := by simp zero_mul := by simp mul_zero := by simp left_distrib := Int.mul_add right_distrib := Int.add_mul class LE₁ (α : Type) where /-- The Less-or-Equal relation. -/ le : α → α → Prop @[inherit_doc] infix:50 " ≤₁ " => LE₁.le class Preorder₁ (α : Type) extends LE₁ α where le_refl : ∀ a : α, a ≤₁ a le_trans : ∀ a b c : α, a ≤₁ b → b ≤₁ c → a ≤₁ c class PartialOrder₁ (α : Type) extends Preorder₁ α where le_antisymm : ∀ a b : α, a ≤₁ b → b ≤₁ a → a = b class OrderedCommMonoid₁ (α : Type) extends PartialOrder₁ α, CommMonoid₃ α where mul_of_le : ∀ a b : α, a ≤₁ b → ∀ c : α, c * a ≤₁ c * b instance : OrderedCommMonoid₁ ℕ where le := (· ≤ ·) le_refl := fun _ ↦ le_rfl le_trans := fun _ _ _ ↦ le_trans le_antisymm := fun _ _ ↦ le_antisymm mul := (· * ·) mul_assoc₃ := mul_assoc one := 1 one_mul := one_mul mul_one := mul_one mul_comm := mul_comm mul_of_le := fun _ _ h c ↦ Nat.mul_le_mul_left c h class SMul₃ (α : Type) (β : Type) where /-- Scalar multiplication -/ smul : α → β → β infixr:73 " • " => SMul₃.smul class Module₁ (R : Type) [Ring₃ R] (M : Type) [AddCommGroup₃ M] extends SMul₃ R M where zero_smul : ∀ m : M, (0 : R) • m = 0 one_smul : ∀ m : M, (1 : R) • m = m mul_smul : ∀ (a b : R) (m : M), (a * b) • m = a • b • m add_smul : ∀ (a b : R) (m : M), (a + b) • m = a • m + b • m smul_add : ∀ (a : R) (m n : M), a • (m + n) = a • m + a • n instance selfModule (R : Type) [Ring₃ R] : Module₁ R R where smul := fun r s ↦ r*s zero_smul := zero_mul one_smul := one_mul mul_smul := mul_assoc₃ add_smul := Ring₃.right_distrib smul_add := Ring₃.left_distrib def nsmul₁ [Zero M] [Add M] : ℕ → M → M | 0, _ => 0 | n + 1, a => a + nsmul₁ n a def zsmul₁ {M : Type _} [Zero M] [Add M] [Neg M] : ℤ → M → M | Int.ofNat n, a => nsmul₁ n a | Int.negSucc n, a => -nsmul₁ n.succ a instance abGrpModule (A : Type) [AddCommGroup₃ A] : Module₁ ℤ A where smul := zsmul₁ zero_smul := sorry one_smul := sorry mul_smul := sorry add_smul := sorry smul_add := sorry #synth Module₁ ℤ ℤ -- abGrpModule ℤ class AddMonoid₄ (M : Type) extends AddSemigroup₃ M, AddZeroClass M where /-- Multiplication by a natural number. -/ nsmul : ℕ → M → M := nsmul₁ /-- Multiplication by `(0 : ℕ)` gives `0`. -/ nsmul_zero : ∀ x, nsmul 0 x = 0 := by intros; rfl /-- Multiplication by `(n + 1 : ℕ)` behaves as expected. -/ nsmul_succ : ∀ (n : ℕ) (x), nsmul (n + 1) x = x + nsmul n x := by intros; rfl instance mySMul {M : Type} [AddMonoid₄ M] : SMul ℕ M := ⟨AddMonoid₄.nsmul⟩ instance (M N : Type) [AddMonoid₄ M] [AddMonoid₄ N] : AddMonoid₄ (M × N) where add := fun p q ↦ (p.1 + q.1, p.2 + q.2) add_assoc₃ := fun a b c ↦ by ext <;> apply add_assoc₃ zero := (0, 0) zero_add := fun a ↦ by ext <;> apply zero_add add_zero := fun a ↦ by ext <;> apply add_zero instance : AddMonoid₄ ℤ where add := (· + ·) add_assoc₃ := Int.add_assoc zero := 0 zero_add := Int.zero_add add_zero := Int.add_zero nsmul := fun n m ↦ (n : ℤ) * m nsmul_zero := Int.zero_mul nsmul_succ := fun n m ↦ show (n + 1 : ℤ) * m = m + n * m by rw [Int.add_mul, Int.add_comm, Int.one_mul] example (n : ℕ) (m : ℤ) : SMul.smul (self := mySMul) n m = n * m := rfl class LT₁ (α : Type) where /-- The Less-Than relation -/ lt : α → α → Prop @[inherit_doc] infix:50 " <₁ " => LT₁.lt class PreOrder₂ (α : Type) extends LE₁ α, LT₁ α where le_refl : ∀ a : α, a ≤₁ a le_trans : ∀ a b c : α, a ≤₁ b → b ≤₁ c → a ≤₁ c lt := fun a b => a ≤₁ b ∧ ¬b ≤₁ a lt_iff_le_not_le : ∀ a b : α, a <₁ b ↔ a ≤₁ b ∧ ¬b ≤₁ a := by intros; rfl
-
-
-
@@ -1,126 +0,0 @@import Mathlib.Topology.Instances.Real def isMonoidHom₁ [Monoid G] [Monoid H] (f : G → H) : Prop := f 1 = 1 ∧ ∀ g g', f (g * g') = f g * f g' structure isMonoidHom₂ [Monoid G] [Monoid H] (f : G → H) : Prop where map_one : f 1 = 1 map_mul : ∀ g g', f (g * g') = f g * f g' example : Continuous (id : ℝ → ℝ) := continuous_id @[ext] structure MonoidHom₁ (G H : Type) [Monoid G] [Monoid H] where toFun : G → H map_one : toFun 1 = 1 map_mul : ∀ g g', toFun (g * g') = toFun g * toFun g' instance [Monoid G] [Monoid H] : CoeFun (MonoidHom₁ G H) (fun _ ↦ G → H) where coe := MonoidHom₁.toFun attribute [coe] MonoidHom₁.toFun example [Monoid G] [Monoid H] (f : MonoidHom₁ G H) : f 1 = 1 := f.map_one @[ext] structure AddMonoidHom₁ (G H : Type) [AddMonoid G] [AddMonoid H] where toFun : G → H map_zero : toFun 0 = 0 map_add : ∀ g g', toFun (g + g') = toFun g + toFun g' instance [AddMonoid G] [AddMonoid H] : CoeFun (AddMonoidHom₁ G H) (fun _ ↦ G → H) where coe := AddMonoidHom₁.toFun attribute [coe] AddMonoidHom₁.toFun @[ext] structure RingHom₁ (R S : Type) [Ring R] [Ring S] extends MonoidHom₁ R S, AddMonoidHom₁ R S class MonoidHomClass₁ (F : Type) (M N : Type) [Monoid M] [Monoid N] where toFun : F → M → N map_one : ∀ f : F, toFun f 1 = 1 map_mul : ∀ f g g', toFun f (g * g') = toFun f g * toFun f g' def badInst [Monoid M] [Monoid N] [MonoidHomClass₁ F M N] : CoeFun F (fun _ ↦ M → N) where coe := MonoidHomClass₁.toFun class MonoidHomClass₂ (F : Type) (M N : outParam Type) [Monoid M] [Monoid N] where toFun : F → M → N map_one : ∀ f : F, toFun f 1 = 1 map_mul : ∀ f g g', toFun f (g * g') = toFun f g * toFun f g' instance [Monoid M] [Monoid N] [MonoidHomClass₂ F M N] : CoeFun F (fun _ ↦ M → N) where coe := MonoidHomClass₂.toFun attribute [coe] MonoidHomClass₂.toFun instance (M N : Type) [Monoid M] [Monoid N] : MonoidHomClass₂ (MonoidHom₁ M N) M N where toFun := MonoidHom₁.toFun map_one := fun f ↦ f.map_one map_mul := fun f ↦ f.map_mul instance (R S : Type) [Ring R] [Ring S] : MonoidHomClass₂ (RingHom₁ R S) R S where toFun := fun f ↦ f.toMonoidHom₁.toFun map_one := fun f ↦ f.toMonoidHom₁.map_one map_mul := fun f ↦ f.toMonoidHom₁.map_mul lemma map_inv_of_inv [Monoid M] [Monoid N] [MonoidHomClass₂ F M N] (f : F) {m m' : M} (h : m*m' = 1) : f m * f m' = 1 := by rw [← MonoidHomClass₂.map_mul, h, MonoidHomClass₂.map_one] example [Monoid M] [Monoid N] (f : MonoidHom₁ M N) {m m' : M} (h : m*m' = 1) : f m * f m' = 1 := map_inv_of_inv f h example [Ring R] [Ring S] (f : RingHom₁ R S) {r r' : R} (h : r*r' = 1) : f r * f r' = 1 := map_inv_of_inv f h class MonoidHomClass₃ (F : Type) (M N : outParam Type) [Monoid M] [Monoid N] extends FunLike F M (fun _ ↦ N) where map_one : ∀ f : F, f 1 = 1 map_mul : ∀ (f : F) g g', f (g * g') = f g * f g' instance (M N : Type) [Monoid M] [Monoid N] : MonoidHomClass₃ (MonoidHom₁ M N) M N where coe := MonoidHom₁.toFun coe_injective' := MonoidHom₁.ext map_one := MonoidHom₁.map_one map_mul := MonoidHom₁.map_mul @[ext] structure OrderPresHom (α β : Type) [LE α] [LE β] where toFun : α → β le_of_le : ∀ a a', a ≤ a' → toFun a ≤ toFun a' @[ext] structure OrderPresMonoidHom (M N : Type) [Monoid M] [LE M] [Monoid N] [LE N] extends MonoidHom₁ M N, OrderPresHom M N class OrderPresHomClass (F : Type) (α β : outParam Type) [LE α] [LE β] extends FunLike F α (fun _ ↦ β) where le_of_le : ∀ (f : F) a a', a ≤ a' → f a ≤ f a' instance (α β : Type) [LE α] [LE β] : OrderPresHomClass (OrderPresHom α β) α β where coe := OrderPresHom.toFun coe_injective' := OrderPresHom.ext le_of_le := OrderPresHom.le_of_le instance (α β : Type) [LE α] [Monoid α] [LE β] [Monoid β] : OrderPresHomClass (OrderPresMonoidHom α β) α β where coe := fun f ↦ f.toOrderPresHom.toFun coe_injective' := OrderPresMonoidHom.ext le_of_le := fun f ↦ f.toOrderPresHom.le_of_le instance (α β : Type) [LE α] [Monoid α] [LE β] [Monoid β] : MonoidHomClass₃ (OrderPresMonoidHom α β) α β where coe := fun f ↦ f.toOrderPresHom.toFun coe_injective' := OrderPresMonoidHom.ext map_one := fun f ↦ f.toMonoidHom₁.map_one map_mul := fun f ↦ f.toMonoidHom₁.map_mul
-
-
-
@@ -1,126 +0,0 @@import Mathlib.GroupTheory.QuotientGroup @[ext] structure Submonoid₁ (M : Type) [Monoid M] where /-- The carrier of a submonoid. -/ carrier : Set M /-- The product of two elements of a submonoid belongs to the submonoid. -/ mul_mem {a b} : a ∈ carrier → b ∈ carrier → a * b ∈ carrier /-- The unit element belongs to the submonoid. -/ one_mem : 1 ∈ carrier /-- Submonoids in `M` can be seen as sets in `M`. -/ instance [Monoid M] : SetLike (Submonoid₁ M) M where coe := Submonoid₁.carrier coe_injective' := Submonoid₁.ext example [Monoid M] (N : Submonoid₁ M) : 1 ∈ N := N.one_mem example [Monoid M] (N : Submonoid₁ M) (α : Type) (f : M → α) := f '' N example [Monoid M] (N : Submonoid₁ M) (x : N) : (x : M) ∈ N := x.property instance SubMonoid₁Monoid [Monoid M] (N : Submonoid₁ M) : Monoid N where mul := fun x y ↦ ⟨x*y, N.mul_mem x.property y.property⟩ mul_assoc := fun x y z ↦ SetCoe.ext (mul_assoc (x : M) y z) one := ⟨1, N.one_mem⟩ one_mul := fun x ↦ SetCoe.ext (one_mul (x : M)) mul_one := fun x ↦ SetCoe.ext (mul_one (x : M)) example [Monoid M] (N : Submonoid₁ M) : Monoid N where mul := fun ⟨x, hx⟩ ⟨y, hy⟩ ↦ ⟨x*y, N.mul_mem hx hy⟩ mul_assoc := fun ⟨x, _⟩ ⟨y, _⟩ ⟨z, _⟩ ↦ SetCoe.ext (mul_assoc x y z) one := ⟨1, N.one_mem⟩ one_mul := fun ⟨x, _⟩ ↦ SetCoe.ext (one_mul x) mul_one := fun ⟨x, _⟩ ↦ SetCoe.ext (mul_one x) class SubmonoidClass₁ (S : Type) (M : Type) [Monoid M] [SetLike S M] : Prop where mul_mem : ∀ (s : S) {a b : M}, a ∈ s → b ∈ s → a * b ∈ s one_mem : ∀ s : S, 1 ∈ s instance [Monoid M] : SubmonoidClass₁ (Submonoid₁ M) M where mul_mem := Submonoid₁.mul_mem one_mem := Submonoid₁.one_mem @[ext] structure Subgroup₁ (G : Type) [Group G] extends Submonoid₁ G where /-- The inverse of an element of a subgroup belongs to the subgroup. -/ inv_mem {a} : a ∈ carrier → a⁻¹ ∈ carrier /-- Subgroups in `M` can be seen as sets in `M`. -/ instance [Group G] : SetLike (Subgroup₁ G) G where coe := fun H ↦ H.toSubmonoid₁.carrier coe_injective' := Subgroup₁.ext instance [Group G] (H : Subgroup₁ G) : Group H := { SubMonoid₁Monoid H.toSubmonoid₁ with inv := fun x ↦ ⟨x⁻¹, H.inv_mem x.property⟩ mul_left_inv := fun x ↦ SetCoe.ext (mul_left_inv (x : G)) } class SubgroupClass₁ (S : Type _) (G : Type) [Group G] [SetLike S G] extends SubmonoidClass₁ S G : Prop where inv_mem : ∀ (s : S) {a : G}, a ∈ s → a⁻¹ ∈ s instance [Group G] : SubmonoidClass₁ (Subgroup₁ G) G where mul_mem := fun H ↦ H.toSubmonoid₁.mul_mem one_mem := fun H ↦ H.toSubmonoid₁.one_mem instance [Group G] : SubgroupClass₁ (Subgroup₁ G) G := { (inferInstance : SubmonoidClass₁ (Subgroup₁ G) G) with inv_mem := Subgroup₁.inv_mem } instance [Monoid M] : Inf (Submonoid₁ M) := ⟨fun S₁ S₂ => { carrier := S₁ ∩ S₂ one_mem := ⟨S₁.one_mem, S₂.one_mem⟩ mul_mem := fun ⟨hx, hx'⟩ ⟨hy, hy'⟩ ↦ ⟨S₁.mul_mem hx hy, S₂.mul_mem hx' hy'⟩ }⟩ example [Monoid M] (N P : Submonoid₁ M) : Submonoid₁ M := N ⊓ P def Submonoid.Setoid [CommMonoid M] (N : Submonoid M) : Setoid M where r := fun x y ↦ ∃ w ∈ N, ∃ z ∈ N, x*w = y*z iseqv := { refl := fun x ↦ ⟨1, N.one_mem, 1, N.one_mem, rfl⟩ symm := fun ⟨w, hw, z, hz, h⟩ ↦ ⟨z, hz, w, hw, h.symm⟩ trans := by rintro a b c ⟨w, hw, z, hz, h⟩ ⟨w', hw', z', hz', h'⟩ refine ⟨w*w', N.mul_mem hw hw', z*z', N.mul_mem hz hz', ?_⟩ rw [← mul_assoc, h, mul_comm b, mul_assoc, h', ← mul_assoc, mul_comm z, mul_assoc] } instance [CommMonoid M] : HasQuotient M (Submonoid M) where quotient' := fun N ↦ Quotient N.Setoid def QuotientMonoid.mk [CommMonoid M] (N : Submonoid M) : M → M ⧸ N := Quotient.mk N.Setoid instance [CommMonoid M] (N : Submonoid M) : Monoid (M ⧸ N) where mul := Quotient.map₂' (· * ·) (by rintro a₁ b₁ ⟨w, hw, z, hz, ha⟩ a₂ b₂ ⟨w', hw', z', hz', hb⟩ refine ⟨w*w', N.mul_mem hw hw', z*z', N.mul_mem hz hz', ?_⟩ rw [mul_comm w, ← mul_assoc, mul_assoc a₁, hb, mul_comm, ← mul_assoc, mul_comm w, ha, mul_assoc, mul_comm z, mul_assoc b₂, mul_comm z', mul_assoc] ) mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ apply Quotient.sound dsimp only rw [mul_assoc] apply @Setoid.refl M N.Setoid one := QuotientMonoid.mk N 1 one_mul := by rintro ⟨a⟩ ; apply Quotient.sound ; dsimp only ; rw [one_mul] ; apply @Setoid.refl M N.Setoid mul_one := by rintro ⟨a⟩ ; apply Quotient.sound ; dsimp only ; rw [mul_one] ; apply @Setoid.refl M N.Setoid
-
-
-
@@ -1,2 +0,0 @@#eval "Hello, World!"
-
-
src/C_Introduction/S02_Overview.lean (deleted)
-
@@ -1,56 +0,0 @@import Mathlib.Data.Nat.Basic import Mathlib.Data.Nat.Parity import Mathlib.Tactic open Nat -- These are pieces of data. #check 2 + 2 def f (x : ℕ) := x + 3 #check f -- These are propositions, of type `Prop`. #check 2 + 2 = 4 def FermatLastTheorem := ∀ x y z n : ℕ, n > 2 ∧ x * y * z ≠ 0 → x ^ n + y ^ n ≠ z ^ n #check FermatLastTheorem -- These are proofs of propositions. theorem easy : 2 + 2 = 4 := rfl #check easy theorem hard : FermatLastTheorem := sorry #check hard -- Here are some proofs. example : ∀ m n : Nat, Even n → Even (m * n) := fun m n ⟨k, (hk : n = k + k)⟩ => have hmn : m * n = m * k + m * k := by rw [hk, mul_add] show ∃ l, m * n = l + l from ⟨_, hmn⟩ example : ∀ m n : Nat, Even n → Even (m * n) := fun m n ⟨k, hk⟩ => ⟨m * k, by rw [hk, mul_add]⟩ example : ∀ m n : Nat, Even n → Even (m * n) := by -- say m and n are natural numbers, and assume n=2*k rintro m n ⟨k, hk⟩ -- We need to prove m*n is twice a natural number. Let's show it's twice m*k. use m * k -- substitute in for n rw [hk] -- and now it's obvious ring example : ∀ m n : Nat, Even n → Even (m * n) := by rintro m n ⟨k, hk⟩; use m * k; rw [hk]; ring example : ∀ m n : Nat, Even n → Even (m * n) := by intros; simp [*, parity_simps]
-
-
-
-
@@ -1,7 +0,0 @@import Mathlib.Data.Nat.Basic import Mathlib.Data.Nat.Parity import Mathlib.Tactic open Nat -- There are no exercises in this section.
-
-
-
@@ -1,178 +0,0 @@import Mathlib.Data.Real.Basic #check ∀ x : ℝ, 0 ≤ x → abs x = x #check ∀ x y ε : ℝ, 0 < ε → ε ≤ 1 → abs x < ε → abs y < ε → abs (x * y) < ε theorem my_lemma : ∀ x y ε : ℝ, 0 < ε → ε ≤ 1 → abs x < ε → abs y < ε → abs (x * y) < ε := sorry section variable (a b δ : ℝ) variable (h₀ : 0 < δ) (h₁ : δ ≤ 1) variable (ha : abs a < δ) (hb : abs b < δ) #check my_lemma a b δ #check my_lemma a b δ h₀ h₁ #check my_lemma a b δ h₀ h₁ ha hb end theorem my_lemma2 : ∀ {x y ε : ℝ}, 0 < ε → ε ≤ 1 → abs x < ε → abs y < ε → abs (x * y) < ε := sorry section variable (a b δ : ℝ) variable (h₀ : 0 < δ) (h₁ : δ ≤ 1) variable (ha : abs a < δ) (hb : abs b < δ) #check my_lemma2 h₀ h₁ ha hb end theorem my_lemma3 : ∀ {x y ε : ℝ}, 0 < ε → ε ≤ 1 → abs x < ε → abs y < ε → abs (x * y) < ε := by intro x y ε epos ele1 xlt ylt sorry theorem my_lemma4 : ∀ {x y ε : ℝ}, 0 < ε → ε ≤ 1 → abs x < ε → abs y < ε → abs (x * y) < ε := by intro x y ε epos ele1 xlt ylt calc abs (x * y) = abs x * abs y := sorry _ ≤ abs x * ε := sorry _ < 1 * ε := sorry _ = ε := sorry def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x section variable (f g : ℝ → ℝ) (a b : ℝ) example (hfa : FnUb f a) (hgb : FnUb g b) : FnUb (fun x ↦ f x + g x) (a + b) := by intro x dsimp apply add_le_add apply hfa apply hgb example (hfa : FnLb f a) (hgb : FnLb g b) : FnLb (fun x => f x + g x) (a + b) := sorry example (nnf : FnLb f 0) (nng : FnLb g 0) : FnLb (fun x => f x * g x) 0 := sorry example (hfa : FnUb f a) (hfb : FnUb g b) (nng : FnLb g 0) (nna : 0 ≤ a) : FnUb (fun x => f x * g x) (a * b) := sorry end section variable {α : Type _} {R : Type _} [OrderedCancelAddCommMonoid R] #check @add_le_add def FnUb' (f : α → R) (a : R) : Prop := ∀ x, f x ≤ a theorem fn_ub_add {f g : α → R} {a b : R} (hfa : FnUb' f a) (hgb : FnUb' g b) : FnUb' (fun x => f x + g x) (a + b) := fun x => add_le_add (hfa x) (hgb x) end example (f : ℝ → ℝ) (h : Monotone f) : ∀ {a b}, a ≤ b → f a ≤ f b := @h section variable (f g : ℝ → ℝ) example (mf : Monotone f) (mg : Monotone g) : Monotone fun x => f x + g x := by intro a b aleb apply add_le_add apply mf aleb apply mg aleb example (mf : Monotone f) (mg : Monotone g) : Monotone fun x => f x + g x := fun a b aleb => add_le_add (mf aleb) (mg aleb) example {c : ℝ} (mf : Monotone f) (nnc : 0 ≤ c) : Monotone fun x => c * f x := sorry example (mf : Monotone f) (mg : Monotone g) : Monotone fun x => f (g x) := sorry def FnEven (f : ℝ → ℝ) : Prop := ∀ x, f x = f (-x) def FnOdd (f : ℝ → ℝ) : Prop := ∀ x, f x = -f (-x) example (ef : FnEven f) (eg : FnEven g) : FnEven fun x => f x + g x := by intro x calc (fun x => f x + g x) x = f x + g x := rfl _ = f (-x) + g (-x) := by rw [ef, eg] example (of : FnOdd f) (og : FnOdd g) : FnEven fun x => f x * g x := by sorry example (ef : FnEven f) (og : FnOdd g) : FnOdd fun x => f x * g x := by sorry example (ef : FnEven f) (og : FnOdd g) : FnEven fun x => f (g x) := by sorry end section variable {α : Type _} (r s t : Set α) example : s ⊆ s := by intro x xs exact xs theorem Subset.refl : s ⊆ s := fun x xs => xs theorem Subset.trans : r ⊆ s → s ⊆ t → r ⊆ t := by sorry end section variable {α : Type _} [PartialOrder α] variable (s : Set α) (a b : α) def SetUb (s : Set α) (a : α) := ∀ x, x ∈ s → x ≤ a example (h : SetUb s a) (h' : a ≤ b) : SetUb s b := sorry end section open Function example (c : ℝ) : Injective fun x => x + c := by intro x₁ x₂ h' exact (add_left_inj c).mp h' example {c : ℝ} (h : c ≠ 0) : Injective fun x => c * x := by sorry variable {α : Type _} {β : Type _} {γ : Type _} variable {g : β → γ} {f : α → β} example (injg : Injective g) (injf : Injective f) : Injective fun x => g (f x) := by sorry end
-
-
-
@@ -1,135 +0,0 @@import Mathlib.Data.Real.Basic example : ∃ x : ℝ, 2 < x ∧ x < 3 := by use 5 / 2 norm_num example : ∃ x : ℝ, 2 < x ∧ x < 3 := have h : 2 < (5 : ℝ) / 2 ∧ (5 : ℝ) / 2 < 3 := by norm_num ⟨5 / 2, h⟩ example : ∃ x : ℝ, 2 < x ∧ x < 3 := ⟨5 / 2, by norm_num⟩ def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x def FnHasUb (f : ℝ → ℝ) := ∃ a, FnUb f a def FnHasLb (f : ℝ → ℝ) := ∃ a, FnLb f a theorem fnUb_add {f g : ℝ → ℝ} {a b : ℝ} (hfa : FnUb f a) (hgb : FnUb g b) : FnUb (fun x => f x + g x) (a + b) := fun x => add_le_add (hfa x) (hgb x) section variable {f g : ℝ → ℝ} example (ubf : FnHasUb f) (ubg : FnHasUb g) : FnHasUb fun x => f x + g x := by cases' ubf with a ubfa cases' ubg with b ubfb use a + b apply fnUb_add ubfa ubfb example (lbf : FnHasLb f) (lbg : FnHasLb g) : FnHasLb fun x => f x + g x := by sorry example {c : ℝ} (ubf : FnHasUb f) (h : c ≥ 0) : FnHasUb fun x => c * f x := by sorry example (ubf : FnHasUb f) (ubg : FnHasUb g) : FnHasUb fun x => f x + g x := by rcases ubf with ⟨a, ubfa⟩ rcases ubg with ⟨b, ubfb⟩ exact ⟨a + b, fnUb_add ubfa ubfb⟩ example : FnHasUb f → FnHasUb g → FnHasUb fun x => f x + g x := by rintro ⟨a, ubfa⟩ ⟨b, ubfb⟩ exact ⟨a + b, fnUb_add ubfa ubfb⟩ example : FnHasUb f → FnHasUb g → FnHasUb fun x => f x + g x := fun ⟨a, ubfa⟩ ⟨b, ubfb⟩ => ⟨a + b, fnUb_add ubfa ubfb⟩ end section variable {α : Type _} [CommRing α] def SumOfSquares (x : α) := ∃ a b, x = a ^ 2 + b ^ 2 theorem sumOfSquares_mul {x y : α} (sosx : SumOfSquares x) (sosy : SumOfSquares y) : SumOfSquares (x * y) := by rcases sosx with ⟨a, b, xeq⟩ rcases sosy with ⟨c, d, yeq⟩ rw [xeq, yeq] use a * c - b * d, a * d + b * c ring theorem sumOfSquares_mul' {x y : α} (sosx : SumOfSquares x) (sosy : SumOfSquares y) : SumOfSquares (x * y) := by rcases sosx with ⟨a, b, rfl⟩ rcases sosy with ⟨c, d, rfl⟩ use a * c - b * d, a * d + b * c ring end section variable {a b c : ℕ} example (divab : a ∣ b) (divbc : b ∣ c) : a ∣ c := by cases' divab with d beq cases' divbc with e ceq rw [ceq, beq] use d * e; ring example (divab : a ∣ b) (divac : a ∣ c) : a ∣ b + c := by sorry end section open Function example {c : ℝ} : Surjective fun x => x + c := by intro x use x - c dsimp; ring example {c : ℝ} (h : c ≠ 0) : Surjective fun x => c * x := by sorry example (x y : ℝ) (h : x - y ≠ 0) : (x ^ 2 - y ^ 2) / (x - y) = x + y := by field_simp [h] ring example {f : ℝ → ℝ} (h : Surjective f) : ∃ x, f x ^ 2 = 4 := by cases' h 2 with x hx use x rw [hx] norm_num end section open Function variable {α : Type _} {β : Type _} {γ : Type _} variable {g : β → γ} {f : α → β} example (surjg : Surjective g) (surjf : Surjective f) : Surjective fun x => g (f x) := by sorry end
-
-
src/C_Logic/S03_Negation.lean (deleted)
-
@@ -1,143 +0,0 @@import Mathlib.Data.Real.Basic section variable (a b : ℝ) example (h : a < b) : ¬b < a := by intro h' have : a < a := lt_trans h h' apply lt_irrefl a this def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x def FnHasUb (f : ℝ → ℝ) := ∃ a, FnUb f a def FnHasLb (f : ℝ → ℝ) := ∃ a, FnLb f a variable (f : ℝ → ℝ) example (h : ∀ a, ∃ x, f x > a) : ¬FnHasUb f := by intro fnub cases' fnub with a fnuba cases' h a with x hx have : f x ≤ a := fnuba x linarith example (h : ∀ a, ∃ x, f x < a) : ¬FnHasLb f := sorry example : ¬FnHasUb fun x => x := sorry #check (not_le_of_gt : a > b → ¬a ≤ b) #check (not_lt_of_ge : a ≥ b → ¬a < b) #check (lt_of_not_ge : ¬a ≥ b → a < b) #check (le_of_not_gt : ¬a > b → a ≤ b) example (h : Monotone f) (h' : f a < f b) : a < b := by sorry example (h : a ≤ b) (h' : f b < f a) : ¬Monotone f := by sorry example : ¬∀ {f : ℝ → ℝ}, Monotone f → ∀ {a b}, f a ≤ f b → a ≤ b := by intro h let f := fun x : ℝ => (0 : ℝ) have monof : Monotone f := by sorry have h' : f 1 ≤ f 0 := le_refl _ sorry example (x : ℝ) (h : ∀ ε > 0, x < ε) : x ≤ 0 := by sorry end section variable {α : Type _} (P : α → Prop) (Q : Prop) example (h : ¬∃ x, P x) : ∀ x, ¬P x := by sorry example (h : ∀ x, ¬P x) : ¬∃ x, P x := by sorry example (h : ¬∀ x, P x) : ∃ x, ¬P x := by sorry example (h : ∃ x, ¬P x) : ¬∀ x, P x := by sorry example (h : ¬∀ x, P x) : ∃ x, ¬P x := by by_contra h' apply h intro x show P x by_contra h'' exact h' ⟨x, h''⟩ example (h : ¬¬Q) : Q := by sorry example (h : Q) : ¬¬Q := by sorry end section variable (f : ℝ → ℝ) example (h : ¬FnHasUb f) : ∀ a, ∃ x, f x > a := by sorry example (h : ¬∀ a, ∃ x, f x > a) : FnHasUb f := by push_neg at h exact h example (h : ¬FnHasUb f) : ∀ a, ∃ x, f x > a := by simp only [FnHasUb, FnUb] at h push_neg at h exact h example (h : ¬Monotone f) : ∃ x y, x ≤ y ∧ f y < f x := by sorry example (h : ¬FnHasUb f) : ∀ a, ∃ x, f x > a := by contrapose! h exact h example (x : ℝ) (h : ∀ ε > 0, x ≤ ε) : x ≤ 0 := by contrapose! h use x / 2 constructor <;> linarith end section variable (a : ℕ) example (h : 0 < 0) : a > 37 := by exfalso apply lt_irrefl 0 h example (h : 0 < 0) : a > 37 := absurd h (lt_irrefl 0) example (h : 0 < 0) : a > 37 := by have h' : ¬0 < 0 := lt_irrefl 0 contradiction end
-
-
-
@@ -1,138 +0,0 @@import Mathlib.Data.Real.Basic import Mathlib.Data.Nat.Prime import Mathlib.Tactic.NormNum example {x y : ℝ} (h₀ : x ≤ y) (h₁ : ¬y ≤ x) : x ≤ y ∧ x ≠ y := by constructor · assumption intro h apply h₁ rw [h] example {x y : ℝ} (h₀ : x ≤ y) (h₁ : ¬y ≤ x) : x ≤ y ∧ x ≠ y := ⟨h₀, fun h => h₁ (by rw [h])⟩ example {x y : ℝ} (h₀ : x ≤ y) (h₁ : ¬y ≤ x) : x ≤ y ∧ x ≠ y := have h : x ≠ y := by contrapose! h₁ rw [h₁] ⟨h₀, h⟩ example {x y : ℝ} (h : x ≤ y ∧ x ≠ y) : ¬y ≤ x := by cases' h with h₀ h₁ contrapose! h₁ exact le_antisymm h₀ h₁ example {x y : ℝ} : x ≤ y ∧ x ≠ y → ¬y ≤ x := by rintro ⟨h₀, h₁⟩ h' exact h₁ (le_antisymm h₀ h') example {x y : ℝ} : x ≤ y ∧ x ≠ y → ¬y ≤ x := fun ⟨h₀, h₁⟩ h' => h₁ (le_antisymm h₀ h') example {x y : ℝ} (h : x ≤ y ∧ x ≠ y) : ¬y ≤ x := by intro h' apply h.right exact le_antisymm h.left h' example {x y : ℝ} (h : x ≤ y ∧ x ≠ y) : ¬y ≤ x := fun h' => h.right (le_antisymm h.left h') example {m n : ℕ} (h : m ∣ n ∧ m ≠ n) : m ∣ n ∧ ¬n ∣ m := sorry example : ∃ x : ℝ, 2 < x ∧ x < 4 := ⟨5 / 2, by norm_num, by norm_num⟩ example (x y : ℝ) : (∃ z : ℝ, x < z ∧ z < y) → x < y := by rintro ⟨z, xltz, zlty⟩ exact lt_trans xltz zlty example (x y : ℝ) : (∃ z : ℝ, x < z ∧ z < y) → x < y := fun ⟨z, xltz, zlty⟩ => lt_trans xltz zlty example : ∃ x : ℝ, 2 < x ∧ x < 4 := by use 5 / 2 constructor <;> norm_num example : ∃ m n : ℕ, 4 < m ∧ m < n ∧ n < 10 ∧ Nat.Prime m ∧ Nat.Prime n := by use 5 use 7 norm_num sorry example {x y : ℝ} : x ≤ y ∧ x ≠ y → x ≤ y ∧ ¬y ≤ x := by rintro ⟨h₀, h₁⟩ use h₀ exact fun h' => h₁ (le_antisymm h₀ h') example {x y : ℝ} (h : x ≤ y) : ¬y ≤ x ↔ x ≠ y := by constructor · contrapose! rintro rfl rfl contrapose! exact le_antisymm h example {x y : ℝ} (h : x ≤ y) : ¬y ≤ x ↔ x ≠ y := ⟨fun h₀ h₁ => h₀ (by rw [h₁]), fun h₀ h₁ => h₀ (le_antisymm h h₁)⟩ example {x y : ℝ} : x ≤ y ∧ ¬y ≤ x ↔ x ≤ y ∧ x ≠ y := sorry theorem aux {x y : ℝ} (h : x ^ 2 + y ^ 2 = 0) : x = 0 := have h' : x ^ 2 = 0 := by sorry pow_eq_zero h' example (x y : ℝ) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := sorry section example (x : ℝ) : abs (x + 3) < 5 → -8 < x ∧ x < 2 := by rw [abs_lt] intro h constructor <;> linarith example : 3 ∣ Nat.gcd 6 15 := by rw [Nat.dvd_gcd_iff] constructor <;> norm_num end theorem not_monotone_iff {f : ℝ → ℝ} : ¬Monotone f ↔ ∃ x y, x ≤ y ∧ f x > f y := by rw [Monotone] push_neg rfl example : ¬Monotone fun x : ℝ => -x := by sorry section variable {α : Type _} [PartialOrder α] variable (a b : α) example : a < b ↔ a ≤ b ∧ a ≠ b := by rw [lt_iff_le_not_le] sorry end section variable {α : Type _} [Preorder α] variable (a b c : α) example : ¬a < a := by rw [lt_iff_le_not_le] sorry example : a < b → b < c → a < c := by simp only [lt_iff_le_not_le] sorry end
-
-
src/C_Logic/S05_Disjunction.lean (deleted)
-
@@ -1,102 +0,0 @@import Mathlib.Data.Real.Basic section variable {x y : ℝ} example (h : y > x ^ 2) : y > 0 ∨ y < -1 := by left linarith [pow_two_nonneg x] example (h : -y > x ^ 2 + 1) : y > 0 ∨ y < -1 := by right linarith [pow_two_nonneg x] example (h : y > 0) : y > 0 ∨ y < -1 := Or.inl h example (h : y < -1) : y > 0 ∨ y < -1 := Or.inr h example : x < abs y → x < y ∨ x < -y := by cases' le_or_gt 0 y with h h · rw [abs_of_nonneg h] intro h left exact h rw [abs_of_neg h] intro h; right; exact h namespace MyAbs theorem le_abs_self (x : ℝ) : x ≤ abs x := by sorry theorem neg_le_abs_self (x : ℝ) : -x ≤ abs x := by sorry theorem abs_add (x y : ℝ) : abs (x + y) ≤ abs x + abs y := by sorry theorem lt_abs : x < abs y ↔ x < y ∨ x < -y := by sorry theorem abs_lt : abs x < y ↔ -y < x ∧ x < y := by sorry end MyAbs end example {x : ℝ} (h : x ≠ 0) : x < 0 ∨ x > 0 := by rcases lt_trichotomy x 0 with (xlt | xeq | xgt) · left exact xlt · contradiction right; exact xgt example {m n k : ℕ} (h : m ∣ n ∨ m ∣ k) : m ∣ n * k := by rcases h with (⟨a, rfl⟩ | ⟨b, rfl⟩) · rw [mul_assoc] apply dvd_mul_right rw [mul_comm, mul_assoc] apply dvd_mul_right example {z : ℝ} (h : ∃ x y, z = x ^ 2 + y ^ 2 ∨ z = x ^ 2 + y ^ 2 + 1) : z ≥ 0 := by sorry example {x : ℝ} (h : x ^ 2 = 1) : x = 1 ∨ x = -1 := by sorry example {x y : ℝ} (h : x ^ 2 = y ^ 2) : x = y ∨ x = -y := by sorry section variable {R : Type _} [CommRing R] [IsDomain R] variable (x y : R) example (h : x ^ 2 = 1) : x = 1 ∨ x = -1 := by sorry example (h : x ^ 2 = y ^ 2) : x = y ∨ x = -y := by sorry end example (P : Prop) : ¬¬P → P := by intro h cases em P · assumption contradiction example (P : Prop) : ¬¬P → P := by intro h by_cases h' : P · assumption contradiction example (P Q : Prop) : P → Q ↔ ¬P ∨ Q := by sorry
-
-
-
@@ -1,96 +0,0 @@import Mathlib.Data.Real.Basic def ConvergesTo (s : ℕ → ℝ) (a : ℝ) := ∀ ε > 0, ∃ N, ∀ n ≥ N, abs (s n - a) < ε example : (fun x y : ℝ => (x + y) ^ 2) = fun x y : ℝ => x ^ 2 + 2 * x * y + y ^ 2 := by ext ring example (a b : ℝ) : abs a = abs (a - b + b) := by congr ring example {a : ℝ} (h : 1 < a) : a < a * a := by convert(mul_lt_mul_right _).2 h · rw [one_mul] exact lt_trans zero_lt_one h theorem convergesTo_const (a : ℝ) : ConvergesTo (fun x : ℕ => a) a := by intro ε εpos use 0 intro n nge; dsimp rw [sub_self, abs_zero] apply εpos theorem convergesTo_add {s t : ℕ → ℝ} {a b : ℝ} (cs : ConvergesTo s a) (ct : ConvergesTo t b) : ConvergesTo (fun n => s n + t n) (a + b) := by intro ε εpos dsimp have ε2pos : 0 < ε / 2 := by linarith cases' cs (ε / 2) ε2pos with Ns hs cases' ct (ε / 2) ε2pos with Nt ht use max Ns Nt sorry theorem convergesTo_mul_const {s : ℕ → ℝ} {a : ℝ} (c : ℝ) (cs : ConvergesTo s a) : ConvergesTo (fun n => c * s n) (c * a) := by by_cases h : c = 0 · convert convergesTo_const 0 · rw [h, MulZeroClass.zero_mul] rw [h, MulZeroClass.zero_mul] have acpos : 0 < abs c := abs_pos.mpr h sorry theorem exists_abs_le_of_convergesTo {s : ℕ → ℝ} {a : ℝ} (cs : ConvergesTo s a) : ∃ N b, ∀ n, N ≤ n → abs (s n) < b := by cases' cs 1 zero_lt_one with N h use N, abs a + 1 sorry theorem aux {s t : ℕ → ℝ} {a : ℝ} (cs : ConvergesTo s a) (ct : ConvergesTo t 0) : ConvergesTo (fun n => s n * t n) 0 := by intro ε εpos dsimp rcases exists_abs_le_of_convergesTo cs with ⟨N₀, B, h₀⟩ have Bpos : 0 < B := lt_of_le_of_lt (abs_nonneg _) (h₀ N₀ (le_refl _)) have pos₀ : ε / B > 0 := div_pos εpos Bpos cases' ct _ pos₀ with N₁ h₁ sorry theorem convergesTo_mul {s t : ℕ → ℝ} {a b : ℝ} (cs : ConvergesTo s a) (ct : ConvergesTo t b) : ConvergesTo (fun n => s n * t n) (a * b) := by have h₁ : ConvergesTo (fun n => s n * (t n + -b)) 0 := by apply aux cs convert convergesTo_add ct (convergesTo_const (-b)) ring have := convergesTo_add h₁ (convergesTo_mul_const b cs) convert convergesTo_add h₁ (convergesTo_mul_const b cs) using 1 · ext; ring ring theorem convergesTo_unique {s : ℕ → ℝ} {a b : ℝ} (sa : ConvergesTo s a) (sb : ConvergesTo s b) : a = b := by by_contra abne have : abs (a - b) > 0 := by sorry let ε := abs (a - b) / 2 have εpos : ε > 0 := by change abs (a - b) / 2 > 0 linarith cases' sa ε εpos with Na hNa cases' sb ε εpos with Nb hNb let N := max Na Nb have absa : abs (s N - a) < ε := by sorry have absb : abs (s N - b) < ε := by sorry have : abs (a - b) < abs (a - b) := by sorry exact lt_irrefl _ this section variable {α : Type _} [LinearOrder α] def ConvergesTo' (s : α → ℝ) (a : ℝ) := ∀ ε > 0, ∃ N, ∀ n ≥ N, abs (s n - a) < ε end
-
-
-
@@ -1,131 +0,0 @@import Mathlib.Data.Real.Basic def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x section variable (f g : ℝ → ℝ) (a b : ℝ) example (hfa : FnLb f a) (hgb : FnLb g b) : FnLb (fun x => f x + g x) (a + b) := by intro x apply add_le_add apply hfa apply hgb example (nnf : FnLb f 0) (nng : FnLb g 0) : FnLb (fun x => f x * g x) 0 := by intro x apply mul_nonneg apply nnf apply nng example (hfa : FnUb f a) (hfb : FnUb g b) (nng : FnLb g 0) (nna : 0 ≤ a) : FnUb (fun x => f x * g x) (a * b) := by intro x apply mul_le_mul apply hfa apply hfb apply nng apply nna end section variable (f g : ℝ → ℝ) example {c : ℝ} (mf : Monotone f) (nnc : 0 ≤ c) : Monotone fun x => c * f x := by intro a b aleb apply mul_le_mul_of_nonneg_left _ nnc apply mf aleb example {c : ℝ} (mf : Monotone f) (nnc : 0 ≤ c) : Monotone fun x => c * f x := fun a b aleb => mul_le_mul_of_nonneg_left (mf aleb) nnc example (mf : Monotone f) (mg : Monotone g) : Monotone fun x => f (g x) := by intro a b aleb apply mf apply mg apply aleb example (mf : Monotone f) (mg : Monotone g) : Monotone fun x => f (g x) := fun a b aleb => mf (mg aleb) def FnEven (f : ℝ → ℝ) : Prop := ∀ x, f x = f (-x) def FnOdd (f : ℝ → ℝ) : Prop := ∀ x, f x = -f (-x) example (of : FnOdd f) (og : FnOdd g) : FnEven fun x => f x * g x := by intro x calc (fun x => f x * g x) x = f x * g x := rfl _ = f (-x) * g (-x) := by rw [of, og, neg_mul_neg] example (ef : FnEven f) (og : FnOdd g) : FnOdd fun x => f x * g x := by intro x dsimp rw [ef, og, neg_mul_eq_mul_neg] example (ef : FnEven f) (og : FnOdd g) : FnEven fun x => f (g x) := by intro x dsimp rw [og, ← ef] end section variable {α : Type _} (r s t : Set α) example : r ⊆ s → s ⊆ t → r ⊆ t := by intro rsubs ssubt x xr apply ssubt apply rsubs apply xr theorem Subset.trans : r ⊆ s → s ⊆ t → r ⊆ t := fun rsubs ssubt x xr => ssubt (rsubs xr) end section variable {α : Type _} [PartialOrder α] variable (s : Set α) (a b : α) def SetUb (s : Set α) (a : α) := ∀ x, x ∈ s → x ≤ a example (h : SetUb s a) (h' : a ≤ b) : SetUb s b := by intro x xs apply le_trans (h x xs) h' example (h : SetUb s a) (h' : a ≤ b) : SetUb s b := fun x xs => le_trans (h x xs) h' end section open Function example {c : ℝ} (h : c ≠ 0) : Injective fun x => c * x := by intro x₁ x₂ h' apply (mul_right_inj' h).mp h' variable {α : Type _} {β : Type _} {γ : Type _} variable {g : β → γ} {f : α → β} example (injg : Injective g) (injf : Injective f) : Injective fun x => g (f x) := by intro x₁ x₂ h apply injf apply injg apply h end
-
-
-
@@ -1,85 +0,0 @@import Mathlib.Data.Real.Basic def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x def FnHasUb (f : ℝ → ℝ) := ∃ a, FnUb f a def FnHasLb (f : ℝ → ℝ) := ∃ a, FnLb f a theorem fnUb_add {f g : ℝ → ℝ} {a b : ℝ} (hfa : FnUb f a) (hgb : FnUb g b) : FnUb (fun x => f x + g x) (a + b) := fun x => add_le_add (hfa x) (hgb x) section variable {f g : ℝ → ℝ} example (lbf : FnHasLb f) (lbg : FnHasLb g) : FnHasLb fun x => f x + g x := by cases' lbf with a lbfa cases' lbg with b lbgb use a + b intro x exact add_le_add (lbfa x) (lbgb x) example {c : ℝ} (ubf : FnHasUb f) (h : c ≥ 0) : FnHasUb fun x => c * f x := by cases' ubf with a lbfa use c * a intro x exact mul_le_mul_of_nonneg_left (lbfa x) h end section variable {a b c : ℕ} example (divab : a ∣ b) (divbc : b ∣ c) : a ∣ c := by rcases divab with ⟨d, rfl⟩ rcases divbc with ⟨e, rfl⟩ use d * e; ring example (divab : a ∣ b) (divac : a ∣ c) : a ∣ b + c := by rcases divab with ⟨d, rfl⟩ rcases divac with ⟨e, rfl⟩ use d + e; ring end section open Function example {c : ℝ} (h : c ≠ 0) : Surjective fun x => c * x := by intro x use x / c dsimp; rw [mul_div_cancel' _ h] example {c : ℝ} (h : c ≠ 0) : Surjective fun x => c * x := by intro x use x / c field_simp [h] ; ring end section open Function variable {α : Type _} {β : Type _} {γ : Type _} variable {g : β → γ} {f : α → β} example (surjg : Surjective g) (surjf : Surjective f) : Surjective fun x => g (f x) := by intro z rcases surjg z with ⟨y, rfl⟩ rcases surjf y with ⟨x, rfl⟩ use x end
-
-
-
@@ -1,113 +0,0 @@import Mathlib.Data.Real.Basic section variable (a b : ℝ) def FnUb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, f x ≤ a def FnLb (f : ℝ → ℝ) (a : ℝ) : Prop := ∀ x, a ≤ f x def FnHasUb (f : ℝ → ℝ) := ∃ a, FnUb f a def FnHasLb (f : ℝ → ℝ) := ∃ a, FnLb f a variable (f : ℝ → ℝ) example (h : ∀ a, ∃ x, f x < a) : ¬FnHasLb f := by rintro ⟨a, ha⟩ rcases h a with ⟨x, hx⟩ have := ha x linarith example : ¬FnHasUb fun x => x := by rintro ⟨a, ha⟩ have : a + 1 ≤ a := ha (a + 1) linarith example (h : Monotone f) (h' : f a < f b) : a < b := by apply lt_of_not_ge intro h'' apply absurd h' apply not_lt_of_ge (h h'') example (h : a ≤ b) (h' : f b < f a) : ¬Monotone f := by intro h'' apply absurd h' apply not_lt_of_ge apply h'' h example : ¬∀ {f : ℝ → ℝ}, Monotone f → ∀ {a b}, f a ≤ f b → a ≤ b := by intro h let f := fun x : ℝ => (0 : ℝ) have monof : Monotone f := by intro a b leab rfl have h' : f 1 ≤ f 0 := le_refl _ have : (1 : ℝ) ≤ 0 := h monof h' linarith example (x : ℝ) (h : ∀ ε > 0, x < ε) : x ≤ 0 := by apply le_of_not_gt intro h' linarith [h _ h'] end section variable {α : Type _} (P : α → Prop) (Q : Prop) example (h : ¬∃ x, P x) : ∀ x, ¬P x := by intro x Px apply h use x exact Px example (h : ∀ x, ¬P x) : ¬∃ x, P x := by rintro ⟨x, Px⟩ exact h x Px example (h : ∃ x, ¬P x) : ¬∀ x, P x := by intro h' rcases h with ⟨x, nPx⟩ apply nPx apply h' example (h : ¬¬Q) : Q := by by_contra h' exact h h' example (h : Q) : ¬¬Q := by intro h' exact h' h end section variable (f : ℝ → ℝ) example (h : ¬FnHasUb f) : ∀ a, ∃ x, f x > a := by intro a by_contra h' apply h use a intro x apply le_of_not_gt intro h'' apply h' use x exact h'' example (h : ¬Monotone f) : ∃ x y, x ≤ y ∧ f y < f x := by rw [Monotone] at h push_neg at h exact h end
-
-
-
@@ -1,97 +0,0 @@import Mathlib.Data.Real.Basic import Mathlib.Data.Nat.Prime import Mathlib.Tactic.NormNum example {m n : ℕ} (h : m ∣ n ∧ m ≠ n) : m ∣ n ∧ ¬n ∣ m := by cases' h with h0 h1 constructor · exact h0 intro h2 apply h1 apply Nat.dvd_antisymm h0 h2 example {x y : ℝ} : x ≤ y ∧ ¬y ≤ x ↔ x ≤ y ∧ x ≠ y := by constructor · rintro ⟨h0, h1⟩ constructor · exact h0 intro h2 apply h1 rw [h2] rintro ⟨h0, h1⟩ constructor · exact h0 intro h2 apply h1 apply le_antisymm h0 h2 theorem aux {x y : ℝ} (h : x ^ 2 + y ^ 2 = 0) : x = 0 := have h' : x ^ 2 = 0 := by linarith [pow_two_nonneg x, pow_two_nonneg y] pow_eq_zero h' example (x y : ℝ) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by constructor · intro h constructor · exact aux h rw [add_comm] at h exact aux h rintro ⟨rfl, rfl⟩ norm_num theorem not_monotone_iff {f : ℝ → ℝ} : ¬Monotone f ↔ ∃ x y, x ≤ y ∧ f x > f y := by rw [Monotone] push_neg rfl example : ¬Monotone fun x : ℝ => -x := by rw [not_monotone_iff] use 0, 1 norm_num section variable {α : Type _} [PartialOrder α] variable (a b : α) example : a < b ↔ a ≤ b ∧ a ≠ b := by rw [lt_iff_le_not_le] constructor · rintro ⟨h0, h1⟩ constructor · exact h0 intro h2 apply h1 rw [h2] rintro ⟨h0, h1⟩ constructor · exact h0 intro h2 apply h1 apply le_antisymm h0 h2 end section variable {α : Type _} [Preorder α] variable (a b c : α) example : ¬a < a := by rw [lt_iff_le_not_le] rintro ⟨h0, h1⟩ exact h1 h0 example : a < b → b < c → a < c := by simp only [lt_iff_le_not_le] rintro ⟨h0, h1⟩ ⟨h2, h3⟩ constructor · apply le_trans h0 h2 intro h4 apply h1 apply le_trans h2 h4 end
-
-
-
@@ -1,142 +0,0 @@import Mathlib.Data.Real.Basic section variable {x y : ℝ} namespace MyAbs theorem le_abs_self (x : ℝ) : x ≤ abs x := by cases' le_or_gt 0 x with h h · rw [abs_of_nonneg h] rw [abs_of_neg h] linarith theorem neg_le_abs_self (x : ℝ) : -x ≤ abs x := by cases' le_or_gt 0 x with h h · rw [abs_of_nonneg h] linarith rw [abs_of_neg h] theorem abs_add (x y : ℝ) : abs (x + y) ≤ abs x + abs y := by cases' le_or_gt 0 (x + y) with h h · rw [abs_of_nonneg h] linarith [le_abs_self x, le_abs_self y] rw [abs_of_neg h] linarith [neg_le_abs_self x, neg_le_abs_self y] theorem lt_abs : x < abs y ↔ x < y ∨ x < -y := by cases' le_or_gt 0 y with h h · rw [abs_of_nonneg h] constructor · intro h' left exact h' intro h' cases' h' with h' h' · exact h' linarith rw [abs_of_neg h] constructor · intro h' right exact h' intro h' cases' h' with h' h' · linarith exact h' theorem abs_lt : abs x < y ↔ -y < x ∧ x < y := by cases' le_or_gt 0 x with h h · rw [abs_of_nonneg h] constructor · intro h' constructor · linarith exact h' intro h' cases' h' with h1 h2 exact h2 rw [abs_of_neg h] constructor · intro h' constructor · linarith linarith intro h' linarith end MyAbs end example {z : ℝ} (h : ∃ x y, z = x ^ 2 + y ^ 2 ∨ z = x ^ 2 + y ^ 2 + 1) : z ≥ 0 := by rcases h with ⟨x, y, rfl | rfl⟩ <;> linarith [sq_nonneg x, sq_nonneg y] example {x : ℝ} (h : x ^ 2 = 1) : x = 1 ∨ x = -1 := by have h' : x ^ 2 - 1 = 0 := by rw [h, sub_self] have h'' : (x + 1) * (x - 1) = 0 := by rw [← h'] ring cases' eq_zero_or_eq_zero_of_mul_eq_zero h'' with h1 h1 · right exact eq_neg_iff_add_eq_zero.mpr h1 left exact eq_of_sub_eq_zero h1 example {x y : ℝ} (h : x ^ 2 = y ^ 2) : x = y ∨ x = -y := by have h' : x ^ 2 - y ^ 2 = 0 := by rw [h, sub_self] have h'' : (x + y) * (x - y) = 0 := by rw [← h'] ring cases' eq_zero_or_eq_zero_of_mul_eq_zero h'' with h1 h1 · right exact eq_neg_iff_add_eq_zero.mpr h1 left exact eq_of_sub_eq_zero h1 section variable {R : Type _} [CommRing R] [IsDomain R] variable (x y : R) example (h : x ^ 2 = 1) : x = 1 ∨ x = -1 := by have h' : x ^ 2 - 1 = 0 := by rw [h, sub_self] have h'' : (x + 1) * (x - 1) = 0 := by rw [← h'] ring cases' eq_zero_or_eq_zero_of_mul_eq_zero h'' with h1 h1 · right exact eq_neg_iff_add_eq_zero.mpr h1 left exact eq_of_sub_eq_zero h1 example (h : x ^ 2 = y ^ 2) : x = y ∨ x = -y := by have h' : x ^ 2 - y ^ 2 = 0 := by rw [h, sub_self] have h'' : (x + y) * (x - y) = 0 := by rw [← h'] ring cases' eq_zero_or_eq_zero_of_mul_eq_zero h'' with h1 h1 · right exact eq_neg_iff_add_eq_zero.mpr h1 left exact eq_of_sub_eq_zero h1 end example (P Q : Prop) : P → Q ↔ ¬P ∨ Q := by constructor · intro h by_cases h' : P · right exact h h' left exact h' rintro (h | h) · intro h' exact absurd h' h intro exact h
-
-
-
@@ -1,126 +0,0 @@import Mathlib.Data.Real.Basic def ConvergesTo (s : ℕ → ℝ) (a : ℝ) := ∀ ε > 0, ∃ N, ∀ n ≥ N, abs (s n - a) < ε theorem convergesTo_const (a : ℝ) : ConvergesTo (fun x : ℕ => a) a := by intro ε εpos use 0 intro n nge; dsimp rw [sub_self, abs_zero] apply εpos theorem convergesTo_add {s t : ℕ → ℝ} {a b : ℝ} (cs : ConvergesTo s a) (ct : ConvergesTo t b) : ConvergesTo (fun n => s n + t n) (a + b) := by intro ε εpos dsimp have ε2pos : 0 < ε / 2 := by linarith cases' cs (ε / 2) ε2pos with Ns hs cases' ct (ε / 2) ε2pos with Nt ht use max Ns Nt intro n hn have ngeNs : n ≥ Ns := le_of_max_le_left hn have ngeNt : n ≥ Nt := le_of_max_le_right hn calc |s n + t n - (a + b)| = |s n - a + (t n - b)| := by congr ring _ ≤ |s n - a| + |t n - b| := (abs_add _ _) _ < ε / 2 + ε / 2 := (add_lt_add (hs n ngeNs) (ht n ngeNt)) _ = ε := by norm_num theorem convergesTo_mul_const {s : ℕ → ℝ} {a : ℝ} (c : ℝ) (cs : ConvergesTo s a) : ConvergesTo (fun n => c * s n) (c * a) := by by_cases h : c = 0 · convert convergesTo_const 0 · rw [h, MulZeroClass.zero_mul] rw [h, MulZeroClass.zero_mul] have acpos : 0 < abs c := abs_pos.mpr h intro ε εpos dsimp have εcpos : 0 < ε / abs c := by apply div_pos εpos acpos cases' cs (ε / abs c) εcpos with Ns hs use Ns intro n ngt calc |c * s n - c * a| = |c| * |s n - a| := by rw [← abs_mul, mul_sub] _ < |c| * (ε / |c|) := (mul_lt_mul_of_pos_left (hs n ngt) acpos) _ = ε := mul_div_cancel' _ (ne_of_lt acpos).symm theorem exists_abs_le_of_converges_to {s : ℕ → ℝ} {a : ℝ} (cs : ConvergesTo s a) : ∃ N b, ∀ n, N ≤ n → abs (s n) < b := by cases' cs 1 zero_lt_one with N h use N, abs a + 1 intro n ngt calc |s n| = |s n - a + a| := by congr abel _ ≤ |s n - a| + |a| := (abs_add _ _) _ < |a| + 1 := by linarith [h n ngt] theorem aux {s t : ℕ → ℝ} {a : ℝ} (cs : ConvergesTo s a) (ct : ConvergesTo t 0) : ConvergesTo (fun n => s n * t n) 0 := by intro ε εpos dsimp rcases exists_abs_le_of_convergesTo cs with ⟨N₀, B, h₀⟩ have Bpos : 0 < B := lt_of_le_of_lt (abs_nonneg _) (h₀ N₀ (le_refl _)) have pos₀ : ε / B > 0 := div_pos εpos Bpos cases' ct _ pos₀ with N₁ h₁ use max N₀ N₁ intro n ngt have ngeN₀ : n ≥ N₀ := le_of_max_le_left ngt have ngeN₁ : n ≥ N₁ := le_of_max_le_right ngt calc |s n * t n - 0| = |s n| * |t n - 0| := by rw [sub_zero, abs_mul, sub_zero] _ < B * (ε / B) := (mul_lt_mul'' (h₀ n ngeN₀) (h₁ n ngeN₁) (abs_nonneg _) (abs_nonneg _)) _ = ε := mul_div_cancel' _ (ne_of_lt Bpos).symm theorem convergesTo_mul {s t : ℕ → ℝ} {a b : ℝ} (cs : ConvergesTo s a) (ct : ConvergesTo t b) : ConvergesTo (fun n => s n * t n) (a * b) := by have h₁ : ConvergesTo (fun n => s n * (t n + -b)) 0 := by apply aux cs convert convergesTo_add ct (convergesTo_const (-b)) ring have := convergesTo_add h₁ (convergesTo_mul_const b cs) convert convergesTo_add h₁ (convergesTo_mul_const b cs) using 1 · ext; ring ring theorem convergesTo_unique {s : ℕ → ℝ} {a b : ℝ} (sa : ConvergesTo s a) (sb : ConvergesTo s b) : a = b := by by_contra abne have : abs (a - b) > 0 := by apply lt_of_le_of_ne · apply abs_nonneg intro h'' apply abne apply eq_of_abs_sub_eq_zero h''.symm let ε := abs (a - b) / 2 have εpos : ε > 0 := by change abs (a - b) / 2 > 0 linarith cases' sa ε εpos with Na hNa cases' sb ε εpos with Nb hNb let N := max Na Nb have absa : abs (s N - a) < ε := by apply hNa apply le_max_left have absb : abs (s N - b) < ε := by apply hNb apply le_max_right have : abs (a - b) < abs (a - b) calc abs (a - b) = abs (-(s N - a) + (s N - b)) := by congr ring _ ≤ abs (-(s N - a)) + abs (s N - b) := (abs_add _ _) _ = abs (s N - a) + abs (s N - b) := by rw [abs_neg] _ < ε + ε := (add_lt_add absa absb) _ = abs (a - b) := by norm_num exact lt_irrefl _ this
-
-
-
@@ -1,118 +0,0 @@import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Data.Nat.Prime import Mathlib.Tactic.NormNum.GCD import Mathlib.Tactic.NormNum.Prime #print Nat.coprime example (m n : Nat) (h : m.coprime n) : m.gcd n = 1 := h example (m n : Nat) (h : m.coprime n) : m.gcd n = 1 := by rw [Nat.coprime] at h exact h example : Nat.coprime 12 7 := by norm_num example : Nat.gcd 12 8 = 4 := by norm_num #check @Nat.prime_def_lt example (p : ℕ) (prime_p : Nat.Prime p) : 2 ≤ p ∧ ∀ m : ℕ, m < p → m ∣ p → m = 1 := by rwa [Nat.prime_def_lt] at prime_p #check Nat.Prime.eq_one_or_self_of_dvd example (p : ℕ) (prime_p : Nat.Prime p) : ∀ m : ℕ, m ∣ p → m = 1 ∨ m = p := prime_p.eq_one_or_self_of_dvd example : Nat.Prime 17 := by norm_num -- commonly used example : Nat.Prime 2 := Nat.prime_two example : Nat.Prime 3 := Nat.prime_three #check @Nat.Prime.dvd_mul #check Nat.Prime.dvd_mul Nat.prime_two #check Nat.prime_two.dvd_mul theorem even_of_even_sqr {m : ℕ} (h : 2 ∣ m ^ 2) : 2 ∣ m := by rw [pow_two, Nat.prime_two.dvd_mul] at h cases h <;> assumption example {m : ℕ} (h : 2 ∣ m ^ 2) : 2 ∣ m := Nat.Prime.dvd_of_dvd_pow Nat.prime_two h example (a b c : Nat) (h : a * b = a * c) (h' : a ≠ 0) : b = c := -- library_search suggests the following: (mul_right_inj' h').mp h example {m n : ℕ} (coprime_mn : m.coprime n) : m ^ 2 ≠ 2 * n ^ 2 := by intro sqr_eq have : 2 ∣ m := by sorry, obtain ⟨k, meq⟩ := dvd_iff_exists_eq_mul_left.mp this have : 2 * (2 * k ^ 2) = 2 * n ^ 2 := by rw [← sqr_eq, meq] ring have : 2 * k ^ 2 = n ^ 2 := sorry, have : 2 ∣ n := by sorry, have : 2 ∣ m.gcd n := by sorry, have : 2 ∣ 1 := by sorry, norm_num at this example {m n p : ℕ} (coprime_mn : m.coprime n) (prime_p : p.Prime) : m ^ 2 ≠ p * n ^ 2 := by sorry #check Nat.factors #check Nat.prime_of_mem_factors #check Nat.prod_factors #check Nat.factors_unique theorem factorization_mul' {m n : ℕ} (mnez : m ≠ 0) (nnez : n ≠ 0) (p : ℕ) : (m * n).factorization p = m.factorization p + n.factorization p := by rw [Nat.factorization_mul mnez nnez] rfl theorem factorization_pow' (n k p : ℕ) : (n ^ k).factorization p = k * n.factorization p := by rw [Nat.factorization_pow] rfl theorem Nat.Prime.factorization' {p : ℕ} (prime_p : p.Prime) : p.factorization p = 1 := by rw [prime_p.factorization] simp example {m n p : ℕ} (nnz : n ≠ 0) (prime_p : p.Prime) : m ^ 2 ≠ p * n ^ 2 := by intro sqr_eq have nsqr_nez : n ^ 2 ≠ 0 := by simpa have eq1 : Nat.factorization (m ^ 2) p = 2 * m.factorization p := by sorry, have eq2 : (p * n ^ 2).factorization p = 2 * n.factorization p + 1 := by sorry, have : 2 * m.factorization p % 2 = (2 * n.factorization p + 1) % 2 := by rw [← eq1, sqr_eq, eq2] rw [add_comm, Nat.add_mul_mod_self_left, Nat.mul_mod_right] at this norm_num at this example {m n k r : ℕ} (nnz : n ≠ 0) (pow_eq : m ^ k = r * n ^ k) {p : ℕ} (prime_p : p.Prime) : k ∣ r.factorization p := by cases' r with r · simp have npow_nz : n ^ k ≠ 0 := fun npowz => nnz (pow_eq_zero npowz) have eq1 : (m ^ k).factorization p = k * m.factorization p := by sorry, have eq2 : (r.succ * n ^ k).factorization p = k * n.factorization p + r.succ.factorization p := by sorry, have : r.succ.factorization p = k * m.factorization p - k * n.factorization p := by rw [← eq1, pow_eq, eq2, add_comm, Nat.add_sub_cancel] rw [this] sorry #check multiplicity
-
-
-
@@ -1,148 +0,0 @@import Mathlib.Data.Nat.GCD.Basic import Mathlib.Algebra.BigOperators.Basic import Mathlib.Tactic example (n : Nat) : n.succ ≠ Nat.zero := Nat.succ_ne_zero n example (m n : Nat) (h : m.succ = n.succ) : m = n := Nat.succ.inj h def fac : ℕ → ℕ | 0 => 1 | n + 1 => (n + 1) * fac n example : fac 0 = 1 := rfl example : fac 0 = 1 := by rw [fac] example : fac 0 = 1 := by simp [fac] example (n : ℕ) : fac (n + 1) = (n + 1) * fac n := rfl example (n : ℕ) : fac (n + 1) = (n + 1) * fac n := by rw [fac] example (n : ℕ) : fac (n + 1) = (n + 1) * fac n := by simp [fac] theorem fac_pos (n : ℕ) : 0 < fac n := by induction' n with n ih · rw [fac] exact zero_lt_one rw [fac] exact mul_pos n.succ_pos ih theorem dvd_fac {i n : ℕ} (ipos : 0 < i) (ile : i ≤ n) : i ∣ fac n := by induction' n with n ih · exact absurd ipos (not_lt_of_ge ile) rw [fac] cases' Nat.of_le_succ ile with h h · apply dvd_mul_of_dvd_right (ih h) rw [h] apply dvd_mul_right theorem pow_two_le_fac (n : ℕ) : 2 ^ (n - 1) ≤ fac n := by cases' n with n · simp [fac] sorry section variable {α : Type _} (s : Finset ℕ) (f : ℕ → ℕ) (n : ℕ) #check Finset.sum s f #check Finset.prod s f open BigOperators open Finset example : s.sum f = ∑ x in s, f x := rfl example : s.prod f = ∏ x in s, f x := rfl example : (range n).sum f = ∑ x in range n, f x := rfl example : (range n).prod f = ∏ x in range n, f x := rfl example (f : ℕ → ℕ) : (∑ x in range 0, f x) = 0 := Finset.sum_range_zero f example (f : ℕ → ℕ) (n : ℕ) : (∑ x in range n.succ, f x) = (∑ x in range n, f x) + f n := Finset.sum_range_succ f n example (f : ℕ → ℕ) : (∏ x in range 0, f x) = 1 := Finset.prod_range_zero f example (f : ℕ → ℕ) (n : ℕ) : (∏ x in range n.succ, f x) = (∏ x in range n, f x) * f n := Finset.prod_range_succ f n example (n : ℕ) : fac n = ∏ i in range n, (i + 1) := by induction' n with n ih · rw [fac, prod_range_zero] rw [fac, ih, prod_range_succ, mul_comm] example (a b c d e f : ℕ) : a * (b * c * f * (d * e)) = d * (a * f * e) * (c * b) := by simp [mul_assoc, mul_comm, mul_left_comm] theorem sum_id (n : ℕ) : (∑ i in range (n + 1), i) = n * (n + 1) / 2 := by symm; apply Nat.div_eq_of_eq_mul_right (by norm_num : 0 < 2) induction' n with n ih · simp rw [Finset.sum_range_succ, mul_add 2, ← ih, Nat.succ_eq_add_one] ring theorem sum_sqr (n : ℕ) : (∑ i in range (n + 1), i ^ 2) = n * (n + 1) * (2 * n + 1) / 6 := by sorry end inductive MyNat | zero : MyNat | succ : MyNat → MyNat namespace MyNat def add : MyNat → MyNat → MyNat | x, zero => x | x, succ y => succ (add x y) def mul : MyNat → MyNat → MyNat | x, zero => zero | x, succ y => add (mul x y) x theorem zero_add (n : MyNat) : add zero n = n := by induction' n with n ih · rfl rw [add, ih] theorem succ_add (m n : MyNat) : add (succ m) n = succ (add m n) := by induction' n with n ih · rfl rw [add, ih] rfl theorem add_comm (m n : MyNat) : add m n = add n m := by induction' n with n ih · rw [zero_add] rfl rw [add, succ_add, ih] theorem add_assoc (m n k : MyNat) : add (add m n) k = add m (add n k) := by sorry theorem mul_add (m n k : MyNat) : mul m (add n k) = add (mul m n) (mul m k) := by sorry theorem zero_mul (n : MyNat) : mul zero n = zero := by sorry theorem succ_mul (m n : MyNat) : mul (succ m) n = add (mul m n) n := by sorry theorem mul_comm (m n : MyNat) : mul m n = mul n m := by sorry end MyNat
-
-
-
@@ -1,231 +0,0 @@import Mathlib.Data.Nat.Prime import Mathlib.Algebra.BigOperators.Order import Mathlib.Tactic import Mathlib.Tactic.IntervalCases open BigOperators theorem two_le {m : ℕ} (h0 : m ≠ 0) (h1 : m ≠ 1) : 2 ≤ m := by cases m; contradiction case succ m => cases m; contradiction repeat' apply Nat.succ_le_succ apply zero_le example {m : ℕ} (h0 : m ≠ 0) (h1 : m ≠ 1) : 2 ≤ m := by by_contra h push_neg at h interval_cases m <;> contradiction example {m : ℕ} (h0 : m ≠ 0) (h1 : m ≠ 1) : 2 ≤ m := by by_contra h push_neg at h revert h0 h1 revert h m decide theorem exists_prime_factor {n : Nat} (h : 2 ≤ n) : ∃ p : Nat, p.Prime ∧ p ∣ n := by by_cases np : n.Prime · use n, np induction' n using Nat.strong_induction_on with n ih dsimp at ih rw [Nat.prime_def_lt] at np push_neg at np rcases np h with ⟨m, mltn, mdvdn, mne1⟩ have : m ≠ 0 := by intro mz rw [mz, zero_dvd_iff] at mdvdn linarith have mgt2 : 2 ≤ m := two_le this mne1 by_cases mp : m.Prime · use m, mp exact mdvdn . rcases ih m mltn mgt2 mp with ⟨p, pp, pdvd⟩ use p, pp apply pdvd.trans mdvdn theorem primes_infinite : ∀ n, ∃ p > n, Nat.Prime p := by intro n have : 2 ≤ Nat.factorial (n + 1) + 1 := by sorry, rcases exists_prime_factor this with ⟨p, pp, pdvd⟩ refine' ⟨p, _, pp⟩ show p > n by_contra ple push_neg at ple have : p ∣ Nat.factorial (n + 1) := by sorry, have : p ∣ 1 := by sorry, show False sorry open Finset section variable {α : Type _} [DecidableEq α] (r s t : Finset α) example : r ∩ (s ∪ t) ⊆ r ∩ s ∪ r ∩ t := by rw [subset_iff] intro x rw [mem_inter, mem_union, mem_union, mem_inter, mem_inter] tauto example : r ∩ (s ∪ t) ⊆ r ∩ s ∪ r ∩ t := by simp [subset_iff] intro x tauto example : r ∩ s ∪ r ∩ t ⊆ r ∩ (s ∪ t) := by simp [subset_iff] intro x tauto example : r ∩ s ∪ r ∩ t = r ∩ (s ∪ t) := by ext x simp tauto end section variable {α : Type _} [DecidableEq α] (r s t : Finset α) example : (r ∪ s) ∩ (r ∪ t) = r ∪ s ∩ t := by sorry example : (r \ s) \ t = r \ (s ∪ t) := by sorry end example (s : Finset ℕ) (n : ℕ) (h : n ∈ s) : n ∣ ∏ i in s, i := Finset.dvd_prod_of_mem _ h theorem Nat.Prime.eq_of_dvd_of_prime {p q : ℕ} (prime_p : Nat.Prime p) (prime_q : Nat.Prime q) (h : p ∣ q) : p = q := by sorry theorem mem_of_dvd_prod_primes {s : Finset ℕ} {p : ℕ} (prime_p : p.Prime) : (∀ n ∈ s, Nat.Prime n) → (p ∣ ∏ n in s, n) → p ∈ s := by intro h₀ h₁ induction' s using Finset.induction_on with a s ans ih · simp at h₁ linarith [prime_p.two_le] simp [Finset.prod_insert ans, prime_p.dvd_mul] at h₀ h₁ rw [mem_insert] sorry example (s : Finset ℕ) (x : ℕ) : x ∈ s.filter Nat.Prime ↔ x ∈ s ∧ x.Prime := mem_filter theorem primes_infinite' : ∀ s : Finset Nat, ∃ p, Nat.Prime p ∧ p ∉ s := by intro s by_contra h push_neg at h set s' := s.filter Nat.Prime with s'_def have mem_s' : ∀ {n : ℕ}, n ∈ s' ↔ n.Prime := by intro n simp [s'_def] apply h have : 2 ≤ (∏ i in s', i) + 1 := by sorry, rcases exists_prime_factor this with ⟨p, pp, pdvd⟩ have : p ∣ ∏ i in s', i := by sorry, have : p ∣ 1 := by convert Nat.dvd_sub' pdvd this simp show False sorry theorem bounded_of_ex_finset (Q : ℕ → Prop) : (∃ s : Finset ℕ, ∀ k, Q k → k ∈ s) → ∃ n, ∀ k, Q k → k < n := by rintro ⟨s, hs⟩ use s.sup id + 1 intro k Qk apply Nat.lt_succ_of_le show id k ≤ s.sup id apply le_sup (hs k Qk) theorem ex_finset_of_bounded (Q : ℕ → Prop) [DecidablePred Q] : (∃ n, ∀ k, Q k → k ≤ n) → ∃ s : Finset ℕ, ∀ k, Q k ↔ k ∈ s := by rintro ⟨n, hn⟩ use (range (n + 1)).filter Q intro k simp [Nat.lt_succ_iff] exact hn k example : 27 % 4 = 3 := by norm_num example (n : ℕ) : (4 * n + 3) % 4 = 3 := by rw [add_comm, Nat.add_mul_mod_self_left] norm_num theorem mod_4_eq_3_or_mod_4_eq_3 {m n : ℕ} (h : m * n % 4 = 3) : m % 4 = 3 ∨ n % 4 = 3 := by revert h rw [Nat.mul_mod] have : m % 4 < 4 := Nat.mod_lt m (by norm_num) interval_cases hm : m % 4 <;> simp [hm] have : n % 4 < 4 := Nat.mod_lt n (by norm_num) interval_cases hn : n % 4 <;> simp [hn] theorem two_le_of_mod_4_eq_3 {n : ℕ} (h : n % 4 = 3) : 2 ≤ n := by apply two_le <;> · intro neq rw [neq] at h norm_num at h theorem aux {m n : ℕ} (h₀ : m ∣ n) (h₁ : 2 ≤ m) (h₂ : m < n) : n / m ∣ n ∧ n / m < n := by sorry theorem exists_prime_factor_mod_4_eq_3 {n : Nat} (h : n % 4 = 3) : ∃ p : Nat, p.Prime ∧ p ∣ n ∧ p % 4 = 3 := by by_cases np : n.Prime · use n exact ⟨np, dvd_rfl, h⟩ induction' n using Nat.strong_induction_on with n ih dsimp at ih rw [Nat.prime_def_lt] at np push_neg at np rcases np (two_le_of_mod_4_eq_3 h) with ⟨m, mltn, mdvdn, mne1⟩ have mge2 : 2 ≤ m := by apply two_le _ mne1 intro mz rw [mz, zero_dvd_iff] at mdvdn linarith have neq : m * (n / m) = n := Nat.mul_div_cancel' mdvdn have : m % 4 = 3 ∨ n / m % 4 = 3 := by apply mod_4_eq_3_or_mod_4_eq_3 rw [neq, h] cases' this with h1 h1 . sorry sorry example (m n : ℕ) (s : Finset ℕ) (h : m ∈ erase s n) : m ≠ n ∧ m ∈ s := by rwa [mem_erase] at h example (m n : ℕ) (s : Finset ℕ) (h : m ∈ erase s n) : m ≠ n ∧ m ∈ s := by simp at h assumption theorem primes_mod_4_eq_3_infinite : ∀ n, ∃ p > n, Nat.Prime p ∧ p % 4 = 3 := by by_contra h push_neg at h cases' h with n hn have : ∃ s : Finset Nat, ∀ p : ℕ, p.Prime ∧ p % 4 = 3 ↔ p ∈ s := by apply ex_finset_of_bounded use n contrapose! hn rcases hn with ⟨p, ⟨pp, p4⟩, pltn⟩ exact ⟨p, pltn, pp, p4⟩ cases' this with s hs have h₁ : ((4 * ∏ i in erase s 3, i) + 3) % 4 = 3 := by sorry, rcases exists_prime_factor_mod_4_eq_3 h₁ with ⟨p, pp, pdvd, p4eq⟩ have ps : p ∈ s := by sorry, have pne3 : p ≠ 3 := by sorry, have : p ∣ 4 * ∏ i in erase s 3, i := by sorry, have : p ∣ 3 := by sorry, have : p = 3 := by sorry, contradiction
-
-
-
@@ -1,101 +0,0 @@import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Data.Nat.Prime import Mathlib.Tactic.NormNum.GCD import Mathlib.Tactic.NormNum.Prime theorem even_of_even_sqr {m : ℕ} (h : 2 ∣ m ^ 2) : 2 ∣ m := by rw [pow_two, Nat.prime_two.dvd_mul] at h cases h <;> assumption example {m n : ℕ} (coprime_mn : m.coprime n) : m ^ 2 ≠ 2 * n ^ 2 := by intro sqr_eq have : 2 ∣ m := by apply even_of_even_sqr rw [sqr_eq] apply dvd_mul_right obtain ⟨k, meq⟩ := dvd_iff_exists_eq_mul_left.mp this have : 2 * (2 * k ^ 2) = 2 * n ^ 2 := by rw [← sqr_eq, meq] ring have : 2 * k ^ 2 = n ^ 2 := (mul_right_inj' (by norm_num)).mp this have : 2 ∣ n := by apply even_of_even_sqr rw [← this] apply dvd_mul_right have : 2 ∣ m.gcd n := by apply Nat.dvd_gcd <;> assumption have : 2 ∣ 1 := by convert this symm exact coprime_mn norm_num at this example {m n p : ℕ} (coprime_mn : m.coprime n) (prime_p : p.Prime) : m ^ 2 ≠ p * n ^ 2 := by intro sqr_eq have : p ∣ m := by apply prime_p.dvd_of_dvd_pow rw [sqr_eq] apply dvd_mul_right obtain ⟨k, meq⟩ := dvd_iff_exists_eq_mul_left.mp this have : p * (p * k ^ 2) = p * n ^ 2 := by rw [← sqr_eq, meq] ring have : p * k ^ 2 = n ^ 2 := by apply (mul_right_inj' _).mp this exact prime_p.ne_zero have : p ∣ n := by apply prime_p.dvd_of_dvd_pow rw [← this] apply dvd_mul_right have : p ∣ Nat.gcd m n := by apply Nat.dvd_gcd <;> assumption have : p ∣ 1 := by convert this symm exact coprime_mn have : 2 ≤ 1 := by apply prime_p.two_le.trans exact Nat.le_of_dvd zero_lt_one this norm_num at this theorem factorization_mul' {m n : ℕ} (mnez : m ≠ 0) (nnez : n ≠ 0) (p : ℕ) : (m * n).factorization p = m.factorization p + n.factorization p := by rw [Nat.factorization_mul mnez nnez] rfl theorem factorization_pow' (n k p : ℕ) : (n ^ k).factorization p = k * n.factorization p := by rw [Nat.factorization_pow] rfl theorem Nat.Prime.factorization' {p : ℕ} (prime_p : p.Prime) : p.factorization p = 1 := by rw [prime_p.factorization] simp example {m n p : ℕ} (nnz : n ≠ 0) (prime_p : p.Prime) : m ^ 2 ≠ p * n ^ 2 := by intro sqr_eq have nsqr_nez : n ^ 2 ≠ 0 := by simpa have eq1 : Nat.factorization (m ^ 2) p = 2 * m.factorization p := by rw [factorization_pow'] have eq2 : (p * n ^ 2).factorization p = 2 * n.factorization p + 1 := by rw [factorization_mul' prime_p.ne_zero nsqr_nez, prime_p.factorization', factorization_pow', add_comm] have : 2 * m.factorization p % 2 = (2 * n.factorization p + 1) % 2 := by rw [← eq1, sqr_eq, eq2] rw [add_comm, Nat.add_mul_mod_self_left, Nat.mul_mod_right] at this norm_num at this example {m n k r : ℕ} (nnz : n ≠ 0) (pow_eq : m ^ k = r * n ^ k) {p : ℕ} (prime_p : p.Prime) : k ∣ r.factorization p := by cases' r with r · simp have npow_nz : n ^ k ≠ 0 := fun npowz => nnz (pow_eq_zero npowz) have eq1 : (m ^ k).factorization p = k * m.factorization p := by rw [factorization_pow'] have eq2 : (r.succ * n ^ k).factorization p = k * n.factorization p + r.succ.factorization p := by rw [factorization_mul' r.succ_ne_zero npow_nz, factorization_pow', add_comm] have : r.succ.factorization p = k * m.factorization p - k * n.factorization p := by rw [← eq1, pow_eq, eq2, add_comm, Nat.add_sub_cancel] rw [this] apply Nat.dvd_sub' <;> apply Nat.dvd_mul_right
-
-
-
@@ -1,98 +0,0 @@import Mathlib.Data.Nat.GCD.Basic import Mathlib.Algebra.BigOperators.Basic import Mathlib.Tactic def fac : ℕ → ℕ | 0 => 1 | n + 1 => (n + 1) * fac n theorem pow_two_le_fac (n : ℕ) : 2 ^ (n - 1) ≤ fac n := by cases' n with n · simp [fac] induction' n with n ih · simp [fac] simp at * rw [pow_succ, fac] apply Nat.mul_le_mul _ ih repeat' apply Nat.succ_le_succ apply zero_le section variable {α : Type _} (s : Finset ℕ) (f : ℕ → ℕ) (n : ℕ) open BigOperators open Finset theorem sum_sqr (n : ℕ) : (∑ i in range (n + 1), i ^ 2) = n * (n + 1) * (2 * n + 1) / 6 := by symm; apply Nat.div_eq_of_eq_mul_right (by norm_num : 0 < 6) induction' n with n ih · simp rw [Finset.sum_range_succ, mul_add 6, ← ih, Nat.succ_eq_add_one] ring end inductive MyNat | zero : MyNat | succ : MyNat → MyNat namespace MyNat def add : MyNat → MyNat → MyNat | x, zero => x | x, succ y => succ (add x y) def mul : MyNat → MyNat → MyNat | x, zero => zero | x, succ y => add (mul x y) x theorem zero_add (n : MyNat) : add zero n = n := by induction' n with n ih · rfl rw [add, ih] theorem succ_add (m n : MyNat) : add (succ m) n = succ (add m n) := by induction' n with n ih · rfl rw [add, ih] rfl theorem add_comm (m n : MyNat) : add m n = add n m := by induction' n with n ih · rw [zero_add] rfl rw [add, succ_add, ih] theorem add_assoc (m n k : MyNat) : add (add m n) k = add m (add n k) := by induction' k with k ih · rfl rw [add, ih] rfl theorem mul_add (m n k : MyNat) : mul m (add n k) = add (mul m n) (mul m k) := by induction' k with k ih · rfl rw [add, mul, mul, ih, add_assoc] theorem zero_mul (n : MyNat) : mul zero n = zero := by induction' n with n ih · rfl rw [mul, ih] rfl theorem succ_mul (m n : MyNat) : mul (succ m) n = add (mul m n) n := by induction' n with n ih · rfl rw [mul, mul, ih, add_assoc, add_assoc, add_comm n, succ_add] rfl theorem mul_comm (m n : MyNat) : mul m n = mul n m := by induction' n with n ih · rw [zero_mul] rfl rw [mul, ih, succ_mul] end MyNat
-
-
-
@@ -1,241 +0,0 @@import Mathlib.Data.Nat.Prime import Mathlib.Algebra.BigOperators.Order import Mathlib.Tactic import Mathlib.Tactic.IntervalCases open BigOperators theorem two_le {m : ℕ} (h0 : m ≠ 0) (h1 : m ≠ 1) : 2 ≤ m := by cases m; contradiction case succ m => cases m; contradiction repeat' apply Nat.succ_le_succ apply zero_le theorem exists_prime_factor {n : Nat} (h : 2 ≤ n) : ∃ p : Nat, p.Prime ∧ p ∣ n := by by_cases np : n.Prime · use n, np induction' n using Nat.strong_induction_on with n ih dsimp at ih rw [Nat.prime_def_lt] at np push_neg at np rcases np h with ⟨m, mltn, mdvdn, mne1⟩ have : m ≠ 0 := by intro mz rw [mz, zero_dvd_iff] at mdvdn linarith have mgt2 : 2 ≤ m := two_le this mne1 by_cases mp : m.Prime · use m, mp exact mdvdn . rcases ih m mltn mgt2 mp with ⟨p, pp, pdvd⟩ use p, pp apply pdvd.trans mdvdn theorem primes_infinite : ∀ n, ∃ p > n, Nat.Prime p := by intro n have : 2 ≤ Nat.factorial (n + 1) + 1 := by apply Nat.succ_le_succ exact Nat.succ_le_of_lt (Nat.factorial_pos _) rcases exists_prime_factor this with ⟨p, pp, pdvd⟩ refine' ⟨p, _, pp⟩ show p > n by_contra ple push_neg at ple have : p ∣ Nat.factorial (n + 1) := by apply Nat.dvd_factorial apply pp.pos linarith have : p ∣ 1 := by convert Nat.dvd_sub' pdvd this simp show False have := Nat.le_of_dvd zero_lt_one this linarith [pp.two_le] open Finset section variable {α : Type _} [DecidableEq α] (r s t : Finset α) example : (r ∪ s) ∩ (r ∪ t) = r ∪ s ∩ t := by ext x rw [mem_inter, mem_union, mem_union, mem_union, mem_inter] tauto example : (r ∪ s) ∩ (r ∪ t) = r ∪ s ∩ t := by ext x simp tauto example : (r \ s) \ t = r \ (s ∪ t) := by ext x rw [mem_sdiff, mem_sdiff, mem_sdiff, mem_union] tauto example : (r \ s) \ t = r \ (s ∪ t) := by ext x simp tauto end theorem Nat.Prime.eq_of_dvd_of_prime {p q : ℕ} (prime_p : Nat.Prime p) (prime_q : Nat.Prime q) (h : p ∣ q) : p = q := by cases prime_q.eq_one_or_self_of_dvd _ h · linarith [prime_p.two_le] assumption theorem mem_of_dvd_prod_primes {s : Finset ℕ} {p : ℕ} (prime_p : p.Prime) : (∀ n ∈ s, Nat.Prime n) → (p ∣ ∏ n in s, n) → p ∈ s := by intro h₀ h₁ induction' s using Finset.induction_on with a s ans ih · simp at h₁ linarith [prime_p.two_le] simp [Finset.prod_insert ans, prime_p.dvd_mul] at h₀ h₁ rw [mem_insert] cases' h₁ with h₁ h₁ · left exact prime_p.eq_of_dvd_of_prime h₀.1 h₁ right exact ih h₀.2 h₁ theorem primes_infinite' : ∀ s : Finset Nat, ∃ p, Nat.Prime p ∧ p ∉ s := by intro s by_contra h push_neg at h set s' := s.filter Nat.Prime with s'_def have mem_s' : ∀ {n : ℕ}, n ∈ s' ↔ n.Prime := by intro n simp [s'_def] apply h have : 2 ≤ (∏ i in s', i) + 1 := by apply Nat.succ_le_succ apply Nat.succ_le_of_lt apply Finset.prod_pos intro n ns' apply (mem_s'.mp ns').pos rcases exists_prime_factor this with ⟨p, pp, pdvd⟩ have : p ∣ ∏ i in s', i := by apply dvd_prod_of_mem rw [mem_s'] apply pp have : p ∣ 1 := by convert Nat.dvd_sub' pdvd this simp show False have := Nat.le_of_dvd zero_lt_one this linarith [pp.two_le] theorem bounded_of_ex_finset (Q : ℕ → Prop) : (∃ s : Finset ℕ, ∀ k, Q k → k ∈ s) → ∃ n, ∀ k, Q k → k < n := by rintro ⟨s, hs⟩ use s.sup id + 1 intro k Qk apply Nat.lt_succ_of_le show id k ≤ s.sup id apply le_sup (hs k Qk) theorem ex_finset_of_bounded (Q : ℕ → Prop) [DecidablePred Q] : (∃ n, ∀ k, Q k → k ≤ n) → ∃ s : Finset ℕ, ∀ k, Q k ↔ k ∈ s := by rintro ⟨n, hn⟩ use (range (n + 1)).filter Q intro k simp [Nat.lt_succ_iff] exact hn k theorem mod_4_eq_3_or_mod_4_eq_3 {m n : ℕ} (h : m * n % 4 = 3) : m % 4 = 3 ∨ n % 4 = 3 := by revert h rw [Nat.mul_mod] have : m % 4 < 4 := Nat.mod_lt m (by norm_num) interval_cases hm : m % 4 <;> simp [hm] have : n % 4 < 4 := Nat.mod_lt n (by norm_num) interval_cases hn : n % 4 <;> simp [hn] theorem two_le_of_mod_4_eq_3 {n : ℕ} (h : n % 4 = 3) : 2 ≤ n := by apply two_le <;> · intro neq rw [neq] at h norm_num at h theorem aux {m n : ℕ} (h₀ : m ∣ n) (h₁ : 2 ≤ m) (h₂ : m < n) : n / m ∣ n ∧ n / m < n := by constructor · exact Nat.div_dvd_of_dvd h₀ exact Nat.div_lt_self (lt_of_le_of_lt (zero_le _) h₂) h₁ theorem exists_prime_factor_mod_4_eq_3 {n : Nat} (h : n % 4 = 3) : ∃ p : Nat, p.Prime ∧ p ∣ n ∧ p % 4 = 3 := by by_cases np : n.Prime · use n exact ⟨np, dvd_rfl, h⟩ induction' n using Nat.strong_induction_on with n ih dsimp at ih rw [Nat.prime_def_lt] at np push_neg at np rcases np (two_le_of_mod_4_eq_3 h) with ⟨m, mltn, mdvdn, mne1⟩ have mge2 : 2 ≤ m := by apply two_le _ mne1 intro mz rw [mz, zero_dvd_iff] at mdvdn linarith have neq : m * (n / m) = n := Nat.mul_div_cancel' mdvdn have : m % 4 = 3 ∨ n / m % 4 = 3 := by apply mod_4_eq_3_or_mod_4_eq_3 rw [neq, h] cases' this with h1 h1 · by_cases mp : m.Prime · use m exact ⟨mp, mdvdn, h1⟩ rcases ih m mltn h1 mp with ⟨p, pp, pdvd, p4eq⟩ use p exact ⟨pp, pdvd.trans mdvdn, p4eq⟩ obtain ⟨nmdvdn, nmltn⟩ := aux mdvdn mge2 mltn by_cases nmp : (n / m).Prime · use n / m exact ⟨nmp, nmdvdn, h1⟩ rcases ih (n / m) nmltn h1 nmp with ⟨p, pp, pdvd, p4eq⟩ use p exact ⟨pp, pdvd.trans nmdvdn, p4eq⟩ theorem primes_mod_4_eq_3_infinite : ∀ n, ∃ p > n, Nat.Prime p ∧ p % 4 = 3 := by by_contra h push_neg at h cases' h with n hn have : ∃ s : Finset Nat, ∀ p : ℕ, p.Prime ∧ p % 4 = 3 ↔ p ∈ s := by apply ex_finset_of_bounded use n contrapose! hn rcases hn with ⟨p, ⟨pp, p4⟩, pltn⟩ exact ⟨p, pltn, pp, p4⟩ cases' this with s hs have h₁ : ((4 * ∏ i in erase s 3, i) + 3) % 4 = 3 := by rw [add_comm, Nat.add_mul_mod_self_left] norm_num rcases exists_prime_factor_mod_4_eq_3 h₁ with ⟨p, pp, pdvd, p4eq⟩ have ps : p ∈ s := by rw [← hs p] exact ⟨pp, p4eq⟩ have pne3 : p ≠ 3 := by intro peq rw [peq, ← Nat.dvd_add_iff_left (dvd_refl 3)] at pdvd rw [Nat.prime_three.dvd_mul] at pdvd norm_num at pdvd have : 3 ∈ s.erase 3 := by apply mem_of_dvd_prod_primes Nat.prime_three _ pdvd intro n simp [← hs n] tauto simp at this have : p ∣ 4 * ∏ i in erase s 3, i := by apply dvd_trans _ (dvd_mul_left _ _) apply dvd_prod_of_mem simp constructor <;> assumption have : p ∣ 3 := by convert Nat.dvd_sub' pdvd this simp have : p = 3 := by apply pp.eq_of_dvd_of_prime Nat.prime_three this contradiction
-
-
src/C_Sets_and_Functions/S01_Sets.lean (deleted)
-
@@ -1,254 +0,0 @@import Mathlib.Data.Set.Lattice import Mathlib.Data.Nat.Prime import Mathlib.Data.Nat.Parity import Mathlib.Tactic section variable {α : Type _} variable (s t u : Set α) open Set example (h : s ⊆ t) : s ∩ u ⊆ t ∩ u := by rw [subset_def, inter_def, inter_def] rw [subset_def] at h dsimp rintro x ⟨xs, xu⟩ exact ⟨h _ xs, xu⟩ example (h : s ⊆ t) : s ∩ u ⊆ t ∩ u := by simp only [subset_def, mem_inter_iff] at * rintro x ⟨xs, xu⟩ exact ⟨h _ xs, xu⟩ example (h : s ⊆ t) : s ∩ u ⊆ t ∩ u := by intro x xsu exact ⟨h xsu.1, xsu.2⟩ theorem foo (h : s ⊆ t) : s ∩ u ⊆ t ∩ u := fun x ⟨xs, xu⟩ => ⟨h xs, xu⟩ example (h : s ⊆ t) : s ∩ u ⊆ t ∩ u := fun x ⟨xs, xu⟩ => ⟨h xs, xu⟩ example : s ∩ (t ∪ u) ⊆ s ∩ t ∪ s ∩ u := by intro x hx have xs : x ∈ s := hx.1 have xtu : x ∈ t ∪ u := hx.2 cases' xtu with xt xu · left show x ∈ s ∩ t exact ⟨xs, xt⟩ right show x ∈ s ∩ u exact ⟨xs, xu⟩ example : s ∩ (t ∪ u) ⊆ s ∩ t ∪ s ∩ u := by rintro x ⟨xs, xt | xu⟩ · left exact ⟨xs, xt⟩ right; exact ⟨xs, xu⟩ example : s ∩ t ∪ s ∩ u ⊆ s ∩ (t ∪ u) := by sorry example : (s \ t) \ u ⊆ s \ (t ∪ u) := by intro x xstu have xs : x ∈ s := xstu.1.1 have xnt : x ∉ t := xstu.1.2 have xnu : x ∉ u := xstu.2 constructor · exact xs intro xtu -- x ∈ t ∨ x ∈ u cases' xtu with xt xu · show False exact xnt xt show False; exact xnu xu example : (s \ t) \ u ⊆ s \ (t ∪ u) := by rintro x ⟨⟨xs, xnt⟩, xnu⟩ use xs rintro (xt | xu) <;> contradiction example : s \ (t ∪ u) ⊆ (s \ t) \ u := by sorry example : s ∩ t = t ∩ s := by ext x simp only [mem_inter_iff] constructor · rintro ⟨xs, xt⟩ exact ⟨xt, xs⟩ rintro ⟨xt, xs⟩; exact ⟨xs, xt⟩ example : s ∩ t = t ∩ s := Set.ext fun x => ⟨fun ⟨xs, xt⟩ => ⟨xt, xs⟩, fun ⟨xt, xs⟩ => ⟨xs, xt⟩⟩ example : s ∩ t = t ∩ s := by ext x; simp [and_comm] example : s ∩ t = t ∩ s := by apply Subset.antisymm · rintro x ⟨xs, xt⟩ exact ⟨xt, xs⟩ rintro x ⟨xt, xs⟩; exact ⟨xs, xt⟩ example : s ∩ t = t ∩ s := Subset.antisymm sorry sorry example : s ∩ (s ∪ t) = s := by sorry example : s ∪ s ∩ t = s := by sorry example : s \ t ∪ t = s ∪ t := by sorry example : s \ t ∪ t \ s = (s ∪ t) \ (s ∩ t) := by sorry def evens : Set ℕ := { n | Even n } def odds : Set ℕ := { n | ¬Even n } example : evens ∪ odds = univ := by rw [evens, odds] ext n simp apply Classical.em example (x : ℕ) (h : x ∈ (∅ : Set ℕ)) : False := h example (x : ℕ) : x ∈ (univ : Set ℕ) := trivial example : { n | Nat.Prime n } ∩ { n | n > 2 } ⊆ { n | ¬Even n } := by sorry #print Prime #print Nat.Prime example (n : ℕ) : Prime n ↔ Nat.Prime n := Nat.prime_iff.symm example (n : ℕ) (h : Prime n) : Nat.Prime n := by rw [Nat.prime_iff] exact h example (n : ℕ) (h : Prime n) : Nat.Prime n := by rwa [Nat.prime_iff] end section variable (s t : Set ℕ) example (h₀ : ∀ x ∈ s, ¬Even x) (h₁ : ∀ x ∈ s, Prime x) : ∀ x ∈ s, ¬Even x ∧ Prime x := by intro x xs constructor · apply h₀ x xs apply h₁ x xs example (h : ∃ x ∈ s, ¬Even x ∧ Prime x) : ∃ x ∈ s, Prime x := by rcases h with ⟨x, xs, _, prime_x⟩ use x, xs exact prime_x section variable (ssubt : s ⊆ t) example (h₀ : ∀ x ∈ t, ¬Even x) (h₁ : ∀ x ∈ t, Prime x) : ∀ x ∈ s, ¬Even x ∧ Prime x := by sorry example (h : ∃ x ∈ s, ¬Even x ∧ Prime x) : ∃ x ∈ t, Prime x := by sorry end end section variable {α I : Type _} variable (A B : I → Set α) variable (s : Set α) open Set example : (s ∩ ⋃ i, A i) = ⋃ i, A i ∩ s := by ext x simp only [mem_inter_iff, mem_iUnion] constructor · rintro ⟨xs, ⟨i, xAi⟩⟩ exact ⟨i, xAi, xs⟩ rintro ⟨i, xAi, xs⟩ exact ⟨xs, ⟨i, xAi⟩⟩ example : (⋂ i, A i ∩ B i) = (⋂ i, A i) ∩ ⋂ i, B i := by ext x simp only [mem_inter_iff, mem_iInter] constructor · intro h constructor · intro i exact (h i).1 intro i exact (h i).2 rintro ⟨h1, h2⟩ i constructor · exact h1 i exact h2 i example : (s ∪ ⋂ i, A i) = ⋂ i, A i ∪ s := by sorry def primes : Set ℕ := { x | Nat.Prime x } example : (⋃ p ∈ primes, { x | p ^ 2 ∣ x }) = { x | ∃ p ∈ primes, p ^ 2 ∣ x } :=by ext rw [mem_iUnion₂] simp example : (⋃ p ∈ primes, { x | p ^ 2 ∣ x }) = { x | ∃ p ∈ primes, p ^ 2 ∣ x } := by ext simp example : (⋂ p ∈ primes, { x | ¬p ∣ x }) ⊆ { x | x = 1 } := by intro x contrapose! simp apply Nat.exists_prime_and_dvd example : (⋃ p ∈ primes, { x | x ≤ p }) = univ := by sorry end section open Set variable {α : Type _} (s : Set (Set α)) example : ⋃₀ s = ⋃ t ∈ s, t := by ext x rw [mem_iUnion₂] simp example : ⋂₀ s = ⋂ t ∈ s, t := by ext x rw [mem_iInter₂] rfl end
-
-
-
@@ -1,217 +0,0 @@import Mathlib.Data.Set.Lattice import Mathlib.Data.Set.Function import Mathlib.Analysis.SpecialFunctions.Log.Basic section variable {α β : Type _} variable (f : α → β) variable (s t : Set α) variable (u v : Set β) open Function open Set example : f ⁻¹' (u ∩ v) = f ⁻¹' u ∩ f ⁻¹' v := by ext rfl example : f '' (s ∪ t) = f '' s ∪ f '' t := by ext y; constructor · rintro ⟨x, xs | xt, rfl⟩ · left use x, xs right use x, xt rintro (⟨x, xs, rfl⟩ | ⟨x, xt, rfl⟩) · use x, Or.inl xs use x, Or.inr xt example : s ⊆ f ⁻¹' (f '' s) := by intro x xs show f x ∈ f '' s use x, xs example : f '' s ⊆ v ↔ s ⊆ f ⁻¹' v := by sorry example (h : Injective f) : f ⁻¹' (f '' s) ⊆ s := by sorry example : f '' (f ⁻¹' u) ⊆ u := by sorry example (h : Surjective f) : u ⊆ f '' (f ⁻¹' u) := by sorry example (h : s ⊆ t) : f '' s ⊆ f '' t := by sorry example (h : u ⊆ v) : f ⁻¹' u ⊆ f ⁻¹' v := by sorry example : f ⁻¹' (u ∪ v) = f ⁻¹' u ∪ f ⁻¹' v := by sorry example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := by sorry example (h : Injective f) : f '' s ∩ f '' t ⊆ f '' (s ∩ t) := by sorry example : f '' s \ f '' t ⊆ f '' (s \ t) := by sorry example : f ⁻¹' u \ f ⁻¹' v ⊆ f ⁻¹' (u \ v) := by sorry example : f '' s ∩ v = f '' (s ∩ f ⁻¹' v) := by sorry example : f '' (s ∩ f ⁻¹' u) ⊆ f '' s ∪ u := by sorry example : s ∩ f ⁻¹' u ⊆ f ⁻¹' (f '' s ∩ u) := by sorry example : s ∪ f ⁻¹' u ⊆ f ⁻¹' (f '' s ∪ u) := by sorry variable {I : Type _} (A : I → Set α) (B : I → Set β) example : (f '' ⋃ i, A i) = ⋃ i, f '' A i := by ext y; simp constructor · rintro ⟨x, ⟨i, xAi⟩, fxeq⟩ use i, x exact ⟨xAi, fxeq⟩ rintro ⟨i, x, xAi, fxeq⟩ exact ⟨x, ⟨i, xAi⟩, fxeq⟩ example : (f '' ⋂ i, A i) ⊆ ⋂ i, f '' A i := by intro y; simp intro x h fxeq i use x exact ⟨h i, fxeq⟩ example (i : I) (injf : Injective f) : (⋂ i, f '' A i) ⊆ f '' ⋂ i, A i := by intro y; simp intro h rcases h i with ⟨x, xAi, fxeq⟩ use x; constructor · intro i' rcases h i' with ⟨x', x'Ai, fx'eq⟩ have : f x = f x' := by rw [fxeq, fx'eq] have : x = x' := injf this rw [this] exact x'Ai exact fxeq example : (f ⁻¹' ⋃ i, B i) = ⋃ i, f ⁻¹' B i := by ext x simp example : (f ⁻¹' ⋂ i, B i) = ⋂ i, f ⁻¹' B i := by ext x simp example : InjOn f s ↔ ∀ x₁ ∈ s, ∀ x₂ ∈ s, f x₁ = f x₂ → x₁ = x₂ := Iff.refl _ end section open Set Real example : InjOn log { x | x > 0 } := by intro x xpos y ypos intro e -- log x = log y calc x = exp (log x) := by rw [exp_log xpos] _ = exp (log y) := by rw [e] _ = y := by rw [exp_log ypos] example : range exp = { y | y > 0 } := by ext y; constructor · rintro ⟨x, rfl⟩ apply exp_pos intro ypos use log y rw [exp_log ypos] example : InjOn sqrt { x | x ≥ 0 } := by sorry example : InjOn (fun x => x ^ 2) { x : ℝ | x ≥ 0 } := by sorry example : sqrt '' { x | x ≥ 0 } = { y | y ≥ 0 } := by sorry example : (range fun x => x ^ 2) = { y : ℝ | y ≥ 0 } := by sorry end section variable {α β : Type _} [Inhabited α] #check (default : α) variable (P : α → Prop) (h : ∃ x, P x) #check Classical.choose h example : P (Classical.choose h) := Classical.choose_spec h noncomputable section open Classical def inverse (f : α → β) : β → α := fun y : β => if h : ∃ x, f x = y then Classical.choose h else default theorem inverse_spec {f : α → β} (y : β) (h : ∃ x, f x = y) : f (inverse f y) = y := by rw [inverse]; dsimp; rw [dif_pos h] exact Classical.choose_spec h variable (f : α → β) open Function example : Injective f ↔ LeftInverse (inverse f) f := sorry example : Surjective f ↔ RightInverse (inverse f) f := sorry end section variable {α : Type _} open Function theorem Cantor : ∀ f : α → Set α, ¬Surjective f := by intro f surjf let S := { i | i ∉ f i } rcases surjf S with ⟨j, h⟩ have h₁ : j ∉ f j := by intro h' have : j ∉ f j := by rwa [h] at h' contradiction have h₂ : j ∈ S sorry have h₃ : j ∉ S sorry contradiction -- COMMENTS: TODO: improve this end
-
-
-
@@ -1,99 +0,0 @@import Mathlib.Data.Set.Lattice import Mathlib.Data.Set.Function import Mathlib.Tactic open Set open Function noncomputable section open Classical variable {α β : Type _} [Nonempty β] section variable (f : α → β) (g : β → α) def sbAux : ℕ → Set α | 0 => univ \ g '' univ | n + 1 => g '' (f '' sbAux n) def sbSet := ⋃ n, sbAux f g n def sbFun (x : α) : β := if x ∈ sbSet f g then f x else invFun g x theorem sb_right_inv {x : α} (hx : x ∉ sbSet f g) : g (invFun g x) = x := by have : x ∈ g '' univ := by contrapose! hx rw [sbSet, mem_iUnion] use 0 rw [sbAux, mem_diff] sorry }, have : ∃ y, g y = x := by { sorry }, sorry theorem sb_injective (hf : Injective f) (hg : Injective g) : Injective (sbFun f g) := by set A := sbSet f g with A_def set h := sbFun f g with h_def intro x₁ x₂ intro (hxeq : h x₁ = h x₂) show x₁ = x₂ simp only [h_def, sbFun, ← A_def] at hxeq by_cases xA : x₁ ∈ A ∨ x₂ ∈ A · wlog x₁A : x₁ ∈ A generalizing x₁ x₂ hxeq xA · symm apply this hxeq.symm xA.symm (xA.resolve_left x₁A) have x₂A : x₂ ∈ A := by apply not_imp_self.mp intro (x₂nA : x₂ ∉ A) rw [if_pos x₁A, if_neg x₂nA] at hxeq rw [A_def, sbSet, mem_iUnion] at x₁A have x₂eq : x₂ = g (f x₁) := by . sorry rcases x₁A with ⟨n, hn⟩ rw [A_def, sbSet, mem_iUnion] use n + 1 simp [sbAux] exact ⟨x₁, hn, x₂eq.symm⟩ . sorry, push_neg at xA sorry theorem sb_surjective (hf : Injective f) (hg : Injective g) : Surjective (sbFun f g) := by set A := sbSet f g with A_def set h := sbFun f g with h_def intro y by_cases gyA : g y ∈ A · rw [A_def, sbSet, mem_iUnion] at gyA rcases gyA with ⟨n, hn⟩ cases' n with n · simp [sbAux] at hn simp [sbAux] at hn rcases hn with ⟨x, xmem, hx⟩ use x have : x ∈ A := by rw [A_def, sbSet, mem_iUnion] exact ⟨n, xmem⟩ simp only [h_def, sbFun, if_pos this] exact hg hx sorry end theorem schroeder_bernstein {f : α → β} {g : β → α} (hf : Injective f) (hg : Injective g) : ∃ h : α → β, Bijective h := ⟨sbFun f g, sb_injective f g hf hg, sb_surjective f g hf hg⟩ -- Auxiliary information section variable (g : β → α) (x : α) #check (invFun g : α → β) #check (leftInverse_invFun : Injective g → LeftInverse (invFun g) g) #check (leftInverse_invFun : Injective g → ∀ y, invFun g (g y) = y) #check (invFun_eq : (∃ y, g y = x) → g (invFun g x) = x) end
-
-
-
@@ -1,165 +0,0 @@import Mathlib.Data.Set.Lattice import Mathlib.Data.Nat.Prime import Mathlib.Data.Nat.Parity import Mathlib.Tactic section variable {α : Type _} variable (s t u : Set α) open Set example : s ∩ t ∪ s ∩ u ⊆ s ∩ (t ∪ u) := by rintro x (⟨xs, xt⟩ | ⟨xs, xu⟩) · use xs left exact xt use xs; right; exact xu example : s \ (t ∪ u) ⊆ (s \ t) \ u := by rintro x ⟨xs, xntu⟩ constructor use xs · intro xt exact xntu (Or.inl xt) intro xu apply xntu (Or.inr xu) example : s ∩ t = t ∩ s := Subset.antisymm (fun x ⟨xs, xt⟩ => ⟨xt, xs⟩) fun x ⟨xt, xs⟩ => ⟨xs, xt⟩ example : s ∩ (s ∪ t) = s := by ext x; constructor · rintro ⟨xs, _⟩ exact xs intro xs use xs; left; exact xs example : s ∪ s ∩ t = s := by ext x; constructor · rintro (xs | ⟨xs, xt⟩) <;> exact xs intro xs; left; exact xs example : s \ t ∪ t = s ∪ t := by ext x; constructor · rintro (⟨xs, nxt⟩ | xt) · left exact xs right exact xt by_cases h : x ∈ t · intro right exact h rintro (xs | xt) · left use xs exact h right; exact xt example : s \ t ∪ t \ s = (s ∪ t) \ (s ∩ t) := by ext x; constructor · rintro (⟨xs, xnt⟩ | ⟨xt, xns⟩) · constructor left exact xs rintro ⟨_, xt⟩ contradiction constructor right exact xt rintro ⟨xs, _⟩ contradiction rintro ⟨xs | xt, nxst⟩ · left use xs intro xt apply nxst constructor <;> assumption right; use xt; intro xs apply nxst constructor <;> assumption example : { n | Nat.Prime n } ∩ { n | n > 2 } ⊆ { n | ¬Even n } := by intro n simp intro nprime cases' Nat.Prime.eq_two_or_odd nprime with h h · rw [h] intro linarith rw [Nat.even_iff, h] norm_num end section variable (s t : Set ℕ) section variable (ssubt : s ⊆ t) example (h₀ : ∀ x ∈ t, ¬Even x) (h₁ : ∀ x ∈ t, Prime x) : ∀ x ∈ s, ¬Even x ∧ Prime x := by intro x xs constructor · apply h₀ x (ssubt xs) apply h₁ x (ssubt xs) example (h : ∃ x ∈ s, ¬Even x ∧ Prime x) : ∃ x ∈ t, Prime x := by rcases h with ⟨x, xs, _, px⟩ use x, ssubt xs exact px end end section variable {α I : Type _} variable (A B : I → Set α) variable (s : Set α) open Set example : (s ∪ ⋂ i, A i) = ⋂ i, A i ∪ s := by ext x simp only [mem_union, mem_iInter] constructor · rintro (xs | xI) · intro i right exact xs intro i left exact xI i intro h by_cases xs : x ∈ s · left exact xs right intro i cases h i · assumption contradiction def primes : Set ℕ := { x | Nat.Prime x } example : (⋃ p ∈ primes, { x | x ≤ p }) = univ := by apply eq_univ_of_forall intro x simp rcases Nat.exists_infinite_primes x with ⟨p, primep, pge⟩ use p, pge exact primep end
-
-
-
@@ -1,256 +0,0 @@import Mathlib.Data.Set.Lattice import Mathlib.Data.Set.Function import Mathlib.Analysis.SpecialFunctions.Log.Basic section variable {α β : Type _} variable (f : α → β) variable (s t : Set α) variable (u v : Set β) open Function open Set example : f '' s ⊆ v ↔ s ⊆ f ⁻¹' v := by constructor · intro h x xs have : f x ∈ f '' s := mem_image_of_mem _ xs exact h this intro h y ymem rcases ymem with ⟨x, xs, fxeq⟩ rw [← fxeq] apply h xs example (h : Injective f) : f ⁻¹' (f '' s) ⊆ s := by rintro x ⟨y, ys, fxeq⟩ rw [← h fxeq] exact ys example : f '' (f ⁻¹' u) ⊆ u := by rintro y ⟨x, xmem, rfl⟩ exact xmem example (h : Surjective f) : u ⊆ f '' (f ⁻¹' u) := by intro y yu rcases h y with ⟨x, fxeq⟩ use x constructor · show f x ∈ u rw [fxeq] exact yu exact fxeq example (h : s ⊆ t) : f '' s ⊆ f '' t := by rintro y ⟨x, xs, fxeq⟩ use x, h xs exact fxeq example (h : u ⊆ v) : f ⁻¹' u ⊆ f ⁻¹' v := by intro x; apply h example : f ⁻¹' (u ∪ v) = f ⁻¹' u ∪ f ⁻¹' v := by ext x; rfl example : f '' (s ∩ t) ⊆ f '' s ∩ f '' t := by rintro y ⟨x, ⟨xs, xt⟩, rfl⟩ constructor . use x, xs . use x, xt example (h : Injective f) : f '' s ∩ f '' t ⊆ f '' (s ∩ t) := by rintro y ⟨⟨x₁, x₁s, rfl⟩, ⟨x₂, x₂t, fx₂eq⟩⟩ use x₁ constructor . use x₁s rw [← h fx₂eq] exact x₂t . rfl example : f '' s \ f '' t ⊆ f '' (s \ t) := by rintro y ⟨⟨x₁, x₁s, rfl⟩, h⟩ use x₁ constructor . constructor . exact x₁s . intro h' apply h use x₁, h' . rfl example : f ⁻¹' u \ f ⁻¹' v ⊆ f ⁻¹' (u \ v) := fun x => id example : f '' s ∩ v = f '' (s ∩ f ⁻¹' v) := by ext y; constructor · rintro ⟨⟨x, xs, rfl⟩, fxv⟩ use x, ⟨xs, fxv⟩ rintro ⟨x, ⟨⟨xs, fxv⟩, rfl⟩⟩ exact ⟨⟨x, xs, rfl⟩, fxv⟩ example : f '' (s ∩ f ⁻¹' u) ⊆ f '' s ∩ u := by rintro y ⟨x, ⟨xs, fxu⟩, rfl⟩ exact ⟨⟨x, xs, rfl⟩, fxu⟩ example : s ∩ f ⁻¹' u ⊆ f ⁻¹' (f '' s ∩ u) := by rintro x ⟨xs, fxu⟩ exact ⟨⟨x, xs, rfl⟩, fxu⟩ example : s ∪ f ⁻¹' u ⊆ f ⁻¹' (f '' s ∪ u) := by rintro x (xs | fxu) · left exact ⟨x, xs, rfl⟩ right; exact fxu variable {I : Type _} (A : I → Set α) (B : I → Set β) example : (f '' ⋃ i, A i) = ⋃ i, f '' A i := by ext y; simp constructor · rintro ⟨x, ⟨i, xAi⟩, fxeq⟩ use i, x exact ⟨xAi, fxeq⟩ rintro ⟨i, x, xAi, fxeq⟩ exact ⟨x, ⟨i, xAi⟩, fxeq⟩ example : (f '' ⋂ i, A i) ⊆ ⋂ i, f '' A i := by intro y; simp intro x h fxeq i use x exact ⟨h i, fxeq⟩ example (i : I) (injf : Injective f) : (⋂ i, f '' A i) ⊆ f '' ⋂ i, A i := by intro y; simp intro h rcases h i with ⟨x, xAi, fxeq⟩ use x; constructor · intro i' rcases h i' with ⟨x', x'Ai, fx'eq⟩ have : f x = f x' := by rw [fxeq, fx'eq] have : x = x' := injf this rw [this] exact x'Ai exact fxeq example : (f ⁻¹' ⋃ i, B i) = ⋃ i, f ⁻¹' B i := by ext x simp example : (f ⁻¹' ⋂ i, B i) = ⋂ i, f ⁻¹' B i := by ext x simp end section open Set Real example : InjOn sqrt { x | x ≥ 0 } := by intro x xnonneg y ynonneg intro e calc x = sqrt x ^ 2 := by rw [sq_sqrt xnonneg] _ = sqrt y ^ 2 := by rw [e] _ = y := by rw [sq_sqrt ynonneg] example : InjOn (fun x => x ^ 2) { x : ℝ | x ≥ 0 } := by intro x xnonneg y ynonneg intro e dsimp at * calc x = sqrt (x ^ 2) := by rw [sqrt_sq xnonneg] _ = sqrt (y ^ 2) := by rw [e] _ = y := by rw [sqrt_sq ynonneg] example : sqrt '' { x | x ≥ 0 } = { y | y ≥ 0 } := by ext y; constructor · rintro ⟨x, ⟨xnonneg, rfl⟩⟩ apply sqrt_nonneg intro ynonneg use y ^ 2 dsimp at * constructor apply pow_nonneg ynonneg apply sqrt_sq assumption example : (range fun x => x ^ 2) = { y : ℝ | y ≥ 0 } := by ext y constructor · rintro ⟨x, rfl⟩ dsimp at * apply pow_two_nonneg intro ynonneg use sqrt y exact sq_sqrt ynonneg end section variable {α β : Type _} [Inhabited α] noncomputable section open Classical def inverse (f : α → β) : β → α := fun y : β => if h : ∃ x, f x = y then Classical.choose h else default theorem inverse_spec {f : α → β} (y : β) (h : ∃ x, f x = y) : f (inverse f y) = y := by rw [inverse]; dsimp; rw [dif_pos h] exact Classical.choose_spec h variable (f : α → β) open Function example : Injective f ↔ LeftInverse (inverse f) f := by constructor · intro h y apply h apply inverse_spec use y intro h x1 x2 e rw [← h x1, ← h x2, e] example : Injective f ↔ LeftInverse (inverse f) f := ⟨fun h y => h (inverse_spec _ ⟨y, rfl⟩), fun h x1 x2 e => by rw [← h x1, ← h x2, e]⟩ example : Surjective f ↔ RightInverse (inverse f) f := by constructor · intro h y apply inverse_spec apply h intro h y use inverse f y apply h example : Surjective f ↔ RightInverse (inverse f) f := ⟨fun h y => inverse_spec _ (h _), fun h y => ⟨inverse f y, h _⟩⟩ end section variable {α : Type _} open Function theorem Cantor : ∀ f : α → Set α, ¬Surjective f := by intro f surjf let S := { i | i ∉ f i } rcases surjf S with ⟨j, h⟩ have h₁ : j ∉ f j := by intro h' have : j ∉ f j := by rwa [h] at h' contradiction have h₂ : j ∈ S := h₁ have h₃ : j ∉ S := by rwa [h] at h₁ contradiction end
-
-
-
@@ -1,92 +0,0 @@import Mathlib.Data.Set.Lattice import Mathlib.Data.Set.Function import Mathlib.Tactic open Set open Function noncomputable section open Classical variable {α β : Type _} [Nonempty β] section variable (f : α → β) (g : β → α) def sbAux : ℕ → Set α | 0 => univ \ g '' univ | n + 1 => g '' (f '' sbAux n) def sbSet := ⋃ n, sbAux f g n def sbFun (x : α) : β := if x ∈ sbSet f g then f x else invFun g x theorem sb_right_inv {x : α} (hx : x ∉ sbSet f g) : g (invFun g x) = x := by have : x ∈ g '' univ := by contrapose! hx rw [sbSet, mem_iUnion] use 0 rw [sbAux, mem_diff] exact ⟨mem_univ _, hx⟩ have : ∃ y, g y = x := by simp at this assumption exact invFun_eq this theorem sb_injective (hf : Injective f) (hg : Injective g) : Injective (sbFun f g) := by set A := sbSet f g with A_def set h := sbFun f g with h_def intro x₁ x₂ intro (hxeq : h x₁ = h x₂) show x₁ = x₂ simp only [h_def, sbFun, ← A_def] at hxeq by_cases xA : x₁ ∈ A ∨ x₂ ∈ A · wlog x₁A : x₁ ∈ A generalizing x₁ x₂ hxeq xA · symm apply this hxeq.symm xA.symm (xA.resolve_left x₁A) have x₂A : x₂ ∈ A := by apply not_imp_self.mp intro (x₂nA : x₂ ∉ A) rw [if_pos x₁A, if_neg x₂nA] at hxeq rw [A_def, sbSet, mem_iUnion] at x₁A have x₂eq : x₂ = g (f x₁) := by rw [hxeq, sb_right_inv f g x₂nA] rcases x₁A with ⟨n, hn⟩ rw [A_def, sbSet, mem_iUnion] use n + 1 simp [sbAux] exact ⟨x₁, hn, x₂eq.symm⟩ rw [if_pos x₁A, if_pos x₂A] at hxeq exact hf hxeq push_neg at xA rw [if_neg xA.1, if_neg xA.2] at hxeq rw [← sb_right_inv f g xA.1, hxeq, sb_right_inv f g xA.2] theorem sb_surjective (hf : Injective f) (hg : Injective g) : Surjective (sbFun f g) := by set A := sbSet f g with A_def set h := sbFun f g with h_def intro y by_cases gyA : g y ∈ A · rw [A_def, sbSet, mem_iUnion] at gyA rcases gyA with ⟨n, hn⟩ cases' n with n · simp [sbAux] at hn simp [sbAux] at hn rcases hn with ⟨x, xmem, hx⟩ use x have : x ∈ A := by rw [A_def, sbSet, mem_iUnion] exact ⟨n, xmem⟩ simp only [h_def, sbFun, if_pos this] exact hg hx use g y simp only [h_def, sbFun, if_neg gyA] apply leftInverse_invFun hg end
-
-
src/C_Structures/S01_Structures.lean (deleted)
-
@@ -1,227 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic noncomputable section @[ext] structure Point where x : ℝ y : ℝ z : ℝ #check Point.ext example (a b : Point) (hx : a.x = b.x) (hy : a.y = b.y) (hz : a.z = b.z) : a = b := by ext repeat' assumption def myPoint1 : Point where x := 2 y := -1 z := 4 def myPoint2 : Point := ⟨2, -1, 4⟩ def myPoint3 := Point.mk 2 (-1) 4 structure Point' where build :: x : ℝ y : ℝ z : ℝ #check Point'.build 2 (-1) 4 namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def add' (a b : Point) : Point where x := a.x + b.x y := a.y + b.y z := a.z + b.z #check add myPoint1 myPoint2 #check myPoint1.add myPoint2 end Point #check Point.add myPoint1 myPoint2 #check myPoint1.add myPoint2 namespace Point protected theorem add_comm (a b : Point) : add a b = add b a := by rw [add, add] ext <;> dsimp repeat' apply add_comm example (a b : Point) : add a b = add b a := by simp [add, add_comm] theorem add_x (a b : Point) : (a.add b).x = a.x + b.x := rfl def addAlt : Point → Point → Point | Point.mk x₁ y₁ z₁, Point.mk x₂ y₂ z₂ => ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩ def addAlt' : Point → Point → Point | ⟨x₁, y₁, z₁⟩, ⟨x₂, y₂, z₂⟩ => ⟨x₁ + x₂, y₁ + y₂, z₁ + z₂⟩ theorem addAlt_x (a b : Point) : (a.addAlt b).x = a.x + b.x := by cases a cases b rfl theorem addAlt_comm (a b : Point) : addAlt a b = addAlt b a := by rcases a with ⟨xa, ya, za⟩ rcases b with ⟨xb, yb, zb⟩ rw [addAlt, addAlt] ext <;> dsimp apply add_comm repeat' apply add_comm example (a b : Point) : addAlt a b = addAlt b a := by rcases a with ⟨xa, ya, za⟩ rcases b with ⟨xb, yb, zb⟩ simp [addAlt, add_comm] example : ∀ a b : Point, addAlt a b = addAlt b a := by rintro ⟨xa, ya, za⟩ ⟨xb, yb, zb⟩ simp [addAlt, add_comm] example : ∀ a b : Point, add a b = add b a := fun ⟨xa, ya, za⟩ ⟨xb, yb, zb⟩ => by simp [add, add_comm] protected theorem add_assoc (a b c : Point) : (a.add b).add c = a.add (b.add c) := by sorry def smul (r : ℝ) (a : Point) : Point := sorry theorem smul_distrib (r : ℝ) (a b : Point) : (smul r a).add (smul r b) = smul r (a.add b) := by sorry end Point structure StandardTwoSimplex where x : ℝ y : ℝ z : ℝ x_nonneg : 0 ≤ x y_nonneg : 0 ≤ y z_nonneg : 0 ≤ z sum_eq : x + y + z = 1 namespace StandardTwoSimplex def swapXy (a : StandardTwoSimplex) : StandardTwoSimplex where x := a.y y := a.x z := a.z x_nonneg := a.y_nonneg y_nonneg := a.x_nonneg z_nonneg := a.z_nonneg sum_eq := by rw [add_comm a.y a.x, a.sum_eq] noncomputable section def midpoint (a b : StandardTwoSimplex) : StandardTwoSimplex where x := (a.x + b.x) / 2 y := (a.y + b.y) / 2 z := (a.z + b.z) / 2 x_nonneg := div_nonneg (add_nonneg a.x_nonneg b.x_nonneg) (by norm_num) y_nonneg := div_nonneg (add_nonneg a.y_nonneg b.y_nonneg) (by norm_num) z_nonneg := div_nonneg (add_nonneg a.z_nonneg b.z_nonneg) (by norm_num) sum_eq := by field_simp; linarith [a.sum_eq, b.sum_eq] def weightedAverage (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardTwoSimplex) : StandardTwoSimplex where sorry end end StandardTwoSimplex open BigOperators structure StandardSimplex (n : ℕ) where V : Fin n → ℝ NonNeg : ∀ i : Fin n, 0 ≤ V i sum_eq_one : (∑ i, V i) = 1 namespace StandardSimplex def midpoint (n : ℕ) (a b : StandardSimplex n) : StandardSimplex n where V i := (a.V i + b.V i) / 2 NonNeg := by intro i apply div_nonneg · linarith [a.NonNeg i, b.NonNeg i] norm_num sum_eq_one := by simp [div_eq_mul_inv, ← Finset.sum_mul, Finset.sum_add_distrib, a.sum_eq_one, b.sum_eq_one] field_simp end StandardSimplex structure IsLinear (f : ℝ → ℝ) where is_additive : ∀ x y, f (x + y) = f x + f y preserves_mul : ∀ x c, f (c * x) = c * f x section variable (f : ℝ → ℝ) (linf : IsLinear f) #check linf.is_additive #check linf.preserves_mul end def Point'' := ℝ × ℝ × ℝ def IsLinear' (f : ℝ → ℝ) := (∀ x y, f (x + y) = f x + f y) ∧ ∀ x c, f (c * x) = c * f x def PReal := { y : ℝ // 0 < y } section variable (x : PReal) #check x.val #check x.property #check x.1 #check x.2 end def StandardTwoSimplex' := { p : ℝ × ℝ × ℝ // 0 ≤ p.1 ∧ 0 ≤ p.2.1 ∧ 0 ≤ p.2.2 ∧ p.1 + p.2.1 + p.2.2 = 1 } def StandardSimplex' (n : ℕ) := { v : Fin n → ℝ // (∀ i : Fin n, 0 ≤ v i) ∧ (∑ i, v i) = 1 } def StdSimplex := Σ n : ℕ, StandardSimplex n section variable (s : StdSimplex) #check s.fst #check s.snd #check s.1 #check s.2 end
-
-
-
@@ -1,172 +0,0 @@import Mathlib.Data.Real.Basic structure Group₁ (α : Type _) where mul : α → α → α one : α inv : α → α mul_assoc : ∀ x y z : α, mul (mul x y) z = mul x (mul y z) mul_one : ∀ x : α, mul x one = x one_mul : ∀ x : α, mul one x = x mul_left_inv : ∀ x : α, mul (inv x) x = one structure Group₁Cat where α : Type _ str : Group₁ α section variable (α β γ : Type _) variable (f : α ≃ β) (g : β ≃ γ) #check Equiv α β #check (f.toFun : α → β) #check (f.invFun : β → α) #check (f.right_inv : ∀ x : β, f (f.invFun x) = x) #check (f.left_inv : ∀ x : α, f.invFun (f x) = x) #check (Equiv.refl α : α ≃ α) #check (f.symm : β ≃ α) #check (f.trans g : α ≃ γ) example (x : α) : (f.trans g).toFun x = g.toFun (f.toFun x) := rfl example (x : α) : (f.trans g) x = g (f x) := rfl example : (f.trans g : α → γ) = g ∘ f := rfl end example (α : Type _) : Equiv.Perm α = (α ≃ α) := rfl def permGroup {α : Type _} : Group₁ (Equiv.Perm α) where mul f g := Equiv.trans g f one := Equiv.refl α inv := Equiv.symm mul_assoc f g h := (Equiv.trans_assoc _ _ _).symm one_mul := Equiv.trans_refl mul_one := Equiv.refl_trans mul_left_inv := Equiv.self_trans_symm structure AddGroup₁ (α : Type _) where (add : α → α → α) -- fill in the rest @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def neg (a : point) : point := sorry def zero : point := sorry def add_group_point : add_group₁ point := sorry end Point section variable {α : Type _} (f g : Equiv.Perm α) (n : ℕ) #check f * g #check mul_assoc f g g⁻¹ -- group power, defined for any group #check g ^ n example : f * g * g⁻¹ = f := by rw [mul_assoc, mul_right_inv, mul_one] example : f * g * g⁻¹ = f := mul_inv_cancel_right f g example {α : Type _} (f g : Equiv.Perm α) : g.symm.trans (g.trans f) = f := mul_inv_cancel_right f g end class Group₂ (α : Type _) where mul : α → α → α one : α inv : α → α mul_assoc : ∀ x y z : α, mul (mul x y) z = mul x (mul y z) mul_one : ∀ x : α, mul x one = x one_mul : ∀ x : α, mul one x = x mul_left_inv : ∀ x : α, mul (inv x) x = one instance {α : Type _} : Group₂ (Equiv.Perm α) where mul f g := Equiv.trans g f one := Equiv.refl α inv := Equiv.symm mul_assoc f g h := (Equiv.trans_assoc _ _ _).symm one_mul := Equiv.trans_refl mul_one := Equiv.refl_trans mul_left_inv := Equiv.self_trans_symm #check @Group₂.mul def mySquare {α : Type _} [Group₂ α] (x : α) := Group₂.mul x x #check @mySquare section variable {β : Type _} (f g : Equiv.Perm β) example : Group₂.mul f g = g.trans f := rfl example : mySquare f = f.trans f := rfl end instance : Inhabited Point where default := ⟨0, 0, 0⟩ #check (default : Point) example : ([] : List Point).headI = default := rfl instance : Add Point where add := Point.add section variable (x y : Point) #check x + y example : x + y = Point.add x y := rfl end instance hasMulGroup₂ {α : Type _} [Group₂ α] : Mul α := ⟨Group₂.mul⟩ instance hasOneGroup₂ {α : Type _} [Group₂ α] : One α := ⟨Group₂.one⟩ instance hasInvGroup₂ {α : Type _} [Group₂ α] : Inv α := ⟨Group₂.inv⟩ section variable {α : Type _} (f g : Equiv.Perm α) #check f * 1 * g⁻¹ def foo : f * 1 * g⁻¹ = g.symm.trans ((Equiv.refl α).trans f) := rfl end class AddGroup₂ (α : Type _) where add : α → α → α -- fill in the rest
-
-
-
@@ -1,271 +0,0 @@import Mathlib.Data.Int.Basic import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Tactic @[ext] structure gaussInt where re : ℤ im : ℤ namespace gaussInt instance : Zero gaussInt := ⟨⟨0, 0⟩⟩ instance : One gaussInt := ⟨⟨1, 0⟩⟩ instance : Add gaussInt := ⟨fun x y => ⟨x.re + y.re, x.im + y.im⟩⟩ instance : Neg gaussInt := ⟨fun x => ⟨-x.re, -x.im⟩⟩ instance : Mul gaussInt := ⟨fun x y => ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussInt) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussInt) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussInt) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussInt) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussInt) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussInt).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussInt).im = 0 := rfl @[simp] theorem one_re : (1 : gaussInt).re = 1 := rfl @[simp] theorem one_im : (1 : gaussInt).im = 0 := rfl @[simp] theorem add_re (x y : gaussInt) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussInt) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussInt) : (-x).re = -x.re := rfl @[simp] theorem neg_im (x : gaussInt) : (-x).im = -x.im := rfl @[simp] theorem mul_re (x y : gaussInt) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussInt) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance instCommRing : CommRing gaussInt where zero := 0 one := 1 add := (· + ·) neg x := -x mul := (· * ·) add_assoc := by intros ext <;> simp <;> ring zero_add := by intros ext <;> simp add_zero := by intros ext <;> simp add_left_neg := by intros ext <;> simp add_comm := by intros ext <;> simp <;> ring mul_assoc := by intros ext <;> simp <;> ring one_mul := by intros ext <;> simp mul_one := by intros ext <;> simp left_distrib := by intros ext <;> simp <;> ring right_distrib := by intros ext <;> simp <;> ring mul_comm := by intros ext <;> simp <;> ring zero_mul := sorry mul_zero := sorry instance : Nontrivial gaussInt := by use 0, 1 rw [Ne, gaussInt.ext_iff] simp end gaussInt example (a b : ℤ) : a = b * (a / b) + a % b := Eq.symm <| Int.ediv_add_emod a b example (a b : ℤ) : b ≠ 0 → 0 ≤ a % b := Int.emod_nonneg a example (a b : ℤ) : b ≠ 0 → a % b < abs b := Int.emod_lt a namespace Int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := by rw [div', mod'] linarith [Int.ediv_add_emod (a + b / 2) b] theorem abs_mod'_le (a b : ℤ) (h : 0 < b) : abs (mod' a b) ≤ b / 2 := by rw [mod', abs_le] constructor · linarith [Int.emod_nonneg (a + b / 2) h.ne'] have := Int.emod_lt_of_pos (a + b / 2) h have := Int.ediv_add_emod b 2 have := Int.emod_lt_of_pos b zero_lt_two revert this; intro this -- FIXME, this should not be needed linarith theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end Int theorem sq_add_sq_eq_zero {α : Type _} [LinearOrderedRing α] (x y : α) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by sorry namespace gaussInt def norm (x : gaussInt) := x.re ^ 2 + x.im ^ 2 @[simp] theorem norm_nonneg (x : gaussInt) : 0 ≤ norm x := by sorry theorem norm_eq_zero (x : gaussInt) : norm x = 0 ↔ x = 0 := by sorry theorem norm_pos (x : gaussInt) : 0 < norm x ↔ x ≠ 0 := by sorry theorem norm_mul (x y : gaussInt) : norm (x * y) = norm x * norm y := by sorry def conj (x : gaussInt) : gaussInt := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussInt) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussInt) : (conj x).im = -x.im := rfl theorem norm_conj (x : gaussInt) : norm (conj x) = norm x := by simp [norm] instance : Div gaussInt := ⟨fun x y => ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩⟩ instance : Mod gaussInt := ⟨fun x y => x - y * (x / y)⟩ theorem div_def (x y : gaussInt) : x / y = ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussInt) : x % y = x - y * (x / y) := rfl theorem norm_mod_lt (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : (x % y).norm < y.norm := by have norm_y_pos : 0 < norm y := by rwa [norm_pos] have : x % y * conj y = ⟨Int.mod' (x * conj y).re (norm y), Int.mod' (x * conj y).im (norm y)⟩ := by rw [mod_def, sub_mul, Int.mod'_eq, Int.mod'_eq, sub_eq_add_neg, div_def, norm] ext <;> simp <;> ring have : norm (x % y) * norm y ≤ norm y / 2 * norm y := by conv => lhs rw [← norm_conj y, ← norm_mul, this, norm] simp trans 2 * (y.norm / 2) ^ 2 · rw [two_mul] apply add_le_add <;> · rw [sq_le_sq] apply le_trans (Int.abs_mod'_le _ _ norm_y_pos) apply le_abs_self rw [pow_two, ← mul_assoc, mul_comm, mul_comm (2 : ℤ)] apply mul_le_mul_of_nonneg_left · apply Int.ediv_mul_le norm_num apply Int.ediv_nonneg (norm_nonneg y) norm_num have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos apply lt_of_le_of_lt this apply Int.ediv_lt_of_lt_mul · norm_num linarith theorem coe_natAbs_norm (x : gaussInt) : (x.norm.natAbs : ℤ) = x.norm := Int.natAbs_of_nonneg (norm_nonneg _) theorem natAbs_norm_mod_lt (x y : gaussInt) (hy : y ≠ 0) : (x % y).norm.natAbs < y.norm.natAbs := by apply Int.ofNat_lt.1 simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg] apply norm_mod_lt x hy theorem not_norm_mul_left_lt_norm (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : ¬(norm (x * y)).natAbs < (norm x).natAbs := by apply not_lt_of_ge rw [norm_mul, Int.natAbs_mul] apply le_mul_of_one_le_right (Nat.zero_le _) apply Int.ofNat_le.1 rw [coe_natAbs_norm] exact Int.add_one_le_of_lt ((norm_pos _).mpr hy) instance : EuclideanDomain gaussInt := { gaussInt.instCommRing with quotient := (· / ·) remainder := (· % ·) quotient_mul_add_remainder_eq := fun x y => by simp only; rw [mod_def, add_comm, sub_add_cancel] quotient_zero := fun x => by simp [div_def, norm, Int.div'] rfl r := Measure (Int.natAbs ∘ norm) r_wellFounded := (measure (Int.natAbs ∘ norm)).2 remainder_lt := natAbs_norm_mod_lt mul_left_not_lt := not_norm_mul_left_lt_norm } example (x : gaussInt) : Irreducible x ↔ Prime x := PrincipalIdealRing.irreducible_iff_prime end gaussInt
-
-
-
@@ -1,96 +0,0 @@import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Real.Basic noncomputable section @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ protected theorem add_assoc (a b c : Point) : (a.add b).add c = a.add (b.add c) := by simp [add, add_assoc] def smul (r : ℝ) (a : Point) : Point := ⟨r * a.x, r * a.y, r * a.z⟩ theorem smul_distrib (r : ℝ) (a b : Point) : (smul r a).add (smul r b) = smul r (a.add b) := by simp [add, smul, mul_add] end Point structure StandardTwoSimplex where x : ℝ y : ℝ z : ℝ x_nonneg : 0 ≤ x y_nonneg : 0 ≤ y z_nonneg : 0 ≤ z sum_eq : x + y + z = 1 namespace StandardTwoSimplex noncomputable section def weightedAverage (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardTwoSimplex) : StandardTwoSimplex where x := lambda * a.x + (1 - lambda) * b.x y := lambda * a.y + (1 - lambda) * b.y z := lambda * a.z + (1 - lambda) * b.z x_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.x_nonneg) (mul_nonneg (by linarith) b.x_nonneg) y_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.y_nonneg) (mul_nonneg (by linarith) b.y_nonneg) z_nonneg := add_nonneg (mul_nonneg lambda_nonneg a.z_nonneg) (mul_nonneg (by linarith) b.z_nonneg) sum_eq := by trans (a.x + a.y + a.z) * lambda + (b.x + b.y + b.z) * (1 - lambda) · ring simp [a.sum_eq, b.sum_eq] end end StandardTwoSimplex open BigOperators structure StandardSimplex (n : ℕ) where V : Fin n → ℝ NonNeg : ∀ i : Fin n, 0 ≤ V i sum_eq_one : (∑ i, V i) = 1 namespace StandardSimplex def midpoint (n : ℕ) (a b : StandardSimplex n) : StandardSimplex n where V i := (a.V i + b.V i) / 2 NonNeg := by intro i apply div_nonneg · linarith [a.NonNeg i, b.NonNeg i] norm_num sum_eq_one := by simp [div_eq_mul_inv, ← Finset.sum_mul, Finset.sum_add_distrib, a.sum_eq_one, b.sum_eq_one] field_simp end StandardSimplex namespace StandardSimplex def weightedAverage {n : ℕ} (lambda : Real) (lambda_nonneg : 0 ≤ lambda) (lambda_le : lambda ≤ 1) (a b : StandardSimplex n) : StandardSimplex n where V i := lambda * a.V i + (1 - lambda) * b.V i NonNeg i := add_nonneg (mul_nonneg lambda_nonneg (a.NonNeg i)) (mul_nonneg (by linarith) (b.NonNeg i)) sum_eq_one := by trans (lambda * ∑ i, a.V i) + (1 - lambda) * ∑ i, b.V i · rw [Finset.sum_add_distrib, Finset.mul_sum, Finset.mul_sum] simp [a.sum_eq_one, b.sum_eq_one] end StandardSimplex
-
-
-
@@ -1,73 +0,0 @@import Mathlib.Data.Real.Basic structure AddGroup₁ (α : Type _) where add : α → α → α zero : α neg : α → α add_assoc : ∀ x y z : α, add (add x y) z = add x (add y z) add_zero : ∀ x : α, add x zero = x zero_add : ∀ x : α, add x zero = x add_left_neg : ∀ x : α, add (neg x) x = zero @[ext] structure Point where x : ℝ y : ℝ z : ℝ namespace Point def add (a b : Point) : Point := ⟨a.x + b.x, a.y + b.y, a.z + b.z⟩ def neg (a : Point) : Point := ⟨-a.x, -a.y, -a.z⟩ def zero : Point := ⟨0, 0, 0⟩ def addGroupPoint : AddGroup₁ Point where add := Point.add zero := Point.zero neg := Point.neg add_assoc := by simp [Point.add, add_assoc] add_zero := by simp [Point.add, Point.zero] zero_add := by simp [Point.add, Point.zero] add_left_neg := by simp [Point.add, Point.neg, Point.zero] end Point class AddGroup₂ (α : Type _) where add : α → α → α zero : α neg : α → α add_assoc : ∀ x y z : α, add (add x y) z = add x (add y z) add_zero : ∀ x : α, add x zero = x zero_add : ∀ x : α, add x zero = x add_left_neg : ∀ x : α, add (neg x) x = zero instance hasAddAddGroup₂ {α : Type _} [AddGroup₂ α] : Add α := ⟨AddGroup₂.add⟩ instance hasZeroAddGroup₂ {α : Type _} [AddGroup₂ α] : Zero α := ⟨AddGroup₂.zero⟩ instance hasNegAddGroup₂ {α : Type _} [AddGroup₂ α] : Neg α := ⟨AddGroup₂.neg⟩ instance : AddGroup₂ Point where add := Point.add zero := Point.zero neg := Point.neg add_assoc := by simp [Point.add, add_assoc] add_zero := by simp [Point.add, Point.zero] zero_add := by simp [Point.add, Point.zero] add_left_neg := by simp [Point.add, Point.neg, Point.zero] section variable (x y : Point) #check x + -y + 0 end
-
-
-
@@ -1,285 +0,0 @@import Mathlib.Data.Int.Basic import Mathlib.Algebra.EuclideanDomain.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Tactic @[ext] structure gaussInt where re : ℤ im : ℤ namespace gaussInt instance : Zero gaussInt := ⟨⟨0, 0⟩⟩ instance : One gaussInt := ⟨⟨1, 0⟩⟩ instance : Add gaussInt := ⟨fun x y => ⟨x.re + y.re, x.im + y.im⟩⟩ instance : Neg gaussInt := ⟨fun x => ⟨-x.re, -x.im⟩⟩ instance : Mul gaussInt := ⟨fun x y => ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩⟩ theorem zero_def : (0 : gaussInt) = ⟨0, 0⟩ := rfl theorem one_def : (1 : gaussInt) = ⟨1, 0⟩ := rfl theorem add_def (x y : gaussInt) : x + y = ⟨x.re + y.re, x.im + y.im⟩ := rfl theorem neg_def (x : gaussInt) : -x = ⟨-x.re, -x.im⟩ := rfl theorem mul_def (x y : gaussInt) : x * y = ⟨x.re * y.re - x.im * y.im, x.re * y.im + x.im * y.re⟩ := rfl @[simp] theorem zero_re : (0 : gaussInt).re = 0 := rfl @[simp] theorem zero_im : (0 : gaussInt).im = 0 := rfl @[simp] theorem one_re : (1 : gaussInt).re = 1 := rfl @[simp] theorem one_im : (1 : gaussInt).im = 0 := rfl @[simp] theorem add_re (x y : gaussInt) : (x + y).re = x.re + y.re := rfl @[simp] theorem add_im (x y : gaussInt) : (x + y).im = x.im + y.im := rfl @[simp] theorem neg_re (x : gaussInt) : (-x).re = -x.re := rfl @[simp] theorem neg_im (x : gaussInt) : (-x).im = -x.im := rfl @[simp] theorem mul_re (x y : gaussInt) : (x * y).re = x.re * y.re - x.im * y.im := rfl @[simp] theorem mul_im (x y : gaussInt) : (x * y).im = x.re * y.im + x.im * y.re := rfl instance instCommRing : CommRing gaussInt where zero := 0 one := 1 add := (· + ·) neg x := -x mul := (· * ·) add_assoc := by intros ext <;> simp <;> ring zero_add := by intros ext <;> simp add_zero := by intros ext <;> simp add_left_neg := by intros ext <;> simp add_comm := by intros ext <;> simp <;> ring mul_assoc := by intros ext <;> simp <;> ring one_mul := by intros ext <;> simp mul_one := by intros ext <;> simp left_distrib := by intros ext <;> simp <;> ring right_distrib := by intros ext <;> simp <;> ring mul_comm := by intros ext <;> simp <;> ring zero_mul := sorry mul_zero := sorry instance : Nontrivial gaussInt := by use 0, 1 rw [Ne, gaussInt.ext_iff] simp end gaussInt namespace Int def div' (a b : ℤ) := (a + b / 2) / b def mod' (a b : ℤ) := (a + b / 2) % b - b / 2 theorem div'_add_mod' (a b : ℤ) : b * div' a b + mod' a b = a := by rw [div', mod'] linarith [Int.ediv_add_emod (a + b / 2) b] theorem abs_mod'_le (a b : ℤ) (h : 0 < b) : abs (mod' a b) ≤ b / 2 := by rw [mod', abs_le] constructor · linarith [Int.emod_nonneg (a + b / 2) h.ne'] have := Int.emod_lt_of_pos (a + b / 2) h have := Int.ediv_add_emod b 2 have := Int.emod_lt_of_pos b zero_lt_two revert this; intro this -- FIXME, this should not be needed linarith theorem mod'_eq (a b : ℤ) : mod' a b = a - b * div' a b := by linarith [div'_add_mod' a b] end Int private theorem aux {α : Type _} [LinearOrderedRing α] {x y : α} (h : x ^ 2 + y ^ 2 = 0) : x = 0 := haveI h' : x ^ 2 = 0 := by apply le_antisymm _ (sq_nonneg x) rw [← h] apply le_add_of_nonneg_right (sq_nonneg y) pow_eq_zero h' theorem sq_add_sq_eq_zero {α : Type _} [LinearOrderedRing α] (x y : α) : x ^ 2 + y ^ 2 = 0 ↔ x = 0 ∧ y = 0 := by constructor · intro h constructor · exact aux h rw [add_comm] at h exact aux h rintro ⟨rfl, rfl⟩ norm_num namespace gaussInt def norm (x : gaussInt) := x.re ^ 2 + x.im ^ 2 @[simp] theorem norm_nonneg (x : gaussInt) : 0 ≤ norm x := by apply add_nonneg <;> apply sq_nonneg theorem norm_eq_zero (x : gaussInt) : norm x = 0 ↔ x = 0 := by rw [norm, sq_add_sq_eq_zero, gaussInt.ext_iff] rfl theorem norm_pos (x : gaussInt) : 0 < norm x ↔ x ≠ 0 := by rw [lt_iff_le_and_ne, ne_comm, Ne, norm_eq_zero] simp [norm_nonneg] theorem norm_mul (x y : gaussInt) : norm (x * y) = norm x * norm y := by simp [norm] ring def conj (x : gaussInt) : gaussInt := ⟨x.re, -x.im⟩ @[simp] theorem conj_re (x : gaussInt) : (conj x).re = x.re := rfl @[simp] theorem conj_im (x : gaussInt) : (conj x).im = -x.im := rfl theorem norm_conj (x : gaussInt) : norm (conj x) = norm x := by simp [norm] instance : Div gaussInt := ⟨fun x y => ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩⟩ instance : Mod gaussInt := ⟨fun x y => x - y * (x / y)⟩ theorem div_def (x y : gaussInt) : x / y = ⟨Int.div' (x * conj y).re (norm y), Int.div' (x * conj y).im (norm y)⟩ := rfl theorem mod_def (x y : gaussInt) : x % y = x - y * (x / y) := rfl theorem norm_mod_lt (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : (x % y).norm < y.norm := by have norm_y_pos : 0 < norm y := by rwa [norm_pos] have : x % y * conj y = ⟨Int.mod' (x * conj y).re (norm y), Int.mod' (x * conj y).im (norm y)⟩ := by rw [mod_def, sub_mul, Int.mod'_eq, Int.mod'_eq, sub_eq_add_neg, div_def, norm] ext <;> simp <;> ring have : norm (x % y) * norm y ≤ norm y / 2 * norm y := by conv => lhs rw [← norm_conj y, ← norm_mul, this, norm] simp trans 2 * (y.norm / 2) ^ 2 · rw [two_mul] apply add_le_add <;> · rw [sq_le_sq] apply le_trans (Int.abs_mod'_le _ _ norm_y_pos) apply le_abs_self rw [pow_two, ← mul_assoc, mul_comm, mul_comm (2 : ℤ)] apply mul_le_mul_of_nonneg_left · apply Int.ediv_mul_le norm_num apply Int.ediv_nonneg (norm_nonneg y) norm_num have : norm (x % y) ≤ norm y / 2 := le_of_mul_le_mul_right this norm_y_pos apply lt_of_le_of_lt this apply Int.ediv_lt_of_lt_mul · norm_num linarith theorem coe_natAbs_norm (x : gaussInt) : (x.norm.natAbs : ℤ) = x.norm := Int.natAbs_of_nonneg (norm_nonneg _) theorem natAbs_norm_mod_lt (x y : gaussInt) (hy : y ≠ 0) : (x % y).norm.natAbs < y.norm.natAbs := by apply Int.ofNat_lt.1 simp only [Int.coe_natAbs, abs_of_nonneg, norm_nonneg] apply norm_mod_lt x hy theorem not_norm_mul_left_lt_norm (x : gaussInt) {y : gaussInt} (hy : y ≠ 0) : ¬(norm (x * y)).natAbs < (norm x).natAbs := by apply not_lt_of_ge rw [norm_mul, Int.natAbs_mul] apply le_mul_of_one_le_right (Nat.zero_le _) apply Int.ofNat_le.1 rw [coe_natAbs_norm] exact Int.add_one_le_of_lt ((norm_pos _).mpr hy) instance : EuclideanDomain gaussInt := { gaussInt.instCommRing with quotient := (· / ·) remainder := (· % ·) quotient_mul_add_remainder_eq := fun x y => by simp only; rw [mod_def, add_comm, sub_add_cancel] quotient_zero := fun x => by simp [div_def, norm, Int.div'] rfl r := Measure (Int.natAbs ∘ norm) r_wellFounded := (measure (Int.natAbs ∘ norm)).2 remainder_lt := natAbs_norm_mod_lt mul_left_not_lt := not_norm_mul_left_lt_norm } example (x : gaussInt) : Irreducible x ↔ Prime x := PrincipalIdealRing.irreducible_iff_prime end gaussInt
-
-
src/C_Topology/S01_Filters.lean (deleted)
-
@@ -1,110 +0,0 @@import Mathlib.Topology.Instances.Real open Set Filter Topology def principal {α : Type _} (s : Set α) : Filter α where sets := { t | s ⊆ t } univ_sets := sorry sets_of_superset := sorry inter_sets := sorry example : Filter ℕ := { sets := { s | ∃ a, ∀ b, a ≤ b → b ∈ s } univ_sets := sorry sets_of_superset := sorry inter_sets := sorry } def Tendsto₁ {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) := ∀ V ∈ G, f ⁻¹' V ∈ F def Tendsto₂ {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) := map f F ≤ G example {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) : Tendsto₂ f F G ↔ Tendsto₁ f F G := Iff.rfl #check (@Filter.map_mono : ∀ {α β} {m : α → β}, Monotone (map m)) #check (@Filter.map_map : ∀ {α β γ} {f : Filter α} {m : α → β} {m' : β → γ}, map m' (map m f) = map (m' ∘ m) f) example {X Y Z : Type _} {F : Filter X} {G : Filter Y} {H : Filter Z} {f : X → Y} {g : Y → Z} (hf : Tendsto₁ f F G) (hg : Tendsto₁ g G H) : Tendsto₁ (g ∘ f) F H := sorry variable (f : ℝ → ℝ) (x₀ y₀ : ℝ) #check comap ((↑) : ℚ → ℝ) (𝓝 x₀) #check Tendsto (f ∘ (↑)) (comap ((↑) : ℚ → ℝ) (𝓝 x₀)) (𝓝 y₀) section variable {α β γ : Type _} (F : Filter α) {m : γ → β} {n : β → α} #check (comap_comap : comap m (comap n F) = comap (n ∘ m) F) end example : 𝓝 (x₀, y₀) = 𝓝 x₀ ×ᶠ 𝓝 y₀ := nhds_prod_eq #check le_inf_iff example (f : ℕ → ℝ × ℝ) (x₀ y₀ : ℝ) : Tendsto f atTop (𝓝 (x₀, y₀)) ↔ Tendsto (Prod.fst ∘ f) atTop (𝓝 x₀) ∧ Tendsto (Prod.snd ∘ f) atTop (𝓝 y₀) := sorry example (x₀ : ℝ) : HasBasis (𝓝 x₀) (fun ε : ℝ => 0 < ε) fun ε => Ioo (x₀ - ε) (x₀ + ε) := nhds_basis_Ioo_pos x₀ example (u : ℕ → ℝ) (x₀ : ℝ) : Tendsto u atTop (𝓝 x₀) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, u n ∈ Ioo (x₀ - ε) (x₀ + ε) := by have : atTop.HasBasis (fun _ : ℕ => True) Ici := atTop_basis rw [this.tendsto_iff (nhds_basis_Ioo_pos x₀)] simp example (P Q : ℕ → Prop) (hP : ∀ᶠ n in atTop, P n) (hQ : ∀ᶠ n in atTop, Q n) : ∀ᶠ n in atTop, P n ∧ Q n := hP.and hQ example (u v : ℕ → ℝ) (h : ∀ᶠ n in atTop, u n = v n) (x₀ : ℝ) : Tendsto u atTop (𝓝 x₀) ↔ Tendsto v atTop (𝓝 x₀) := tendsto_congr' h example (u v : ℕ → ℝ) (h : u =ᶠ[atTop] v) (x₀ : ℝ) : Tendsto u atTop (𝓝 x₀) ↔ Tendsto v atTop (𝓝 x₀) := tendsto_congr' h #check @eventually_of_forall #check @Eventually.mono #check @Eventually.and example (P Q R : ℕ → Prop) (hP : ∀ᶠ n in atTop, P n) (hQ : ∀ᶠ n in atTop, Q n) (hR : ∀ᶠ n in atTop, P n ∧ Q n → R n) : ∀ᶠ n in atTop, R n := by apply (hP.and (hQ.and hR)).mono rintro n ⟨h, h', h''⟩ exact h'' ⟨h, h'⟩ example (P Q R : ℕ → Prop) (hP : ∀ᶠ n in atTop, P n) (hQ : ∀ᶠ n in atTop, Q n) (hR : ∀ᶠ n in atTop, P n ∧ Q n → R n) : ∀ᶠ n in atTop, R n := by filter_upwards [hP, hQ, hR] intro n h h' h'' exact h'' ⟨h, h'⟩ #check mem_closure_iff_clusterPt #check le_principal_iff #check neBot_of_le example (u : ℕ → ℝ) (M : Set ℝ) (x : ℝ) (hux : Tendsto u atTop (𝓝 x)) (huM : ∀ᶠ n in atTop, u n ∈ M) : x ∈ closure M := sorry
-
-
src/C_Topology/S02_Metric_Spaces.lean (deleted)
-
@@ -1,200 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter open Topology Filter variable {X : Type _} [MetricSpace X] (a b c : X) #check (dist a b : ℝ) #check (dist_nonneg : 0 ≤ dist a b) #check (dist_eq_zero : dist a b = 0 ↔ a = b) #check (dist_comm a b : dist a b = dist b a) #check (dist_triangle a b c : dist a c ≤ dist a b + dist b c) -- Note the next three lines are not quoted, their purpose is to make sure those things don't get renamed while we're looking elsewhere. #check EMetricSpace #check PseudoMetricSpace #check PseudoEMetricSpace example {u : ℕ → X} {a : X} : Tendsto u atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) a < ε := Metric.tendsto_atTop example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} : Continuous f ↔ ∀ x : X, ∀ ε > 0, ∃ δ > 0, ∀ x', dist x' x < δ → dist (f x') (f x) < ε := Metric.continuous_iff example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by continuity example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := continuous_dist.comp ((hf.comp continuous_fst).prod_mk (hf.comp continuous_snd)) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by apply Continuous.dist exact hf.comp continuous_fst exact hf.comp continuous_snd example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := (hf.comp continuous_fst).dist (hf.comp continuous_snd) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := hf.fst'.dist hf.snd' example {f : ℝ → X} (hf : Continuous f) : Continuous fun x : ℝ => f (x ^ 2 + x) := sorry example {X Y : Type _} [MetricSpace X] [MetricSpace Y] (f : X → Y) (a : X) : ContinuousAt f a ↔ ∀ ε > 0, ∃ δ > 0, ∀ {x}, dist x a < δ → dist (f x) (f a) < ε := Metric.continuousAt_iff variable (r : ℝ) example : Metric.ball a r = { b | dist b a < r } := rfl example : Metric.closedBall a r = { b | dist b a ≤ r } := rfl example (hr : 0 < r) : a ∈ Metric.ball a r := Metric.mem_ball_self hr example (hr : 0 ≤ r) : a ∈ Metric.closedBall a r := Metric.mem_closedBall_self hr example (s : Set X) : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.isOpen_iff example {s : Set X} : IsClosed s ↔ IsOpen (sᶜ) := isOpen_compl_iff.symm example {s : Set X} (hs : IsClosed s) {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) (hus : ∀ n, u n ∈ s) : a ∈ s := hs.mem_of_tendsto hu (eventually_of_forall hus) example {s : Set X} : a ∈ closure s ↔ ∀ ε > 0, ∃ b ∈ s, a ∈ Metric.ball b ε := Metric.mem_closure_iff example {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) {s : Set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := sorry example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.nhds_basis_ball.mem_iff example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.closedBall x ε ⊆ s := Metric.nhds_basis_closedBall.mem_iff example : IsCompact (Set.Icc 0 1 : Set ℝ) := isCompact_Icc example {s : Set X} (hs : IsCompact s) {u : ℕ → X} (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y := hs.exists_forall_le hs' hfs example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x := hs.exists_forall_ge hs' hfs example {s : Set X} (hs : IsCompact s) : IsClosed s := hs.isClosed example {X : Type _} [MetricSpace X] [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ #check IsCompact.isClosed example {X : Type _} [MetricSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} : UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : X}, dist a b < δ → dist (f a) (f b) < ε := Metric.uniformContinuous_iff example {X : Type _} [MetricSpace X] [CompactSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} (hf : Continuous f) : UniformContinuous f := sorry example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := Metric.cauchySeq_iff example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, dist (u n) (u N) < ε := Metric.cauchySeq_iff' example [CompleteSpace X] (u : ℕ → X) (hu : CauchySeq u) : ∃ x, Tendsto u atTop (𝓝 x) := cauchySeq_tendsto_of_complete hu open BigOperators open Finset theorem cauchySeq_of_le_geometric_two' {u : ℕ → X} (hu : ∀ n : ℕ, dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : CauchySeq u := by rw [Metric.cauchySeq_iff'] intro ε ε_pos obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε := by sorry use N intro n hn obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn calc dist (u (N + k)) (u N) = dist (u (N + 0)) (u (N + k)) := sorry _ ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) := sorry _ ≤ ∑ i in range k, (1 / 2 : ℝ) ^ (N + i) := sorry _ = 1 / 2 ^ N * ∑ i in range k, (1 / 2) ^ i := sorry _ ≤ 1 / 2 ^ N * 2 := sorry _ < ε := sorry open Metric example [CompleteSpace X] (f : ℕ → Set X) (ho : ∀ n, IsOpen (f n)) (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := by let B : ℕ → ℝ := fun n => (1 / 2) ^ n have Bpos : ∀ n, 0 < B n sorry /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closedBall center radius` is included both in `f n` and in `closedBall x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X), ∀ δ > 0, ∃ y : X, ∃ r > 0, r ≤ B (n + 1) ∧ closedBall y r ⊆ closedBall x δ ∩ f n := by sorry choose! center radius Hpos HB Hball using this intro x rw [mem_closure_iff_nhds_basis nhds_basis_closedBall] intro ε εpos /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closedBall (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → X × ℝ := fun n => Nat.recOn n (Prod.mk x (min ε (B 0))) fun n p => Prod.mk (center n p.1 p.2) (radius n p.1 p.2) let c : ℕ → X := fun n => (F n).1 let r : ℕ → ℝ := fun n => (F n).2 have rpos : ∀ n, 0 < r n := by sorry have rB : ∀ n, r n ≤ B n := by sorry have incl : ∀ n, closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) ∩ f n := by sorry have cdist : ∀ n, dist (c n) (c (n + 1)) ≤ B n := by sorry have : CauchySeq c := cauchySeq_of_le_geometric_two' cdist -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchySeq_tendsto_of_complete this with ⟨y, ylim⟩ -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y have I : ∀ n, ∀ m ≥ n, closedBall (c m) (r m) ⊆ closedBall (c n) (r n) := by sorry have yball : ∀ n, y ∈ closedBall (c n) (r n) := by sorry sorry
-
-
-
@@ -1,151 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter open Topology Filter section variable {X : Type _} [TopologicalSpace X] example : IsOpen (univ : Set X) := isOpen_univ example : IsOpen (∅ : Set X) := isOpen_empty example {ι : Type _} {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋃ i, s i) := isOpen_iUnion hs example {ι : Type _} [Fintype ι] {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋂ i, s i) := isOpen_iInter hs variable {Y : Type _} [TopologicalSpace Y] example {f : X → Y} : Continuous f ↔ ∀ s, IsOpen s → IsOpen (f ⁻¹' s) := continuous_def example {f : X → Y} {x : X} : ContinuousAt f x ↔ map f (𝓝 x) ≤ 𝓝 (f x) := Iff.rfl example {f : X → Y} {x : X} : ContinuousAt f x ↔ ∀ U ∈ 𝓝 (f x), ∀ᶠ x in 𝓝 x, f x ∈ U := Iff.rfl example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ t, t ⊆ s ∧ IsOpen t ∧ x ∈ t := mem_nhds_iff example (x : X) : pure x ≤ 𝓝 x := pure_le_nhds x example (x : X) (P : X → Prop) (h : ∀ᶠ y in 𝓝 x, P y) : P x := pure_le_nhds x h example {P : X → Prop} {x : X} (h : ∀ᶠ y in 𝓝 x, P y) : ∀ᶠ y in 𝓝 x, ∀ᶠ z in 𝓝 y, P z := eventually_eventually_nhds.mpr h #check TopologicalSpace.mkOfNhds #check TopologicalSpace.nhds_mkOfNhds example {α : Type _} (n : α → Filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → ∀ᶠ y in n a, ∀ᶠ x in n y, p x) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := sorry end -- BOTH. variable {X Y : Type _} example (f : X → Y) : TopologicalSpace X → TopologicalSpace Y := TopologicalSpace.coinduced f example (f : X → Y) : TopologicalSpace Y → TopologicalSpace X := TopologicalSpace.induced f example (f : X → Y) (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) : TopologicalSpace.coinduced f T_X ≤ T_Y ↔ T_X ≤ TopologicalSpace.induced f T_Y := coinduced_le_iff_le_induced #check coinduced_compose #check induced_compose example {T T' : TopologicalSpace X} : T ≤ T' ↔ ∀ s, T'.IsOpen s → T.IsOpen s := Iff.rfl example (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) (f : X → Y) : Continuous f ↔ TopologicalSpace.coinduced f T_X ≤ T_Y := continuous_iff_coinduced_le example {Z : Type _} (f : X → Y) (T_X : TopologicalSpace X) (T_Z : TopologicalSpace Z) (g : Y → Z) : @Continuous Y Z (TopologicalSpace.coinduced f T_X) T_Z g ↔ @Continuous X Z T_X T_Z (g ∘ f) := by rw [continuous_iff_coinduced_le, coinduced_compose, continuous_iff_coinduced_le] example (ι : Type _) (X : ι → Type _) (T_X : ∀ i, TopologicalSpace <| X i) : (Pi.topologicalSpace : TopologicalSpace (∀ i, X i)) = ⨅ i, TopologicalSpace.induced (fun x => x i) (T_X i) := rfl example [TopologicalSpace X] [T2Space X] {u : ℕ → X} {a b : X} (ha : Tendsto u atTop (𝓝 a)) (hb : Tendsto u atTop (𝓝 b)) : a = b := tendsto_nhds_unique ha hb example [TopologicalSpace X] [RegularSpace X] (a : X) : (𝓝 a).HasBasis (fun s : Set X => s ∈ 𝓝 a ∧ IsClosed s) id := closed_nhds_basis a example [TopologicalSpace X] {x : X} : (𝓝 x).HasBasis (fun t : Set X => t ∈ 𝓝 x ∧ IsOpen t) id := nhds_basis_opens' x theorem aux {X Y A : Type _} [TopologicalSpace X] {c : A → X} {f : A → Y} {x : X} {F : Filter Y} (h : Tendsto f (comap c (𝓝 x)) F) {V' : Set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, IsOpen V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := sorry example [TopologicalSpace X] [TopologicalSpace Y] [RegularSpace Y] {A : Set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : Continuous f) (hf : ∀ x : X, ∃ c : Y, Tendsto f (comap (↑) <| 𝓝 x) <| 𝓝 c) : ∃ φ : X → Y, Continuous φ ∧ ∀ a : A, φ a = f a := sorry #check @HasBasis.tendsto_right_iff example [TopologicalSpace X] [TopologicalSpace.FirstCountableTopology X] {s : Set X} {a : X} : a ∈ closure s ↔ ∃ u : ℕ → X, (∀ n, u n ∈ s) ∧ Tendsto u atTop (𝓝 a) := mem_closure_iff_seq_limit variable [TopologicalSpace X] example {F : Filter X} {x : X} : ClusterPt x F ↔ NeBot (𝓝 x ⊓ F) := Iff.rfl example {s : Set X} : IsCompact s ↔ ∀ (F : Filter X) [NeBot F], F ≤ 𝓟 s → ∃ a ∈ s, ClusterPt a F := Iff.rfl example [TopologicalSpace.FirstCountableTopology X] {s : Set X} {u : ℕ → X} (hs : IsCompact s) (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu variable [TopologicalSpace Y] example {x : X} {F : Filter X} {G : Filter Y} (H : ClusterPt x F) {f : X → Y} (hfx : ContinuousAt f x) (hf : Tendsto f F G) : ClusterPt (f x) G := ClusterPt.map H hfx hf example [TopologicalSpace Y] {f : X → Y} (hf : Continuous f) {s : Set X} (hs : IsCompact s) : IsCompact (f '' s) := by intro F F_ne F_le have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F := by sorry have Hne : (𝓟 s ⊓ comap f F).NeBot := by sorry have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s := inf_le_left sorry example {ι : Type _} {s : Set X} (hs : IsCompact s) (U : ι → Set X) (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i := hs.elim_finite_subcover U hUo hsU example [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ
-
-
-
@@ -1,71 +0,0 @@import Mathlib.Topology.Instances.Real open Set Filter Topology -- In the next example we could use `tauto` in each proof instead of knowing the lemmas example {α : Type _} (s : Set α) : Filter α := { sets := { t | s ⊆ t } univ_sets := subset_univ s sets_of_superset := fun hU hUV => Subset.trans hU hUV inter_sets := fun hU hV => subset_inter hU hV } example : Filter ℕ := { sets := { s | ∃ a, ∀ b, a ≤ b → b ∈ s } univ_sets := by use 42 simp sets_of_superset := by rintro U V ⟨N, hN⟩ hUV use N tauto inter_sets := by rintro U V ⟨N, hN⟩ ⟨N', hN'⟩ use max N N' intro b hb rw [max_le_iff] at hb constructor <;> tauto } def Tendsto₁ {X Y : Type _} (f : X → Y) (F : Filter X) (G : Filter Y) := ∀ V ∈ G, f ⁻¹' V ∈ F example {X Y Z : Type _} {F : Filter X} {G : Filter Y} {H : Filter Z} {f : X → Y} {g : Y → Z} (hf : Tendsto₁ f F G) (hg : Tendsto₁ g G H) : Tendsto₁ (g ∘ f) F H := calc map (g ∘ f) F = map g (map f F) := by rw [map_map] _ ≤ map g G := (map_mono hf) _ ≤ H := hg example {X Y Z : Type _} {F : Filter X} {G : Filter Y} {H : Filter Z} {f : X → Y} {g : Y → Z} (hf : Tendsto₁ f F G) (hg : Tendsto₁ g G H) : Tendsto₁ (g ∘ f) F H := by intro V hV rw [preimage_comp] apply hf apply hg exact hV example (f : ℕ → ℝ × ℝ) (x₀ y₀ : ℝ) : Tendsto f atTop (𝓝 (x₀, y₀)) ↔ Tendsto (Prod.fst ∘ f) atTop (𝓝 x₀) ∧ Tendsto (Prod.snd ∘ f) atTop (𝓝 y₀) := calc Tendsto f atTop (𝓝 (x₀, y₀)) ↔ map f atTop ≤ 𝓝 (x₀, y₀) := Iff.rfl _ ↔ map f atTop ≤ 𝓝 x₀ ×ᶠ 𝓝 y₀ := by rw [nhds_prod_eq] _ ↔ map f atTop ≤ comap Prod.fst (𝓝 x₀) ⊓ comap Prod.snd (𝓝 y₀) := Iff.rfl _ ↔ map f atTop ≤ comap Prod.fst (𝓝 x₀) ∧ map f atTop ≤ comap Prod.snd (𝓝 y₀) := le_inf_iff _ ↔ map Prod.fst (map f atTop) ≤ 𝓝 x₀ ∧ map Prod.snd (map f atTop) ≤ 𝓝 y₀ := by rw [← map_le_iff_le_comap, ← map_le_iff_le_comap] _ ↔ map (Prod.fst ∘ f) atTop ≤ 𝓝 x₀ ∧ map (Prod.snd ∘ f) atTop ≤ 𝓝 y₀ := by rw [map_map, map_map] -- an alternative solution example (f : ℕ → ℝ × ℝ) (x₀ y₀ : ℝ) : Tendsto f atTop (𝓝 (x₀, y₀)) ↔ Tendsto (Prod.fst ∘ f) atTop (𝓝 x₀) ∧ Tendsto (Prod.snd ∘ f) atTop (𝓝 y₀) := by rw [nhds_prod_eq] unfold Tendsto Filter.prod rw [le_inf_iff, ← map_le_iff_le_comap, map_map, ← map_le_iff_le_comap, map_map] example (u : ℕ → ℝ) (M : Set ℝ) (x : ℝ) (hux : Tendsto u atTop (𝓝 x)) (huM : ∀ᶠ n in atTop, u n ∈ M) : x ∈ closure M := mem_closure_iff_clusterPt.mpr (neBot_of_le <| le_inf hux <| le_principal_iff.mpr huM)
-
-
-
@@ -1,365 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter open Topology Filter variable {X : Type _} [MetricSpace X] (a b c : X) #check (dist a b : ℝ) #check (dist_nonneg : 0 ≤ dist a b) #check (dist_eq_zero : dist a b = 0 ↔ a = b) #check (dist_comm a b : dist a b = dist b a) #check (dist_triangle a b c : dist a c ≤ dist a b + dist b c) -- Note the next three lines are not quoted, their purpose is to make sure those things don't get renamed while we're looking elsewhere. #check EMetricSpace #check PseudoMetricSpace #check PseudoEMetricSpace example {u : ℕ → X} {a : X} : Tendsto u atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) a < ε := Metric.tendsto_atTop example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} : Continuous f ↔ ∀ x : X, ∀ ε > 0, ∃ δ > 0, ∀ x', dist x' x < δ → dist (f x') (f x) < ε := Metric.continuous_iff example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by continuity example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := continuous_dist.comp ((hf.comp continuous_fst).prod_mk (hf.comp continuous_snd)) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := by apply Continuous.dist exact hf.comp continuous_fst exact hf.comp continuous_snd example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := (hf.comp continuous_fst).dist (hf.comp continuous_snd) example {X Y : Type _} [MetricSpace X] [MetricSpace Y] {f : X → Y} (hf : Continuous f) : Continuous fun p : X × X => dist (f p.1) (f p.2) := hf.fst'.dist hf.snd' example {f : ℝ → X} (hf : Continuous f) : Continuous fun x : ℝ => f (x ^ 2 + x) := sorry example {f : ℝ → X} (hf : Continuous f) : Continuous fun x : ℝ => f (x ^ 2 + x) := hf.comp <| (continuous_pow 2).add continuous_id example {X Y : Type _} [MetricSpace X] [MetricSpace Y] (f : X → Y) (a : X) : ContinuousAt f a ↔ ∀ ε > 0, ∃ δ > 0, ∀ {x}, dist x a < δ → dist (f x) (f a) < ε := Metric.continuousAt_iff variable (r : ℝ) example : Metric.ball a r = { b | dist b a < r } := rfl example : Metric.closedBall a r = { b | dist b a ≤ r } := rfl example (hr : 0 < r) : a ∈ Metric.ball a r := Metric.mem_ball_self hr example (hr : 0 ≤ r) : a ∈ Metric.closedBall a r := Metric.mem_closedBall_self hr example (s : Set X) : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.isOpen_iff example {s : Set X} : IsClosed s ↔ IsOpen (sᶜ) := isOpen_compl_iff.symm example {s : Set X} (hs : IsClosed s) {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) (hus : ∀ n, u n ∈ s) : a ∈ s := hs.mem_of_tendsto hu (eventually_of_forall hus) example {s : Set X} : a ∈ closure s ↔ ∀ ε > 0, ∃ b ∈ s, a ∈ Metric.ball b ε := Metric.mem_closure_iff example {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) {s : Set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := sorry example {u : ℕ → X} (hu : Tendsto u atTop (𝓝 a)) {s : Set X} (hs : ∀ n, u n ∈ s) : a ∈ closure s := by rw [Metric.tendsto_atTop] at hu rw [Metric.mem_closure_iff] intro ε ε_pos rcases hu ε ε_pos with ⟨N, hN⟩ refine' ⟨u N, hs _, _⟩ rw [dist_comm] exact hN N le_rfl example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.ball x ε ⊆ s := Metric.nhds_basis_ball.mem_iff example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ ε > 0, Metric.closedBall x ε ⊆ s := Metric.nhds_basis_closedBall.mem_iff example : IsCompact (Set.Icc 0 1 : Set ℝ) := isCompact_Icc example {s : Set X} (hs : IsCompact s) {u : ℕ → X} (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y := hs.exists_forall_le hs' hfs example {s : Set X} (hs : IsCompact s) (hs' : s.Nonempty) {f : X → ℝ} (hfs : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x := hs.exists_forall_ge hs' hfs example {s : Set X} (hs : IsCompact s) : IsClosed s := hs.isClosed example {X : Type _} [MetricSpace X] [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ #check IsCompact.isClosed example {X : Type _} [MetricSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} : UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : X}, dist a b < δ → dist (f a) (f b) < ε := Metric.uniformContinuous_iff example {X : Type _} [MetricSpace X] [CompactSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} (hf : Continuous f) : UniformContinuous f := sorry example {X : Type _} [MetricSpace X] [CompactSpace X] {Y : Type _} [MetricSpace Y] {f : X → Y} (hf : Continuous f) : UniformContinuous f := by rw [Metric.uniformContinuous_iff] intro ε ε_pos let φ : X × X → ℝ := fun p => dist (f p.1) (f p.2) have φ_cont : Continuous φ := hf.fst'.dist hf.snd' let K := { p : X × X | ε ≤ φ p } have K_closed : IsClosed K := isClosed_le continuous_const φ_cont have K_cpct : IsCompact K := K_closed.isCompact cases' eq_empty_or_nonempty K with hK hK · use 1, by norm_num intro x y _ have : (x, y) ∉ K := by simp [hK] simpa using this · rcases K_cpct.exists_forall_le hK continuous_dist.continuousOn with ⟨⟨x₀, x₁⟩, xx_in, H⟩ use dist x₀ x₁ constructor · change _ < _ rw [dist_pos] intro h have : ε ≤ 0 := by simpa [*] using xx_in linarith · intro x x' contrapose! intro hxx' exact H (x, x') hxx' example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := Metric.cauchySeq_iff example (u : ℕ → X) : CauchySeq u ↔ ∀ ε > 0, ∃ N : ℕ, ∀ n ≥ N, dist (u n) (u N) < ε := Metric.cauchySeq_iff' example [CompleteSpace X] (u : ℕ → X) (hu : CauchySeq u) : ∃ x, Tendsto u atTop (𝓝 x) := cauchySeq_tendsto_of_complete hu open BigOperators open Finset theorem cauchySeq_of_le_geometric_two' {u : ℕ → X} (hu : ∀ n : ℕ, dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : CauchySeq u := by rw [Metric.cauchySeq_iff'] intro ε ε_pos obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε := by sorry use N intro n hn obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn calc dist (u (N + k)) (u N) = dist (u (N + 0)) (u (N + k)) := sorry _ ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) := sorry _ ≤ ∑ i in range k, (1 / 2 : ℝ) ^ (N + i) := sorry _ = 1 / 2 ^ N * ∑ i in range k, (1 / 2) ^ i := sorry _ ≤ 1 / 2 ^ N * 2 := sorry _ < ε := sorry example {u : ℕ → X} (hu : ∀ n : ℕ, dist (u n) (u (n + 1)) ≤ (1 / 2) ^ n) : CauchySeq u := by rw [Metric.cauchySeq_iff'] intro ε ε_pos obtain ⟨N, hN⟩ : ∃ N : ℕ, 1 / 2 ^ N * 2 < ε := by have : Tendsto (fun N : ℕ => (1 / 2 ^ N * 2 : ℝ)) atTop (𝓝 0) := by rw [← MulZeroClass.zero_mul (2 : ℝ)] apply Tendsto.mul simp_rw [← one_div_pow (2 : ℝ)] apply tendsto_pow_atTop_nhds_0_of_lt_1 <;> linarith exact tendsto_const_nhds rcases(atTop_basis.tendsto_iff (nhds_basis_Ioo_pos (0 : ℝ))).mp this ε ε_pos with ⟨N, _, hN⟩ exact ⟨N, by simpa using (hN N left_mem_Ici).2⟩ use N intro n hn obtain ⟨k, rfl : n = N + k⟩ := le_iff_exists_add.mp hn calc dist (u (N + k)) (u N) = dist (u (N + 0)) (u (N + k)) := by rw [dist_comm, add_zero] _ ≤ ∑ i in range k, dist (u (N + i)) (u (N + (i + 1))) := (dist_le_range_sum_dist (fun i => u (N + i)) k) _ ≤ ∑ i in range k, (1 / 2 : ℝ) ^ (N + i) := (sum_le_sum fun i _ => hu <| N + i) _ = 1 / 2 ^ N * ∑ i in range k, (1 / 2 : ℝ) ^ i := by simp_rw [← one_div_pow, pow_add, ← mul_sum] _ ≤ 1 / 2 ^ N * 2 := (mul_le_mul_of_nonneg_left (sum_geometric_two_le _) (one_div_nonneg.mpr (pow_nonneg (zero_le_two : (0 : ℝ) ≤ 2) _))) _ < ε := hN open Metric example [CompleteSpace X] (f : ℕ → Set X) (ho : ∀ n, IsOpen (f n)) (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := by let B : ℕ → ℝ := fun n => (1 / 2) ^ n have Bpos : ∀ n, 0 < B n sorry /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closedBall center radius` is included both in `f n` and in `closedBall x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X), ∀ δ > 0, ∃ y : X, ∃ r > 0, r ≤ B (n + 1) ∧ closedBall y r ⊆ closedBall x δ ∩ f n := by sorry choose! center radius Hpos HB Hball using this intro x rw [mem_closure_iff_nhds_basis nhds_basis_closedBall] intro ε εpos /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closedBall (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → X × ℝ := fun n => Nat.recOn n (Prod.mk x (min ε (B 0))) fun n p => Prod.mk (center n p.1 p.2) (radius n p.1 p.2) let c : ℕ → X := fun n => (F n).1 let r : ℕ → ℝ := fun n => (F n).2 have rpos : ∀ n, 0 < r n := by sorry have rB : ∀ n, r n ≤ B n := by sorry have incl : ∀ n, closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) ∩ f n := by sorry have cdist : ∀ n, dist (c n) (c (n + 1)) ≤ B n := by sorry have : CauchySeq c := cauchySeq_of_le_geometric_two' cdist -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchySeq_tendsto_of_complete this with ⟨y, ylim⟩ -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y have I : ∀ n, ∀ m ≥ n, closedBall (c m) (r m) ⊆ closedBall (c n) (r n) := by sorry have yball : ∀ n, y ∈ closedBall (c n) (r n) := by sorry sorry example [CompleteSpace X] (f : ℕ → Set X) (ho : ∀ n, IsOpen (f n)) (hd : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := by let B : ℕ → ℝ := fun n => (1 / 2) ^ n have Bpos : ∀ n, 0 < B n := fun n => pow_pos sorry n /- Translate the density assumption into two functions `center` and `radius` associating to any n, x, δ, δpos a center and a positive radius such that `closedBall center radius` is included both in `f n` and in `closedBall x δ`. We can also require `radius ≤ (1/2)^(n+1)`, to ensure we get a Cauchy sequence later. -/ have : ∀ (n : ℕ) (x : X), ∀ δ > 0, ∃ y : X, ∃ r > 0, r ≤ B (n + 1) ∧ closedBall y r ⊆ closedBall x δ ∩ f n := by intro n x δ δpos have : x ∈ closure (f n) := hd n x rcases Metric.mem_closure_iff.1 this (δ / 2) (half_pos δpos) with ⟨y, ys, xy⟩ rw [dist_comm] at xy obtain ⟨r, rpos, hr⟩ : ∃ r > 0, closedBall y r ⊆ f n := nhds_basis_closedBall.mem_iff.1 (isOpen_iff_mem_nhds.1 (ho n) y ys) refine' ⟨y, min (min (δ / 2) r) (B (n + 1)), _, _, fun z hz => ⟨_, _⟩⟩ show 0 < min (min (δ / 2) r) (B (n + 1)) exact lt_min (lt_min (half_pos δpos) rpos) (Bpos (n + 1)) show min (min (δ / 2) r) (B (n + 1)) ≤ B (n + 1) exact min_le_right _ _ show z ∈ closedBall x δ exact calc dist z x ≤ dist z y + dist y x := dist_triangle _ _ _ _ ≤ min (min (δ / 2) r) (B (n + 1)) + δ / 2 := (add_le_add hz xy.le) _ ≤ δ / 2 + δ / 2 := (add_le_add_right ((min_le_left _ _).trans (min_le_left _ _)) _) _ = δ := add_halves δ show z ∈ f n exact hr (calc dist z y ≤ min (min (δ / 2) r) (B (n + 1)) := hz _ ≤ r := (min_le_left _ _).trans (min_le_right _ _) ) choose! center radius Hpos HB Hball using this refine' fun x => (mem_closure_iff_nhds_basis nhds_basis_closedBall).2 fun ε εpos => _ /- `ε` is positive. We have to find a point in the ball of radius `ε` around `x` belonging to all `f n`. For this, we construct inductively a sequence `F n = (c n, r n)` such that the closed ball `closedBall (c n) (r n)` is included in the previous ball and in `f n`, and such that `r n` is small enough to ensure that `c n` is a Cauchy sequence. Then `c n` converges to a limit which belongs to all the `f n`. -/ let F : ℕ → X × ℝ := fun n => Nat.recOn n (Prod.mk x (min ε (B 0))) fun n p => Prod.mk (center n p.1 p.2) (radius n p.1 p.2) let c : ℕ → X := fun n => (F n).1 let r : ℕ → ℝ := fun n => (F n).2 have rpos : ∀ n, 0 < r n := by intro n induction' n with n hn exact lt_min εpos (Bpos 0) exact Hpos n (c n) (r n) hn have rB : ∀ n, r n ≤ B n := by intro n induction' n with n hn exact min_le_right _ _ exact HB n (c n) (r n) (rpos n) have incl : ∀ n, closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) ∩ f n := fun n => Hball n (c n) (r n) (rpos n) have cdist : ∀ n, dist (c n) (c (n + 1)) ≤ B n := by intro n rw [dist_comm] have A : c (n + 1) ∈ closedBall (c (n + 1)) (r (n + 1)) := mem_closedBall_self (rpos <| n + 1).le have I := calc closedBall (c (n + 1)) (r (n + 1)) ⊆ closedBall (c n) (r n) := (incl n).trans (inter_subset_left _ _) _ ⊆ closedBall (c n) (B n) := closedBall_subset_closedBall (rB n) exact I A have : CauchySeq c := cauchySeq_of_le_geometric_two' cdist -- as the sequence `c n` is Cauchy in a complete space, it converges to a limit `y`. rcases cauchySeq_tendsto_of_complete this with ⟨y, ylim⟩ -- this point `y` will be the desired point. We will check that it belongs to all -- `f n` and to `ball x ε`. use y have I : ∀ n, ∀ m ≥ n, closedBall (c m) (r m) ⊆ closedBall (c n) (r n) := by intro n refine' Nat.le_induction _ fun m hnm h => _ · exact Subset.rfl · exact (incl m).trans ((Set.inter_subset_left _ _).trans h) have yball : ∀ n, y ∈ closedBall (c n) (r n) := by intro n refine' isClosed_ball.mem_of_tendsto ylim _ refine' (Filter.eventually_ge_atTop n).mono fun m hm => _ exact I n m hm (mem_closedBall_self (rpos _).le) constructor · suffices ∀ n, y ∈ f n by rwa [Set.mem_iInter] intro n have : closedBall (c (n + 1)) (r (n + 1)) ⊆ f n := Subset.trans (incl n) (inter_subset_right _ _) exact this (yball (n + 1)) calc dist y x ≤ r 0 := yball 0 _ ≤ ε := min_le_left _ _
-
-
-
@@ -1,202 +0,0 @@import Mathlib.Topology.Instances.Real import Mathlib.Analysis.NormedSpace.BanachSteinhaus open Set Filter open Topology Filter section variable {X : Type _} [TopologicalSpace X] example : IsOpen (univ : Set X) := isOpen_univ example : IsOpen (∅ : Set X) := isOpen_empty example {ι : Type _} {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋃ i, s i) := isOpen_iUnion hs example {ι : Type _} [Fintype ι] {s : ι → Set X} (hs : ∀ i, IsOpen <| s i) : IsOpen (⋂ i, s i) := isOpen_iInter hs variable {Y : Type _} [TopologicalSpace Y] example {f : X → Y} : Continuous f ↔ ∀ s, IsOpen s → IsOpen (f ⁻¹' s) := continuous_def example {f : X → Y} {x : X} : ContinuousAt f x ↔ map f (𝓝 x) ≤ 𝓝 (f x) := Iff.rfl example {f : X → Y} {x : X} : ContinuousAt f x ↔ ∀ U ∈ 𝓝 (f x), ∀ᶠ x in 𝓝 x, f x ∈ U := Iff.rfl example {x : X} {s : Set X} : s ∈ 𝓝 x ↔ ∃ t, t ⊆ s ∧ IsOpen t ∧ x ∈ t := mem_nhds_iff example (x : X) : pure x ≤ 𝓝 x := pure_le_nhds x example (x : X) (P : X → Prop) (h : ∀ᶠ y in 𝓝 x, P y) : P x := pure_le_nhds x h example {P : X → Prop} {x : X} (h : ∀ᶠ y in 𝓝 x, P y) : ∀ᶠ y in 𝓝 x, ∀ᶠ z in 𝓝 y, P z := eventually_eventually_nhds.mpr h #check TopologicalSpace.mkOfNhds #check TopologicalSpace.nhds_mkOfNhds example {α : Type _} (n : α → Filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → ∀ᶠ y in n a, ∀ᶠ x in n y, p x) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := sorry example {α : Type _} (n : α → Filter α) (H₀ : ∀ a, pure a ≤ n a) (H : ∀ a : α, ∀ p : α → Prop, (∀ᶠ x in n a, p x) → ∀ᶠ y in n a, ∀ᶠ x in n y, p x) : ∀ a, ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a' := by intro a s s_in refine' ⟨{ y | s ∈ n y }, H a (fun x => x ∈ s) s_in, _, by tauto⟩ rintro y (hy : s ∈ n y) exact H₀ y hy end -- BOTH. variable {X Y : Type _} example (f : X → Y) : TopologicalSpace X → TopologicalSpace Y := TopologicalSpace.coinduced f example (f : X → Y) : TopologicalSpace Y → TopologicalSpace X := TopologicalSpace.induced f example (f : X → Y) (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) : TopologicalSpace.coinduced f T_X ≤ T_Y ↔ T_X ≤ TopologicalSpace.induced f T_Y := coinduced_le_iff_le_induced #check coinduced_compose #check induced_compose example {T T' : TopologicalSpace X} : T ≤ T' ↔ ∀ s, T'.IsOpen s → T.IsOpen s := Iff.rfl example (T_X : TopologicalSpace X) (T_Y : TopologicalSpace Y) (f : X → Y) : Continuous f ↔ TopologicalSpace.coinduced f T_X ≤ T_Y := continuous_iff_coinduced_le example {Z : Type _} (f : X → Y) (T_X : TopologicalSpace X) (T_Z : TopologicalSpace Z) (g : Y → Z) : @Continuous Y Z (TopologicalSpace.coinduced f T_X) T_Z g ↔ @Continuous X Z T_X T_Z (g ∘ f) := by rw [continuous_iff_coinduced_le, coinduced_compose, continuous_iff_coinduced_le] example (ι : Type _) (X : ι → Type _) (T_X : ∀ i, TopologicalSpace <| X i) : (Pi.topologicalSpace : TopologicalSpace (∀ i, X i)) = ⨅ i, TopologicalSpace.induced (fun x => x i) (T_X i) := rfl example [TopologicalSpace X] [T2Space X] {u : ℕ → X} {a b : X} (ha : Tendsto u atTop (𝓝 a)) (hb : Tendsto u atTop (𝓝 b)) : a = b := tendsto_nhds_unique ha hb example [TopologicalSpace X] [RegularSpace X] (a : X) : (𝓝 a).HasBasis (fun s : Set X => s ∈ 𝓝 a ∧ IsClosed s) id := closed_nhds_basis a example [TopologicalSpace X] {x : X} : (𝓝 x).HasBasis (fun t : Set X => t ∈ 𝓝 x ∧ IsOpen t) id := nhds_basis_opens' x theorem aux {X Y A : Type _} [TopologicalSpace X] {c : A → X} {f : A → Y} {x : X} {F : Filter Y} (h : Tendsto f (comap c (𝓝 x)) F) {V' : Set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, IsOpen V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := sorry example {X Y A : Type _} [TopologicalSpace X] {c : A → X} {f : A → Y} {x : X} {F : Filter Y} (h : Tendsto f (comap c (𝓝 x)) F) {V' : Set Y} (V'_in : V' ∈ F) : ∃ V ∈ 𝓝 x, IsOpen V ∧ c ⁻¹' V ⊆ f ⁻¹' V' := by simpa [and_assoc] using ((nhds_basis_opens' x).comap c).tendsto_left_iff.mp h V' V'_in example [TopologicalSpace X] [TopologicalSpace Y] [RegularSpace Y] {A : Set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : Continuous f) (hf : ∀ x : X, ∃ c : Y, Tendsto f (comap (↑) <| 𝓝 x) <| 𝓝 c) : ∃ φ : X → Y, Continuous φ ∧ ∀ a : A, φ a = f a := sorry #check @HasBasis.tendsto_right_iff example [TopologicalSpace X] [TopologicalSpace Y] [T3Space Y] {A : Set X} (hA : ∀ x, x ∈ closure A) {f : A → Y} (f_cont : Continuous f) (hf : ∀ x : X, ∃ c : Y, Tendsto f (comap (↑) <| 𝓝 x) <| 𝓝 c) : ∃ φ : X → Y, Continuous φ ∧ ∀ a : A, φ a = f a := by choose φ hφ using hf use φ constructor · rw [continuous_iff_continuousAt] intro x suffices ∀ V' ∈ 𝓝 (φ x), IsClosed V' → φ ⁻¹' V' ∈ 𝓝 x by simpa [ContinuousAt, (closed_nhds_basis (φ x)).tendsto_right_iff] intro V' V'_in V'_closed obtain ⟨V, V_in, V_op, hV⟩ : ∃ V ∈ 𝓝 x, IsOpen V ∧ (↑) ⁻¹' V ⊆ f ⁻¹' V' := aux (hφ x) V'_in suffices : ∀ y ∈ V, φ y ∈ V' exact mem_of_superset V_in this intro y y_in have hVx : V ∈ 𝓝 y := V_op.mem_nhds y_in haveI : (comap ((↑) : A → X) (𝓝 y)).NeBot := by simpa [mem_closure_iff_comap_neBot] using hA y apply V'_closed.mem_of_tendsto (hφ y) exact mem_of_superset (preimage_mem_comap hVx) hV · intro a have lim : Tendsto f (𝓝 a) (𝓝 <| φ a) := by simpa [nhds_induced] using hφ a exact tendsto_nhds_unique lim f_cont.continuousAt example [TopologicalSpace X] [TopologicalSpace.FirstCountableTopology X] {s : Set X} {a : X} : a ∈ closure s ↔ ∃ u : ℕ → X, (∀ n, u n ∈ s) ∧ Tendsto u atTop (𝓝 a) := mem_closure_iff_seq_limit variable [TopologicalSpace X] example {F : Filter X} {x : X} : ClusterPt x F ↔ NeBot (𝓝 x ⊓ F) := Iff.rfl example {s : Set X} : IsCompact s ↔ ∀ (F : Filter X) [NeBot F], F ≤ 𝓟 s → ∃ a ∈ s, ClusterPt a F := Iff.rfl example [TopologicalSpace.FirstCountableTopology X] {s : Set X} {u : ℕ → X} (hs : IsCompact s) (hu : ∀ n, u n ∈ s) : ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (u ∘ φ) atTop (𝓝 a) := hs.tendsto_subseq hu variable [TopologicalSpace Y] example {x : X} {F : Filter X} {G : Filter Y} (H : ClusterPt x F) {f : X → Y} (hfx : ContinuousAt f x) (hf : Tendsto f F G) : ClusterPt (f x) G := ClusterPt.map H hfx hf example [TopologicalSpace Y] {f : X → Y} (hf : Continuous f) {s : Set X} (hs : IsCompact s) : IsCompact (f '' s) := by intro F F_ne F_le have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F := by sorry have Hne : (𝓟 s ⊓ comap f F).NeBot := by sorry have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s := inf_le_left sorry example [TopologicalSpace Y] {f : X → Y} (hf : Continuous f) {s : Set X} (hs : IsCompact s) : IsCompact (f '' s) := by intro F F_ne F_le have map_eq : map f (𝓟 s ⊓ comap f F) = 𝓟 (f '' s) ⊓ F := by rw [Filter.push_pull, map_principal] have Hne : (𝓟 s ⊓ comap f F).NeBot := by apply NeBot.of_map rwa [map_eq, inf_of_le_right F_le] have Hle : 𝓟 s ⊓ comap f F ≤ 𝓟 s := inf_le_left rcases hs Hle with ⟨x, x_in, hx⟩ refine' ⟨f x, mem_image_of_mem f x_in, _⟩ apply hx.map hf.continuousAt rw [Tendsto, map_eq] exact inf_le_right example {ι : Type _} {s : Set X} (hs : IsCompact s) (U : ι → Set X) (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) : ∃ t : Finset ι, s ⊆ ⋃ i ∈ t, U i := hs.elim_finite_subcover U hUo hsU example [CompactSpace X] : IsCompact (univ : Set X) := isCompact_univ
-