9.Β Basic TypesπŸ”—

Lean includes a number of built-in types that are specially supported by the compiler. Some, such as Nat, additionally have special support in the kernel. Other types don't have special compiler support per se, but rely in important ways on the internal representation of types for performance reasons.

  1. 9.1. Natural Numbers
    1. 9.1.1. Logical Model
    2. 9.1.2. Run-Time Representation
      1. 9.1.2.1. Performance Notes
    3. 9.1.3. Syntax
    4. 9.1.4. API Reference
      1. 9.1.4.1. Arithmetic
        1. 9.1.4.1.1. Bitwise Operations
      2. 9.1.4.2. Minimum and Maximum
      3. 9.1.4.3. GCD and LCM
      4. 9.1.4.4. Powers of Two
      5. 9.1.4.5. Comparisons
        1. 9.1.4.5.1. Boolean Comparisons
        2. 9.1.4.5.2. Decidable Equality
        3. 9.1.4.5.3. Predicates
      6. 9.1.4.6. Iteration
      7. 9.1.4.7. Conversion
        1. 9.1.4.7.1. Metaprogramming and Internals
      8. 9.1.4.8. Casts
      9. 9.1.4.9. Elimination
        1. 9.1.4.9.1. Alternative Induction Principles
    5. 9.1.5. Simplification
  2. 9.2. Integers
  3. 9.3. Finite Natural Numbers
  4. 9.4. Fixed-Precision Integer Types
  5. 9.5. Bitvectors
  6. 9.6. Floating-Point Numbers
  7. 9.7. Characters
    1. 9.7.1. Syntax
    2. 9.7.2. Logical Model
    3. 9.7.3. Run-Time Representation
    4. 9.7.4. API Reference
      1. 9.7.4.1. Character Classes
  8. 9.8. Strings
    1. 9.8.1. Logical Model
    2. 9.8.2. Run-Time Representation
      1. 9.8.2.1. Performance Notes
    3. 9.8.3. Syntax
      1. 9.8.3.1. String Literals
      2. 9.8.3.2. Interpolated Strings
      3. 9.8.3.3. Raw String Literals
    4. 9.8.4. API Reference
      1. 9.8.4.1. Constructing
      2. 9.8.4.2. Conversions
      3. 9.8.4.3. Properties
      4. 9.8.4.4. Positions
      5. 9.8.4.5. Lookups and Modifications
      6. 9.8.4.6. Folds and Aggregation
      7. 9.8.4.7. Comparisons
      8. 9.8.4.8. Manipulation
      9. 9.8.4.9. Iterators
      10. 9.8.4.10. Substrings
      11. 9.8.4.11. Proof Automation
      12. 9.8.4.12. Metaprogramming
      13. 9.8.4.13. Encodings
    5. 9.8.5. FFI
  9. 9.9. The Unit Type
    1. 9.9.1. Definitional Equality
  10. 9.10. The Empty Type
  11. 9.11. Booleans
    1. 9.11.1. Run-Time Representation
    2. 9.11.2. Booleans and Propositions
    3. 9.11.3. Syntax
    4. 9.11.4. API Reference
      1. 9.11.4.1. Logical Operations
      2. 9.11.4.2. Comparisons
      3. 9.11.4.3. Conversions
  12. 9.12. Optional Values
  13. 9.13. Tuples
  14. 9.14. Sum Types
  15. 9.15. Linked Lists
  16. 9.16. Arrays
    1. 9.16.1. Logical Model
    2. 9.16.2. Run-Time Representation
      1. 9.16.2.1. Performance Notes
    3. 9.16.3. Syntax
    4. 9.16.4. API Reference
      1. 9.16.4.1. Constructing Arrays
      2. 9.16.4.2. Size
      3. 9.16.4.3. Lookups
      4. 9.16.4.4. Conversions
      5. 9.16.4.5. Modification
      6. 9.16.4.6. Sorted Arrays
      7. 9.16.4.7. Iteration
      8. 9.16.4.8. Transformation
      9. 9.16.4.9. Filtering
      10. 9.16.4.10. Partitioning
      11. 9.16.4.11. Element Predicates
      12. 9.16.4.12. Comparisons
      13. 9.16.4.13. Termination Helpers
      14. 9.16.4.14. Proof Automation
    5. 9.16.5. Sub-Arrays
      1. 9.16.5.1. Size
      2. 9.16.5.2. Resizing
      3. 9.16.5.3. Lookups
      4. 9.16.5.4. Iteration
      5. 9.16.5.5. Element Predicates
    6. 9.16.6. FFI
  17. 9.17. Subtypes
  18. 9.18. Lazy Computations
  19. 9.19. Tasks and Threads