Documentation

Time.Verify.Calendar.OrdinalDate

Verify date calculations #

Main theorems:

Get next_date of dt:

  • if dt.dayOfYear is less then days in dt.year then add 1 to dt.dayOfYear,
  • else add 1 to dt.Year and set dt.dayOfYear to 1.
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Verify.OrdinalDate.icc_eq (dt : Time.OrdinalDate) (a : Time.Icc 1 365) (h : dt.dayOfYear = Time.DayOfYear.common a) :
      a.val, = match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d
      theorem Verify.OrdinalDate.icc_eq' (dt : Time.OrdinalDate) (a : Time.Icc 1 366) (h : dt.dayOfYear = Time.DayOfYear.leap a) :
      a = match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d
      theorem Verify.OrdinalDate.val_eq (dt : Time.OrdinalDate) (a : Time.Icc 1 365) (h : dt.dayOfYear = Time.DayOfYear.common a) :
      a.val = (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val
      theorem Verify.OrdinalDate.val_eq' (dt : Time.OrdinalDate) (a : Time.Icc 1 366) (h : dt.dayOfYear = Time.DayOfYear.leap a) :
      a.val = (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val
      theorem Verify.OrdinalDate.Int.self_mul_ediv_le {x k : Int} (h : k 0) :
      x / k * k x
      theorem Verify.OrdinalDate.Icc.minus_one_add_le {b : Nat} (x : Time.Icc 1 b) :
      0 -1 + x.val
      theorem Verify.OrdinalDate.Icc.minus_one_add_lt {a b : Nat} (x : Time.Icc a b) :
      -1 + x.val < b
      theorem Verify.OrdinalDate.assoc' (a b c : Int) :
      a - c + b = a + (-c + b)
      Equations
      Instances For
        Equations
        Instances For
          Equations
          Instances For
            Equations
            Instances For
              theorem Verify.OrdinalDate.days_since_1_1_1_mod_eq (dt : Time.OrdinalDate) :
              Verify.OrdinalDate.days_since_1_1_1 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) % 146097 = Verify.OrdinalDate.days_since_1_1_1_mod_146097 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d)
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Verify.OrdinalDate.days_since_1_1_1_mod_146097_mod_36524_lt (dt : Time.OrdinalDate) (h : ¬(dt.year % 400 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)) :
                Verify.OrdinalDate.days_since_1_1_1_mod_146097_mod_36524 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) < 36524
                theorem Verify.OrdinalDate.days_since_1_1_1_mod_146097_div_eq (dt : Time.OrdinalDate) (h : ¬(dt.year % 400 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)) :
                Verify.OrdinalDate.days_since_1_1_1_mod_146097 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) / 36524 = Verify.OrdinalDate.cent dt
                theorem Verify.OrdinalDate.cent_eq (dt : Time.OrdinalDate) (h : ¬(dt.year % 400 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)) :
                Verify.OrdinalDate.cent dt = Verify.OrdinalDate.days_since_1_1_1_mod_146097 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) / 36524
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Equations
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Verify.OrdinalDate.mod_lt_146096_eq (dt : Time.OrdinalDate) (h : Verify.OrdinalDate.days_since_1_1_1_mod_146097 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) < 146096) :
                          ¬(dt.year % 400 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)
                          theorem Verify.OrdinalDate.d'_add_eq (dt : Time.OrdinalDate) :
                          Verify.OrdinalDate.d' dt = (dt.year - 1) % 4 * 365 + (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - 1
                          theorem Verify.OrdinalDate.day_eq_if_days_eq_1460 (dt : Time.OrdinalDate) (hmod : Verify.OrdinalDate.d' dt = 1460) :
                          (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366
                          theorem Verify.OrdinalDate.year_lt_mod_1460_eq (dt : Time.OrdinalDate) (hNot : ¬(dt.year % 400 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)) :
                          (Time.toModifiedJulianDay dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - default.modifiedJulianDay) / 146097 * 400 + (Time.toModifiedJulianDay dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - default.modifiedJulianDay) % 146097 / 36524 * 100 + ((Time.toModifiedJulianDay dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - default.modifiedJulianDay) % 146097 - (Time.toModifiedJulianDay dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - default.modifiedJulianDay) % 146097 / 36524 * 36524) / 1461 * 4 + ((Time.toModifiedJulianDay dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - default.modifiedJulianDay) % 146097 - (Time.toModifiedJulianDay dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val - default.modifiedJulianDay) % 146097 / 36524 * 36524) % 1461 / 365 + 1 = Verify.OrdinalDate.quadcent dt * 400 + Verify.OrdinalDate.cent dt * 100 + Verify.OrdinalDate.quad dt * 4 + Verify.OrdinalDate.d' dt / 365 + 1
                          theorem Verify.OrdinalDate.d'_eq (dt : Time.OrdinalDate) (h : ¬(dt.year % 400 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)) :
                          (Verify.OrdinalDate.days_since_1_1_1 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) % 146097 - Verify.OrdinalDate.days_since_1_1_1 dt (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d) % 146097 / 36524 * 36524) % 1461 = Verify.OrdinalDate.d' dt
                          theorem Verify.OrdinalDate.d'_lt_1460_eq (dt : Time.OrdinalDate) (hlt : Verify.OrdinalDate.d' dt < 1460) :
                          ¬(dt.year % 4 = 0 (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val = 366)
                          theorem Verify.OrdinalDate.d'_lt_1460_lt (dt : Time.OrdinalDate) (hlt : Verify.OrdinalDate.d' dt < 1460) :
                          (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val < 366
                          theorem Verify.OrdinalDate.d'_lt_1460_eq_day_common {a : Time.Icc 1 365} (dt : Time.OrdinalDate) (h : dt.dayOfYear = Time.DayOfYear.common a) :
                          (Verify.OrdinalDate.d' dt % 365 + 1).toNat = (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val
                          theorem Verify.OrdinalDate.d'_lt_1460_eq_day_leap {a : Time.Icc 1 366} (dt : Time.OrdinalDate) (h : dt.dayOfYear = Time.DayOfYear.leap a) (hlt : Verify.OrdinalDate.d' dt < 1460) :
                          (Verify.OrdinalDate.d' dt % 365 + 1).toNat = (match dt.dayOfYear with | Time.DayOfYear.common d => d.val, | Time.DayOfYear.leap d => d).val