def
definition
k_B
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.Thermodynamics.PartitionFunction on GitHub at line 34.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
thermal_energy_at_unit_T -
e_SI -
proton_mass_MeV_pos -
coolingFraction_band -
en002_certificate -
rs_coherence_quantum_pos -
thermal_ratio_pos -
thermal_ratio_room_temp -
rs_entropy -
computation_has_nonzero_energy_cost -
computation_limits_summary -
ic002_certificate -
k_B -
landauer_energy_pos -
landauer_scales_with_temp -
ic001_certificate -
k_B_ln2 -
landauer_constant_pos -
ledger_identity -
entropyApplications -
source_coding_theorem -
thermodynamic_entropy_connection -
info_per_voxel -
recombination_temperature_positive -
rs_eta -
bcs_gap_positive -
bcs_Tc_positive -
gamow_energy_increases_with_T -
nuclear_efficiency_valid -
virial_temperature -
bekensteinHawkingEntropy -
entropyInBits -
entropy_proportional_to_area -
hawkingTemperature -
horizonArea -
informationContent -
k_B -
planck_mass_temperature -
planckTemperature -
solarMassTemperature
formal source
31open IndisputableMonolith.Cost
32
33/-- Boltzmann constant. -/
34noncomputable def k_B : ℝ := 1.380649e-23
35
36/-- Inverse temperature β = 1/(k_B T). -/
37noncomputable def beta (T : ℝ) (hT : T > 0) : ℝ := 1 / (k_B * T)
38
39/-! ## The Classical Partition Function -/
40
41/-- A discrete system with energy levels. -/
42structure DiscreteSystem where
43 /-- Number of energy levels -/
44 numLevels : ℕ
45 /-- Energy of each level -/
46 energy : Fin numLevels → ℝ
47 /-- Degeneracy of each level (must be positive) -/
48 degeneracy : Fin numLevels → ℕ
49 /-- At least one level -/
50 nonempty : numLevels > 0
51 /-- Each level has degeneracy ≥ 1 -/
52 deg_pos : ∀ i, degeneracy i ≥ 1
53
54/-- The canonical partition function Z = Σᵢ gᵢ exp(-βEᵢ). -/
55noncomputable def partitionFunction (sys : DiscreteSystem) (T : ℝ) (hT : T > 0) : ℝ :=
56 ∑ i : Fin sys.numLevels, (sys.degeneracy i : ℝ) * exp (-beta T hT * sys.energy i)
57
58/-- **THEOREM**: Partition function is always positive. -/
59theorem partition_function_positive (sys : DiscreteSystem) (T : ℝ) (hT : T > 0) :
60 partitionFunction sys T hT > 0 := by
61 unfold partitionFunction
62 have hne : Nonempty (Fin sys.numLevels) := ⟨⟨0, sys.nonempty⟩⟩
63 apply Finset.sum_pos
64 · intro i _