File: Mathlib/Control/Random.lean

full_name: RandGT
code: /-- A monad transformer to generate random objects using the generic generator type `g` -/
abbrev RandGT (g : Type) 
goal: Type (max u_1 u_2)

full_name: RandG
code: /-- A monad to generate random objects using the generator type `g`.  -/
abbrev RandG (g : Type) 
goal: Type u_1

full_name: RandT
code: /-- A monad transformer to generate random objects using the generator type `StdGen`.
`RandT m α` should be thought of a random value in `m α`. -/
abbrev RandT 
goal: Type (max u_1 u_2)

full_name: Rand
code: /-- A monad to generate random objects using the generator type `StdGen`.  -/
abbrev Rand 
goal: Type u_1

full_name: instMonadLiftTRandGTOfMonadLift
code: instance [MonadLift m n] : MonadLiftT (RandGT g m) (RandGT g n) 
goal: MonadLiftT (RandGT g m) (RandGT g n)

full_name: Random.random
code: /-- `Random m α` gives us machinery to generate values of type `α` in the monad `m`.

Note that `m` is a parameter as some types may only be sampleable with access to a certain monad. -/
class Random (m) (α : Type u) where
  random [RandomGen g] : RandGT g m α
goal: RandGT g m α

full_name: Random
code: /-- `Random m α` gives us machinery to generate values of type `α` in the monad `m`.

Note that `m` is a parameter as some types may only be sampleable with access to a certain monad. -/
class Random (m) (α : Type u) where
  random [RandomGen g] : RandGT g m α
goal: Type (max (max 1 u) u_1)

full_name: BoundedRandom
code: /-- `BoundedRandom m α` gives us machinery to generate values of type `α` between certain bounds in
the monad `m`. -/
class BoundedRandom (m) (α : Type u) [Preorder α] where
  randomR {g : Type} (lo hi : α) (h : lo ≤ hi) [RandomGen g] : RandGT g m {a // lo ≤ a ∧ a ≤ hi}
goal: Type (max (max 1 u) u_1)

full_name: BoundedRandom.randomR
code: /-- `BoundedRandom m α` gives us machinery to generate values of type `α` between certain bounds in
the monad `m`. -/
class BoundedRandom (m) (α : Type u) [Preorder α] where
  randomR {g : Type} (lo hi : α) (h : lo ≤ hi) [RandomGen g] : RandGT g m {a // lo ≤ a ∧ a ≤ hi}
goal: RandGT g m { a // lo ≤ a ∧ a ≤ hi }

full_name: Rand.next
code: /-- Generate one more `Nat` -/
def next [RandomGen g] [Monad m] : RandGT g m Nat 
goal: RandGT g m ℕ

full_name: Rand.split
code: /-- Create a new random number generator distinct from the one stored in the state -/
def split {g : Type} [RandomGen g] [Monad m] : RandGT g m g 
goal: RandGT g m g

full_name: Rand.range
code: /-- Get the range of Nat that can be generated by the generator `g` -/
def range {g : Type} [RandomGen g] [Monad m] : RandGT g m (Nat × Nat) 
goal: RandGT g m (ℕ × ℕ)

full_name: Random.rand
code: /-- Generate a random value of type `α`. -/
def rand (α : Type u) [Random m α] [RandomGen g] : RandGT g m α 
goal: RandGT g m α

full_name: Random.randBound
code: /-- Generate a random value of type `α` between `x` and `y` inclusive. -/
def randBound (α : Type u)
    [Preorder α] [BoundedRandom m α] (lo hi : α) (h : lo ≤ hi) [RandomGen g] :
    RandGT g m {a // lo ≤ a ∧ a ≤ hi} 
goal: RandGT g m { a // lo ≤ a ∧ a ≤ hi }

full_name: Random.randFin
code: def randFin {n : Nat} [RandomGen g] : RandGT g m (Fin n.succ) 
goal: RandGT g m (Fin n.succ)

full_name: Random.instFinSucc
code: instance {n : Nat} : Random m (Fin n.succ) 
goal: Random m (Fin n.succ)

full_name: Random.randBool
code: def randBool [RandomGen g] : RandGT g m Bool 
goal: RandGT g m Bool

full_name: Random.instBool
code: instance : Random m Bool 
goal: Random m Bool

full_name: Random.instULiftOfULiftable
code: instance {α : Type u} [ULiftable m m'] [Random m α] : Random m' (ULift.{v} α) 
goal: Random m' (ULift.{v, u} α)

full_name: Random.instBoundedRandomNat
code: instance : BoundedRandom m Nat 
goal: BoundedRandom m ℕ

full_name: Random.instBoundedRandomInt
code: instance : BoundedRandom m Int 
goal: BoundedRandom m ℤ

full_name: Random.instBoundedRandomFin
code: instance {n : Nat} : BoundedRandom m (Fin n) 
goal: BoundedRandom m (Fin n)

full_name: Random.instBoundedRandomULiftOfULiftableOfMonad
code: instance {α : Type u} [Preorder α] [ULiftable m m'] [BoundedRandom m α] [Monad m'] :
    BoundedRandom m' (ULift.{v} α) 
goal: BoundedRandom m' (ULift.{v, u} α)

full_name: IO.runRand
code: /--
Computes a `RandT m α` using the global `stdGenRef` as RNG.

Note that:
- `stdGenRef` is not necessarily properly seeded on program startup
  as of now and will therefore be deterministic.
- `stdGenRef` is not thread local, hence two threads accessing it
  at the same time will get the exact same generator.
-/
def runRand (cmd : RandT m α) : m α 
goal: m α

full_name: IO.runRandWith
code: def runRandWith (seed : Nat) (cmd : RandT m α) : m α 
goal: m α