Documentation

Time.Calendar.MonthDay

def Time.monthLengths (isleap : Bool) :

Month and days of month.

Equations
Instances For
    structure Time.Date :

    Date in proleptic Gregorian calendar.

    Instances For
      theorem Time.Date.ext_iff {x y : Date} :
      x = y x.Year = y.Year x.Month = y.Month x.Day = y.Day
      theorem Time.Date.ext {x y : Date} (Year : x.Year = y.Year) (Month : x.Month = y.Month) (Day : x.Day = y.Day) :
      x = y
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Date syntactic category

        Equations
        Instances For

          Date from numeric literals year, month and day

          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

              Last day of month as day of year, see monthLengths_sum_le_map_pair.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                First and last day of month as day of year, see monthLengths_sum_le_map_pair'.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[simp]
                  theorem Time.monthLengths_length_eq_12 (isleap : Bool) :
                  (monthLengths isleap).length = 12
                  theorem Time.monthLengths_index_eq_of_fst_eq (isleap : Bool) (i i' : Fin (monthLengths isleap).length) :
                  (monthLengths isleap)[i].fst = (monthLengths isleap)[i'].fsti = i'
                  theorem Time.Int.le_of_sub_le {a b c d : Nat} (h1 : a c) (h2 : c - b d) :
                  a - b d
                  theorem Time.monthLastDayAsDayOfYear_val_le {yd : Nat} (isleap : Bool) (i : Fin (monthLastDayAsDayOfYear isleap).length) (val : Nat) (hVal : val = ((monthLastDayAsDayOfYear isleap).get i - 1, ).snd) (h1 : ¬yd val) (h2 : yd ((monthLastDayAsDayOfYear isleap).get i).snd) :
                  1 yd - val yd - val 31
                  def Time.monthLengths_sum_le (isleap : Bool) (m : Nat) :
                  Equations
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Time.monthLengths' (isleap : Bool) :
                      Equations
                      Instances For
                        Equations
                        Instances For
                          theorem Time.monthLengths_sum_eq (isleap : Bool) :
                          (monthLengths_sum isleap == if isleap = true then 366 else 365) = true
                          theorem Time.monthLengths_month_in (isleap : Bool) (a : Nat × Nat) :
                          a monthLengths isleap1 a.fst a.fst 12
                          theorem Time.monthLengths_days_in (isleap : Bool) (a : Nat × Nat) :
                          a monthLengths isleap1 a.snd a.snd 31
                          theorem Time.monthLengths_month_eq (isleap : Bool) (a : Fin (monthLengths isleap).length) :
                          (monthLengths isleap)[a].fst = a + 1
                          theorem Time.month_le_val_exists (isleap : Bool) (i v : Nat) (hle : 1 i) (hlt : i < (monthLengths isleap).length) (h2 : v ((monthLastDayAsDayOfYear isleap).get i, ).snd) :
                          (m : Nat × Nat), m monthLengths isleap m.fst = i + 1 v - ((monthLastDayAsDayOfYear isleap).get i - 1, ).snd m.snd
                          theorem Time.list_foldl_init_add {α : Type u_1} (l : List α) (init v : Nat) (f : αNat) :
                          List.foldl (fun (acc : Nat) (v : α) => f v + acc) init l + v = List.foldl (fun (acc : Nat) (v : α) => f v + acc) (init + v) l
                          def Time.findValidMonthDay_1 (year : Int) (isLeap : Bool) (yd : Icc 1 366) (h : yd.val ((monthLastDayAsDayOfYear isLeap).get 0, ).snd) :
                          Equations
                          Instances For
                            def Time.findValidMonthDay_n (year : Int) (isLeap : Bool) (i : Nat) (yd : Icc 1 366) (hl : isLeapYear year = isLeap) (hle : 1 i) (hlt : i < (monthLengths isLeap).length) (hlt' : i < (monthLastDayAsDayOfYear isLeap).length) (hn : ¬yd.val ((monthLastDayAsDayOfYear isLeap).get i - 1, ).snd) (h : yd.val ((monthLastDayAsDayOfYear isLeap).get i, hlt').snd) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Time.findValidMonthDay_tail (year : Int) (isLeap : Bool) (yd : Icc 1 366) (hl : isLeapYear year = isLeap) (hle : yd.val if isLeap = true then 366 else 365) (h6 : ¬yd.val (monthLastDayAsDayOfYear isLeap)[5].snd) :
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Time.findValidMonthDay (year : Int) (isLeap : Bool) (yd : Icc 1 366) (hl : isLeapYear year = isLeap) (hle : yd.val if isLeap = true then 366 else 365) :
                                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 Time.monthLengths_month_le_12 (isleap : Bool) (a : Nat × Nat) :
                                    a monthLengths isleap1 a.fst a.fst 12
                                    theorem Time.monthLengths_days_ge_28 (isleap : Bool) (a : Nat × Nat) :
                                    a monthLengths isleap28 a.snd
                                    theorem Time.monthLengths_days_le_31 (isleap : Bool) (a : Nat × Nat) :
                                    a monthLengths isleapa.snd 31
                                    def Time.monthLength' (isLeap : Bool) (month' : Fin 12) :

                                    The length of a given month in the Gregorian or Julian calendars.

                                    Equations
                                    Instances For
                                      theorem Time.monthLength'_ge_1 (isLeap : Bool) (month' : Fin 12) :
                                      1 monthLength' isLeap month'
                                      theorem Time.monthLength'_le_31 (isLeap : Bool) (month' : Fin 12) :
                                      monthLength' isLeap month' 31
                                      def Time.memOfMonth (isleap : Bool) (month : Icc 1 12) :
                                      Equations
                                      Instances For
                                        def Time.dy' (isleap : Bool) (month : Icc 1 12) (day : Icc 1 31) :

                                        Get day of year from month and day of month by lookup in monthLastDayAsDayOfYear'.

                                        Equations
                                        Instances For
                                          theorem Time.le_dy' (isleap : Bool) (month : Icc 1 12) (day : Icc 1 31) :
                                          1 dy' isleap month day
                                          theorem Time.dy'_le (isleap : Bool) (month : Icc 1 12) (day : Icc 1 31) :
                                          dy' isleap month day if isleap = true then 366 else 365
                                          def Time.dy (isleap : Bool) (month day : Nat) :

                                          Compute day of year from month (1..12) and day of month (1..31).

                                          Equations
                                          Instances For
                                            def Time.dyOfLastDayOfMonth (isleap : Bool) (month : Nat) :

                                            The day of year of the last day of a month can be computed as the predecessor of the first day of the next month.

                                            Equations
                                            Instances For
                                              theorem Time.le_dy (isleap : Bool) (month : Icc 1 12) (day : Icc 1 31) :
                                              1 dy isleap month.val day.val
                                              theorem Time.dy_le (isleap : Bool) (month : Icc 1 12) (day : Icc 1 31) :
                                              dy isleap month.val day.val if isleap = true then 366 else 365
                                              def Time.monthAndDayToDayOfYearClipped' (year : Int) (month day : Nat) (hd1 : 1 day) (hd2 : day 31) (hm1 : 1 month) (hm2 : month 12) :
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Time.monthAndDayToDayOfYearClipped (year : Int) (month' : NonemptyIcc 1 12) (day' : Nat) (hd1 : 1 day') (hd2 : day' 31) :
                                                Equations
                                                Instances For
                                                  theorem Time.days_le_31 (isLeap : Bool) (m : Fin 12) (day : NonemptyIcc 1 (monthLength' isLeap m)) :
                                                  day.icc.val 31

                                                  Convert month and day in the Gregorian or Julian calendars to day of year.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    Convert month and day in the Gregorian or Julian calendars to day of year option.

                                                    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