Documentation

Analysis.Appendix_B_2

Analysis I, Appendix B.2: The decimal representation of real numbers #

An implementation of the decimal representation of Mathlib's real numbers .

This is separate from the way decimal numerals are already represented in Mathlib. We also represent the integer part of the natural numbers just by , avoiding using the decimal representation from the previous section, although we still retain the Digit class.

Instances For
    Equations
    Instances For
      theorem AppendixB.NNRealDecimal.toNNReal_conv (d : NNRealDecimal) :
      Summable fun (i : ) => (d.fracPart i) * 10 ^ (-i - 1)

      Exercise B.2.1

      theorem AppendixB.NNRealDecimal.surj (x : NNReal) :
      ∃ (d : NNRealDecimal), x = d
      theorem AppendixB.NNRealDecimal.not_inj :
      1 = { intPart := 1, fracPart := fun (x : ) => 0 } 1 = { intPart := 0, fracPart := fun (x : ) => 9 }

      Proposition B.2.2

      theorem AppendixB.RealDecimal.surj (x : ) :
      ∃ (d : RealDecimal), x = match d with | pos d => d | neg d => -d
      theorem AppendixB.RealDecimal.not_inj_one (d : RealDecimal) :
      (match d with | pos d => d | neg d => -d) = 1 d = pos { intPart := 1, fracPart := fun (x : ) => 0 } d = pos { intPart := 0, fracPart := fun (x : ) => 9 }

      Exercise B.2.2

      @[reducible, inline]

      Exercise B.2.3

      Equations
      Instances For
        theorem AppendixB.RealDecimal.not_inj_terminating {x : } (hx : TerminatingDecimal x) :
        ∃ (d₁ : RealDecimal) (d₂ : RealDecimal), d₁ d₂ ∀ (d : RealDecimal), (match d with | pos d => d | neg d => -d) = x d = d₁ d = d₂
        theorem AppendixB.RealDecimal.inj_nonterminating {x : } (hx : ¬TerminatingDecimal x) :
        ∃! d : RealDecimal, (match d with | pos d => d | neg d => -d) = x